protected override void OnDestroy() { commandHandler = null; defaultCommands = null; logReader.OnDestroy(); logReader = null; base.OnDestroy(); }
protected override void Awake() { base.Awake(); DontDestroyOnLoad(true); ObjectSelector = GetComponent <ObjectSelector>(); commandHandler = new CommandHandler(); defaultCommands = new DefaultCommandAdder(); logReader = new DefaultLogReader(); scrollRect = console.GetComponentInChildren <ScrollRect>(); defaultCommands.AddCommands(); inputField.onEndEdit.AddListener(OnSubmitCommand); ObjectSelector.enabled = console.activeSelf; selectedObjectWindow.SetActive(console.activeSelf); }