Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Tanks Intro Canvas without Wait

Discussion in 'Scripting' started by DDAUDIOSOLUTIONS, May 8, 2017.

  1. DDAUDIOSOLUTIONS

    DDAUDIOSOLUTIONS

    Joined:
    Sep 5, 2015
    Posts:
    21
    Hi, i would like to give the option to not wait the waitforseconds in the Tanks Demo Game.

    Now the game start showing the Round and wait a few seconds that i can set up in the GameManager Script.

    I woul like to give the option to press some key and interrump the wait time.

    How can i make this in the script.

    This is de Void Start:

    Code (CSharp):
    1.  
    2.  
    3. private void Start()
    4.         {
    5.          
    6.             musicaInicio = FMODUnity.RuntimeManager.CreateInstance ("event:/Music_Background");
    7.             musicaInicio.setParameterValue ("Music", 0f);
    8.             musicaInicio.start ();
    9.             musicaInicio.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));
    10.             // Create the delays so they only have to be made once.
    11.  
    12.             m_StartWait = new WaitForSeconds (m_StartDelay);
    13.  
    14.             m_EndWait = new WaitForSeconds (m_EndDelay);
    15.  
    16.             SpawnAllTanks();
    17.             SetCameraTargets();           // Once the tanks have been created and the camera is using them as targets, start the game.
    18.  
    19.             StartCoroutine (GameLoop ());
    20.         }
    21.  
    22.  
    i woul like the way that if don't want wait the the StartDelay, press some key and StartCoroutine.

    Thanks
     
    Last edited: May 9, 2017
  2. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
  3. DDAUDIOSOLUTIONS

    DDAUDIOSOLUTIONS

    Joined:
    Sep 5, 2015
    Posts:
    21
    Sorry for the bad code, up.

    Thanks