Example #1
0
 // 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);
 }
Example #2
0
 // 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;
 }
Example #3
0
 // 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);
     }
 }
Example #4
0
 private void OnEnable()
 {
     Hitman = (HitmanFSM)target;
 }
Example #5
0
 // 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();
 }