Example #1
0
 void Awake()
 {
     deathanim = GetComponent<Animator> ();
     playerMovement = GetComponent<PlayerMovement> ();;
     hash = GameObject.FindWithTag (Tags.GameController).GetComponent<HashIDs> ();
     screenFadeInOut = GameObject.FindWithTag (Tags.Fader).GetComponent<ScreenFadeInOut> ();
     lastPlayerSighting = GameObject.FindWithTag (Tags.GameController).GetComponent<LastPlayerSight> ();
 }
Example #2
0
    private Vector3 previousSighting; // Where the player was sighted last frame.

    #endregion Fields

    #region Methods

    void Awake()
    {
        // Setting up the references.
        nav = GetComponent<NavMeshAgent>();
        col = GetComponent<SphereCollider>();
        anim = GetComponent<Animator>();
        lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent<LastPlayerSight>();
        player = GameObject.FindGameObjectWithTag (Tags.Player);
        playerAnim = player.GetComponent<Animator>();
        playerHealth = player.GetComponent<PlayerHealth>();
        hash = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent<HashIDs>();

        // Set the personal sighting and the previous sighting to the reset position.
        personalLastSighting = lastPlayerSighting.resetPosition;
        previousSighting = lastPlayerSighting.resetPosition;
    }
 // Use this for initialization
 void Start()
 {
     _player = GameObject.FindWithTag (Tags.Player);
     _lastPlayerSight = GameObject.FindWithTag (Tags.GameController).GetComponent<LastPlayerSight> ();
 }