protected void GoBackToMenu()
        {
#if UNITY_ANDROID
            OnGoingBackToMenu();
#endif
            CameraFade.StartAlphaFade(Color.black, false, 0.25f, 0f, () => BluetoothExamplesTools.LoadLevel("BluetoothDemoMenu"));
        }
Пример #2
0
        protected void GoBackToMenu()
        {
#if UNITY_ANDROID
            OnBackToMenu();
#endif
            CameraFade.StartAlphaFade(Color.black, false, 0.25f, 0f, () => Application.LoadLevel(0));
        }
        private void OnGUI()
        {
            const float width        = 250f;
            const float buttonHeight = 35f;
            const float height       = 100f + buttonHeight * 3f;

            float scaleFactor = BluetoothExamplesTools.UpdateScaleMobile();

            GUI.color = Color.white;
            GUILayout.BeginArea(
                new Rect(
                    Screen.width / 2f / scaleFactor - width / 2f,
                    Screen.height / 2f / scaleFactor - height / 2f,
                    width,
                    height),
                "Android Bluetooth Multiplayer Demo",
                "Window");
            GUILayout.BeginVertical();

            GUILayout.Space(10);
            if (GUILayout.Button("Basic multiplayer", GUILayout.Height(buttonHeight)))
            {
                CameraFade.StartAlphaFade(Color.black, false, 0.25f, 0f, () => Application.LoadLevel("BluetoothMultiplayerDemo"));
            }

            if (GUILayout.Button("Device discovery", GUILayout.Height(buttonHeight)))
            {
                CameraFade.StartAlphaFade(Color.black, false, 0.25f, 0f, () => Application.LoadLevel("BluetoothDiscoveryDemo"));
            }

            if (GUILayout.Button("Basic RPC file transfer", GUILayout.Height(buttonHeight)))
            {
                CameraFade.StartAlphaFade(Color.black, false, 0.25f, 0f, () => Application.LoadLevel("BluetoothFileTransferDemo"));
            }

            GUILayout.Space(15);
            GUI.backgroundColor = new Color(1f, 0.6f, 0.6f, 1f);
            if (GUILayout.Button("Quit", GUILayout.Height(buttonHeight)))
            {
                CameraFade.StartAlphaFade(Color.black, false, 0.25f, 0f, Application.Quit);
            }

            GUILayout.EndVertical();
            GUILayout.EndArea();
        }
Пример #4
0
 protected virtual void OnLevelWasLoaded(int level)
 {
     Screen.sleepTimeout = 500;
     CameraFade.StartAlphaFade(Color.black, true, 0.25f, 0.0f);
 }
Пример #5
0
 public void LoadLevel(string levelName)
 {
     CameraFade.StartAlphaFade(Color.black, false, 0.25f, 0f, () => BluetoothExamplesTools.LoadLevel(levelName));
 }
Пример #6
0
 private void QuitApplication()
 {
     CameraFade.StartAlphaFade(Color.black, false, 0.25f, 0f, Application.Quit);
 }
Пример #7
0
 protected virtual void SceneLoadedHandler(int buildIndex)
 {
     Screen.sleepTimeout = SleepTimeout.SystemSetting;
     CameraFade.StartAlphaFade(Color.black, true, 0.25f, 0.0f);
 }
 private void OnLevelWasLoaded(int level)
 {
     Screen.sleepTimeout = SleepTimeout.SystemSetting;
     CameraFade.StartAlphaFade(Color.black, true, 0.25f, 0.0f);
 }