private void Awake() { //Singletone pattern if (!Instance) { Instance = this; Init(); } else { DestroyImmediate(gameObject); } }
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; }