private void Awake() { s_instance = this; if (ApplicationMgr.IsPublic()) { UnityEngine.Object.DestroyImmediate(base.gameObject); } }
private GUIStyle style; // The style the text will be displayed at, based en defaultSkin.label. void Start() { _enable = true; StartCoroutine(FPS()); if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { //Destroy(gameObject); } }
private ShowFPS GetFpsComponent() { GameObject go = GameObject.Find("FPS"); if (go == null) { go = new GameObject("FPS"); Object.DontDestroyOnLoad(go); } ShowFPS com = go.GetComponent <ShowFPS>(); if (com == null) { com = go.AddComponent <ShowFPS>(); } return(com); }
void subThread() { while (true) { CallPCL.kernelUpdate(); Voice.startTiming(); if (turn == 0) { CallPCL.getMesh(ref meshList0, VERTICES_MAX); meshList = meshList0; turn = 1; } else { CallPCL.getMesh(ref meshList1, VERTICES_MAX); meshList = meshList1; turn = 0; } ShowFPS.udpateFrame(); } }
private void ShowFPS() { ShowFPS showFPS = gameObject.AddComponent <ShowFPS> (); showFPS.fpsText = fpsText; }
void OnDisable() { Instance = null; }
void OnEnable() { Instance = this; }
private void Awake() { //Debug.Log("隐藏也运行"); Instance = this; }
private void OnDestroy() { s_instance = null; }
public void ShowFps(bool isShow = true) { ShowFPS com = GetFpsComponent(); com.enabled = isShow; }
public void ShowOrHideFps() { ShowFPS com = GetFpsComponent(); com.enabled = !com.enabled; }
/// 游戏运行时的日志bug信息, [开发时开启=>监听严重错误时的收集] void ListonException() { ShowFPS sFPS = gameObject.AddComponent <ShowFPS>(); Application.logMessageReceived += OnLog; }