示例#1
0
        private static IEnumerator FadeOutExit()
        {
            FadeMusic.FadeOutMusic();
            SceneChanger.FadeToScene();
            yield return(new WaitForSeconds(1));

            Application.Quit();
        }
示例#2
0
 protected override void Initialize()
 {
     base.Initialize();
     footDust.Stop();
     jumpDust.Stop();
     stateMachine.Initialize(idleState);
     fadeMusic = GameObject.Find("MusicPlayer").GetComponent <FadeMusic>();
 }
示例#3
0
        private static IEnumerator FadeOutMainMenu()
        {
            FadeMusic.FadeOutMusic();
            SceneChanger.FadeToScene();
            yield return(new WaitForSeconds(1));

            SceneManager.LoadScene("MainMenuBox");
        }
        private static IEnumerator NextScene()
        {
            FadeMusic.FadeOutMusic();
            SceneChanger.FadeToScene();
            yield return(new WaitForSeconds(1));

            SceneChanger.NextScene();
        }
示例#5
0
    // Start is called before the first frame update
    void Start()
    {
        S           = this;
        musicFader  = this.GetComponentInChildren <FadeMusic>();
        fadeInMusic = true;

        soundMgr = this.GetComponent <AudioSource>();
        startGame();
    }
示例#6
0
    void Start()
    {
        m_SoundFader = GetComponent <FadeMusic>();

        //Make sure the pointer is disabled
        EnablePointer(false);

        //Make sure player can move
        Time.timeScale = 1;
    }
示例#7
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(instance);
 }
    // Use this for initialization
    void Start()
    {
        // Find object with has the script ScrollGameOverText
        GameObject textScroll = GameObject.FindGameObjectWithTag("Finish");

        // Get a reference to script ScrollGameOverText
        sTxt = textScroll.GetComponent <ScrollGameOverText>();

        // Find camera with script on it
        GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");

        // Get reference to script FadeMusic
        fm = camera.GetComponent <FadeMusic>();

        // Get reference to script GameControl
        gc = camera.GetComponent <GameControl>();
    }// End Start()
    // Use this for initialization
    void Start () {

        // Find object with has the script ScrollGameOverText
        GameObject textScroll = GameObject.FindGameObjectWithTag("Finish");

        // Get a reference to script ScrollGameOverText
        sTxt = textScroll.GetComponent<ScrollGameOverText>();

        // Find camera with script on it
        GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");

        // Get reference to script FadeMusic
        fm = camera.GetComponent<FadeMusic>();

        // Get reference to script GameControl
        gc = camera.GetComponent<GameControl>();

    }// End Start()
示例#10
0
 public void FadeOutMusic()
 {
     backgroundMusic = GameObject.Find("Main Camera").GetComponent <AudioSource>();
     StartCoroutine(FadeMusic.StartFade(backgroundMusic, duration, targetVolume));
 }