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); } }
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); }
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); } }
public static GTreePrototypeGroupInspectorDrawer Create(GTreePrototypeGroup group) { return(new GTreePrototypeGroupInspectorDrawer(group)); }
public GTreePrototypeGroupInspectorDrawer(GTreePrototypeGroup group) { instance = group; }
private void OnEnable() { instance = target as GTreePrototypeGroup; }