IEnumerator Fly() { _state = State.Flying; _flyStartTime = Time.time; _flyDirection = EnforceBoundary(EnemyAI_Random.GetRandomDirectionXZ()); _flyDuration = BASE_FLY_DURATION + Random.Range(-FLY_DURATION_VARIANCE, FLY_DURATION_VARIANCE); yield return(new WaitForSeconds(_flyDuration)); StartCoroutine("Idle"); }
void Start() { _enemyMove.Mode = EnemyMove.MovementMode.DirectionOnly; _enemyMove.AlwaysFaceTowardsMoveDirection = false; MoveDirection = EnemyAI_Random.GetRandomDirectionXZ(); if (IsHead) { CreateWormBody(); } IsVulnerable = (IsHead || IsTail); }
void Start() { _enemyMove.Mode = EnemyMove.MovementMode.DirectionOnly; MoveDirection = EnemyAI_Random.GetRandomDirectionXZ(); }
void ChangeDirection() { _moveDirection = EnemyAI_Random.GetRandomDirectionXZ(); }