Commit 024f86b4 authored by wanqing's avatar wanqing

修改代码

parent 40ed08b0
...@@ -156,6 +156,27 @@ public class StorageView : MonoBehaviour ...@@ -156,6 +156,27 @@ public class StorageView : MonoBehaviour
} }
} }
} }
//invoke旋转
void RotateInvoke()
{
CancelRotateInvoke();
InvokeRepeating("RotateTarget", 0.5f, 0.5f);
}
//取消invoke
void CancelRotateInvoke()
{
if (IsInvoking("RotateTarget"))
{
CancelInvoke("RotateTarget");
}
}
void RotateTarget()
{
if (m_curTargetTrans)
{
m_curTargetTrans.transform.Rotate(transform.up, 90.0f);
}
}
void Update() void Update()
{ {
if (!BattleCtrl.instance.isStartBattle) if (!BattleCtrl.instance.isStartBattle)
...@@ -266,6 +287,7 @@ public class StorageView : MonoBehaviour ...@@ -266,6 +287,7 @@ public class StorageView : MonoBehaviour
BattleCtrl.instance.battleUI.SetSymbolPos(0, 0); BattleCtrl.instance.battleUI.SetSymbolPos(0, 0);
CancelDelayMatChangeHandle(); CancelDelayMatChangeHandle();
Invoke("DelayMatChangeHandle", 0.5f); Invoke("DelayMatChangeHandle", 0.5f);
CancelRotateInvoke();
} }
void CancelDelayMatChangeHandle() void CancelDelayMatChangeHandle()
{ {
...@@ -355,6 +377,7 @@ public class StorageView : MonoBehaviour ...@@ -355,6 +377,7 @@ public class StorageView : MonoBehaviour
{ {
m_curTargetTrans.GetComponent<MeshRenderer>().sharedMaterial = m_dicMat[m_curTargetTrans]; m_curTargetTrans.GetComponent<MeshRenderer>().sharedMaterial = m_dicMat[m_curTargetTrans];
} }
RotateInvoke();
break; break;
} }
} }
...@@ -386,5 +409,6 @@ public class StorageView : MonoBehaviour ...@@ -386,5 +409,6 @@ public class StorageView : MonoBehaviour
GameServices.inputService.pad.onTouchUp -= OnTouchUp; GameServices.inputService.pad.onTouchUp -= OnTouchUp;
} }
CancelDelayMatChangeHandle(); CancelDelayMatChangeHandle();
CancelRotateInvoke();
} }
} }
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