Пример #1
0
    public void Restart()
    {
        Debug.Log("[Globals]: Restart begin...");

        GameDefines.WriteConfigFile();
        //GUIVipStore.WritePendingOrderIds();

        ThirdPartyPlatform.CloseSDK();


        Debug.Log("[Globals]: Restart call Release()...");
        Globals.Instance.Release();
        GameObject dontAutoDelObj = GameObject.Find("GlobalScripts");

        if (null != dontAutoDelObj)
        {
            GameObject.Destroy(dontAutoDelObj);
        }

        dontAutoDelObj = GameObject.Find("StaticRes");
        if (null != dontAutoDelObj)
        {
            GameObject.Destroy(dontAutoDelObj);
        }

        dontAutoDelObj = GameObject.Find("UI Root");
        if (null != dontAutoDelObj)
        {
            GameObject.Destroy(dontAutoDelObj);
        }

        dontAutoDelObj = GameObject.Find("CameraControl");
        if (null != dontAutoDelObj)
        {
            GameObject.Destroy(dontAutoDelObj);
        }

        dontAutoDelObj = GameObject.Find("TaskCameraControl");
        if (null != dontAutoDelObj)
        {
            GameObject.Destroy(dontAutoDelObj);
//			GameObject.DestroyImmediate(dontAutoDelObj);
        }

        Debug.Log("[Globals]: Restart call Application.LoadLevel...");
        Application.LoadLevel("SceneStart");

        Debug.Log("[Globals]: Restart End...");
    }
Пример #2
0
    public void QuitGame()
    {
        GameDefines.WriteConfigFile();
        //GUIVipStore.WritePendingOrderIds();

        // Quit game
        Application.Quit();

        // Test the Process state
        if (!Application.isEditor)
        {
            Process currentProcess = Process.GetCurrentProcess();
            if (currentProcess != null)
            {
                currentProcess.Kill();
            }
        }
    }
Пример #3
0
    //public static int	Setting_MusicVol		= 100;
    //public static int	Setting_SoundVol		= 100;
    public void ChangeSound(GameObject obj)
    {
        bool state = obj.GetComponent <UIToggle> ().value;

        SetBallPsition(Sound_Ball, state);
        if (state)
        {
            GameDefines.Setting_MusicVol = 100;
            GameDefines.Setting_SoundVol = 100;
            SoundManager.CurrentPlayingMusicAudio.volume = 1;
        }
        else
        {
            GameDefines.Setting_MusicVol = 0;
            GameDefines.Setting_SoundVol = 0;
            SoundManager.CurrentPlayingMusicAudio.volume = 0;
        }
        GameDefines.WriteConfigFile();
    }
Пример #4
0
    public void ChangeDefinition(GameObject obj)
    {
        GameDefines.Setting_UserDefined = true;
        bool state = obj.GetComponent <UIToggle> ().value;

        SetBallPsition(Definition_Ball, state);
        if (state)
        {
            Globals.Instance.MGUIManager.ShowSimpleCenterTips(9001);
            GameDefines.Setting_ScreenQuality = true;
        }
        else
        {
            Globals.Instance.MGUIManager.ShowSimpleCenterTips(9002);
            GameDefines.Setting_ScreenQuality = false;
        }

        GameDefines.WriteConfigFile();
    }