public static void FixMissingTreeDemo00()
        {
            Object o = Selection.activeObject;

            if (o is GTreePrototypeGroup)
            {
                string[] prefabAssetPaths = new string[]
                {
                    "Assets/Polaris - Low Poly Ecosystem/Polaris - Low Poly Terrain Engine/Samples/Pinwheel Studio/Prefabs/Pine_00.prefab",
                    "Assets/Polaris - Low Poly Ecosystem/Polaris - Low Poly Terrain Engine/Samples/Pinwheel Studio/Prefabs/Dead.prefab",
                    "Assets/Polaris - Low Poly Ecosystem/Polaris - Low Poly Terrain Engine/Samples/Pinwheel Studio/Prefabs/Pine_01.prefab",
                    "Assets/Polaris - Low Poly Ecosystem/Polaris - Low Poly Terrain Engine/Samples/Pinwheel Studio/Prefabs/Dead_Break.prefab"
                };

                GTreePrototypeGroup group = o as GTreePrototypeGroup;
                group.Prototypes.Clear();
                for (int i = 0; i < prefabAssetPaths.Length; ++i)
                {
                    GameObject     p     = AssetDatabase.LoadAssetAtPath <GameObject>(prefabAssetPaths[i]);
                    GTreePrototype proto = GTreePrototype.Create(p);
                    proto.Refresh();
                    group.Prototypes.Add(proto);
                }

                EditorUtility.SetDirty(group);
            }
        }
        public static void FixMissingPrefab()
        {
            Object o = Selection.activeObject;

            if (o is GTreePrototypeGroup)
            {
                string[] prefabAssetPaths = new string[]
                {
                    "Assets/Griffin - PolarisV2/_Demo/Prefabs/AutumnTree1.prefab",
                    "Assets/Griffin - PolarisV2/_Demo/Prefabs/SpringTree1.prefab",
                    "Assets/Griffin - PolarisV2/_Demo/Prefabs/Pine_00.prefab",
                    "Assets/Griffin - PolarisV2/_Demo/Prefabs/Pine_01.prefab",
                    "Assets/Griffin - PolarisV2/_Demo/Prefabs/Dead.prefab",
                    "Assets/Griffin - PolarisV2/_Demo/Prefabs/Dead_Break.prefab"
                };

                GTreePrototypeGroup group = o as GTreePrototypeGroup;
                group.Prototypes.Clear();
                for (int i = 0; i < prefabAssetPaths.Length; ++i)
                {
                    GameObject     p     = AssetDatabase.LoadAssetAtPath <GameObject>(prefabAssetPaths[i]);
                    GTreePrototype proto = GTreePrototype.Create(p);
                    proto.Refresh();
                    group.Prototypes.Add(proto);
                }

                EditorUtility.SetDirty(group);
            }
        }
Esempio n. 3
0
        private void DrawAddPrototypeGUI()
        {
            EditorGUILayout.GetControlRect(GUILayout.Height(1));
            Rect       r = EditorGUILayout.GetControlRect(GUILayout.Height(GEditorCommon.objectSelectorDragDropHeight));
            GameObject g = GEditorCommon.ObjectSelectorDragDrop <GameObject>(r, "Drop a Game Object here!", "t:GameObject");

            if (g != null)
            {
                GTreePrototype p = GTreePrototype.Create(g);
                instance.Prototypes.Add(p);
            }
        }