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); } }
public override void Execute() { GetComponent <Renderer>().material.color = actingColor; if (btRoot != null) { btRoot.Execute(); } if (CheckDistanceToPlayer() >= GetComponent <Idle>().WarningDistance) { print("aaaaaaaaaaaaa"); Yo.SetNewState(NextState); } }