void Start() { stats = GetComponentInParent <EnemyStats>(); rb = GetComponentInParent <Rigidbody>(); stats.movementClock.ClockEnded += OnShouldMove; currentNode = stats.gameObject.transform.position; currentDirection = MouchouDirection.Down; }
public void OnShouldMove() { if (canMove == true) { currentDirection = pattern.patternList[patternIndex]; if (patternIndex == pattern.patternList.Count - 1) { patternIndex = 0; } else { patternIndex++; } GetNextNode(); UpdateMovement(); } }