void SetRandomDir() { if (currState != EnemyStates.WANDERING) { return; } currentDir = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), 0).normalized; Callbacks.AddFixed(SetRandomDir, randomDirDuration, gameObject); }
void CheckPlayerDist() { if (currState == EnemyStates.WANDERING) { Callbacks.AddFixed(CheckPlayerDist, 2f, gameObject); if (IsCloseToPlayer()) { SendFriendSignal(); } } }