Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        tempEnemey = GameObject.Find("Enemy").GetComponent <EnemyStateMachine>();
        tempPlayer = GameObject.Find("Player").GetComponent <PlayerStateMachine>();

        player.SetText();
        GridMovement = GameObject.Find("Player").GetComponent <PlayerGridMovement>();
        EnemeyTemp   = GameObject.Find("Enemy").GetComponent <EnemyStateMachine>();
        PlayerStateFunc();

        distance = Vector3.Distance(transform.position, TfEnemey.position);
        if (distance < maxAllowedDistance)
        {
            player.inRange = true;
        }
        else
        {
            player.inRange = false;
        }
    }
Exemple #2
0
 // Update is called once per frame
 void Update()
 {
     player.SetText();
     EnemeyTemp = GameObject.Find("Enemy").GetComponent <EnemyStateMachine>();
     PlayerStateFunc();
 }