Unity Editor下使用 Application.Quit()为啥无效?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unity Editor下使用 Application.Quit()为啥无效?相关的知识,希望对你有一定的参考价值。
参考技术A 因为Editor:UnityEditor.EditorApplication.isPlaying = false
才能退。
只有当工程打包后:
Application.Quit();
android和Windows通适用。
unity editor下选中GameObject粘贴复制pos信息
参考:https://blog.uwa4d.com/archives/USparkle_Continuous-optimization.html
实现:运行时 选中GameObject后copy坐标信息可粘贴出来
实现代码:
using System.Collections; using System.Collections.Generic; using UnityEngine; public class TestCopyPosHelper : MonoBehaviour { private void OnEnable() { UnityEditor.Selection.selectionChanged += OnSelectChanged; } // Use this for initialization void Start () { } // Update is called once per frame void Update () { } private void OnDisable() { UnityEditor.Selection.selectionChanged -= OnSelectChanged; } private void OnSelectChanged() { GameObject tempSelectObject = UnityEditor.Selection.activeGameObject; if(tempSelectObject!=null) { string ret = tempSelectObject.transform.localPosition.x.ToString("0.0") + "," + tempSelectObject.transform.localPosition.y.ToString("0.0") + "," + tempSelectObject.transform.localPosition.z.ToString("0.0"); Debug.LogError(ret); GUIUtility.systemCopyBuffer = ret; } } }
以上是关于Unity Editor下使用 Application.Quit()为啥无效?的主要内容,如果未能解决你的问题,请参考以下文章