Ejemplo n.º 1
0
    void Behaviour()
    {
        if (currentBehaviour != null)
        {
            if (!currentBehaviour.Execute())
            {
                currentBehaviour.Finish();
                currentBehaviour = null;
            }
        }

        if (currentBehaviour == null)
        {
            float rng = Random.Range(0.0f, 4.0f);
            //Debug.Log(rng);

            //rng = 1.5f; //DEBUG to Force Behaviours

            if (rng <= 0)
            {
                SetBehaviour(new BossBehaviourIdle(this));
            }
            else if (rng <= 1)
            {
                SetBehaviour(new BossBehaviourSpawnTurret(this));
            }
            else if (rng <= 2)
            {
                SetBehaviour(new BossBehaviourHeavy(this));
            }
            else if (rng <= 3)
            {
                SetBehaviour(new BossBehaviourCombo(this));
            }
            else if (rng <= 4)
            {
                SetBehaviour(new BossBehaviourAOE(this));
            }
        }
    }
Ejemplo n.º 2
0
 public void SetBehaviour( IBossBehaviour newBehaviour )
 {
     currentBehaviour = newBehaviour;
     currentBehaviour.Init();
     Debug.Log("setBehaviour " + currentBehaviour.ToString());
 }