美文网首页
2020-03-31Unity常用文件夹自动创建

2020-03-31Unity常用文件夹自动创建

作者: VECTOR_Y | 来源:发表于2020-03-31 10:27 被阅读0次
    using UnityEngine;
    using UnityEditor;
    using System.IO;
    
    
    /// <summary>
    /// 创建文件夹  
    /// </summary>
    public class CreateFile
    {
        [MenuItem("Tools / CreateFolder")]//需要引入命名空间using UnityEditor
        public static void CreateFolder()
        {
            string path = Application.dataPath + "/";
            Directory.CreateDirectory(path + "Resources");//需要引入命名空间 using System.Io
            Directory.CreateDirectory(path + "Plugins");
            Directory.CreateDirectory(path + "StreamingAssets");
            Directory.CreateDirectory(path + "Editor");
            Directory.CreateDirectory(path + "Scenes");
            Directory.CreateDirectory(path + "Scripts");
        }
    }
    
    
    image.png

    相关文章

      网友评论

          本文标题:2020-03-31Unity常用文件夹自动创建

          本文链接:https://www.haomeiwen.com/subject/weaiuhtx.html