상속: Object
        private void WhatNextSlide()
        {
            TutorialGUI.Paragraph(
                "Now you can freely explore the example, it should be " +
                "all configured to talk with the cloud as the game " +
                "you've just created."
                );

            TutorialGUI.Paragraph(
                "- try registering players and logging in"
                );

            TutorialGUI.Paragraph(
                "- open the database and view the registered players"
                );

            TutorialGUI.Paragraph(
                "- this example was created from the <i>Email " +
                "authentication</i> template. Go explore its documentation " +
                "and learn more at:"
                );

            TutorialGUI.Form(() => {
                string url = "https://unisave.cloud/docs/email-authentication";
                if (GUILayout.Button(url))
                {
                    Application.OpenURL(url);
                }
            });
        }
예제 #2
0
        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);

            if (_onForceClosing)
            {
                return;
            }

            var result = MessageBox.Show(
                "Shutdown server?",
                "Shutdown",
                MessageBoxButtons.YesNo,
                MessageBoxIcon.Exclamation
                );

            if (result == DialogResult.Yes)
            {
                UnityApplication.Quit();
            }
            else
            {
                e.Cancel = true;
            }
        }
예제 #3
0
 private void InputHandler()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         Application.Quit();
     }
 }
예제 #4
0
 public void New()
 {
     if (MessageBox.Show("Your current progress will be lost. \n Do you want to proceed?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         Application.LoadLevelAsync(Application.loadedLevel);
     }
 }
예제 #5
0
        private static void InitGoogleService()
        {
            UserCredential credential;
            string         credentialPath = EditorUtility.OpenFilePanel("Select your API credential",
                                                                        Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "json");

            if (credentialPath == "")
            {
                Application.OpenURL("https://developers.google.com/drive/api/v3/quickstart/dotnet");
            }

            string credPath = Path.GetDirectoryName(credentialPath) + "\\token.json";

            using (var stream = new FileStream(credentialPath, FileMode.Open, FileAccess.Read))
            {
                credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                    stream,
                    Scopes,
                    "user",
                    CancellationToken.None,
                    new FileDataStore(credPath, true)).Result;

                Debug.Log("Credential file saved to: " + credPath);
            }

            // Create Drive API service.
            driveService = new DriveService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName       = ApplicationName,
            });
        }
예제 #6
0
 static public int constructor(IntPtr l)
 {
     UnityEngine.Application o;
     o = new UnityEngine.Application();
     pushObject(l, o);
     return(1);
 }
예제 #7
0
		protected override Action checkMutation(Application app, Index p) {
			LocalApplication lApp = (LocalApplication)app;
			float voxelSize = calculateVoxelSize(app, p);
			Vector3 diff = calculateDiff(lApp.position, p, voxelSize);
			LocalAction action = checkMutation(lApp, p, diff, voxelSize);
			action.voxelSize = voxelSize;
			return action;
		}
예제 #8
0
파일: Logger.cs 프로젝트: s3chugo/KEngine
 public static void RemoveLogCallback(Application.LogCallback callback)
 {
     if (!_hasRegisterLogCallback)
     {
         Application.RegisterLogCallbackThreaded(OnLogCallback);
         _hasRegisterLogCallback = true;
     }
     LogCallbackEvent -= callback;
 }
