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

增加npoi插件对,exle导出为lua配置文件 工具完成

上级 762f28ec
文件已添加
......@@ -54,6 +54,11 @@
</PropertyGroup>
<ItemGroup>
<Analyzer Include="D:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Visual Studio Tools for Unity\Analyzers\Microsoft.Unity.Analyzers.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.OOXML.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.OpenXml4Net.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.OpenXmlFormats.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\ICSharpCode.SharpZipLib.dll" />
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\LuaFramework\ToLua\Editor\Extend\ToLua_System_Type.cs" />
......@@ -84,6 +89,10 @@
<Compile Include="Assets\LuaFramework\ToLua\Editor\ToLuaExport.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Editor\Extend\ToLua_System_Delegate.cs" />
<Compile Include="Assets\Editor\ResConfig\ResConfigEditor.cs" />
<Compile Include="Assets\Editor\Excel2Lua\ExcelTransfer.cs" />
<Compile Include="Assets\Editor\Excel2Lua\FileExporter.cs" />
<Compile Include="Assets\Editor\Excel2Lua\GloablDef.cs" />
<Compile Include="Assets\Editor\Excel2Lua\Excel2LuaTools.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="UnityEngine">
......@@ -389,6 +398,21 @@
<Reference Include="nunit.framework">
<HintPath>Library\PackageCache\com.unity.ext.nunit@2.0.2\net40\unity-custom\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="NPOI.OOXML">
<HintPath>Assets\Plugins\NPOI\NPOI.OOXML.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>Assets\Plugins\NPOI\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXmlFormats">
<HintPath>Assets\Plugins\NPOI\NPOI.OpenXmlFormats.dll</HintPath>
</Reference>
<Reference Include="NPOI">
<HintPath>Assets\Plugins\NPOI\NPOI.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXml4Net">
<HintPath>Assets\Plugins\NPOI\NPOI.OpenXml4Net.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode">
<HintPath>D:\Unity\2021.3.11f1c1\Editor\Data\PlaybackEngines\iOSSupport\UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
</Reference>
......
......@@ -54,6 +54,11 @@
</PropertyGroup>
<ItemGroup>
<Analyzer Include="D:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Visual Studio Tools for Unity\Analyzers\Microsoft.Unity.Analyzers.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.OOXML.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.OpenXml4Net.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.OpenXmlFormats.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\ICSharpCode.SharpZipLib.dll" />
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\Plugins\DOTween\Modules\DOTweenModuleUnityVersion.cs" />
......@@ -66,13 +71,19 @@
<Compile Include="Assets\Plugins\DOTween\Modules\DOTweenModuleEPOOutline.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Assets\Plugins\NPOI\NPOI.OpenXml4Net.dll" />
<None Include="Assets\Plugins\X86_64\tolua.dll" />
<None Include="Assets\Plugins\NPOI\NPOI.dll" />
<None Include="Assets\Plugins\Debugger.dll" />
<None Include="Assets\Plugins\Ionic.Zip.Unity.dll" />
<None Include="Assets\Plugins\DOTween\DOTween.XML" />
<None Include="Assets\Plugins\NPOI\ICSharpCode.SharpZipLib.dll" />
<None Include="Assets\Plugins\x86\tolua.dll" />
<None Include="Assets\Plugins\NPOI\NPOI.OpenXmlFormats.dll" />
<None Include="Assets\Plugins\DOTween\DOTween.dll" />
<None Include="Assets\Plugins\DOTween\readme.txt" />
<None Include="Assets\Plugins\NPOI\NPOI.OOXML.dll" />
<None Include="Assets\Plugins\NPOI\NPOI.XML" />
</ItemGroup>
<ItemGroup>
<Reference Include="UnityEngine">
......@@ -339,6 +350,21 @@
<Reference Include="nunit.framework">
<HintPath>Library\PackageCache\com.unity.ext.nunit@2.0.2\net40\unity-custom\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="NPOI.OOXML">
<HintPath>Assets\Plugins\NPOI\NPOI.OOXML.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>Assets\Plugins\NPOI\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXmlFormats">
<HintPath>Assets\Plugins\NPOI\NPOI.OpenXmlFormats.dll</HintPath>
</Reference>
<Reference Include="NPOI">
<HintPath>Assets\Plugins\NPOI\NPOI.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXml4Net">
<HintPath>Assets\Plugins\NPOI\NPOI.OpenXml4Net.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode">
<HintPath>D:\Unity\2021.3.11f1c1\Editor\Data\PlaybackEngines\iOSSupport\UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
</Reference>
......
......@@ -54,6 +54,11 @@
</PropertyGroup>
<ItemGroup>
<Analyzer Include="D:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Visual Studio Tools for Unity\Analyzers\Microsoft.Unity.Analyzers.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.OOXML.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.OpenXml4Net.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\NPOI.OpenXmlFormats.dll" />
<Analyzer Include="D:\WorkSpace\Masterdulepre\Assets\Plugins\NPOI\ICSharpCode.SharpZipLib.dll" />
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\LuaFramework\Scripts\Manager\LuaManager.cs" />
......@@ -115,13 +120,11 @@
<Compile Include="Assets\XFramework\Sprite\SpriteCfg.cs" />
<Compile Include="Assets\XFramework\LitJson\JsonData.cs" />
<Compile Include="Assets\XFramework\sproto\SprotoDef\c2s.cs" />
<Compile Include="Assets\XFramework\Common\Global\GlobalObjs.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Source\Generate\UnityEngine_SkinnedMeshRendererWrap.cs" />
<Compile Include="Assets\LuaFramework\ToLua\BaseType\System_Collections_ObjectModel_ReadOnlyCollectionWrap.cs" />
<Compile Include="Assets\XFramework\Audio\AudioChannelItem.cs" />
<Compile Include="Assets\XFramework\Common\Util\XMLUtil.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Misc\LuaClient.cs" />
<Compile Include="Assets\XFramework\Common\Global\GameDef.cs" />
<Compile Include="Assets\LuaFramework\Scripts\Common\CallLuaBehaviour.cs" />
<Compile Include="Assets\XFramework\Common\Global\Cache.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Core\ToLua.cs" />
......@@ -161,7 +164,6 @@
<Compile Include="Assets\LuaFramework\ToLua\BaseType\UnityEngine_ScreenWrap.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Source\Generate\UnityEngine_AnimationBlendModeWrap.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Source\Generate\UnityEngine_AnimatorWrap.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Source\Generate\GlobalObjsWrap.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Source\Generate\UnityEngine_QueueModeWrap.cs" />
<Compile Include="Assets\LuaFramework\ToLua\Source\Generate\UGUIToolWrap.cs" />
<Compile Include="Assets\XFramework\UGUIExpand\Text\OutlineEx.cs" />
......@@ -578,6 +580,21 @@
<Reference Include="nunit.framework">
<HintPath>Library\PackageCache\com.unity.ext.nunit@2.0.2\net40\unity-custom\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="NPOI.OOXML">
<HintPath>Assets\Plugins\NPOI\NPOI.OOXML.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>Assets\Plugins\NPOI\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXmlFormats">
<HintPath>Assets\Plugins\NPOI\NPOI.OpenXmlFormats.dll</HintPath>
</Reference>
<Reference Include="NPOI">
<HintPath>Assets\Plugins\NPOI\NPOI.dll</HintPath>
</Reference>
<Reference Include="NPOI.OpenXml4Net">
<HintPath>Assets\Plugins\NPOI\NPOI.OpenXml4Net.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode">
<HintPath>D:\Unity\2021.3.11f1c1\Editor\Data\PlaybackEngines\iOSSupport\UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
</Reference>
......
......@@ -8,7 +8,7 @@
"type": "emmylua_attach",
"request": "attach",
"name": "通过进程ID附加",
"pid": 5268,
"pid": 18068,
"processName": "",
"captureLog": false
}
......
......@@ -155,7 +155,6 @@ namespace LuaFramework
_GT(typeof(Cache)),
_GT(typeof(NetworkManager)),
_GT(typeof(EventDispatcher)),
_GT(typeof(GlobalObjs)),
_GT(typeof(ResourceManager)),
_GT(typeof(PrefabBinder)),
_GT(typeof(DelayCallMgr)),
......
......@@ -6,19 +6,20 @@ public class FastOpenTools
[MenuItem("Tools/配置表/打开图集配置")]
public static void OpenSprCfg()
{
OpenFileOrDirectory("/LuaFramework/Lua/Config/sprites.bytes");
OpenFileOrDirectory("/ResAssets/Xml/sprites.bytes");
}
[MenuItem("Tools/配置表/打开资源配置")]
public static void OpenAssCfg()
{
OpenFileOrDirectory("/LuaFramework/Lua/Config/prefabs.bytes");
OpenFileOrDirectory("/ResAssets/Xml/prefabs.bytes");
}
[MenuItem("Tools/配置表/打开音效配置")]
public static void OpenAudCfg()
{
OpenFileOrDirectory("/LuaFramework/Lua/Config/audios.bytes");
OpenFileOrDirectory("/ResAssets/Xml/audios.bytes");
}
public static void OpenFileOrDirectory(string uri, string workingDir = "")
......
fileFormatVersion: 2
guid: 4d7a9884d059bba469f74aaf56c8646a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEditor;
using System.IO;
namespace Excel2Lua
{
public class Excel2LuaTool
{
private static string excelPath = @"D:\WorkSpace\Excel";
private static string luaPath = @"D:\WorkSpace\Masterdulepre\Assets\LuaFramework\Lua\Config";
[MenuItem("Tools/配置表Excel转换为Lua")]
public static void Excel2Lua()
{
FileExporter.ExportAllLuaFiles(excelPath, luaPath);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: cdee86a4af975cb479ba0c3ceddaefaa
guid: 0328eee65840a034a8dfd00cf7fc5ad2
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
using NPOI.SS.UserModel;
using System.Collections.Generic;
using System.Text;
namespace Excel2Lua
{
/// <summary>
/// excel表格转换处理核心类
/// </summary>
class ExcelTransfer
{
/// <summary>
/// Excel数组开始行数
/// </summary>
const int BGN_ROW = 5;
/// <summary>
/// 源字符组
/// </summary>
private static readonly char[] charSymbol = { '[', ']', ',' };
/// <summary>
/// 替换字符组
/// </summary>
private static readonly char[] insteadSymbol = { '{', '}', ','};
/// <summary>
/// 根据字符串返回对应的字段类型
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static FiledType StringToFieldType(string str)
{
str = str.Trim().ToLower();
switch (str)
{
case "int":
return FiledType.T_int;
case "string":
return FiledType.T_string;
case "table":
return FiledType.T_table;
default:
break;
}
return FiledType.unkonw;
}
/// <summary>
/// 获取表格的列数,表头碰到空白列直接中断
/// </summary>
/// <returns></returns>
public static int GetSheetColonums(ISheet sheet)
{
int rowNum = sheet.LastRowNum;
IRow firstRow = sheet.GetRow(0);
if (firstRow != null)
{
return firstRow.LastCellNum;
}
return 0;
}
/// <summary>
/// 获取表格行数
/// </summary>
/// <param name="sheet"></param>
/// <returns></returns>
public static int GetSheetRows(ISheet sheet)
{
return sheet.LastRowNum;
}
/// <summary>
/// 获取当前sheet的表头信息
/// </summary>
/// <param name="sheet"></param>
/// <returns></returns>
public static List<ColoumnDes> GetColoumnDesc(ISheet sheet)
{
int coloumnCount = GetSheetColonums(sheet);
List<ColoumnDes> coloumnDesList = new List<ColoumnDes>();
for (int i = 1; i < coloumnCount; i++)
{
ColoumnDes coloumnDes = new ColoumnDes();
coloumnDes.index = i;
coloumnDes.comment = sheet.GetRow(0).GetCell(i).ToString().Trim();
coloumnDes.name = sheet.GetRow(1).GetCell(i).ToString().Trim();
coloumnDes.typeStr = sheet.GetRow(2).GetCell(i).ToString().Trim();
coloumnDes.type = StringToFieldType(coloumnDes.typeStr);
coloumnDesList.Add(coloumnDes);
}
return coloumnDesList;
}
/// <summary>
/// 生成lua文件
/// </summary>
/// <param name="sheet"></param>
/// <returns></returns>
public static string GenLuaFile(ISheet sheet, string fileName)
{
List<ColoumnDes> coloumnDesList = GetColoumnDesc(sheet);
StringBuilder stringBuilder = new StringBuilder();
if (null == coloumnDesList || coloumnDesList.Count <= 0)
{
return string.Empty;
}
stringBuilder.AppendFormat("--[[Notice: This lua config file is auto generate by {0},don't modify it manually! --]]\n\n", fileName);
//表头映射表
Dictionary<int, FiledType> filedMap = new Dictionary<int, FiledType>();
#region 转化变量名称
stringBuilder.Append("local indexData = {\n");
for (int i = 0; i < coloumnDesList.Count; i++)
{
ColoumnDes item = coloumnDesList[i];
if (item != null && !string.IsNullOrEmpty(item.name))
{
filedMap.Add(item.index, item.type);
stringBuilder.AppendFormat("\t{0} = {1}, --{2} \n", item.name, i + 1, item.comment);
}
}
stringBuilder.Append("}\n\n");
#endregion 转化变量名称
#region 转化内容
stringBuilder.Append("local data = {\n");
for (int i = BGN_ROW; i <= GetSheetRows(sheet); i++)
{
string data = sheet.GetRow(i).GetCell(1).ToString().Trim();
if (!string.IsNullOrEmpty(data))
{
stringBuilder.AppendFormat("\t[{0}] = ", data);
stringBuilder.Append("{");
for (int j = 1; j < GetSheetColonums(sheet); j++)
{
string cellData = sheet.GetRow(i).GetCell(j).ToString().Trim();
if (!string.IsNullOrEmpty(cellData))
{
cellData = ParseCellDataByType(filedMap[j], cellData);
stringBuilder.AppendFormat("[{0}]={1},", j, cellData);
}
}
stringBuilder.Append("},\n");
}
}
stringBuilder.Append("}\n\n");
#endregion 转化内容
#region lua matetable
//设置元表
string str =
@"local mt = {}
mt.__index = function(t,k)
if indexData[k] then
return rawget(t,indexData[k])
end
end
for _,v in pairs(data) do
setmetatable(v,mt)
end
return data";
stringBuilder.Append(str);
#endregion
return stringBuilder.ToString();
}
/// <summary>
/// 解析cell数据
/// </summary>
/// <param name="filedType"></param>
/// <param name="data"></param>
/// <returns></returns>
public static string ParseCellDataByType(FiledType filedType, string data)
{
StringBuilder sb = new StringBuilder();
switch (filedType)
{
case FiledType.unkonw:
return data;
case FiledType.T_int:
return data;
case FiledType.T_string:
sb.Append("\'" + data + "\'");
return sb.ToString();
case FiledType.T_table:
return DealCellDataByTable(data);
default:
return data;
}
}
/// <summary>
/// 处理table类型的数据
/// </summary>
/// <param name="data">数据</param>
/// <returns></returns>
public static string DealCellDataByTable(string data)
{
for (int i = 0; i < charSymbol.Length; i++)
{
data = data.Replace(charSymbol[i], insteadSymbol[i]);
}
return data;
}
}
}
fileFormatVersion: 2
guid: 79a4eace972f2934baada3f90d34b5b6
timeCreated: 1495270359
licenseType: Pro
guid: 9866c728970f94a46969e6155388e8e2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using System.Text.RegularExpressions;
using UnityEngine;
using UnityEditor;
namespace Excel2Lua
{
public class FileExporter
{
/// <summary>
/// 清空导出的lua
/// </summary>
/// <param name="luaPath"></param>
public static void ClearLuaDir(string luaPath)
{
if (!Directory.Exists(luaPath))
{
return;
}
DirectoryInfo directoryInfo = new DirectoryInfo(luaPath);
FileSystemInfo[] fsinfos = directoryInfo.GetFileSystemInfos();
foreach (FileSystemInfo fsinfo in fsinfos)
{
if (fsinfo is DirectoryInfo)
{
try
{
Directory.Delete(fsinfo.FullName, true);
}
catch (Exception e)
{
Debug.Log("警告:目录删除失败 " + e.Message);
}
}
else
{
try
{
File.Delete(fsinfo.FullName);
}
catch (Exception e)
{
Debug.Log("警告:文件删除失败 " + e.Message);
}
}
Debug.Log("删除成功 {0}" + fsinfo.FullName);
}
}
/// <summary>
/// 导出所有的lua文件
/// </summary>
/// <param name="excelPath"></param>
/// <param name="luaPath"></param>
public static void ExportAllLuaFiles(string excelPath, string luaPath)
{
ClearLuaDir(luaPath);
List<string> allExcelList = Directory.GetFiles(excelPath, "*.*", SearchOption.AllDirectories).ToList();
Debug.Log("开始转表.....");
foreach (var itemExcel in allExcelList)
{
ExportSingleLuaFile(itemExcel, luaPath);
}
AssetDatabase.Refresh();
Debug.Log("结束转表.....");
}
public static void ExportSingleLuaFile(string ExcelName, string luaDir)
{
string extension = Path.GetExtension(ExcelName).ToLower();
if (".xls" != extension && ".xlsx" != extension)
{
Debug.Log("表格式仅支持xls xlsx");
return;
}
//打开文件流
FileStream fs = null;
try
{
fs = File.Open(ExcelName, FileMode.Open);
}
catch (Exception e)
{
Debug.Log(e.Message);
}
if (null == fs) return;
IWorkbook book = null;
if (".xls" == extension)
{
book = new HSSFWorkbook(fs);
}
else
{
book = new XSSFWorkbook(fs);
}
fs.Close();
if (book != null)
{
for (int i = 0; i < book.NumberOfSheets; i++)
{
ISheet sheet = book.GetSheetAt(i);
string fileContent = ExcelTransfer.GenLuaFile(sheet, Path.GetFileName(ExcelName));
string name = ExcelName.Replace("D:\\WorkSpace\\Excel\\","").Replace(".xlsx", ".lua");
string outPath = Path.Combine(luaDir, name);
if (!string.IsNullOrEmpty(fileContent))
{
File.WriteAllText(outPath, fileContent);
}
}
}
}
}
}
fileFormatVersion: 2
guid: 7e6e90aab4c772845a24b2cca1bbd825
timeCreated: 1494502981
licenseType: Pro
guid: b3e207d7a40201242976147bce8649a9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Excel2Lua
{
/// <summary>
/// 表格字段类型枚举
/// </summary>
public enum FiledType : byte
{
unkonw,
T_int,
T_string,
T_table,
}
/// <summary>
/// 表头字段描述
/// </summary>
public class ColoumnDes
{
public int index = -1;
public string comment = "";
public string typeStr = "";
public string name = "";
public FiledType type;
public override String ToString()
{
return string.Format("index = {0}, comment = {1}, typeStr = {2}, name = {3}, type = {4}", index, comment, typeStr, name, type);
}
}
}
fileFormatVersion: 2
guid: ff7423fe1a6d07c4f920eef056070c4b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -23,6 +23,7 @@ public class PrefabBinderEditor : EditorWindow
private Object m_itemObj;
private bool m_lock;
private string m_componentStr = "";
enum ItemOption
{
AddItem,
......@@ -236,8 +237,9 @@ public class PrefabBinderEditor : EditorWindow
private void DrawComponentList()
{
var go = Selection.activeObject as GameObject; //获取选中对象
if (go && m_lock == false)
if (go || m_selectedItemName != go.name && m_lock == false)
{
m_itemObj = go;
Component[] components = go.GetComponents<Component>();
m_comList.Clear();
m_comList.AddRange(components);
......
......@@ -121,7 +121,7 @@ public class ResConfigEditor : EditorWindow
return ResEditorErrorCode.ResExist;
item.SetAttribute("name", objname);
item.SetAttribute("editorPath", sourcepath);
item.SetAttribute("ediPath", sourcepath);
item.SetAttribute("editime", System.DateTime.Now.ToShortDateString());
item.SetAttribute("desc", description);
XmlNode rootNode = doc.SelectSingleNode("items");
......@@ -153,7 +153,7 @@ public class ResConfigEditor : EditorWindow
return ResEditorErrorCode.notResExist;
string filePath = AssetDatabase.GetAssetPath(m_curObj);
item.SetAttribute("editorPath", filePath);
item.SetAttribute("ediPath", filePath);
item.SetAttribute("version", System.DateTime.Now.ToShortDateString());
if (string.IsNullOrEmpty(description))
description = item.Attributes["desc"].Value;
......@@ -226,10 +226,10 @@ public class ResConfigEditor : EditorWindow
{
for (int i = 0; i < nodeList.Count; ++i)
{
string editorPath = nodeList[i].Attributes["editorPath"].Value;
int index1 = editorPath.LastIndexOf('/');
string ediPath = nodeList[i].Attributes["ediPath"].Value;
int index1 = ediPath.LastIndexOf('/');
if (index1 == -1) continue;
string tempPath = editorPath.Remove(0, index1 + 1);
string tempPath = ediPath.Remove(0, index1 + 1);
int index2 = tempPath.LastIndexOf('.');
if (index2 == -1) continue;
string tempName = tempPath.Remove(index2, tempPath.Length - index2);
......
fileFormatVersion: 2
guid: df8fb3547813b7143a969225f052794b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -78,7 +78,7 @@ function ViewBase:register()
for index, value in pairs(self) do
if string.find (index, "OnClick_") then
local var = string.gsub(index, "OnClick_", "")
UGUITool.SetButton(binder, var, value)
UGUITool.SetButton(self.binder, var, value)
end
......
......@@ -9,17 +9,31 @@ Protocal = {
Message = '104'; --接收消息
}
EventNameDef =
{
LUA_NETWORK_RESEND_SUCCESSFULLY = "LUA_NETWORK_RESEND_SUCCESSFULLY",
}
-- EventNameDef =
-- {
-- LUA_NETWORK_RESEND_SUCCESSFULLY = "LUA_NETWORK_RESEND_SUCCESSFULLY",
-- }
-- LANGUAGE =
-- {
-- "zh",--中文
-- "en"--英文
-- }
const = const or {}
-- 仅在main场景下有效 常用非常量
function const:Init()
local binder = GameObject.Find("Canvas").gameObject:GetComponent("PrefabBinder")
-- 背景界面父物体
const.T_Bg = binder:GetObj("T_Bg")
-- 游戏界面父物体
const.T_Ga = binder:GetObj("T_Ga")
-- 提示界面父物体
const.T_To = binder:GetObj("T_To")
-- 光源方向
const.T_Light = binder:GetObj("T_Light")
-- 光源颜色和强度
const.L_Light = binder:GetObj("L_Light")
end
\ No newline at end of file
-- 常用类
GameObject = UnityEngine.GameObject
Util = LuaFramework.Util
Prefs = UnityEngine.PlayerPrefs
Util = LuaFramework.Util
NetMgr = LuaFramework.LuaHelper.GetNetManager()
CliNet = ClientNet.instance
DelMgr = DelayCallMgr.instance
......
fileFormatVersion: 2
guid: 51440e5e30a76ca4baac58348c7ff919
guid: de916f1a101b61e44a2798a6c1fad4d5
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
--[[Notice: This lua config file is auto generate by Language.xlsx,don't modify it manually! --]]
local indexData = {
key = 1, --主键
zh = 2, --中文
des = 3, --中文描述
}
local data = {
[3] = {[1]=3,[2]='擂台',[3]='使用擂台主自定义规则对战',},
[4] = {[1]=4,[2]='构筑',[3]='制作一张卡',},
[5] = {[1]=5,[2]='牌库',[3]='包含系统赠送和自定义卡牌和卡组',},
}
local mt = {}
mt.__index = function(t,k)
if indexData[k] then
return rawget(t,indexData[k])
end
end
for _,v in pairs(data) do
setmetatable(v,mt)
end
return data
\ No newline at end of file
fileFormatVersion: 2
guid: ae2ff60e40746d3449af3d58c900c666
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
<?xml version="1.0" encoding="utf-8"?>
<items>
<item name="Iron-Blooded" editorPath="Assets/RawAssets/Audios/Iron-Blooded.mp3" editime="2023/1/27" desc="主界面背景音乐" />
</items>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<items>
<item name="MenuPanel" editorPath="Assets/ResAssets/Menu/MenuPanel.prefab" editime="2023/1/27" desc="主菜单" />
</items>
\ No newline at end of file
......@@ -4,13 +4,14 @@ MenuPanel = ViewBase:New("MenuPanel", true)
function MenuPanel:OnShow()
local Par_snow = self.binder:GetObj("Par_snow")
Par_snow:Play()
local Ani_box = self.binder:GetObj("Ani_box")
Ani_box:Play("UI3d_Box_chuxian")
end
function MenuPanel:OnHide()
Par_snow:Stop()
end
function MenuPanel:OnClick_Btn_chess()
end
......
//this source code was auto-generated by tolua#, do not modify it
using System;
using LuaInterface;
public class GlobalObjsWrap
{
public static void Register(LuaState L)
{
L.BeginClass(typeof(GlobalObjs), typeof(System.Object));
L.RegFunction("New", _CreateGlobalObjs);
L.RegFunction("__tostring", ToLua.op_ToString);
L.RegVar("s_canvas", get_s_canvas, set_s_canvas);
L.RegVar("s_topPanel", get_s_topPanel, set_s_topPanel);
L.RegVar("s_gamePanel", get_s_gamePanel, set_s_gamePanel);
L.RegVar("s_bgPanel", get_s_bgPanel, set_s_bgPanel);
L.EndClass();
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _CreateGlobalObjs(IntPtr L)
{
try
{
int count = LuaDLL.lua_gettop(L);
if (count == 0)
{
GlobalObjs obj = new GlobalObjs();
ToLua.PushObject(L, obj);
return 1;
}
else
{
return LuaDLL.luaL_throw(L, "invalid arguments to ctor method: GlobalObjs.New");
}
}
catch(Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int get_s_canvas(IntPtr L)
{
try
{
ToLua.Push(L, GlobalObjs.s_canvas);
return 1;
}
catch(Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int get_s_topPanel(IntPtr L)
{
try
{
ToLua.Push(L, GlobalObjs.s_topPanel);
return 1;
}
catch(Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int get_s_gamePanel(IntPtr L)
{
try
{
ToLua.Push(L, GlobalObjs.s_gamePanel);
return 1;
}
catch(Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int get_s_bgPanel(IntPtr L)
{
try
{
ToLua.Push(L, GlobalObjs.s_bgPanel);
return 1;
}
catch(Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int set_s_canvas(IntPtr L)
{
try
{
UnityEngine.Canvas arg0 = (UnityEngine.Canvas)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Canvas));
GlobalObjs.s_canvas = arg0;
return 0;
}
catch(Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int set_s_topPanel(IntPtr L)
{
try
{
UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Transform));
GlobalObjs.s_topPanel = arg0;
return 0;
}
catch(Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int set_s_gamePanel(IntPtr L)
{
try
{
UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Transform));
GlobalObjs.s_gamePanel = arg0;
return 0;
}
catch(Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int set_s_bgPanel(IntPtr L)
{
try
{
UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Transform));
GlobalObjs.s_bgPanel = arg0;
return 0;
}
catch(Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
}
......@@ -14,7 +14,6 @@ public static class LuaBinder
ClientNetWrap.Register(L);
CacheWrap.Register(L);
EventDispatcherWrap.Register(L);
GlobalObjsWrap.Register(L);
ResourceManagerWrap.Register(L);
PrefabBinderWrap.Register(L);
DelayCallMgrWrap.Register(L);
......
fileFormatVersion: 2
guid: f99d1d7549277f24ca0596ae4b474805
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c66a960db3f944444945de587355b0f3
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: da6b4be03cd83334b80f1586546f34ca
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 50e7902443b5eae4e97683de2f6fb6a5
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 581cf0510952fab4696301e62aa63c5b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
此差异已折叠。
fileFormatVersion: 2
guid: 5be6a9f879e2cd840a5bb0e50c004624
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 53631069fe4098142abc60fa206cb861
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
......@@ -300,117 +300,6 @@ AnimationClip:
path: drawer
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8333333
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 2.9166667
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.r
path: light
classID: 108
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8333333
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 2.9166667
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.g
path: light
classID: 108
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8333333
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 2.9166667
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.b
path: light
classID: 108
script: {fileID: 0}
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
......@@ -454,27 +343,6 @@ AnimationClip:
typeID: 224
customType: 28
isPPtrCurve: 0
- serializedVersion: 2
path: 1796889847
attribute: 2526845255
script: {fileID: 0}
typeID: 108
customType: 25
isPPtrCurve: 0
- serializedVersion: 2
path: 1796889847
attribute: 4215373228
script: {fileID: 0}
typeID: 108
customType: 25
isPPtrCurve: 0
- serializedVersion: 2
path: 1796889847
attribute: 2334886179
script: {fileID: 0}
typeID: 108
customType: 25
isPPtrCurve: 0
- serializedVersion: 2
path: 3574611457
attribute: 2537237887
......@@ -871,117 +739,6 @@ AnimationClip:
path:
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8333333
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 2.9166667
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.r
path: light
classID: 108
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8333333
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 2.9166667
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.g
path: light
classID: 108
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.8333333
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 2.9166667
value: 0.7058824
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_Color.b
path: light
classID: 108
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UI_3d_Box_yijinru
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0, y: 0, z: 120}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: lnode
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0, y: 0, z: -120}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: rnode
m_PositionCurves: []
m_ScaleCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 750, y: 750, z: 750}
inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 35
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_AnchoredPosition.y
path:
classID: 224
script: {fileID: 0}
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 1054562824
attribute: 4
script: {fileID: 0}
typeID: 4
customType: 4
isPPtrCurve: 0
- serializedVersion: 2
path: 3775624171
attribute: 4
script: {fileID: 0}
typeID: 4
customType: 4
isPPtrCurve: 0
- serializedVersion: 2
path: 0
attribute: 3
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 0
attribute: 538195251
script: {fileID: 0}
typeID: 224
customType: 28
isPPtrCurve: 0
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 750
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.x
path:
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 750
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.y
path:
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 750
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalScale.z
path:
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path: lnode
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path: lnode
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 120
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path: lnode
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.x
path: rnode
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.y
path: rnode
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: -120
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: localEulerAnglesRaw.z
path: rnode
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 35
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_AnchoredPosition.y
path:
classID: 224
script: {fileID: 0}
m_EulerEditorCurves:
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path: lnode
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path: lnode
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path: lnode
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.x
path: rnode
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.y
path: rnode
classID: 224
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalEulerAngles.z
path: rnode
classID: 224
script: {fileID: 0}
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
fileFormatVersion: 2
guid: ca751eae3ab591749a60987b9e575906
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName: rawassets_animation_box
assetBundleVariant: raw
fileFormatVersion: 2
guid: 51440e5e30a76ca4baac58348c7ff919
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
<?xml version="1.0" encoding="utf-8"?>
<items>
<item name="Iron-Blooded" ediPath="Assets/RawAssets/Audios/Iron-Blooded.mp3" editime="2023/1/27" desc="主界面背景音乐" />
</items>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<items>
<item name="MenuPanel" ediPath="Assets/ResAssets/Menu/MenuPanel.prefab" editime="2023/1/27" desc="主菜单" />
</items>
\ No newline at end of file
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.3731193, g: 0.38073996, b: 0.35872698, a: 1}
m_IndirectSpecularColor: {r: 0.43733448, g: 0.47739393, b: 0.52366334, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
......@@ -335,6 +335,7 @@ RectTransform:
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1525724963}
- {fileID: 1738668703}
- {fileID: 1967082374}
- {fileID: 1878497129}
......@@ -385,6 +386,10 @@ MonoBehaviour:
obj: {fileID: 1738668703}
- name: T_To
obj: {fileID: 1738668703}
- name: L_Light
obj: {fileID: 1525724962}
- name: T_Light
obj: {fileID: 1525724962}
--- !u!1 &865741007
GameObject:
m_ObjectHideFlags: 0
......@@ -453,6 +458,121 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1525724962
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1525724963}
- component: {fileID: 1525724965}
- component: {fileID: 1525724964}
m_Layer: 6
m_Name: Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1525724963
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1525724962}
m_LocalRotation: {x: 0.19310854, y: -0.13715214, z: -0.46670687, w: 0.85210514}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 670355793}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 11.6, y: -25, z: -60}
--- !u!114 &1525724964
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1525724962}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 1
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_CustomShadowLayers: 0
m_ShadowLayerMask: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
--- !u!108 &1525724965
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1525724962}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 0.8632076, g: 0.8718018, b: 1, a: 1}
m_Intensity: 0.6
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.1
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 1
m_CullingMask:
serializedVersion: 2
m_Bits: 64
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!1 &1738668702
GameObject:
m_ObjectHideFlags: 0
......@@ -483,7 +603,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 670355793}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
......@@ -528,7 +648,7 @@ RectTransform:
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 670355793}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
......@@ -574,7 +694,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 670355793}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
......

/// <summary>
/// 全局定义
/// </summary>
public class GameDef
{
}
using UnityEngine;
/// <summary>
/// 全局物体
/// </summary>
public class GlobalObjs
{
public static Canvas s_canvas;
public static Transform s_topPanel;
public static Transform s_gamePanel;
public static Transform s_bgPanel;
}
\ No newline at end of file
......@@ -10,6 +10,21 @@ using System.Collections.Generic;
/// </summary>
public class UnityUtil
{
/// <summary>
/// 获得系统默认语言
/// </summary>
public static string GetLanguage()
{
#if UNITY_ANDROID
AndroidJavaClass unityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject _unityContext = unityClass.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject locale = _unityContext.Call<AndroidJavaObject>("getResources").Call<AndroidJavaObject>("getConfiguration").Get<AndroidJavaObject>("locale");
return locale.Call<string>("getLanguage");
#endif
}
/// <summary>
/// uint转换为Color
......
......@@ -4,7 +4,7 @@
/// </summary>
public class ResourceConfigItem : ConfigItem
{
public string editorPath;
public string ediPath;
public string desc;
public string name;
......@@ -15,7 +15,7 @@ public class ResourceConfigItem : ConfigItem
public override string ToString()
{
return string.Format("name = {0},path = {1},description = {2}", name, editorPath, desc);
return string.Format("name = {0},path = {1},description = {2}", name, ediPath, desc);
}
......
......@@ -31,13 +31,13 @@ public class ResourceManager
Dictionary<string, ResourceConfigItem> allItems = m_resourceConfigFile.GetAllItems();
foreach (KeyValuePair<string, ResourceConfigItem> p in allItems)
{
if (!m_urlDic.ContainsKey(p.Value.editorPath))
if (!m_urlDic.ContainsKey(p.Value.ediPath))
{
m_urlDic.Add(p.Value.name, p.Value);
}
else
{
GameLogger.Log("name be same, " + p.Value.editorPath);
GameLogger.Log("name be same, " + p.Value.ediPath);
}
}
}
......@@ -53,7 +53,7 @@ public class ResourceManager
GameObject obj = null;
if (m_urlDic.ContainsKey(name))
{
obj = Instantiate<GameObject>(m_urlDic[name].editorPath);
obj = Instantiate<GameObject>(m_urlDic[name].ediPath);
obj.name = name;
}
return obj;
......
......@@ -17,7 +17,7 @@ public class ResourcePathBuilder
public static string BuildConfigPath(string name)
{
#if UNITY_EDITOR
string path = "Assets/LuaFramework/Lua/Config/" + name;
string path = "Assets/ResAssets/Xml/" + name;
if (!path.EndsWith(".bytes")) path += ".bytes";
return path;
#else
......
......@@ -46,6 +46,9 @@ public class StartUp : MonoBehaviour
// 自动横屏
UnityUtil.ActiveScreenAutoRotate(true);
//设置默认语言
PlayerPrefs.SetString("CurrentLanguage", UnityUtil.GetLanguage());
// 后台运行
Application.runInBackground = true;
......
......@@ -27,7 +27,7 @@ public class GuideMaskBhv : MonoBehaviour
// 设置事件透传对象
gameObject.GetComponent<EventPermeate>().target = this.target;
var canvas = GlobalObjs.s_canvas;
var canvas = GameObject.Find("Canvas").GetComponent<Canvas>();
target.GetComponent<RectTransform>().GetWorldCorners(corners);
diameter = Vector2.Distance(WordToCanvasPos(canvas, corners[0]), WordToCanvasPos(canvas, corners[2])) / 2f;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册