コード例 #1
0
ファイル: FTimeManager.cs プロジェクト: asmboom/UnityTools
    void OnDestroy()
    {
        // Stopping all coroutines, even if this is not our original coroutine
        StopAllCoroutines();

        if (this == _instance)
        {
            _instance = null;
        }
    }
コード例 #2
0
ファイル: FTimeManager.cs プロジェクト: asmboom/UnityTools
 void Awake()
 {
     if (_instance != null)
     {
         Debug.LogWarning("There is another instance of " + this + " already. Destroying the new one");
         Destroy(this);
         return;
     }
     _instance = this;
     Scale     = Time.timeScale;
     _instance.StartCoroutine(UpdateDeltaTime());
 }