コード例 #1
0
ファイル: VoxelSwatch.cs プロジェクト: KevinBreurken/VME
    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]));

            }

        }
       
    }
コード例 #2
0
    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]));
            }
        }
    }
コード例 #3
0
ファイル: VoxelSwatch.cs プロジェクト: KevinBreurken/VME
 public QuickReference (string _identifier,VSCategory _categoryReference,VSTileGroup _group) {
     groupReference = _group;
     identifierName = _identifier;
     categoryReference = _categoryReference;
 }
コード例 #4
0
ファイル: VoxelSwatch.cs プロジェクト: KevinBreurken/VME
    public VSTileGroup (string _name, VSCategory _categoryReference) {

        groupName = _name;
        categoryReference = _categoryReference;
        styles = new List<GameObject>();

    }
コード例 #5
0
 public QuickReference(string _identifier, VSCategory _categoryReference, VSTileGroup _group)
 {
     groupReference    = _group;
     identifierName    = _identifier;
     categoryReference = _categoryReference;
 }
コード例 #6
0
 public VSTileGroup(string _name, VSCategory _categoryReference)
 {
     groupName         = _name;
     categoryReference = _categoryReference;
     styles            = new List <GameObject>();
 }