コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        public static GTreePrototypeGroup Create(TreePrototype[] treePrototypes)
        {
            GTreePrototypeGroup group = CreateInstance <GTreePrototypeGroup>();

            for (int i = 0; i < treePrototypes.Length; ++i)
            {
                group.Prototypes.Add((GTreePrototype)treePrototypes[i]);
            }

            return(group);
        }
コード例 #4
0
        public static void RefreshPrototypes()
        {
            Object o = Selection.activeObject;

            if (o is GTreePrototypeGroup)
            {
                GTreePrototypeGroup group = o as GTreePrototypeGroup;
                for (int i = 0; i < group.Prototypes.Count; ++i)
                {
                    group.Prototypes[i].Refresh();
                }
                EditorUtility.SetDirty(group);
            }
        }
コード例 #5
0
 public static GTreePrototypeGroupInspectorDrawer Create(GTreePrototypeGroup group)
 {
     return(new GTreePrototypeGroupInspectorDrawer(group));
 }
コード例 #6
0
 public GTreePrototypeGroupInspectorDrawer(GTreePrototypeGroup group)
 {
     instance = group;
 }
コード例 #7
0
 private void OnEnable()
 {
     instance = target as GTreePrototypeGroup;
 }