// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { astar = animator.GetComponent <AStarNavigation>(); hitFSM = animator.GetComponent <HitmanFSM>(); //Set destination to Contract Target astar.ChangeGoalPosition(hitFSM.GetContractObject().transform.position); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { finishEating = false; astar = animator.GetComponent <AStarNavigation>(); wormFSM = animator.GetComponent <WormFSM>(); astar.ChangeGoalPosition(wormFSM.foodAgent.transform.position); astar.Speed = wormFSM.chaseSpeed;//Increase speed }
// Start is called before the first frame update void Start() { AddSoundObject(); astar = this.GetComponent <AStarNavigation>(); audio = this.GetComponent <AudioSource>(); audio.loop = true; audio.minDistance = maxSoundRadius; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { astar = animator.GetComponent <AStarNavigation>(); hitFSM = animator.GetComponent <HitmanFSM>(); visibleTarget = hitFSM.GetVisibleTargetObject(); if (visibleTarget != null) { //transition to assassinate animator.SetBool("FoundTarget", true); } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { GovFSM = animator.GetComponent <GovForceFSM>(); astar = animator.GetComponent <AStarNavigation>(); astar.stopRadius = astar.initialstopRadius;//set to the original stopRadius visibleTarget = GovFSM.GetFirstVisibleObject(GovFSM.EnemyAspects); if (visibleTarget != null) { //Transition to Chase animator.SetBool("EnemyLost", false); } }
// OnStateEnter is called before OnStateEnter is called on any state inside this state machine override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { animator.SetBool("EnemyLost", false); astar = animator.GetComponent <AStarNavigation>(); GovFSM = animator.GetComponent <GovForceFSM>(); //set stopping distance to shooting stop distance astar.stopRadius = GovFSM.startShootingRange; visibleTarget = GovFSM.GetFirstVisibleObject(GovFSM.EnemyAspects); //Check if there is a visible object with this aspect & proceed to chase if (visibleTarget != null) { astar.ChangeGoalPosition(visibleTarget.transform.position); } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { //set enemy not lost animator.SetBool("EnemyLost", false); GovFSM = animator.GetComponent <GovForceFSM>(); astar = animator.GetComponent <AStarNavigation>(); astar.isStopped = true;//activate astar ResetShootTimer(GovFSM); visibleTarget = GovFSM.GetFirstVisibleObject(GovFSM.EnemyAspects); if (visibleTarget != null) { TurnToTarget(animator, visibleTarget, GovFSM); FireProjectile(animator); } else { //Transition to LastKnownPosition animator.SetBool("InShootRange", false); astar.isStopped = false;//deactivate astar } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { astar = animator.GetComponent <AStarNavigation>(); animator.SetBool("WayPointReached", true); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { astar = animator.GetComponent <AStarNavigation>(); wormFSM = animator.GetComponent <WormFSM>(); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { astar = animator.GetComponent <AStarNavigation>(); GovFSM = animator.GetComponent <GovForceFSM>(); EnemyFoundCheck(animator); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { astar = animator.GetComponent <AStarNavigation>(); hitFSM = animator.GetComponent <HitmanFSM>(); hitFSM.NextContract(); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { astar = animator.GetComponent <AStarNavigation>(); waypoint = astar.goalPos.GetComponent <Waypoint>(); }