コード例 #1
0
        private void Awake()
        {
            if (_instance != null)
            {
                Destroy(this);
            }
            else
            {
                _instance = this;
                // Preserve on scene change
                DontDestroyOnLoad(gameObject);
            }

            LoggingUtils.PrettyPrint(this, "Awake");
        }
コード例 #2
0
 private void OnDestroy()
 {
     LoggingUtils.PrettyPrint(this, "OnDestroy");
 }
コード例 #3
0
 public void Increment()
 {
     _counter++;
     LoggingUtils.PrettyPrint(this, _counter.ToString());
 }