private void NextMovementStage() { switch (currentMovementStage) { case MovementStage.Wait: currentMovementStage = MovementStage.TurnToTarget; PrepareToTurn(); break; case MovementStage.TurnToTarget: currentMovementStage = MovementStage.Wait2; PrepareWaitStage(); break; case MovementStage.Wait2: currentMovementStage = MovementStage.WalkToTarget; PrepareWalkStage(); break; case MovementStage.WalkToTarget: currentMovementStage = MovementStage.Wait; PrepareWaitStage(); break; } }
public void OnEnable() { reverseDirection = false; indexOfTargetNode = 1; transform.LookAt(pathNodes[indexOfTargetNode].transform.position); //Set wait 2, there's no need to turn to the target as we are already facing it currentMovementStage = MovementStage.Wait2; PrepareWaitStage(); }
// Start is called before the first frame update protected void Start() { currentMovementStage = MovementStage.RandomWait1; PrepareRandomWaitStage(); //todo remove, for debugging //debugEnabled = true; //currentMovementStage = MovementStage.WalkStage; //currentWalkStage = WalkStage.Forward; //walkStageDuration = 1000; //randomWalkSpeed = BASE_SPEED * 1f; //walkMultiplier = 1.5f; //animationController.SetAnimation(SpiderAnimator.SpiderAnimation.Walk, walkMultiplier); }
//To be used for e.g jumping from randomwait 1 to walk private void GoToMovementStage(MovementStage newMovementStage) { //Debug.Log(gameObject.name + ": " + currentMovementStage.ToString() + " --> " + newMovementStage.ToString()); currentMovementStage = newMovementStage; switch (newMovementStage) { case MovementStage.RandomWait1: PrepareRandomWaitStage(); break; case MovementStage.TurnOnTheSpot: PrepareTurnOnTheSpotStage(); break; case MovementStage.RandomWait2: PrepareRandomWaitStage(); break; case MovementStage.WalkStage: PrepareWalkStage(); break; } }
public MovementChangedEventArgs(Character character, MovementStage stage, ScreenPoint location) { this.Character = character; this.Stage = stage; this.location = location; }
public MovementInfo(ScreenPoint location, Directions direction, MovementStage stage, MovementType type, string animation) { this.Location = location; this.Direction = direction; this.Stage = stage; this.Type = type; this.Animation = animation; }