public override void Execute()
    {
        GetComponent <Renderer>().material.color = warningColor;
        Vector3 playerPos = GameObject.Find("Player").transform.position;

        transform.LookAt(playerPos);
        if (CheckDistanceToPlayer() <= actDistance)
        {
            print("cambio a Act");
            Yo.SetNewState(NextState);
        }
    }
예제 #2
0
 public override void Execute()
 {
     GetComponent <Renderer>().material.color = actingColor;
     if (btRoot != null)
     {
         btRoot.Execute();
     }
     if (CheckDistanceToPlayer() >= GetComponent <Idle>().WarningDistance)
     {
         print("aaaaaaaaaaaaa");
         Yo.SetNewState(NextState);
     }
 }