예제 #1
0
    // 获取资源运行时路径
    public static string GetAssetResourceRunPath(string Type, ResourcesPathMode Mode)
    {
        StringBuilder Builder = new StringBuilder(string.Empty);

        Builder.Append(Mode == ResourcesPathMode.AssetBundle ? GetABRunDir() : "Assets/");
        string str = GetRelativePath(Type, Mode);

        Builder.Append(str);
        return(Builder.ToString());
    }
    public static string GetRelativePath(string Type, ResourcesPathMode Mode)
    {
        int index = (int)Mode;

        string[] sArray = GetResTypePath(Type);
        if (sArray == null || sArray.Length == 0)
        {
            return(string.Empty);
        }
        return(sArray[index]);
    }
예제 #3
0
    /// <summary>
    ///     <para> 获取资源存储路径 </para>
    /// </summary>
    /// <param name="type"></param>
    /// <param name="mode"></param>
    /// <returns></returns>
    public static string GetAssetResourceSavePath(string type, ResourcesPathMode mode)
    {
        StringBuilder stringBuilder = new StringBuilder(string.Empty);

        if (mode == ResourcesPathMode.AssetBundle)
        {
            stringBuilder.Append(BuildSettings.assetBundleOutputPath);
        }

        string path = ResourcesPath.GetRelativePath(type, mode);

        stringBuilder.Append(path);
        return(stringBuilder.ToString());
    }
예제 #4
0
    // 获取资源存储路径
    public static string GetAssetResourceSavePath(string Type, ResourcesPathMode Mode)
    {
        StringBuilder Builder = new StringBuilder(string.Empty);

        if (Mode == ResourcesPathMode.AssetBundle)
        {
            Builder.Append(AssetBundlePath);
        }

        string str = ResourcesPath.GetRelativePath(Type, Mode);

        Builder.Append(str);
        return(Builder.ToString());
    }
예제 #5
0
        public static string GetResourcePath(ResourcesType type, ResourcesPathMode mode)
        {
            int index = (int)mode;

            string[] path = null;
            switch (type)
            {
            case ResourcesType.UIWnd:
                path = UIWndPath;
                break;

            case ResourcesType.UIWndItem:
                path = UIWndItemPath;
                break;

            case ResourcesType.UIAtlas:
                path = UIAtlasPath;
                break;

            case ResourcesType.UIPublicWndAtlas:
                path = UIPublicAtlasPath;
                break;

            case ResourcesType.SceneItem:
                path = SceneItemPath;
                break;

            // hero
            case ResourcesType.ActorHero:
                path = ActorHeroPath;
                break;

            case ResourcesType.ActorShowHero:
                path = ActorHeroShowPath;
                break;

            case ResourcesType.HeroAnim:
                path = HeroAnimPath;
                break;

            // soldier
            case ResourcesType.ActorSoldier:
                path = ActorSoldierPath;
                break;

            case ResourcesType.ActorSoldierMaterial:
                path = ActorSoldierMaterialPath;
                break;

            case ResourcesType.ActorSoldierMesh:
                path = ActorSoldierMeshPath;
                break;

            case ResourcesType.ActorSoldierAnim:
                path = ActorSoldierAnimPath;
                break;

            case ResourcesType.Building:
                path = BuildingPath;
                break;

            case ResourcesType.BuildingModel:
                path = BuildingModelPath;
                break;

            case ResourcesType.BuildingSite:
                path = BuildingSitePath;
                break;

            case ResourcesType.CityTree:
                path = CityTreePath;
                break;

            case ResourcesType.BuildingTexture:
                path = BuildingTexturePath;
                break;

            case ResourcesType.PngTexture:
                path = PngTexturePath;
                break;

            case ResourcesType.Effect:
                path = EffectPath;
                break;

            case ResourcesType.Skill:
                path = SkillPath;
                break;

            case ResourcesType.Audio:
                path = AudioPath;
                break;

            case ResourcesType.Shader:
                path = ShaderPath;
                break;

            case ResourcesType.Map:
                path = MapPath;
                break;

            case ResourcesType.Scene:
                path = ScenePath;
                break;

            case ResourcesType.MapData:
                path = MapDataPath;
                break;

            case ResourcesType.LuaData:
                path = LuaDataPath;
                break;

            case ResourcesType.ComMaterial:
                path = ComMaterialPath;
                break;

            case ResourcesType.Depend:      //LightMapPath
                path = DependPath;
                break;

            case ResourcesType.Config:
                path = ConfigPath;
                break;
            }

            if (null == path)
            {
                return(string.Empty);
            }

            return(path[index]);
        }