Example #1
0
    public void Start()
    {
        gm = GameManager.GetInstance();

        steerable = GetComponent <SteerableBehaviour>();

        x = Random.Range(-2, 0);
        y = Random.Range(-1, 1);
    }
Example #2
0
    public override void Awake()
    {
        base.Awake();

        Transition Atacando = new Transition();

        Atacando.condition = new ConditionDistLT(transform, GameObject.FindWithTag("Player").transform, 2.0f);
        Atacando.target    = GetComponent <StateAtaque>();
        transitions.Add(Atacando);
        steerable = GetComponent <SteerableBehaviour>();
    }
Example #3
0
    public override void Awake()
    {
        base.Awake();
        // Configure a transição para outro estado aqui.
        Transition ToAtacando = new Transition();

        ToAtacando.condition = new ConditionDistLT(transform, GameObject.FindWithTag("Player").transform, 2.0f);
        ToAtacando.target    = GetComponent <StateAtaque>();
        transitions.Add(ToAtacando);
        steerable = GetComponent <SteerableBehaviour>();
    }
Example #4
0
    public override void Awake()
    {
        base.Awake();

        steerable = GetComponent <SteerableBehaviour>();

        shooter = steerable as IShooter;
        if (shooter == null)
        {
            throw new MissingComponentException("Esse GameObject não implementa IShooter");
        }
    }
Example #5
0
    public override void Awake()
    {
        base.Awake();

        Transition ToChaseState = new Transition();

        ToChaseState.condition = new ConditionDistLT(transform, GameObject.FindWithTag("Player").transform, 7.0f);
        ToChaseState.target    = GetComponent <ChaseState>();
        transitions.Add(ToChaseState);

        steerable = GetComponent <SteerableBehaviour>();
    }
    public override void Awake()
    {
        base.Awake();
        gm = GameManager.GetInstance();
        //Criamos e populamos uma nova transição
        Transition ToAtacando = new Transition();

        ToAtacando.condition = new ConditionDistLT(transform, GameObject.FindWithTag("Player").transform, 4.0f);
        ToAtacando.target    = GetComponent <StateAtaque>();

        // Adicionamos nossa transição na lista de transições
        transitions.Add(ToAtacando);
        steerable = GetComponent <SteerableBehaviour>();
    }
Example #7
0
    public override void Awake()
    {
        base.Awake();

        // Criamos e populamos uma nova transição
        Transition ToAttack = new Transition();

        ToAttack.condition = new ConditionDistLT(transform,
                                                 GameObject.FindWithTag("Player").transform,
                                                 30.0f);
        ToAttack.target = GetComponent <StateAttack>();
        // Adicionamos a transição em nossa lista de transições
        transitions.Add(ToAttack);

        steerable = GetComponent <SteerableBehaviour>();
    }
    public override void Awake()
    {
        base.Awake();
        if (GameObject.FindWithTag("Player") == null)
        {
            return;
        }

        Transition attacking = new Transition();

        attacking.condition = new ConditionDistLT(transform, GameObject.FindWithTag("Player").transform, distance);
        attacking.target    = GetComponent <StateAtaqueWaypoint>();
        transitions.Add(attacking);

        steerable = GetComponent <SteerableBehaviour>();
    }
Example #9
0
    public override void Awake()
    {
        base.Awake();

        Transition attacking = new Transition();

        attacking.condition = new ConditionDistLT(
            transform,
            GameObject.FindWithTag("Player").transform,
            2.0f
            );

        attacking.target = GetComponent <StateAttacking>();
        transitions.Add(attacking);

        steerable = GetComponent <SteerableBehaviour>();
    }
Example #10
0
    public override void Awake()
    {
        base.Awake();

        Transition Patrulha = new Transition();

        Patrulha.condition = new ConditionDistGT(transform, GameObject.FindWithTag("Player").transform, 2.0f);
        Patrulha.target    = GetComponent <StatePatrulhaWaypoints>();
        transitions.Add(Patrulha);

        steerable = GetComponent <SteerableBehaviour>();
        shooter   = steerable as IShooter;
        if (shooter == null)
        {
            throw new MissingComponentException("Este GameObject não implementa IShooter");
        }
    }
Example #11
0
    public override void Awake()
    {
        base.Awake();
        if (GameObject.FindWithTag("Player") == null)
        {
            return;
        }
        //Criando e populando nova transição
        Transition attacking = new Transition();

        attacking.condition = new ConditionDistLT(transform, GameObject.FindWithTag("Player").transform, 2.0f);

        attacking.target = GetComponent <StateAtaquePatrol>();

        transitions.Add(attacking);

        steerable = GetComponent <SteerableBehaviour>();
    }
Example #12
0
 public override void Awake()
 {
     base.Awake();
     // Criamos e populamos uma nova transição
     if (GameObject.FindWithTag("Player"))
     {
         Transition ToAtacando = new Transition();
         ToAtacando.condition = new ConditionDistLT(transform, GameObject.FindWithTag("Player").transform, 20.0f);
         ToAtacando.target    = GetComponent <StateAtaque>();
         // Adicionamos a transição em nossa lista de transições
         transitions.Add(ToAtacando);
         steerable = GetComponent <SteerableBehaviour>();
     }
     else
     {
         Destroy(gameObject);
     }
 }
Example #13
0
    public override void Awake()
    {
        base.Awake();


        Transition ToPatrolState = new Transition();

        ToPatrolState.condition = new ConditionDistGT(transform, GameObject.FindWithTag("Player").transform, 5.0f);
        ToPatrolState.target    = GetComponent <PatrolState>();
        // Adicionamos a transição em nossa lista de transições
        transitions.Add(ToPatrolState);

        steerable = GetComponent <SteerableBehaviour>(); // acho que caguei kkkkk
        shooter   = steerable as IShooter;
        if (shooter == null)
        {
            throw new MissingComponentException("Este GameObject não implementa IShooter");
        }
    }
Example #14
0
    public override void Awake()
    {
        base.Awake();
        gm = GameManager.GetInstance();

        Transition ToPatrulha = new Transition();

        ToPatrulha.condition = new ConditionDistGT(transform, GameObject.FindWithTag("Player").transform, 3.0f);
        ToPatrulha.target    = GetComponent <StatePatrulha>();

        // Adicionamos a transição em nossa lista de transições
        transitions.Add(ToPatrulha);

        steerable = GetComponent <SteerableBehaviour>();
        shooter   = steerable as IShooter;
        if (shooter == null)
        {
            throw new MissingComponentException("Este GameObject não implementa IShooter");
        }
    }
Example #15
0
    public override void Awake()
    {
        base.Awake();

        if (GameObject.FindWithTag("Player") == null)
        {
            return;
        }
        Transition patrol = new Transition();

        patrol.condition = new ConditionDistGT(transform, GameObject.FindWithTag("Player").transform, distance);
        patrol.target    = GetComponent <StatePatrulhaPorWaypoints>();


        transitions.Add(patrol);


        steerable = GetComponent <SteerableBehaviour>();
        shooter   = steerable as IShooter;
        if (shooter == null)
        {
            throw new MissingComponentException("Este GameObject não implementa IShooter");
        }
    }
Example #16
0
 public override void Awake()
 {
     base.Awake();
     steerable = GetComponent <SteerableBehaviour>();
 }