예제 #9
0
		protected override Voxel mutate(Application app, Index pos, Action action, Voxel original) {
			BlurApp bApp = (BlurApp)app;
			BlurAction bAction = (BlurAction)action;
			float dis = Mathf.Sqrt(bAction.disSqr);
			float actualStrength = strength * (1 - (dis / bApp.radius));
			if (actualStrength <= 0)
				return original;
			byte newOpacity = calculateOpacity(bApp.original, pos.x - app.min.x, pos.y - app.min.y, pos.z - app.min.z, actualStrength);
			return new Voxel(original.averageMaterialType(), newOpacity);
		}
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Application o;
         o = new UnityEngine.Application();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    public void ConfirmQuit()
    {
        var dialogResult = MessageBox.Show("really want exit game ?", "system message", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

        if (dialogResult == DialogResult.OK)
        {
            Application.CancelQuit();
            //TODO write you logic method

            Application.Quit();
        }
    }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.Application o;
			o=new UnityEngine.Application();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
예제 #13
0
파일: ThatGUI.cs 프로젝트: active-logic/uta
                     public static bool A(string label, string url, int width = -1)
                     {
                         bool ㄸ = width < 0 ? Button(label) : Button(label, Width(width));

                         if (ㄸ)
                         {
                             App.OpenURL(url); return(true);
                         }
                         else
                         {
                             return(false);
                         }
                     }
예제 #14
0
 static public int constructor(IntPtr l)
 {
     LuaDLL.lua_remove(l, 1);
     UnityEngine.Application o;
     if (matchType(l, 1))
     {
         o = new UnityEngine.Application();
         pushObject(l, o);
         return(1);
     }
     LuaDLL.luaL_error(l, "New object failed.");
     return(0);
 }
예제 #15
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Application o;
         o = new UnityEngine.Application();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
예제 #16
0
        static void RiderPreferencesItem()
        {
            EditorGUILayout.BeginVertical();

            var url = "https://github.com/JetBrains/Unity3dRider";

            if (GUILayout.Button(url))
            {
                Application.OpenURL(url);
            }

            EditorGUI.BeginChangeCheck();

            var enabledMsg = @"Enable Unity3dRider.";

            Enabled =
                EditorGUILayout.Toggle(
                    new GUIContent("Enable Unity3dRider",
                                   enabledMsg), Enabled);
            EditorGUILayout.HelpBox(enabledMsg, MessageType.None);

            var help = @"For now target 4.5 is strongly recommended.
 - Without 4.5:
    - Rider will fail to resolve System.Linq on Mac/Linux
    - Rider will fail to resolve Firebase Analytics.
 - With 4.5 Rider will show ambiguous references in UniRx.
All those problems will go away after Unity upgrades to mono4.";

            TargetFrameworkVersion45 =
                EditorGUILayout.Toggle(
                    new GUIContent("TargetFrameworkVersion 4.5",
                                   help), TargetFrameworkVersion45);
            EditorGUILayout.HelpBox(help, MessageType.None);

            EditorGUI.EndChangeCheck();

            EditorGUI.BeginChangeCheck();

            var loggingMsg =
                @"Enable logging. If you are about to report an issue, please enable logging and attach Unity console output to the issue.";

            EnableLogging =
                EditorGUILayout.Toggle(
                    new GUIContent("Enable Logging",
                                   loggingMsg), EnableLogging);
            EditorGUILayout.HelpBox(loggingMsg, MessageType.None);

            EditorGUI.EndChangeCheck();
        }
예제 #17
0
		protected override Action checkMutation(Application app, Index pos) {
			BlurApp bApp = (BlurApp)app;
			BlurAction action = new BlurAction();
			float voxelSize = LocalMutator.calculateVoxelSize(app, pos);
			Vector3 diff = LocalMutator.calculateDiff(bApp.position, pos, voxelSize);

			action.disSqr = diff.sqrMagnitude;
			float maxRadius = bApp.radius + voxelSize;
			float maxRadSqr = maxRadius * maxRadius;
			if (action.disSqr > maxRadSqr)
				return action;
			action.doTraverse = true;
			action.modify = true;
			return action;
		}
예제 #18
0
        public static void RegisterLogCallback(Application.LogCallback logCallback)
        {
            if (!_initialized)
            {
            return;
            }

            if (logCallback == null)
            {
            return;
            }

            UnregisterLogCallback(logCallback);
            PSAssert.Validate(!_callbacks.Contains(logCallback), "log callback already added");
            _callbacks.Add(logCallback);
            PSDebug.Log("app: registered log callback {0}", _callbacks.Count);
        }
예제 #19
0
        static void RiderPreferencesItem()
        {
            EditorGUILayout.BeginVertical();

            var url = "https://github.com/JetBrains/resharper-unity";

            if (GUILayout.Button(url))
            {
                Application.OpenURL(url);
            }

            EditorGUI.BeginChangeCheck();

            var help = @"For now target 4.5 is strongly recommended.
 - Without 4.5:
    - Rider will fail to resolve System.Linq on Mac/Linux
    - Rider will fail to resolve Firebase Analytics.
 - With 4.5 Rider will show ambiguous references in UniRx.
All those problems will go away after Unity upgrades to mono4.";

            TargetFrameworkVersion45 =
                EditorGUILayout.Toggle(
                    new GUIContent("TargetFrameworkVersion 4.5",
                                   help), TargetFrameworkVersion45);
            EditorGUILayout.HelpBox(help, MessageType.None);

            EditorGUI.EndChangeCheck();

            EditorGUI.BeginChangeCheck();

            var loggingMsg =
                @"Sets the amount of Rider Debug output. If you are about to report an issue, please select Verbose logging level and attach Unity console output to the issue.";

            SelectedLoggingLevel = (LoggingLevel)EditorGUILayout.EnumPopup(new GUIContent("Logging Level", loggingMsg), SelectedLoggingLevel);
            EditorGUILayout.HelpBox(loggingMsg, MessageType.None);

            EditorGUI.EndChangeCheck();

/*      if (GUILayout.Button("reset RiderInitializedOnce = false"))
 *    {
 *      RiderInitializedOnce = false;
 *    }*/

            EditorGUILayout.EndVertical();
        }
        private void RegistrationSlide()
        {
            TutorialGUI.Paragraph(
                "Register yourself at the Unisave web to be able to access " +
                "the web app."
                );

            TutorialGUI.Form(() => {
                if (GUILayout.Button("Open https://unisave.cloud/"))
                {
                    Application.OpenURL("https://unisave.cloud/");
                }
            });

            TutorialGUI.Paragraph(
                "Then create a new game in the web app."
                );
        }
예제 #21
0
    /// <summary>
    /// 初始化摄像头
    /// </summary>
    private IEnumerator Start()
    {
        yield return(Application.RequestUserAuthorization(UserAuthorization.WebCam));

        if (Application.HasUserAuthorization(UserAuthorization.WebCam))
        {
            WebCamDevice[] devices = WebCamTexture.devices;
            //MessageBox.Show(devices.Length.ToString());
            if (devices.Length > 0)
            {
                //读取前置摄像头
                DeviceName      = devices[0].name;
                _webCamera      = new WebCamTexture(DeviceName, (int)CameraSize.x, (int)CameraSize.y, (int)CameraFPS);
                Texture.texture = _webCamera;
                _webCamera.Play();
            }
        }
    }
예제 #22
0
        private static void LinkButton(string caption, string url)
        {
            var style = GUI.skin.label;

            style.richText = true;
            caption        = string.Format("<color=#0000FF>{0}</color>", caption);

            bool bClicked = GUILayout.Button(caption, style);

            var rect = GUILayoutUtility.GetLastRect();

            rect.width = style.CalcSize(new GUIContent(caption)).x;
            EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link);

            if (bClicked)
            {
                Application.OpenURL(url);
            }
        }
