// 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); }
// Start is called before the first frame update void Start() { hitFSM = this.GetComponentInParent <HitmanFSM>(); rb = this.GetComponent <Rigidbody>(); rb.useGravity = false; rb.isKinematic = true; collider = this.GetComponent <BoxCollider>(); collider.isTrigger = 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>(); hitFSM = animator.GetComponent <HitmanFSM>(); visibleTarget = hitFSM.GetVisibleTargetObject(); if (visibleTarget != null) { //transition to assassinate animator.SetBool("FoundTarget", true); } }
private void OnEnable() { Hitman = (HitmanFSM)target; }
// 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(); }