static void SceneRequrementsGame() { EditorUtils.CreateGameControllerObject(true); UnityEngine.UI.Text textui = _createUI(); if (textui == null) { Debug.LogError("Cannot create 'Trigger UI' component."); } UnityEngine.UI.Text uiText = _createItemPicker(); if (uiText == null) { Debug.LogError("Cannot create 'Item Picker UI' component."); } // assign text ui to trigger manager GameObject player = GameObject.FindGameObjectWithTag("Player"); if (player) { TriggerManagement tm = player.GetComponent <TriggerManagement>(); tm.m_TriggerUI = textui; ItemPicker ip = player.GetComponent <ItemPicker>(); ip.DisplayUI = uiText; } Undo.SetCurrentGroupName("Create Scene Requirements ( Game )"); }
bool _createTriggerManager(UnityEngine.UI.Text textUI) { TriggerManagement tMan = character.GetComponent <TriggerManagement>(); if (!tMan) { tMan = Undo.AddComponent <TriggerManagement>(character); } tMan.m_TriggerUI = textUI; tMan.m_TriggerInterval = 1.0f; return(true); }
static void SceneRequrementsDefault() { EditorUtils.CreateGameControllerObject(false); UnityEngine.UI.Text textui = _createUI(); if (textui == null) { Debug.LogError("Cannot create 'Trigger UI' component."); } // assign text ui to trigger manager GameObject player = GameObject.FindGameObjectWithTag("Player"); if (player) { TriggerManagement tm = player.GetComponent <TriggerManagement>(); tm.m_TriggerUI = textui; } Undo.SetCurrentGroupName("Create Scene Requirements"); }