예제 #23
0
    override protected void onSelect()
    {
        switch (this.getCurrentOpt())
        {
        case 0:
            this.LoadLevel(1);
            break;

        case 1:
            this.LoadScene("scenes/000-game-controller/LevelSelect");
            break;

        case 2:
            this.LoadScene("scenes/000-game-controller/Options");
            break;

        case 3:
            App.Quit();
            break;
        }
    }
    static int _CreateUnityEngine_ApplicationWrap(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                UnityEngine.Application obj = new UnityEngine.Application();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: UnityEngine.Application.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #25
0
 private void OpenManual()
 {
     Application.OpenURL("http://assetstore.phbarralis.com/sge/features.html");
 }
예제 #26
0
 private void OpenDiscordHelp()
 {
     Application.OpenURL("https://discord.gg/ksURBah");
 }
예제 #27
0
 private void OpenEmailHelp()
 {
     Application.OpenURL("mailto:[email protected]");
 }
예제 #28
0
 public void ExitGame()
 {
     Application.Quit();
 }
예제 #29
0
		public static float calculateVoxelSize(Application app, Index p) {
			return 1 << (app.tree.maxDetail - p.depth);
		}
예제 #30
0
		private static void RegisterLogCallback(Application.LogCallback handler, bool threaded)
		{
			if (Application.s_RegisterLogCallbackDeprecated != null)
			{
				Application.logMessageReceived -= Application.s_RegisterLogCallbackDeprecated;
				Application.logMessageReceivedThreaded -= Application.s_RegisterLogCallbackDeprecated;
			}
			Application.s_RegisterLogCallbackDeprecated = handler;
			if (handler != null)
			{
				if (threaded)
				{
					Application.logMessageReceivedThreaded += handler;
				}
				else
				{
					Application.logMessageReceived += handler;
				}
			}
		}
예제 #31
0
 public static extern bool RequestAdvertisingIdentifierAsync(Application.AdvertisingIdentifierCallback delegateMethod);
예제 #32
0
 public void QuitButton_OnClick()
 {
     // todo: Prompt do you want to save?
     Application.Quit();
 }
    // Update is called once per frame
    void Update()
    {
        // Determines what scene it is, and if the appropiate input is made, moves to the next Scene

        Scene m_scene = SceneManager.GetActiveScene();

        // Checks for the WinCondition to be fufilled in the PlayerController Script
        if (m_scene.name == "MainMenu")
        {
            //if (Input.GetKeyDown(KeyCode.Space) && p.WinState)
            if (Input.GetKeyDown(KeyCode.Space))
            {
                SceneManager.LoadScene(1);
            }
        }

        // This code checks the game every frame to during the Game scene to see if the lose condition has been activated.
        // If it has, it store the name and sprite of the winning / losing player and change to the game over screen
        else if (m_scene.name == "Game" && player2.getScore() == 5)
        {
            winningPlayerName = "Player 1";
            losingPlayerName  = "Player 2";
            winningPlayer     = player2.up;
            losingPlayer      = player1.up;
            SceneManager.LoadScene(2);
        }

        else if (m_scene.name == "Game" && player1.getScore() == 5)
        {
            winningPlayerName = "Player 2";
            losingPlayerName  = "Player 1";
            winningPlayer     = player1.up;
            losingPlayer      = player2.up;
            SceneManager.LoadScene(2);
        }

        // This code stores a few situational conditions in the game over screen, altering the images depending on who won.
        else if (m_scene.name == "GameOver")
        {
            // This code sets the images properly for the game over screen
            winningPlayerHead.sprite  = winningPlayer;
            winningPlayerHead2.sprite = winningPlayer;
            losingPlayerHead.sprite   = losingPlayer;

            // This code sets the text and color of the game over screen middle
            playerVictory.text = winningPlayerName;
            playerLoss.text    = losingPlayerName;

            if (winningPlayerName == "Player 1")
            {
                playerVictory.color = Color.green;
                playerLoss.color    = Color.magenta;
            }
            else
            {
                playerVictory.color = Color.magenta;
                playerLoss.color    = Color.green;
            }

            // Finally, this last piece of coat allows us to return to the main menu
            if (Input.GetKeyDown(KeyCode.Space))
            {
                SceneManager.LoadScene(0);
            }
        }

        // This gives the game a "quit" button by pressing Escape. If it is pressed outside of main menu, it returns you to main menu
        if (Input.GetKey("escape"))
        {
            if (m_scene.name == "MainMenu")
            {
                Application.Quit();
            }

            else
            {
                SceneManager.LoadScene(0);
            }
        }
    }
예제 #34
0
 public void MenuExit()
 {
     MenuExitText.text = "Exit Pressed";
     Application.Quit();
 }
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.Application o;
         o=new UnityEngine.Application();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
예제 #36
0
 public void Button_Close()
 {
     Application.Quit();
 }
예제 #37
0
 private void OpenChangelog()
 {
     Application.OpenURL("http://assetstore.phbarralis.com/sge/changelog.html");
 }
예제 #38
0
 public static void UnregisterLogCallback(Application.LogCallback logCallback)
 {
     /*var removed =*/ _callbacks.RemoveAll(x => EqualityComparer<Application.LogCallback>.Default.Equals(x, logCallback));
     //Debug.Log("removed " + removed);
 }
예제 #39
0
 private void OpenSetup()
 {
     Application.OpenURL("http://assetstore.phbarralis.com/urpdebugviews/getting_started.html#setup");
 }
예제 #40
0
		protected override Voxel mutate(Application app, Index p, Action action, Voxel original) {
			return mutate((LocalApplication)app, p, (LocalAction)action, original);
		}
예제 #41
0
		public static void RegisterLogCallback(Application.LogCallback handler)
		{
			Application.RegisterLogCallback(handler, false);
		}
예제 #42
0
		public static void RegisterLogCallbackThreaded(Application.LogCallback handler)
		{
			Application.RegisterLogCallback(handler, true);
		}