diff options
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; |