예제 #1
0
 private void Awake()
 {
     //Singletone pattern
     if (!Instance)
     {
         Instance = this;
         Init();
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
예제 #2
0
        private void Init()
        {
            if (initialized)
            {
                return;
            }

            levelMetrics = LevelMetrics.Instance;

            if (!levelMetrics || !enabled)
            {
                return;
            }

            levelMetrics.AddRecordable(recordable);

            foreach (Signal.Config signal in signals)
            {
                levelMetrics.AddSignal(signal);
            }

            initialized = true;
        }