public void LoadSwatches () { if (categories == null) { categories = new List<VSCategory>(); } if (references == null) { references = new List<QuickReference>(); } categories.Clear(); references.Clear(); string Path = AssetDatabase.GetAssetPath(this).Replace('\\', '/').Replace(this.name + ".asset", ""); string TilePath = Path + "SwatchFiles/Tiles"; string PropsPath = Path + "SwatchFiles/Props"; string EffectsPath = Path + "SwatchFiles/Effects"; VSCategory TileCategory = new VSCategory("Tiles",TilePath,this); categories.Add(TileCategory); VSCategory PropsCategory = new VSCategory("Props",PropsPath,this); categories.Add(PropsCategory); VSCategory EffectCategory = new VSCategory("Effects",EffectsPath,this); categories.Add(EffectCategory); //Get all files string[] excistingPrefabGroups = Directory.GetFiles(Application.dataPath, "*.prefab", SearchOption.AllDirectories); foreach (string fbxFile in excistingPrefabGroups) { string assetPath = "Assets" + fbxFile.Replace(Application.dataPath, "").Replace('\\', '/'); if (assetPath.Contains(TilePath)) { GameObject tileobject = (GameObject)AssetDatabase.LoadAssetAtPath(assetPath, typeof(GameObject)); string[] names = tileobject.name.Split('_'); TileCategory.AddItemGroup(tileobject, names[0], int.Parse(names[1])); } } }
public void LoadSwatches() { if (categories == null) { categories = new List <VSCategory>(); } if (references == null) { references = new List <QuickReference>(); } categories.Clear(); references.Clear(); string Path = AssetDatabase.GetAssetPath(this).Replace('\\', '/').Replace(this.name + ".asset", ""); string TilePath = Path + "SwatchFiles/Tiles"; string PropsPath = Path + "SwatchFiles/Props"; string EffectsPath = Path + "SwatchFiles/Effects"; VSCategory TileCategory = new VSCategory("Tiles", TilePath, this); categories.Add(TileCategory); VSCategory PropsCategory = new VSCategory("Props", PropsPath, this); categories.Add(PropsCategory); VSCategory EffectCategory = new VSCategory("Effects", EffectsPath, this); categories.Add(EffectCategory); //Get all files string[] excistingPrefabGroups = Directory.GetFiles(Application.dataPath, "*.prefab", SearchOption.AllDirectories); foreach (string fbxFile in excistingPrefabGroups) { string assetPath = "Assets" + fbxFile.Replace(Application.dataPath, "").Replace('\\', '/'); if (assetPath.Contains(TilePath)) { GameObject tileobject = (GameObject)AssetDatabase.LoadAssetAtPath(assetPath, typeof(GameObject)); string[] names = tileobject.name.Split('_'); TileCategory.AddItemGroup(tileobject, names[0], int.Parse(names[1])); } } }
public QuickReference (string _identifier,VSCategory _categoryReference,VSTileGroup _group) { groupReference = _group; identifierName = _identifier; categoryReference = _categoryReference; }
public VSTileGroup (string _name, VSCategory _categoryReference) { groupName = _name; categoryReference = _categoryReference; styles = new List<GameObject>(); }
public QuickReference(string _identifier, VSCategory _categoryReference, VSTileGroup _group) { groupReference = _group; identifierName = _identifier; categoryReference = _categoryReference; }
public VSTileGroup(string _name, VSCategory _categoryReference) { groupName = _name; categoryReference = _categoryReference; styles = new List <GameObject>(); }