Exemplo n.º 1
0
 private static void AddOnesOfFolder(DirectoryInfo dirInfo, string suffix, bool key_no_suffix = false, bool folder_name_tolower = false)
 {
     FileInfo[] files = dirInfo.GetFiles("*" + suffix, 1);
     for (int i = 0; i < files.Length; i++)
     {
         FileInfo fileInfo = files[i];
         if (!fileInfo.get_Name().EndsWith("meta"))
         {
             string text = fileInfo.get_Name();
             if (key_no_suffix)
             {
                 text = text.Remove(text.get_Length() - suffix.get_Length());
             }
             if (!ResBase.Names.Contains(text))
             {
                 if (folder_name_tolower)
                 {
                     ResBase.AddNameOfFolder(text, fileInfo.get_Directory().get_Name().ToLower());
                 }
                 else
                 {
                     ResBase.AddNameOfFolder(text, fileInfo.get_Directory().get_Name());
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 private static void ResourcesOffxs()
 {
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(".prefab");
     ResBase.RootPath = PathSystem.GetGameEffectPrefabRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty));
 }
Exemplo n.º 3
0
 private static void AddOnesOfPath(DirectoryInfo dirInfo, string suffix, bool key_no_suffix, string searchPattern = "*", bool key_tolower = false, string custom_suffix = "")
 {
     if (dirInfo == null)
     {
         return;
     }
     FileInfo[] files = dirInfo.GetFiles(searchPattern + suffix, 1);
     for (int i = 0; i < files.Length; i++)
     {
         FileInfo fileInfo = files[i];
         if (!fileInfo.get_Name().EndsWith("meta"))
         {
             string text = fileInfo.get_Name();
             if (key_no_suffix)
             {
                 text = text.Remove(text.get_Length() - suffix.get_Length());
             }
             if (!ResBase.Names.Contains(text))
             {
                 if (key_tolower)
                 {
                     text = text.ToLower();
                 }
                 text += custom_suffix;
                 ResBase.AddNameOfPath(text, fileInfo.get_FullName().Remove(fileInfo.get_FullName().get_Length() - suffix.get_Length()).Replace("\\", "/"));
             }
         }
     }
 }
Exemplo n.º 4
0
 private static void ResourcesOfUI()
 {
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(FileSystem.key_suffix_prefab);
     ResBase.RootPath = PathSystem.GetReservedPrefabRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty));
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(FileSystem.key_suffix_prefab);
     ResBase.RootPath = PathSystem.GetUIPrefabRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty));
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(FileSystem.key_suffix_prefab);
     ResBase.RootPath = PathSystem.GetUI3DPrefabRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty));
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(FileSystem.key_suffix_prefab);
     ResBase.RootPath = PathSystem.GetReservedPrefabRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty));
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(FileSystem.key_suffix_material);
     ResBase.RootPath = PathSystem.GetUI3DPrefabRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, string.Empty));
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(FileSystem.key_suffix_controller);
     ResBase.RootPath = PathSystem.GetUIAnimRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty));
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(FileSystem.key_suffix_prefab);
     ResBase.RootPath = PathSystem.GetSpineRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, FileSystem.key_suffix_spine));
 }
Exemplo n.º 5
0
 private static void ResourcesOfAnimatorController()
 {
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(".controller");
     ResBase.RootPath = PathSystem.GetActorAnimationRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty));
 }
Exemplo n.º 6
0
 private static void ResourcesOfSceneLightmaps()
 {
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(".prefab");
     ResBase.RootPath = PathSystem.GetSceneRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "s*", false, string.Empty));
 }
Exemplo n.º 7
0
 private static void ResourcesOfShaders()
 {
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(".prefab");
     ResBase.RootPath = PathSystem.GetShaderPrefabRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, ".shader"));
 }
Exemplo n.º 8
0
 private static void ResourcesOfAudios()
 {
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(".wav");
     ResBase.Suffixs.Add(".mp3");
     ResBase.RootPath = PathSystem.GetAudioRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty));
 }
