提交 4537e371 编写于 作者: 威武堂堂's avatar 威武堂堂

资源管理editor工具

上级 d433d87c
......@@ -68,14 +68,14 @@
<Compile Include="Assets\Editor\PrefabBinder\PrefabBinderEditor.cs" />
<Compile Include="Assets\Editor\PrefabBinder\PrefabBinderInspector.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Editor\Extend\ToLua_UnityEngine_GameObject.cs" />
<Compile Include="Assets\Editor\LuaDebugRedirection.cs" />
<Compile Include="Assets\Editor\Common\LuaDebugRedirection.cs" />
<Compile Include="Assets\Editor\Common\FastOpenTools.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Editor\Extend\ToLua_LuaInterface_LuaProperty.cs" />
<Compile Include="Assets\Editor\SpriteAtlas\AutoSprite2ui.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Editor\Extend\ToLua_LuaInterface_LuaConstructor.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Editor\Extend\ToLua_System_Object.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Editor\Extend\ToLua_LuaInterface_LuaMethod.cs" />
<Compile Include="Assets\LuaFramework\Editor\CustomSettings.cs" />
<Compile Include="Assets\Editor\Common\CustomSettings.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Editor\ToLuaTree.cs" />
<Compile Include="Assets\Editor\SpriteAtlas\SpriteAtlasTools.cs" />
<Compile Include="Assets\Editor\Build\BuildUtils.cs" />
......
......@@ -6,13 +6,13 @@ public class FastOpenTools
[MenuItem("Tools/命令/打开图集配置 &i")]
public static void OpenSpr2atlasCfg()
{
OpenFileOrDirectory("/GameRes/Config/sprite2atlas.bytes");
OpenFileOrDirectory("/ResAssets/Config/sprite2atlas.bytes");
}
[MenuItem("Tools/命令/打开资源配置 &r")]
public static void OpenResCfg()
{
OpenFileOrDirectory("/GameRes/Config/resources.bytes");
OpenFileOrDirectory("/ResAssets/Config/resources.bytes");
}
......
fileFormatVersion: 2
guid: 5d61493dfa61fb0419d49dc75503af38
folderAsset: yes
DefaultImporter:
userData:
fileFormatVersion: 2
guid: 6749548d6322bd8499f25778b385dd24
folderAsset: yes
guid: 3b2abbe0b4b22cd4b8798376b3972772
DefaultImporter:
externalObjects: {}
userData:
......
fileFormatVersion: 2
guid: 945af47fecee10044989b172212a1256
timeCreated: 1426783366
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
<?xml version="1.0" encoding="utf-8"?>
<items>
<item id="0" name="Iron-Blooded" editorPath="Assets/RawAssets/Audios/Iron-Blooded.mp3" editime="2023/1/27" desc="主界面背景音乐" />
</items>
\ No newline at end of file
fileFormatVersion: 2
guid: 7d2b1d91772bdf445937280ad5b94a5b
folderAsset: yes
DefaultImporter:
guid: ad5c61c635033d34683b8c785649745c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
......
<?xml version="1.0" encoding="utf-8"?>
<items>
<item id="0" name="box" editorPath="Assets/ResAssets/Menu/box.prefab" editime="2023/1/27" desc="主菜单" />
<item id="1" name="HotUpdatePanel" editorPath="Assets/ResAssets/Menu/HotUpdatePanel.prefab" editime="2023/1/27" desc="热更新界面" />
</items>
\ No newline at end of file
......@@ -3,5 +3,5 @@ guid: e129108de049b0c44aa9f77a5d8f5ea0
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName: config
assetBundleVariant: res
assetBundleName:
assetBundleVariant:
<?xml version="1.0" encoding="utf-8"?>
<items>
</items>
......@@ -23,13 +23,4 @@ function Main.Start()
-- 显示登录界面
LoginPanel.Show()
end
function Main.Send()
Network.SendData("sayhello", { what = "hi, i am unity from lua" }, function(data)
log("on response: " .. data.error_code .. " " .. data.msg)
end
)
end
-- endregion
end
\ No newline at end of file
fileFormatVersion: 2
guid: a2b94ce93f0c5da4481d023b2349fcc8
folderAsset: yes
DefaultImporter:
userData:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &180150
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 433712}
m_Layer: 0
m_Name: TestGameObjectPrefab
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &433712
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 180150}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 180150}
m_IsPrefabParent: 1
fileFormatVersion: 2
guid: 064ce7f9fcc2fba4a885cc163c7354df
timeCreated: 1468686469
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
......@@ -300,7 +300,7 @@ namespace LuaFramework
}
#endif
return true;
#endif // DO_NOT_CHECK_ENVI
#endif
}
//Lua 里面读取配置表文件
......
fileFormatVersion: 2
guid: 741aeab11d92f6d4bb877490a3454872
guid: 4aeb83c1df6f9a6499155b124d4ea23d
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides:
7:
loadType: 2
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
......@@ -25,5 +18,5 @@ AudioImporter:
ambisonic: 0
3D: 1
userData:
assetBundleName: rawassets_audios
assetBundleVariant: raw
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!687078895 &4343727234628468602
SpriteAtlas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CommonUI
serializedVersion: 2
m_EditorData:
serializedVersion: 2
textureSettings:
serializedVersion: 2
anisoLevel: 1
compressionQuality: 50
maxTextureSize: 2048
textureCompression: 0
filterMode: 1
generateMipMaps: 0
readable: 0
crunchedCompression: 0
sRGB: 1
platformSettings: []
packingSettings:
serializedVersion: 2
padding: 4
blockOffset: 1
allowAlphaSplitting: 0
enableRotation: 1
enableTightPacking: 1
enableAlphaDilation: 0
secondaryTextureSettings: {}
variantMultiplier: 1
packables:
- {fileID: 102900000, guid: fa25a5bc8ed8c0b4fab93c4af1a61e1c, type: 3}
bindAsDefault: 1
isAtlasV2: 0
cachedData: {fileID: 0}
m_MasterAtlas: {fileID: 0}
m_PackedSprites:
- {fileID: 21300000, guid: 415a9e33391ce0c44bd7592d6494dcbf, type: 3}
- {fileID: 21300000, guid: 79b1714b9b9e8384f922c158c1b4b321, type: 3}
- {fileID: 21300000, guid: fc68c4ac18be2d2409dac34387396666, type: 3}
m_PackedSpriteNamesToIndex:
- framebg
- frame
- btn
m_RenderDataMap: {}
m_Tag: CommonUI
m_IsVariant: 0
m_IsPlaceholder: 0
fileFormatVersion: 2
guid: 43a538e8cf82e1441894e825d682f5b1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4343727234628468602
userData:
assetBundleName: atlas
assetBundleVariant: res
<?xml version="1.0" encoding="utf-8"?>
<items>
<item id="1" editorPath="BaseRes/HotUpdatePanel.prefab" version="2021/11/10" desc="热更新界面" />
<item id="2" editorPath="UIPrefabs/Box/box.prefab" version="2023/1/2" desc="主菜单界面3d预制体" />
<item id="3" editorPath="UIPrefabs/Login/LoginPanel.prefab" version="2021/11/10" desc="登录界面" />
<item id="5" editorPath="Atlas/CommonUI.spriteatlas" version="2021/11/10" desc="图集" />
<item id="6" editorPath="Audios/bg.mp3" version="2021/11/10" desc="背景音乐" />
<item id="8" editorPath="BaseRes/TestPanel.prefab" version="2021/11/10" desc="测试界面" />
<item id="9" editorPath="UIPrefabs/Common/FlyTips.prefab" version="2021/11/10" desc="冒提示语" />
<item id="10" editorPath="UIPrefabs/GameHall/GameHallPanel.prefab" version="2021/11/10" desc="大厅界面" />
<item id="12" editorPath="UIPrefabs/Common/TipsDlg.prefab" version="2021/11/10" desc="提示框" />
<item id="13" editorPath="UIPrefabs/Common/WaitBoard.prefab" version="2021/11/10" desc="请稍等挡板" />
<item id="14" editorPath="UIPrefabs/Backpack/BackpackPanel.prefab" version="2021/11/10" desc="背包界面" />
<item id="15" editorPath="UIPrefabs/Redpoint/RedpointPanel.prefab" version="2021/12/13" desc="红点系统界面" />
<item id="16" editorPath="UIPrefabs/Tree/TreePanel.prefab" version="2022/3/17" desc="树界面" />
</items>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<items>
<item name="framebg" atlas="CommonUI.spriteatlas" resId="5"/>
<item name="frame" atlas="CommonUI.spriteatlas" resId="5"/>
<item name="btn" atlas="CommonUI.spriteatlas" resId="5"/>
</items>
......@@ -7,6 +7,21 @@ using Object = UnityEngine.Object;
/// </summary>
public class ResourceManager
{
private ConfigFile<ResourceConfigItem> m_resourceConfigFile;
private Dictionary<string, ResourceConfigItem> m_urlDic;
private static ResourceManager s_instance;
public static ResourceManager instance
{
get
{
if (null == s_instance)
s_instance = new ResourceManager();
return s_instance;
}
}
public ResourceManager()
{
m_urlDic = new Dictionary<string, ResourceConfigItem>();
......@@ -119,19 +134,5 @@ public class ResourceManager
}
return -1;
}
private ConfigFile<ResourceConfigItem> m_resourceConfigFile;
private Dictionary<string, ResourceConfigItem> m_urlDic;
private static ResourceManager s_instance;
public static ResourceManager instance
{
get
{
if (null == s_instance)
s_instance = new ResourceManager();
return s_instance;
}
}
}
......@@ -9,10 +9,15 @@ public class ResourcePathBuilder
{
}
/// <summary>
/// 返回配置表路径
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public static string BuildConfigPath(string name)
{
#if UNITY_EDITOR
string path = "Assets/GameRes/Config/" + name;
string path = "Assets/LuaFramework/Lua/Config/" + name;
if (!path.EndsWith(".bytes")) path += ".bytes";
return path;
#else
......@@ -33,7 +38,6 @@ public class ResourcePathBuilder
#else
string url = Application.streamingAssetsPath + "/"+ name;
#endif
return url;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册