Commit be03f2b7 authored by czy's avatar czy

方块版本1.0

parent a5f1ac4d
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
<Compile Include="Assets\#A2_Scripts\Battle\UI\TestGestureAround.cs" /> <Compile Include="Assets\#A2_Scripts\Battle\UI\TestGestureAround.cs" />
<Compile Include="Assets\#A2_Scripts\Battle\View\BombView.cs" /> <Compile Include="Assets\#A2_Scripts\Battle\View\BombView.cs" />
<Compile Include="Assets\#A2_Scripts\Battle\View\CarView.cs" /> <Compile Include="Assets\#A2_Scripts\Battle\View\CarView.cs" />
<Compile Include="Assets\#A2_Scripts\Battle\View\CarView2.cs" />
<Compile Include="Assets\#A2_Scripts\Battle\View\ChainDragView.cs" /> <Compile Include="Assets\#A2_Scripts\Battle\View\ChainDragView.cs" />
<Compile Include="Assets\#A2_Scripts\Battle\View\ChainRopeView.cs" /> <Compile Include="Assets\#A2_Scripts\Battle\View\ChainRopeView.cs" />
<Compile Include="Assets\#A2_Scripts\Battle\View\ChainView.cs" /> <Compile Include="Assets\#A2_Scripts\Battle\View\ChainView.cs" />
...@@ -261,8 +262,11 @@ ...@@ -261,8 +262,11 @@
<Compile Include="Assets\EasyTouchBundle\EasyTouchControls\Plugins\ETCInput.cs" /> <Compile Include="Assets\EasyTouchBundle\EasyTouchControls\Plugins\ETCInput.cs" />
<Compile Include="Assets\EasyTouchBundle\EasyTouchControls\Plugins\ETCJoystick.cs" /> <Compile Include="Assets\EasyTouchBundle\EasyTouchControls\Plugins\ETCJoystick.cs" />
<Compile Include="Assets\EasyTouchBundle\EasyTouchControls\Plugins\ETCTouchPad.cs" /> <Compile Include="Assets\EasyTouchBundle\EasyTouchControls\Plugins\ETCTouchPad.cs" />
<Compile Include="Assets\My\FloorBoard.cs" />
<Compile Include="Assets\My\RandomEnvironment.cs" />
<Compile Include="Assets\My\TestEtc.cs" /> <Compile Include="Assets\My\TestEtc.cs" />
<Compile Include="Assets\My\TriggerTurnDir.cs" /> <Compile Include="Assets\My\TriggerTurnDir.cs" />
<Compile Include="Assets\My\Wall.cs" />
<Compile Include="Assets\Ultimate Game Tools\AutomaticLOD\Scripts\AutomaticLOD.cs" /> <Compile Include="Assets\Ultimate Game Tools\AutomaticLOD\Scripts\AutomaticLOD.cs" />
<Compile Include="Assets\Ultimate Game Tools\MeshSimplify\Scripts\MeshSimplify.cs" /> <Compile Include="Assets\Ultimate Game Tools\MeshSimplify\Scripts\MeshSimplify.cs" />
<Compile Include="Assets\Ultimate Game Tools\MeshSimplify\Scripts\MeshUniqueVertices.cs" /> <Compile Include="Assets\Ultimate Game Tools\MeshSimplify\Scripts\MeshUniqueVertices.cs" />
......
This diff is collapsed.
fileFormatVersion: 2
guid: d967723201452894680314048a609a92
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -43,15 +43,23 @@ public class BattleCtrl : MonoBehaviour ...@@ -43,15 +43,23 @@ public class BattleCtrl : MonoBehaviour
public int Score = 0; public int Score = 0;
public String GoldName = "Egg"; //金币名称(Resources)
//更新分数 //更新分数
public delegate void UpdateScoreDe(); public delegate void UpdateScoreDe();
public UpdateScoreDe updateScore; public UpdateScoreDe updateScore;
//强制转弯 //强制转弯
public delegate void TurnDir(float angle); public delegate void TurnDir(float angle);
public TurnDir turnDir; public TurnDir turnDir;
//随机生成金币。
public delegate void RandomGold();
public RandomGold randomGold;
private void Awake() private void Awake()
{ {
_Instance = this; _Instance = this;
//Assert.IsNotNull(battleUI, "battleUI is null"); //Assert.IsNotNull(battleUI, "battleUI is null");
InitServices(); InitServices();
...@@ -61,7 +69,7 @@ public class BattleCtrl : MonoBehaviour ...@@ -61,7 +69,7 @@ public class BattleCtrl : MonoBehaviour
void Start() void Start()
{ {
battleUI.onStartBtn = StartBattle; battleUI.onStartBtn += StartBattle;
} }
void InitServices() void InitServices()
...@@ -101,6 +109,7 @@ public class BattleCtrl : MonoBehaviour ...@@ -101,6 +109,7 @@ public class BattleCtrl : MonoBehaviour
/// </summary> /// </summary>
void StartBattle() void StartBattle()
{ {
print("_IsStartBattle设置为true");
_IsStartBattle = true; _IsStartBattle = true;
...@@ -147,7 +156,7 @@ public class BattleCtrl : MonoBehaviour ...@@ -147,7 +156,7 @@ public class BattleCtrl : MonoBehaviour
/// </summary> /// </summary>
public void OnBeforeLoadLevel() public void OnBeforeLoadLevel()
{ {
//_IsStartBattle = false; _IsStartBattle = false;
_IsEndBattle = false; _IsEndBattle = false;
battleUI.OnBeforeLoadLevel(); battleUI.OnBeforeLoadLevel();
//GameServices.inputService.DisableService(); //GameServices.inputService.DisableService();
...@@ -207,6 +216,7 @@ public class BattleCtrl : MonoBehaviour ...@@ -207,6 +216,7 @@ public class BattleCtrl : MonoBehaviour
{ {
m_levelManager.onBeforeLoadLevel -= OnBeforeLoadLevel; m_levelManager.onBeforeLoadLevel -= OnBeforeLoadLevel;
m_levelManager.onAfterLoadLevel -= OnAfterLoadLevel; m_levelManager.onAfterLoadLevel -= OnAfterLoadLevel;
battleUI.onStartBtn -= StartBattle;
//battleUI.onStartBtn = null; //battleUI.onStartBtn = null;
_GameServices.OnDisponse(); _GameServices.OnDisponse();
_GameServices = null; _GameServices = null;
......
...@@ -97,16 +97,29 @@ public class BattleUI : MonoBehaviour ...@@ -97,16 +97,29 @@ public class BattleUI : MonoBehaviour
// 当前关卡再来一次 // 当前关卡再来一次
void LoadCurLevel() void LoadCurLevel()
{ {
//UI的显示和隐藏
m_loseObj.SetActive(false); m_loseObj.SetActive(false);
m_successObj.SetActive(false); m_battleObj.SetActive(false);
m_startLogoObj.SetActive(true);
//更新分数为0;
BattleCtrl.instance.Score = 0;
BattleCtrl.instance.updateScore?.Invoke();
BattleCtrl.instance.levelManager.LoadCurLevel(); BattleCtrl.instance.levelManager.LoadCurLevel();
//SceneManager.LoadScene(0);
} }
//再来一次 //再来一次
void TryAgainLevel() void TryAgainLevel()
{ {
//UI的显示和隐藏
m_loseObj.SetActive(false); m_loseObj.SetActive(false);
m_battleObj.SetActive(false);
m_startLogoObj.SetActive(true);
//更新分数为0;
BattleCtrl.instance.Score = 0;
BattleCtrl.instance.updateScore?.Invoke();
BattleCtrl.instance.levelManager.LoadCurLevel(); BattleCtrl.instance.levelManager.LoadCurLevel();
} }
// 进入下一关卡 // 进入下一关卡
public void NextLevel() public void NextLevel()
...@@ -125,7 +138,7 @@ public class BattleUI : MonoBehaviour ...@@ -125,7 +138,7 @@ public class BattleUI : MonoBehaviour
void StartBtn() void StartBtn()
{ {
onStartBtn?.Invoke(); onStartBtn?.Invoke();
m_startBtn.gameObject.SetActive(false); //m_startBtn.gameObject.SetActive(false);
m_startLogoObj.SetActive(false); m_startLogoObj.SetActive(false);
SetBattleObjState(true); SetBattleObjState(true);
SettingBtnState(false); SettingBtnState(false);
......
...@@ -172,7 +172,7 @@ public class CarView : MonoBehaviour ...@@ -172,7 +172,7 @@ public class CarView : MonoBehaviour
print(m_rigidBody+"添加力:" +(-transform.up * m_curMotorSpeed));
m_rigidBody.AddForce(-transform.up * m_curMotorSpeed); m_rigidBody.AddForce(-transform.up * m_curMotorSpeed);
......
This diff is collapsed.
fileFormatVersion: 2
guid: 8d27f9023a363b94b863bd8c27bd5a1f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -735,9 +735,9 @@ public class ChainRopeView : MonoBehaviour ...@@ -735,9 +735,9 @@ public class ChainRopeView : MonoBehaviour
//m_threeClawTrans.localRotation = Quaternion.Euler(0, m_threeClawStartRatateY, m_addAngleSpeed); //m_threeClawTrans.localRotation = Quaternion.Euler(0, m_threeClawStartRatateY, m_addAngleSpeed);
} }
} }
//} }
//void LateUpdate() void LateUpdate()
//{ {
if (!BattleCtrl.instance.isStartBattle) if (!BattleCtrl.instance.isStartBattle)
{ {
return; return;
......
...@@ -234,9 +234,9 @@ public class ChainView : MonoBehaviour ...@@ -234,9 +234,9 @@ public class ChainView : MonoBehaviour
m_leftClawTrans.localRotation = Quaternion.Euler(0, 0, -m_addAngleSpeed); m_leftClawTrans.localRotation = Quaternion.Euler(0, 0, -m_addAngleSpeed);
m_rightClawTrans.localRotation = Quaternion.Euler(0, 0, m_addAngleSpeed); m_rightClawTrans.localRotation = Quaternion.Euler(0, 0, m_addAngleSpeed);
} }
//} }
//void LateUpdate() void LateUpdate()
//{ {
if (m_bIsHitLeftClaw && m_bIsHitRightClaw && !m_bIsCatch if (m_bIsHitLeftClaw && m_bIsHitRightClaw && !m_bIsCatch
&& m_targetView && m_addAngleSpeed >= m_targetView.clawMinAngle) && m_targetView && m_addAngleSpeed >= m_targetView.clawMinAngle)
{ {
......
...@@ -37,10 +37,11 @@ public class FollowTarget : MonoBehaviour ...@@ -37,10 +37,11 @@ public class FollowTarget : MonoBehaviour
public Transform target; public Transform target;
public float smood=10; public float smood=10;
private void FixedUpdate() private void LateUpdate()
{ {
Vector3 followPoint = target.position + Vector3.up * upDis - target.forward * backDis; Vector3 followPoint = target.position + Vector3.up * upDis - target.forward * backDis;
transform.position = Vector3.Lerp(transform.position, followPoint,Time.deltaTime*smood); transform.position = followPoint;
//transform.position = Vector3.Lerp(transform.position, followPoint,Time.deltaTime*smood);
transform.LookAt(target); transform.LookAt(target);
} }
} }
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1368698011785206269
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1368698011785206258}
- component: {fileID: 1368698011785206257}
- component: {fileID: 1368698011785206259}
m_Layer: 1
m_Name: Box1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1368698011785206258
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1368698011785206269}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.63, y: 3, z: 0}
m_LocalScale: {x: 0.3, y: 6.95, z: 1}
m_Children: []
m_Father: {fileID: 1368698013044413522}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &1368698011785206257
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1368698011785206269}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &1368698011785206259
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1368698011785206269}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1.0000002, y: 1, z: 1.0000002}
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &1368698013044413533
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1368698013044413522}
- component: {fileID: 1368698013044413521}
- component: {fileID: 1368698013044413520}
- component: {fileID: 1368698013044413523}
- component: {fileID: 6030592403643872703}
m_Layer: 1
m_Name: FloorBoard
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1368698013044413522
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1368698013044413533}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -17.21, y: -0.5, z: 424.78}
m_LocalScale: {x: 10, y: 1, z: 24.32606}
m_Children:
- {fileID: 1368698011785206258}
- {fileID: 995542175946132765}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &1368698013044413521
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1368698013044413533}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1368698013044413520
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1368698013044413533}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 007f38ea7c3eccd419bbed5fa1aaa3e4, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!65 &1368698013044413523
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1368698013044413533}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &6030592403643872703
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1368698013044413533}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 49d42611cd469a042b78b557de2d6c26, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &8690977390665052917
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 995542175946132765}
- component: {fileID: 62831510571331353}
- component: {fileID: 474765328833858023}
m_Layer: 1
m_Name: Box2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &995542175946132765
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8690977390665052917}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.63, y: 3, z: 0}
m_LocalScale: {x: 0.3, y: 6.95, z: 1}
m_Children: []
m_Father: {fileID: 1368698013044413522}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &62831510571331353
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8690977390665052917}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &474765328833858023
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8690977390665052917}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1.0000002, y: 1, z: 1.0000002}
m_Center: {x: 0, y: 0, z: 0}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment