Exemplo n.º 1
0
 private void Awake()
 {
     if (Instance && singleTon)
     {
         Destroy(gameObject);
         return;
     }
     Instance = this;
     if (dontDestroy)
     {
         DontDestroyOnLoad(gameObject);
     }
     CreateTimer();
 }
Exemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            SessionLocalTimer ssT = (SessionLocalTimer)target;

            DrawDefaultInspector();
            if (EditorApplication.isPlaying)
            {
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Pause"))
                {
                    if (ssT != null)
                    {
                        ssT.PauseTimer();
                    }
                }

                if (GUILayout.Button("Restart"))
                {
                    if (ssT != null)
                    {
                        ssT.RestartTimer();
                    }
                }

                if (GUILayout.Button("Start"))
                {
                    if (ssT != null)
                    {
                        ssT.StartTimer();
                    }
                }
                GUILayout.EndHorizontal();
            }
            else
            {
                GUILayout.Label("Goto play mode for test");
            }
        }