Beispiel #1
0
 private void Awake()
 {
     s_instance = this;
     if (ApplicationMgr.IsPublic())
     {
         UnityEngine.Object.DestroyImmediate(base.gameObject);
     }
 }
Beispiel #2
0
    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);
        }
    }
Beispiel #3
0
    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);
    }
Beispiel #4
0
 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();
     }
 }
Beispiel #5
0
    private void ShowFPS()
    {
        ShowFPS showFPS = gameObject.AddComponent <ShowFPS> ();

        showFPS.fpsText = fpsText;
    }
Beispiel #6
0
 void OnDisable()
 {
     Instance = null;
 }
Beispiel #7
0
 void OnEnable()
 {
     Instance = this;
 }
Beispiel #8
0
 private void Awake()
 {
     //Debug.Log("隐藏也运行");
     Instance = this;
 }
Beispiel #9
0
 private void OnDestroy()
 {
     s_instance = null;
 }
Beispiel #10
0
    public void ShowFps(bool isShow = true)
    {
        ShowFPS com = GetFpsComponent();

        com.enabled = isShow;
    }
Beispiel #11
0
    public void ShowOrHideFps()
    {
        ShowFPS com = GetFpsComponent();

        com.enabled = !com.enabled;
    }
Beispiel #12
0
    /// 游戏运行时的日志bug信息, [开发时开启=>监听严重错误时的收集]
    void ListonException()
    {
        ShowFPS sFPS = gameObject.AddComponent <ShowFPS>();

        Application.logMessageReceived += OnLog;
    }