Commit be03f2b7 authored by czy's avatar czy

方块版本1.0

parent a5f1ac4d
......@@ -92,6 +92,7 @@
<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\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\ChainRopeView.cs" />
<Compile Include="Assets\#A2_Scripts\Battle\View\ChainView.cs" />
......@@ -261,8 +262,11 @@
<Compile Include="Assets\EasyTouchBundle\EasyTouchControls\Plugins\ETCInput.cs" />
<Compile Include="Assets\EasyTouchBundle\EasyTouchControls\Plugins\ETCJoystick.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\TriggerTurnDir.cs" />
<Compile Include="Assets\My\Wall.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\MeshUniqueVertices.cs" />
......
This diff is collapsed.
fileFormatVersion: 2
guid: d967723201452894680314048a609a92
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -43,15 +43,23 @@ public class BattleCtrl : MonoBehaviour
public int Score = 0;
public String GoldName = "Egg"; //金币名称(Resources)
//更新分数
public delegate void UpdateScoreDe();
public UpdateScoreDe updateScore;
//强制转弯
public delegate void TurnDir(float angle);
public TurnDir turnDir;
//随机生成金币。
public delegate void RandomGold();
public RandomGold randomGold;
private void Awake()
{
_Instance = this;
//Assert.IsNotNull(battleUI, "battleUI is null");
InitServices();
......@@ -61,7 +69,7 @@ public class BattleCtrl : MonoBehaviour
void Start()
{
battleUI.onStartBtn = StartBattle;
battleUI.onStartBtn += StartBattle;
}
void InitServices()
......@@ -101,6 +109,7 @@ public class BattleCtrl : MonoBehaviour
/// </summary>
void StartBattle()
{
print("_IsStartBattle设置为true");
_IsStartBattle = true;
......@@ -147,7 +156,7 @@ public class BattleCtrl : MonoBehaviour
/// </summary>
public void OnBeforeLoadLevel()
{
//_IsStartBattle = false;
_IsStartBattle = false;
_IsEndBattle = false;
battleUI.OnBeforeLoadLevel();
//GameServices.inputService.DisableService();
......@@ -207,6 +216,7 @@ public class BattleCtrl : MonoBehaviour
{
m_levelManager.onBeforeLoadLevel -= OnBeforeLoadLevel;
m_levelManager.onAfterLoadLevel -= OnAfterLoadLevel;
battleUI.onStartBtn -= StartBattle;
//battleUI.onStartBtn = null;
_GameServices.OnDisponse();
_GameServices = null;
......
......@@ -97,16 +97,29 @@ public class BattleUI : MonoBehaviour
// 当前关卡再来一次
void LoadCurLevel()
{
//UI的显示和隐藏
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();
//SceneManager.LoadScene(0);
}
//再来一次
void TryAgainLevel()
{
//UI的显示和隐藏
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();
}
// 进入下一关卡
public void NextLevel()
......@@ -125,7 +138,7 @@ public class BattleUI : MonoBehaviour
void StartBtn()
{
onStartBtn?.Invoke();
m_startBtn.gameObject.SetActive(false);
//m_startBtn.gameObject.SetActive(false);
m_startLogoObj.SetActive(false);
SetBattleObjState(true);
SettingBtnState(false);
......
......@@ -170,9 +170,9 @@ public class CarView : MonoBehaviour
print("未驱动车轮。");
}
print(m_rigidBody+"添加力:" +(-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
//m_threeClawTrans.localRotation = Quaternion.Euler(0, m_threeClawStartRatateY, m_addAngleSpeed);
}
}
//}
//void LateUpdate()
//{
}
void LateUpdate()
{
if (!BattleCtrl.instance.isStartBattle)
{
return;
......
......@@ -234,9 +234,9 @@ public class ChainView : MonoBehaviour
m_leftClawTrans.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
&& m_targetView && m_addAngleSpeed >= m_targetView.clawMinAngle)
{
......
......@@ -37,10 +37,11 @@ public class FollowTarget : MonoBehaviour
public Transform target;
public float smood=10;
private void FixedUpdate()
private void LateUpdate()
{
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);
}
}
This diff is collapsed.
fileFormatVersion: 2
guid: c633fd4428d1a3042bb84d0e4902847e
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -73,5 +73,5 @@ Material:
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.990566, g: 0.4448022, b: 0.126157, a: 1}
- _Color: {r: 0.99215686, g: 0.3930721, b: 0.12549017, a: 0.38431373}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: punishMaterial
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.03551085, g: 0.18069187, b: 0.3962264, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: b52cbfa819b01234c9ac2b4831aa9a62
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: rewardMaterial
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.9811321, g: 0.0509078, b: 0.0509078, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: 75071b84975741f4198abfd3a1f81fce
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
......@@ -15,8 +15,8 @@ public class CharacterAnimation : MonoBehaviour {
// Wait end of frame to manage charactercontroller, because gravity is managed by virtual controller
//void LateUpdate(){
void Update(){
void LateUpdate(){
if (cc.isGrounded && (ETCInput.GetAxis("Vertical")!=0)){
anim.CrossFade("soldierRun");
}
......
......@@ -15,8 +15,8 @@ public class CharacterAnimationDungeon : MonoBehaviour {
// Wait end of frame to manage charactercontroller, because gravity is managed by virtual controller
//void LateUpdate(){
void Update(){
void LateUpdate(){
if (cc.isGrounded && (ETCInput.GetAxis("Vertical")!=0 || ETCInput.GetAxis("Horizontal")!=0)){
anim.CrossFade("soldierRun");
}
......
This diff is collapsed.
fileFormatVersion: 2
guid: 49d42611cd469a042b78b557de2d6c26
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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