Ejemplo n.º 1
0
 public void Setup()
 {
     targetAux = target;
     target    = new GameObject();
     target.AddComponent <SteeringBehaviours.Agent>();
     auxAgent = target.GetComponent <SteeringBehaviours.Agent>();
 }
Ejemplo n.º 2
0
    public override void Awake()
    {
        base.Awake();
        targetAux = target.gameObject;
        target    = new GameObject();

        if (targetAux != null)
        {
            agentTarget = targetAux.HasComponent <SteeringBehaviours.Agent>()? targetAux.GetComponent <SteeringBehaviours.Agent>() : null;
        }
    }
Ejemplo n.º 3
0
    public override void Awake()
    {
        base.Awake();

        // si hay un objetivo y ese objetivo es un agente, entonces usaremos esa velocidad
        // sino, trabajaremos con la velocidad del rigidbody
        // sino tiene ninguno de estos componentes entonces dara error en tiempo de ejecucion
        if (target != null)
        {
            agentTarget = target.HasComponent <SteeringBehaviours.Agent>()? target.GetComponent <SteeringBehaviours.Agent>() : null;
        }
    }