Пример #1
0
 public Command(EnemigoCombo2 receiver3)
 {
     combo2Comando = receiver3;
 }
Пример #2
0
 public ZOR_Command(EnemigoCombo2 receiver) :
     base(receiver)
 {
 }
Пример #3
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            invoker.ExecuteDown();
        }

        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            invoker.ExecuteUpper();
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            invoker.ExecuteEsc();
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            invoker.ExecuteSpace();
        }

        // Trtamiento especial para los enemigos de secuencia de letras (Combos)
        if (GameObject.Find("combo1(Clone)") != null)
        {
            combo1        = GameObject.Find("combo1(Clone)");
            enemigoCombo1 = combo1.GetComponent <EnemigoCombo1> ();
            QMGc          = new QMG_Command(enemigoCombo1);
            invoker.SetCommand(QMGc);
        }

        if (Input.GetKeyDown("q"))
        {
            comp = true;
        }

        if (comp && Input.GetKeyDown("m"))
        {
            comp2 = true;
        }

        if (comp && comp2 && Input.GetKeyDown("g"))
        {
            invoker.ExecuteQMG();
        }


        if (GameObject.Find("combo2(Clone)") != null)
        {
            combo2        = GameObject.Find("combo2(Clone)");
            enemigoCombo2 = combo2.GetComponent <EnemigoCombo2> ();
            ZORc          = new ZOR_Command(enemigoCombo2);
            invoker.SetCommand(ZORc);
        }

        if (Input.GetKeyDown("z"))
        {
            comp = true;
        }

        if (comp && Input.GetKeyDown("o"))
        {
            comp2 = true;
        }

        if (comp && comp2 && Input.GetKeyDown("r"))
        {
            invoker.ExecuteQMG();
        }
    }