public static void SubscribeToConsoleActivationEvent(ConsoleActivationListener listener) { if (sInstance != null) { sInstance.consoleActivationEvent += listener; } }
public static void UnsubscribeFromConsoleActivationEvent(ConsoleActivationListener listener) { if (sInstance != null) { sInstance.consoleActivationEvent -= listener; } }
private void Awake() { //pre-allocate this space consoleOutputObjects = new Queue <Text>(MAX_ENTRIES); Debug.Assert(consoleOutputPrefab != null); Debug.Assert(scrollrect != null); Debug.Assert(consoleAutocomplete != null); Debug.Assert(consoleCanvas != null); Debug.Assert(inputField != null); contentFrameVLG = scrollrect.content.GetComponent <VerticalLayoutGroup>(); contentFrameCSF = scrollrect.content.GetComponent <ContentSizeFitter>(); Debug.Assert(contentFrameVLG != null); Debug.Assert(contentFrameCSF != null); //Need to make sure the prefab has this object Debug.Assert(consoleOutputPrefab.GetComponent <ContentSizeFitter>() != null); sInstance = this; forwardToUnityDebug = true; scrollrect.verticalNormalizedPosition = 0; Log("Console online!"); SetConsoleActive(false); consoleActivationEvent = null; }