private void Move() { CurrentNode.RemoveObject(gameObject); CurrentNode = TargetNode; CurrentNode.AddObject(gameObject); LeanTween.move(gameObject, m_gridRef.GridCoordToWorldCoord(CurrentNode.position), 0.1f); shotCooldown = (shotCooldown <= 3) ? shotCooldown + 1 : 3; GameController.LevelStats().AddMove(); }
// Start is called before the first frame update private void Start() { GameController.StepController().StepEvent += Move; GameController.StepController().AddEntity(); CurrentNode = m_gridRef.GetNearestNode(transform.position); CurrentNode.AddObject(gameObject); health = maxHealth; GameController.LevelStats().Reset(); }