コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        //if (!showingReadyUp)
        //{
        //    // If START is pressed on any controller, show ready up screen
        //    foreach (HasController controller in player_controllers)
        //    {
        //        if (controller.controller != null && controller.controller.startButton.wasPressedThisFrame)
        //        {
        //            showingReadyUp = true;
        //            StartButtonPrompt.SetActive(false);
        //            StartButtonPrompt2.SetActive(false);
        //            ReadyUpPanel.SetActive(true);
        //            ReadyUpPanel2.SetActive(true);
        //        }
        //    }
        //}

        if (readyPlayers.Count == numPlayers)
        {
            fader.FadeToLevel(2);
        }
        else if (menuPlayers.Count == numPlayers)
        {
            fader.FadeToLevel(0);
        }
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        if (!showingReadyUp)
        {
            // If START is pressed on any controller, show ready up screen
            foreach (HasController controller in player_controllers)
            {
                if (controller.controller != null && controller.controller.startButton.wasPressedThisFrame)
                {
                    showingReadyUp = true;
                    StartButtonPrompt.SetActive(false);
                    StartButtonPrompt2.SetActive(false);
                    ReadyUpPanel.SetActive(true);
                    ReadyUpPanel2.SetActive(true);

                    audioSource.PlayOneShot(beep);
                }
            }
        }

        if (readyPlayers.Count == numPlayers)
        {
            fader.FadeToLevel(5);
        }
    }
コード例 #3
0
 void OnTriggerEnter(Collider other)
 {
     // "if layer == 'Player'"
     if (other.gameObject.CompareTag("Player"))
     {
         CheckpointManager.position = Vector3.zero;
         fadeObject.FadeToLevel();
     }
 }
コード例 #4
0
    private IEnumerator DefenderWinScreen()
    {
        //DefenderWinText.enabled = true;
        //AttackersLoseText.enabled = true;
        //miniCam.transform.position = new Vector3(200, 0, 200);
        yield return(new WaitForSeconds(1.0f));

        fader.FadeToLevel(3);
        //SceneManager.LoadScene(2); // Go to menu
    }
コード例 #5
0
    // Update is called once per frame
    void Update()
    {
        if (playersWhoSucceededCurrentTask.Count == attackersNeeded)
        {
            // Delete walls
            task_walls[current_task].attacker1_wall.SetActive(false);
            task_walls[current_task].attacker2_wall.SetActive(false);
            task_walls[current_task].attacker3_wall.SetActive(false);

            current_task++;
            playersWhoSucceededCurrentTask.Clear();

            if (current_task == tasks.jail)
            {
                // Display jail text
                UIAlertManager.instance.AddToQueue("If you get caught, you'll be sent to jail. Press A to free other attackers.", true);
            }

            if (current_task == tasks.door)
            {
                UIAlertManager.instance.AddToQueue("Hit a button to open a door with 'A'", true);
            }

            if (current_task == tasks.dash)
            {
                UIAlertManager.instance.AddToQueue("Press X to do a dash!", true);
                UIAlertManager.instance.AddToQueue("Press X to do a dash!");
            }
        }

        if (current_task > tasks.dash)
        {
            if (TutorialManagerDefender.instance.tutorialFinished)
            {
                fader.FadeToLevel(2);
            }
            else
            {
                //waitForPlayers.enabled = true;
                UIAlertManager.instance.AddToQueue("Waiting for other players...", true);
            }
        }
    }
コード例 #6
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Alpha0))
        {
            fader.FadeToLevel(0);
        }

        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            fader.FadeToLevel(1);
        }

        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            fader.FadeToLevel(2);
        }

        if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            fader.FadeToLevel(3);
        }

        if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            fader.FadeToLevel(4);
        }

        if (Input.GetKeyDown(KeyCode.Alpha5))
        {
            fader.FadeToLevel(5);
        }

        if (inMenu && Gamepad.current.startButton.wasPressedThisFrame)
        {
            fader.FadeToLevel(1);
        }
    }
コード例 #7
0
    IEnumerator GoToTutorial()
    {
        yield return(new WaitForSeconds(5.0f));

        fader.FadeToLevel(1);
    }