Example #1
0
        public static void CreateTrigger()
        {
            GameObject     trigger  = CreateSceneObject.Create("Trigger");
            SphereCollider collider = trigger.AddComponent <SphereCollider>();

            collider.isTrigger = true;
            trigger.AddComponent <Trigger>();
        }
Example #2
0
        public static void CreateHotspot()
        {
            GameObject     trigger  = CreateSceneObject.Create("Hotspot");
            SphereCollider collider = trigger.AddComponent <SphereCollider>();

            collider.isTrigger = true;
            trigger.AddComponent <Hotspot>();
        }
Example #3
0
        public static void CreateGameProfileUI()
        {
            GameObject text = CreateSceneObject.Create("Profile");

            text.AddComponent <GameProfileUI>();

            text.transform.localRotation = Quaternion.identity;
            text.transform.localScale    = Vector3.one;
        }
Example #4
0
        private T CreateSubObject <T>() where T : MonoBehaviour
        {
            if (PrefabUtility.IsPartOfPrefabAsset(this.trigger.gameObject))
            {
                return(CreatePrefabObject.AddGameObjectToPrefab <T>(
                           this.trigger.gameObject,
                           typeof(T).Name
                           ));
            }

            GameObject asset = CreateSceneObject.Create(typeof(T).Name, false);

            return(asset.AddComponent <T>());
        }
Example #5
0
        // PUBLIC METHODS: ------------------------------------------------------------------------

        public static GameObject Create(string name, bool autoSelect = true)
        {
            if (GameObject.Find(name) != null)
            {
                int    index      = 1;
                string uniqueName = "";

                do
                {
                    uniqueName = string.Format(NAME_FMT, name, index);
                    ++index;
                } while (GameObject.Find(uniqueName) != null);
                name = uniqueName;
            }

            GameObject newGameObject = new GameObject(name);

            return(CreateSceneObject.Create(newGameObject, autoSelect));
        }
Example #6
0
        private void CreateTriggerOption(ReorderableList list, string itemType)
        {
            int itemIndex = list.count;

            list.serializedProperty.InsertArrayElementAtIndex(itemIndex);
            SerializedProperty spNewItem = list.serializedProperty.GetArrayElementAtIndex(itemIndex);

            list.index = itemIndex;

            GameObject asset = CreateSceneObject.Create(itemType, false);

            if (itemType == "Event")
            {
                spNewItem.objectReferenceValue = asset.AddComponent <Event>();
            }
            else if (itemType == "Actions")
            {
                spNewItem.objectReferenceValue = asset.AddComponent <Actions>();
            }
        }
Example #7
0
        public static void CreateEvent()
        {
            GameObject eventAsset = CreateSceneObject.Create("Event");

            eventAsset.AddComponent <Event>();
        }
Example #8
0
        public static void CreateAction()
        {
            GameObject actions = CreateSceneObject.Create("Actions");

            actions.AddComponent <Actions>();
        }
Example #9
0
        public static void CreateConditions()
        {
            GameObject conditionsAsset = CreateSceneObject.Create("Conditions");

            conditionsAsset.AddComponent <Conditions>();
        }