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

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

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

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

        Application.logMessageReceived += OnLog;
    }