Beispiel #1
0
    void Player1Controller()
    {
        if (Input.GetKey("w") && cooldownW == false)
        {
            GameObject a = Instantiate(booms) as GameObject;
            a.transform.position = new Vector2(-1, (float)-3.35);
            Destroy(a, destroyTime);
            Invoke("resetCooldownW", cooldownBoom);
            cooldownW = true;
            Debug.Log("W position completed");
            cdW.isHit(cooldownBoom);
        }

        if (Input.GetKey("q") && cooldownQ == false)
        {
            GameObject a = Instantiate(booms) as GameObject;
            a.transform.position = new Vector2(-6, (float)-3.35);
            Destroy(a, destroyTime);
            Invoke("resetCooldownQ", cooldownBoom);
            cooldownQ = true;
            Debug.Log("Q position completed");
            cdQ.isHit(cooldownBoom);
        }

        if (Input.GetKey("e") && cooldownE == false)
        {
            GameObject a = Instantiate(booms) as GameObject;
            a.transform.position = new Vector2(4, (float)-3.35);
            Destroy(a, destroyTime);
            Invoke("resetCooldownE", cooldownBoom);
            cooldownE = true;
            Debug.Log("E posistion completed");
            cdE.isHit(cooldownBoom);
        }

        if (Input.GetKey("r") && cooldownR == false && (cooldownE == true || cooldownQ == true || cooldownW == true))
        {
            resetCooldownE();
            resetCooldownQ();
            resetCooldownW();
            //Invoke("resetCooldownR", 8f);
            cooldownR = true;
            Debug.Log("Cooldown all booms");
            cdE.cooldownNow();
            cdQ.cooldownNow();
            cdW.cooldownNow();
        }
    }