Exemplo n.º 9
0
    public static Hashtable GetNamesOfFolder(bool key_no_suffix = false, bool folder_name_tolower = false)
    {
        ResBase.Names.Clear();
        DirectoryInfo dirInfo = new DirectoryInfo(ResBase.RootPath);

        for (int i = 0; i < ResBase.Suffixs.get_Count(); i++)
        {
            ResBase.AddOnesOfFolder(dirInfo, ResBase.Suffixs.get_Item(i), key_no_suffix, folder_name_tolower);
        }
        return(ResBase.Names);
    }
Exemplo n.º 10
0
    public static Hashtable GetNamesOfPath(bool no_suffix_key, string searchPattern = "*", bool key_tolower = false, string custom_suffix = "")
    {
        ResBase.Names.Clear();
        DirectoryInfo dirInfo = new DirectoryInfo(ResBase.RootPath);

        for (int i = 0; i < ResBase.Suffixs.get_Count(); i++)
        {
            ResBase.AddOnesOfPath(dirInfo, ResBase.Suffixs.get_Item(i), no_suffix_key, searchPattern, key_tolower, custom_suffix);
        }
        return(ResBase.Names);
    }
Exemplo n.º 11
0
        public UntransactedPostCommand(Guid id, string name, Guid?aff1, Guid?aff2, string nodeName)
        {
            _id   = id;
            _name = name;
            var res = CreateResource(name);

            res.Payload           = Guid.NewGuid();
            res.ResourceAffinity1 = aff1;
            res.ResourceAffinity2 = aff2;
            res.NodeAffinity      = nodeName;
            Res = res;
        }
Exemplo n.º 12
0
    private static void ResourcesOfTPAtlas()
    {
        ResBase.Suffixs.Clear();
        ResBase.Suffixs.Add(".png");
        ResBase.Suffixs.Add(".jpg");
        ResBase.Suffixs.Add(".PNG");
        ResBase.Suffixs.Add(".JPG");
        ResBase.RootPath = PathSystem.GetSrcSpriteRoot(PathType.absPath);
        ResourceMap2File.Add2AllResources(ResBase.GetNamesOfFolder(true, true));
        ResBase.Suffixs.Clear();
        ResBase.Suffixs.Add(".png");
        ResBase.Suffixs.Add(".jpg");
        ResBase.Suffixs.Add(".PNG");
        ResBase.Suffixs.Add(".JPG");
        ResBase.RootPath = PathSystem.GetSrcSpriteRGBRoot(PathType.absPath);
        ResourceMap2File.Add2AllResources(ResBase.GetNamesOfFolder(true, true));
        ResBase.Suffixs.Clear();
        ResBase.Suffixs.Add(".prefab");
        ResBase.RootPath = PathSystem.GetTPAtlasRoot(PathType.absPath);
        Hashtable namesOfPath = ResBase.GetNamesOfPath(true, "*", true, string.Empty);

        ResourceMap2File.Add2AllResources(namesOfPath);
        string      text       = string.Empty;
        IEnumerator enumerator = namesOfPath.get_Keys().GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                object current = enumerator.get_Current();
                string text2   = current.ToString();
                text2 = text2.Substring(0, text2.get_Length() - "_pb".get_Length());
                text  = text + text2 + ';';
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
        ResourceMap2File.AllResources.set_Item("UiAtlas_KEY", text);
        ResBase.Suffixs.Clear();
        ResBase.Suffixs.Add(".prefab");
        ResBase.RootPath = PathSystem.GetReservedPrefabRoot(PathType.absPath);
        namesOfPath      = ResBase.GetNamesOfPath(true, "*", true, string.Empty);
        ResourceMap2File.Add2AllResources(namesOfPath);
    }
Exemplo n.º 13
0
 private static void ResourcesOfTexture()
 {
     ResBase.Suffixs.Clear();
     ResBase.Suffixs.Add(".png");
     ResBase.Suffixs.Add(".jpg");
     ResBase.Suffixs.Add(".tga");
     ResBase.Suffixs.Add(".psd");
     ResBase.RootPath = PathSystem.GetTextureRGBARoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, string.Empty));
     ResBase.RootPath = PathSystem.GetTextureRGBRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, string.Empty));
     ResBase.RootPath = PathSystem.GetTextureShaderRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, string.Empty));
     ResBase.RootPath = PathSystem.GetReservedPrefabRoot(PathType.absPath);
     ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, string.Empty));
 }