Пример #1
0
 void Update()
 {
     if (Input.GetKeyDown(releaseButton))
     {
         Instantiate(trapDoor, transform.position, transform.rotation);
         sounds.PlaySound(4);
         Destroy(gameObject);
         Debug.Log("Trap door activated!");
     }
 }
    private void Recognizer_OnPhraseRecognized(PhraseRecognizedEventArgs args)
    {
        word = args.text;
        if (word == "Fire" && !hasFireCooledDown)
        {
            sounds.PlaySound(8);
            word = "Cooldown in effect!";
        }
        if (word == "Burn" && !hasFireCooledDown)
        {
            sounds.PlaySound(8);
            word = "Cooldown in effect!";
        }
        if (word == "Burn them Alive" && !hasFireCooledDown)
        {
            sounds.PlaySound(8);
            word = "Cooldown in effect!";
        }
        if (word == "Lightning" && !hasLightningCooledDown)
        {
            sounds.PlaySound(8);
            word = "Cooldown in effect!";
        }
        if (word == "Thunder" && !hasLightningCooledDown)
        {
            sounds.PlaySound(8);
            word = "Cooldown in effect!";
        }
        if (word == "Send in the minions" && !hasMinionsCooleddown)
        {
            sounds.PlaySound(8);
            word = "Cooldown in effect!";
        }

        /*if (word == "Fear" && !hasFearCooledDown) {
         *      sounds.PlaySound(8);
         *      word = "Cooldown in effect!";
         * }
         * if (word == "Mind Control" && !hasMindControlCooledDown) {
         *      sounds.PlaySound(8);
         *      word = "Cooldown in effect!";
         * }*/
        if (word == "Ha ha ha" && !hasEvilCooledDown)
        {
            sounds.PlaySound(8);
            word = "Cooldown in effect!";
        }
        string debugText = "You said: <b>" + word + "</b>";

        Debug.Log(debugText);
        //i placed this here so that they wouldnt spam
        isSpawningMinions   = true;
        isSpawningFire      = true;
        isSpawningLightning = true;
        //isSpawningFear = true;
        //isSpawningMindControl = true;
        isSpawningEvil = true;
    }
Пример #3
0
 void changeMenuSelection()
 {
     //Options orb select
     if (targetPosition.x >= changeMenuSelect2XPosition && targetPosition.x <= changeMenuSelect1XPosition)
     {
         menuOptions.SetActive(true);
         menuPlay.SetActive(false);
         menuExit.SetActive(false);
         if (Input.GetButton("Fire1"))
         {
             sounds.PlaySound(2);
             Debug.Log("Options has been selected");
             Options.SetActive(true);
             MagicOrbEquipment.SetActive(false);
             gameObject.SetActive(false);
         }
         //Play orb select
     }
     else if (targetPosition.x > changeMenuSelect1XPosition)
     {
         menuOptions.SetActive(false);
         menuPlay.SetActive(true);
         menuExit.SetActive(false);
         transform.Rotate((new Vector3(0.0f, 0.0f, -targetPosition.y) /** sphereRotateSpeed*/), Space.Self);
         if (Input.GetButton("Fire1"))
         {
             sounds.PlaySound(2);
             SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
         }
         //Exit orb Select
     }
     else if (targetPosition.x < changeMenuSelect2XPosition)
     {
         menuOptions.SetActive(false);
         menuPlay.SetActive(false);
         menuExit.SetActive(true);
         transform.Rotate((new Vector3(0.0f, 0.0f, targetPosition.y) /** sphereRotateSpeed*/), Space.Self);
         if (Input.GetButton("Fire1"))
         {
             sounds.PlaySound(2);
             Debug.Log("Exit has been selected");
             Application.Quit();
         }
     }
 }
Пример #4
0
 private void FixedUpdate()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         Debug.Log("You pressed A");
         if (hasMinionsCooleddown == false)
         {
             sounds.PlaySound(8);
         }
         spawnMinions();
         hasMinionsCooleddown = false;
         StartCoroutine(MagicCoolDown(1, hasMinionsCooleddown));
     }
     else if (Input.GetKeyDown(KeyCode.S))
     {
         Debug.Log("You pressed S");
         if (hasFireCooledDown == false)
         {
             sounds.PlaySound(8);
         }
         SpawnFire();
         hasFireCooledDown = false;
         StartCoroutine(MagicCoolDown(2, hasFireCooledDown));
     }
     else if (Input.GetKeyDown(KeyCode.D))
     {
         Debug.Log("You pressed D");
         if (hasLightningCooledDown == false)
         {
             sounds.PlaySound(8);
         }
         SpawnLightning();
         hasLightningCooledDown = false;
         StartCoroutine(MagicCoolDown(3, hasLightningCooledDown));
     }         /*else if (Input.GetKeyDown (KeyCode.F)) {
                *    Debug.Log ("You pressed F");
                *    if (hasFearCooledDown == false) {
                *            sounds.PlaySound(8);
                *    }
                *    SpawnFear ();
                *    hasFearCooledDown = false;
                *    StartCoroutine (MagicCoolDown (4, hasFearCooledDown));
                * } else if (Input.GetKeyDown (KeyCode.G)) {
                *    Debug.Log ("You pressed G");
                *    if (hasMindControlCooledDown == false) {
                *            sounds.PlaySound(8);
                *    }
                *    SpawnMindControl ();
                *    hasMindControlCooledDown = false;
                *    StartCoroutine (MagicCoolDown (5, hasMindControlCooledDown));
                * }*/
     else if (Input.GetKeyDown(KeyCode.H))
     {
         Debug.Log("You pressed H");
         if (hasEvilCooledDown == false)
         {
             sounds.PlaySound(8);
         }
         SpawnEvilPromotion();
         hasEvilCooledDown = false;
         StartCoroutine(MagicCoolDown(6, hasEvilCooledDown));
     }
 }