Esempio n. 1
0
        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 )");
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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");
        }