void Awake() { if (Instance != null && Instance != this) { Debug.LogError("[KodeUILog] Instance already exists"); Destroy(this); return; } Instance = this; }
void OnDestroy() { if (Instance == this) { Instance = null; } if (fileStream != null) { fileStream.Flush(); fileStream.Close(); } }