protected override void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Debug.Log($"InGameChat instance already exists, destorying {gameObject.name}"); Destroy(this); } base.Awake(); }
/* -------------------------------------------------------------------------------------------------------- */ /* * UNITY STUFF */ /* -------------------------------------------------------------------------------------------------------- */ // Used when the game start void Awake() { Script = this; mainScreenScript = MainScreen.Script; playerName = MainScreen.playerName; inGameChatEntries = new List<LobbyChat.LobbyChatEntry>(); window = new Rect(windowStartX, windowStartY, Screen.width-(windowStartX*2), windowHeight); }