Ejemplo n.º 1
0
    void Awake() {
        //navMeshAgent = GetComponent<NavMeshAgent>();
        

        sphereCollider = GetComponent<SphereCollider>();
        lastPlayerSighting = GameManager.Instance.GetComponent<LastPlayerSightingScript>();
        player = GameObject.FindGameObjectWithTag(Tags.player);

        // Set the personal sighting and the previous sighting to the reset position.
        personalLastSighting = lastPlayerSighting.resetPosition;
        previousSighting = lastPlayerSighting.resetPosition;
    }
Ejemplo n.º 2
0
    void Awake () {

        time = Time.time;
        //Getting the references
        agent = GetComponent<NavMeshAgent>();
        enemySight = GetComponent<EnemySightScript>();
        lastPlayerSighting = GameManager.Instance.GetComponent<LastPlayerSightingScript>();

        if (target == null) target = GameObject.FindWithTag(Tags.player).transform;
        InvokeRepeating("StateLogic", 0, 0.01f);

        StartCoroutine("StateMachine");
	}