diff options
| author | chai <215380520@qq.com> | 2023-05-04 11:25:52 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2023-05-04 11:25:52 +0800 |
| commit | 848097c88bbcf24934a375dff39cf4defa2819dd (patch) | |
| tree | 85f4cc4d09fbf2a3839752449d21cb3e0bec8fa1 /marching/Assets/Scripts/VampireScript.cs | |
| parent | ba1ad0efd8601dc4af023aca5a78609c55b4d67f (diff) | |
*misc
Diffstat (limited to 'marching/Assets/Scripts/VampireScript.cs')
| -rw-r--r-- | marching/Assets/Scripts/VampireScript.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/marching/Assets/Scripts/VampireScript.cs b/marching/Assets/Scripts/VampireScript.cs index 87fdd7a..2f993d3 100644 --- a/marching/Assets/Scripts/VampireScript.cs +++ b/marching/Assets/Scripts/VampireScript.cs @@ -5,7 +5,7 @@ using UnityEngine; namespace MH { - public class VampireScript : MonoBehaviour + public class VampireScript : UnitBase { public Camera m_Camera; @@ -13,21 +13,23 @@ namespace MH private bool m_Moving; - // Start is called before the first frame update void Start() { m_Moving = true; m_Sprite = GetComponent<SpriteRenderer>(); } - // Update is called once per frame - void Update() + protected override void Update() { + base.Update(); + if (Input.GetMouseButtonDown(1)) { m_Moving = !m_Moving; } + GetComponent<Animator>().speed = m_Moving ? 1 : 0; + if (!m_Moving) return; |
