예제 #1
0
 void Start()
 {
     sensing 		= 		GetComponent<GuardSensing> ();
     player 			= 		GameObject.FindWithTag("Player");
     torso 			= 		GameObject.Find ("ppl_chest");
     anim 			= 		GetComponent<Animator> ();
     pHealth 		= 		GameObject.Find ("Health Manager").GetComponent<HealthManager> ();
 }
예제 #2
0
    void Start()
    {
        sensing 		= 		GetComponent<GuardSensing> ();
        behaviour 		= 		GetComponent<GuardBehaviour> ();
        alerted 		= 		false;
        alertSystem 	= 		GameObject.Find ("Alert System").GetComponent<AlertManager>();
        pHealth 		= 		GameObject.Find ("Health Manager").GetComponent<HealthManager> ();

        // Set default state: patrol or sentry (stationary)
        if (patrolling)
        {
            behaviour.guardState = GuardBehaviour.GuardState.Patrol;
        } else {
            behaviour.guardState = GuardBehaviour.GuardState.Sentry;
        }
    }
예제 #3
0
    void Start()
    {
        player 			= 		GameObject.FindWithTag ("Player");
        navMeshAgent 	= 		GetComponent<NavMeshAgent> ();
        guardSensing 	= 		GetComponent<GuardSensing> ();
        guardAI 		= 		GetComponent<GuardAI> ();
        guardShooting 	= 		GetComponent<Shooting> ();
        anim 			= 		GetComponent<Animator> ();
        pHealth 		= 		GameObject.Find("Health Manager").GetComponent<HealthManager> ();
        guardBodyParts 	= 		GetComponent<GuardSelfDestruct> ();
        visionCone 		= 		transform.Find ("VisionCone").gameObject;

        // compile patrol and alert routes
        patrolRoute = new Vector3[4]
        {
            waypoint1.transform.position,
            waypoint2.transform.position,
            waypoint3.transform.position,
            waypoint2.transform.position
        };
        alertRoute = new Vector3[4]{
            alertWaypoint1.transform.position,
            alertWaypoint2.transform.position,
            alertWaypoint3.transform.position,
            alertWaypoint2.transform.position
        };
    }