parent
f0b9e1d8e6
commit
733b11e1bd
|
@ -1209,6 +1209,8 @@ ActivityTypeDef = {
|
|||
YiJingBaoKu = 8000,--易经宝库
|
||||
|
||||
MeiRiLiBao = 10004,
|
||||
|
||||
lingLongBaoJing = 67,
|
||||
}
|
||||
--活动结束需要处理面板关闭类型
|
||||
ActivityTypePanel = {
|
||||
|
|
|
@ -195,6 +195,7 @@ local ManagerNames = {
|
|||
"Practice/PracticeManager",
|
||||
--!!!!红点管理(尽量放在最后)!!!!--
|
||||
"Story/StoryMapManager",
|
||||
"linglongbaojing/LingLongBaoJingManager",
|
||||
"Player/RedpotManager",
|
||||
|
||||
}
|
||||
|
|
|
@ -207,6 +207,7 @@ ConfigName = {
|
|||
WishActivityPool = "WishActivityPool",
|
||||
WishActivityUp = "WishActivityUp",
|
||||
PackageConfig = "PackageConfig",
|
||||
LingLongPool = "LingLongPool",
|
||||
}
|
||||
|
||||
require "Framework/GameDataBase"
|
||||
|
|
|
@ -50,6 +50,15 @@ CHOICEDRAWCARDREQUEST_ACTIVITYID_FIELD = protobuf.FieldDescriptor();
|
|||
CHOICEDRAWCARDREQUEST_TYPE_FIELD = protobuf.FieldDescriptor();
|
||||
CHOICEDRAWCARDRESPONSE = protobuf.Descriptor();
|
||||
CHOICEDRAWCARDRESPONSE_DROP_FIELD = protobuf.FieldDescriptor();
|
||||
QIMENDUNJIADRAWREQUEST = protobuf.Descriptor();
|
||||
QIMENDUNJIADRAWREQUEST_ACTIVITYID_FIELD = protobuf.FieldDescriptor();
|
||||
QIMENDUNJIADRAWRESPONSE = protobuf.Descriptor();
|
||||
QIMENDUNJIADRAWRESPONSE_DROP_FIELD = protobuf.FieldDescriptor();
|
||||
QIMENDUNJIADRAWRESPONSE_IDLIST_FIELD = protobuf.FieldDescriptor();
|
||||
QIMENDUNJIAHITLISTREQUEST = protobuf.Descriptor();
|
||||
QIMENDUNJIAHITLISTREQUEST_ACTIVITYID_FIELD = protobuf.FieldDescriptor();
|
||||
QIMENDUNJIAHITLISTRESPONSE = protobuf.Descriptor();
|
||||
QIMENDUNJIAHITLISTRESPONSE_HITLIST_FIELD = protobuf.FieldDescriptor();
|
||||
|
||||
COMMITSHEJIACTIVITYITEMREQUEST_ITEMID_FIELD.name = "itemId"
|
||||
COMMITSHEJIACTIVITYITEMREQUEST_ITEMID_FIELD.full_name = ".rpc.protocols.CommitShejiActivityItemRequest.itemId"
|
||||
|
@ -459,6 +468,85 @@ CHOICEDRAWCARDRESPONSE.enum_types = {}
|
|||
CHOICEDRAWCARDRESPONSE.fields = {CHOICEDRAWCARDRESPONSE_DROP_FIELD}
|
||||
CHOICEDRAWCARDRESPONSE.is_extendable = false
|
||||
CHOICEDRAWCARDRESPONSE.extensions = {}
|
||||
QIMENDUNJIADRAWREQUEST_ACTIVITYID_FIELD.name = "activityId"
|
||||
QIMENDUNJIADRAWREQUEST_ACTIVITYID_FIELD.full_name = ".rpc.protocols.qiMenDunJiaDrawRequest.activityId"
|
||||
QIMENDUNJIADRAWREQUEST_ACTIVITYID_FIELD.number = 1
|
||||
QIMENDUNJIADRAWREQUEST_ACTIVITYID_FIELD.index = 0
|
||||
QIMENDUNJIADRAWREQUEST_ACTIVITYID_FIELD.label = 1
|
||||
QIMENDUNJIADRAWREQUEST_ACTIVITYID_FIELD.has_default_value = false
|
||||
QIMENDUNJIADRAWREQUEST_ACTIVITYID_FIELD.default_value = 0
|
||||
QIMENDUNJIADRAWREQUEST_ACTIVITYID_FIELD.type = 5
|
||||
QIMENDUNJIADRAWREQUEST_ACTIVITYID_FIELD.cpp_type = 1
|
||||
|
||||
QIMENDUNJIADRAWREQUEST.name = "qiMenDunJiaDrawRequest"
|
||||
QIMENDUNJIADRAWREQUEST.full_name = ".rpc.protocols.qiMenDunJiaDrawRequest"
|
||||
QIMENDUNJIADRAWREQUEST.nested_types = {}
|
||||
QIMENDUNJIADRAWREQUEST.enum_types = {}
|
||||
QIMENDUNJIADRAWREQUEST.fields = {QIMENDUNJIADRAWREQUEST_ACTIVITYID_FIELD}
|
||||
QIMENDUNJIADRAWREQUEST.is_extendable = false
|
||||
QIMENDUNJIADRAWREQUEST.extensions = {}
|
||||
QIMENDUNJIADRAWRESPONSE_DROP_FIELD.name = "drop"
|
||||
QIMENDUNJIADRAWRESPONSE_DROP_FIELD.full_name = ".rpc.protocols.qiMenDunJiaDrawResponse.drop"
|
||||
QIMENDUNJIADRAWRESPONSE_DROP_FIELD.number = 1
|
||||
QIMENDUNJIADRAWRESPONSE_DROP_FIELD.index = 0
|
||||
QIMENDUNJIADRAWRESPONSE_DROP_FIELD.label = 1
|
||||
QIMENDUNJIADRAWRESPONSE_DROP_FIELD.has_default_value = false
|
||||
QIMENDUNJIADRAWRESPONSE_DROP_FIELD.default_value = nil
|
||||
QIMENDUNJIADRAWRESPONSE_DROP_FIELD.message_type = CommonProto_pb.DROP
|
||||
QIMENDUNJIADRAWRESPONSE_DROP_FIELD.type = 11
|
||||
QIMENDUNJIADRAWRESPONSE_DROP_FIELD.cpp_type = 10
|
||||
|
||||
QIMENDUNJIADRAWRESPONSE_IDLIST_FIELD.name = "idList"
|
||||
QIMENDUNJIADRAWRESPONSE_IDLIST_FIELD.full_name = ".rpc.protocols.qiMenDunJiaDrawResponse.idList"
|
||||
QIMENDUNJIADRAWRESPONSE_IDLIST_FIELD.number = 2
|
||||
QIMENDUNJIADRAWRESPONSE_IDLIST_FIELD.index = 1
|
||||
QIMENDUNJIADRAWRESPONSE_IDLIST_FIELD.label = 3
|
||||
QIMENDUNJIADRAWRESPONSE_IDLIST_FIELD.has_default_value = false
|
||||
QIMENDUNJIADRAWRESPONSE_IDLIST_FIELD.default_value = {}
|
||||
QIMENDUNJIADRAWRESPONSE_IDLIST_FIELD.type = 5
|
||||
QIMENDUNJIADRAWRESPONSE_IDLIST_FIELD.cpp_type = 1
|
||||
|
||||
QIMENDUNJIADRAWRESPONSE.name = "qiMenDunJiaDrawResponse"
|
||||
QIMENDUNJIADRAWRESPONSE.full_name = ".rpc.protocols.qiMenDunJiaDrawResponse"
|
||||
QIMENDUNJIADRAWRESPONSE.nested_types = {}
|
||||
QIMENDUNJIADRAWRESPONSE.enum_types = {}
|
||||
QIMENDUNJIADRAWRESPONSE.fields = {QIMENDUNJIADRAWRESPONSE_DROP_FIELD, QIMENDUNJIADRAWRESPONSE_IDLIST_FIELD}
|
||||
QIMENDUNJIADRAWRESPONSE.is_extendable = false
|
||||
QIMENDUNJIADRAWRESPONSE.extensions = {}
|
||||
QIMENDUNJIAHITLISTREQUEST_ACTIVITYID_FIELD.name = "activityId"
|
||||
QIMENDUNJIAHITLISTREQUEST_ACTIVITYID_FIELD.full_name = ".rpc.protocols.qiMenDunJiaHitListRequest.activityId"
|
||||
QIMENDUNJIAHITLISTREQUEST_ACTIVITYID_FIELD.number = 1
|
||||
QIMENDUNJIAHITLISTREQUEST_ACTIVITYID_FIELD.index = 0
|
||||
QIMENDUNJIAHITLISTREQUEST_ACTIVITYID_FIELD.label = 1
|
||||
QIMENDUNJIAHITLISTREQUEST_ACTIVITYID_FIELD.has_default_value = false
|
||||
QIMENDUNJIAHITLISTREQUEST_ACTIVITYID_FIELD.default_value = 0
|
||||
QIMENDUNJIAHITLISTREQUEST_ACTIVITYID_FIELD.type = 5
|
||||
QIMENDUNJIAHITLISTREQUEST_ACTIVITYID_FIELD.cpp_type = 1
|
||||
|
||||
QIMENDUNJIAHITLISTREQUEST.name = "qiMenDunJiaHitListRequest"
|
||||
QIMENDUNJIAHITLISTREQUEST.full_name = ".rpc.protocols.qiMenDunJiaHitListRequest"
|
||||
QIMENDUNJIAHITLISTREQUEST.nested_types = {}
|
||||
QIMENDUNJIAHITLISTREQUEST.enum_types = {}
|
||||
QIMENDUNJIAHITLISTREQUEST.fields = {QIMENDUNJIAHITLISTREQUEST_ACTIVITYID_FIELD}
|
||||
QIMENDUNJIAHITLISTREQUEST.is_extendable = false
|
||||
QIMENDUNJIAHITLISTREQUEST.extensions = {}
|
||||
QIMENDUNJIAHITLISTRESPONSE_HITLIST_FIELD.name = "hitList"
|
||||
QIMENDUNJIAHITLISTRESPONSE_HITLIST_FIELD.full_name = ".rpc.protocols.qiMenDunJiaHitListResponse.hitList"
|
||||
QIMENDUNJIAHITLISTRESPONSE_HITLIST_FIELD.number = 1
|
||||
QIMENDUNJIAHITLISTRESPONSE_HITLIST_FIELD.index = 0
|
||||
QIMENDUNJIAHITLISTRESPONSE_HITLIST_FIELD.label = 3
|
||||
QIMENDUNJIAHITLISTRESPONSE_HITLIST_FIELD.has_default_value = false
|
||||
QIMENDUNJIAHITLISTRESPONSE_HITLIST_FIELD.default_value = {}
|
||||
QIMENDUNJIAHITLISTRESPONSE_HITLIST_FIELD.type = 5
|
||||
QIMENDUNJIAHITLISTRESPONSE_HITLIST_FIELD.cpp_type = 1
|
||||
|
||||
QIMENDUNJIAHITLISTRESPONSE.name = "qiMenDunJiaHitListResponse"
|
||||
QIMENDUNJIAHITLISTRESPONSE.full_name = ".rpc.protocols.qiMenDunJiaHitListResponse"
|
||||
QIMENDUNJIAHITLISTRESPONSE.nested_types = {}
|
||||
QIMENDUNJIAHITLISTRESPONSE.enum_types = {}
|
||||
QIMENDUNJIAHITLISTRESPONSE.fields = {QIMENDUNJIAHITLISTRESPONSE_HITLIST_FIELD}
|
||||
QIMENDUNJIAHITLISTRESPONSE.is_extendable = false
|
||||
QIMENDUNJIAHITLISTRESPONSE.extensions = {}
|
||||
|
||||
CommitShejiActivityItemRequest = protobuf.Message(COMMITSHEJIACTIVITYITEMREQUEST)
|
||||
CommitShejiActivityItemResponse = protobuf.Message(COMMITSHEJIACTIVITYITEMRESPONSE)
|
||||
|
@ -480,4 +568,8 @@ choiceDrawCardRequest = protobuf.Message(CHOICEDRAWCARDREQUEST)
|
|||
choiceDrawCardResponse = protobuf.Message(CHOICEDRAWCARDRESPONSE)
|
||||
choiceHeroRewardRequest = protobuf.Message(CHOICEHEROREWARDREQUEST)
|
||||
choiceHeroRewardResponse = protobuf.Message(CHOICEHEROREWARDRESPONSE)
|
||||
qiMenDunJiaDrawRequest = protobuf.Message(QIMENDUNJIADRAWREQUEST)
|
||||
qiMenDunJiaDrawResponse = protobuf.Message(QIMENDUNJIADRAWRESPONSE)
|
||||
qiMenDunJiaHitListRequest = protobuf.Message(QIMENDUNJIAHITLISTREQUEST)
|
||||
qiMenDunJiaHitListResponse = protobuf.Message(QIMENDUNJIAHITLISTRESPONSE)
|
||||
|
||||
|
|
|
@ -194,6 +194,7 @@ ACTIVITYINFO_REALLYOPEN_FIELD = protobuf.FieldDescriptor();
|
|||
ACTIVITYINFO_STARTTIME_FIELD = protobuf.FieldDescriptor();
|
||||
ACTIVITYINFO_VALUE_FIELD = protobuf.FieldDescriptor();
|
||||
ACTIVITYINFO_CHOICEREWARDID_FIELD = protobuf.FieldDescriptor();
|
||||
ACTIVITYINFO_HITID_FIELD = protobuf.FieldDescriptor();
|
||||
GMRESPONSE = protobuf.Descriptor();
|
||||
GMRESPONSE_DROP_FIELD = protobuf.FieldDescriptor();
|
||||
GMRESPONSE_INFO_FIELD = protobuf.FieldDescriptor();
|
||||
|
@ -2511,11 +2512,21 @@ ACTIVITYINFO_CHOICEREWARDID_FIELD.default_value = 0
|
|||
ACTIVITYINFO_CHOICEREWARDID_FIELD.type = 5
|
||||
ACTIVITYINFO_CHOICEREWARDID_FIELD.cpp_type = 1
|
||||
|
||||
ACTIVITYINFO_HITID_FIELD.name = "hitId"
|
||||
ACTIVITYINFO_HITID_FIELD.full_name = ".rpc.protocols.ActivityInfo.hitId"
|
||||
ACTIVITYINFO_HITID_FIELD.number = 8
|
||||
ACTIVITYINFO_HITID_FIELD.index = 7
|
||||
ACTIVITYINFO_HITID_FIELD.label = 3
|
||||
ACTIVITYINFO_HITID_FIELD.has_default_value = false
|
||||
ACTIVITYINFO_HITID_FIELD.default_value = {}
|
||||
ACTIVITYINFO_HITID_FIELD.type = 5
|
||||
ACTIVITYINFO_HITID_FIELD.cpp_type = 1
|
||||
|
||||
ACTIVITYINFO.name = "ActivityInfo"
|
||||
ACTIVITYINFO.full_name = ".rpc.protocols.ActivityInfo"
|
||||
ACTIVITYINFO.nested_types = {ACTIVITYINFO_MISSIONINFO}
|
||||
ACTIVITYINFO.enum_types = {}
|
||||
ACTIVITYINFO.fields = {ACTIVITYINFO_ACTIVITYID_FIELD, ACTIVITYINFO_MISSION_FIELD, ACTIVITYINFO_ENDTIME_FIELD, ACTIVITYINFO_REALLYOPEN_FIELD, ACTIVITYINFO_STARTTIME_FIELD, ACTIVITYINFO_VALUE_FIELD, ACTIVITYINFO_CHOICEREWARDID_FIELD}
|
||||
ACTIVITYINFO.fields = {ACTIVITYINFO_ACTIVITYID_FIELD, ACTIVITYINFO_MISSION_FIELD, ACTIVITYINFO_ENDTIME_FIELD, ACTIVITYINFO_REALLYOPEN_FIELD, ACTIVITYINFO_STARTTIME_FIELD, ACTIVITYINFO_VALUE_FIELD, ACTIVITYINFO_CHOICEREWARDID_FIELD, ACTIVITYINFO_HITID_FIELD}
|
||||
ACTIVITYINFO.is_extendable = false
|
||||
ACTIVITYINFO.extensions = {}
|
||||
GMRESPONSE_DROP_FIELD.name = "drop"
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -489,6 +489,7 @@ function this.ExecuteLoading()
|
|||
function() NetManager.HardStageRequest(LoadingPanel.OnStep) end,
|
||||
function() NetManager.VipLevelStateRequset(LoadingPanel.OnStep) end,
|
||||
function() NetManager.RequestRedPacketData(LoadingPanel.OnStep) end,
|
||||
function() LingLongBaoJingManager.InitData(LoadingPanel.OnStep) end,
|
||||
--[[[35] =]] function() -- 登录请求最终接口,所有请求放在此接口之前
|
||||
-- 登录成功确认
|
||||
NetManager.LoginConfimRequest()
|
||||
|
|
|
@ -5265,5 +5265,35 @@ function NetManager.ChoiceDrawCardRequest(actID,_type,func)
|
|||
end)
|
||||
end
|
||||
|
||||
function NetManager.QiMenDunJiaHitListRequest(actID,func)
|
||||
local data=ActivityProto_pb.qiMenDunJiaHitListRequest()
|
||||
data.activityId = actID
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.qiMenDunJiaHitListRequest, MessageTypeProto_pb.qiMenDunJiaHitListResponse, msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = ActivityProto_pb.qiMenDunJiaHitListResponse()
|
||||
msg:ParseFromString(data)
|
||||
--PrivilegeManager.GetPrivilegeRemainValue(self.freeTimesId)
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function NetManager.QiMenDunJiaDrawRequest(actID,func)
|
||||
local data=ActivityProto_pb.qiMenDunJiaDrawRequest()
|
||||
data.activityId = actID
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.qiMenDunJiaDrawRequest, MessageTypeProto_pb.qiMenDunJiaDrawResponse, msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = ActivityProto_pb.qiMenDunJiaDrawResponse()
|
||||
msg:ParseFromString(data)
|
||||
--PrivilegeManager.GetPrivilegeRemainValue(self.freeTimesId)
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
return this
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 600f1a9ab76a71344b57cd32f4a55e51
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,78 @@
|
|||
LingLongBaoJingManager = {}
|
||||
local this = LingLongBaoJingManager
|
||||
local hitList = {} --已经抽取了的
|
||||
local rewardList = {}
|
||||
--初始化
|
||||
function this.Initialize()
|
||||
Game.GlobalEvent.AddEvent(GameEvent.Activity.OnActivityOpenOrClose,this.InitData)
|
||||
end
|
||||
|
||||
function this.InitData(func)
|
||||
local id = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.lingLongBaoJing)
|
||||
if not id or id < 1 then
|
||||
hitList = {}
|
||||
rewardList = {}
|
||||
return
|
||||
end
|
||||
this.InitDataList(id)
|
||||
NetManager.QiMenDunJiaHitListRequest(id,function(msg)
|
||||
hitList = msg.hitList
|
||||
this.SetDataListState(hitList)
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function this.InitDataList(id)
|
||||
local configs = ConfigManager.GetAllConfigsDataByKey(ConfigName.LingLongPool,"ActivityId",id)
|
||||
for i = 1 ,#configs do
|
||||
local data = {}
|
||||
data.id = configs[i].Id
|
||||
data.reward = configs[i].ItemId
|
||||
data.rate = configs[i].FakeRate
|
||||
data.typeIndex = configs[i].Position
|
||||
data.address = configs[i].Address
|
||||
data.sort = configs[i].Sort
|
||||
data.state = 0
|
||||
rewardList[configs[i].Id] = data
|
||||
end
|
||||
end
|
||||
|
||||
function this.SetDataListState(list,typeIndex)
|
||||
if list and #list > 0 then
|
||||
for i = 1,#list do
|
||||
rewardList[list[i]].state = 1
|
||||
end
|
||||
else
|
||||
for k,v in pairs(rewardList) do
|
||||
if not typeIndex or (typeIndex == v.typeIndex) then
|
||||
v.state = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function this.IsAllGet()
|
||||
local index = 0
|
||||
for k,v in pairs(rewardList) do
|
||||
if v.state == 0 then
|
||||
index = index + 1
|
||||
end
|
||||
end
|
||||
if index < 1 then
|
||||
this.SetDataListState()
|
||||
end
|
||||
return index < 1
|
||||
end
|
||||
|
||||
function this.QiMenDunJiaDrawRequest(id,func)
|
||||
NetManager.QiMenDunJiaDrawRequest(id,function(msg)
|
||||
this.SetDataListState(msg.idList)
|
||||
if func then
|
||||
func(msg.idList,msg.drop)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
return this
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 088b9d9e4b234f840894e8f2ed2b3809
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,164 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using GameEditor.Core;
|
||||
using GameEditor.GameEditor.PlayerBuilder;
|
||||
using GameLogic;
|
||||
using System.Diagnostics;
|
||||
using ResUpdate;
|
||||
using System.Threading;
|
||||
using Debug = UnityEngine.Debug;
|
||||
using LitJson;
|
||||
|
||||
namespace GameEditor.FrameTool {
|
||||
public class ConfigWindowNew : EditorWindow
|
||||
{
|
||||
static string excelPath; //模板config 路径
|
||||
static string m_ExcelPath; //config 路径
|
||||
Dictionary<string, Object> dic; //模板config字典
|
||||
Dictionary<string, Object> m_dic; //config字典
|
||||
|
||||
// Add menu named "My Window" to the Window menu
|
||||
[MenuItem("Build/ConfigNew")]
|
||||
static void Init()
|
||||
{
|
||||
m_ExcelPath = EditorPrefs.GetString("ConfigWindowNew_m_ExcelPath");
|
||||
excelPath = EditorPrefs.GetString("ConfigWindowNew_ExcelPath");
|
||||
// Get existing open window or if none, make a new one:
|
||||
ConfigWindowNew window = (ConfigWindowNew)EditorWindow.GetWindow(typeof(ConfigWindowNew));
|
||||
window.Show();
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
EditorGUILayout.BeginVertical();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Config模板路径:");
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
excelPath = EditorGUILayout.TextField("", excelPath);
|
||||
if (GUILayout.Button("Browse", GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
excelPath = EditorUtility.OpenFilePanel("Resource path", excelPath, "");
|
||||
EditorPrefs.SetString("IMPORTSPINE_SOURCESFOLDERPATH", excelPath);
|
||||
LoadTempConfigFile(excelPath);
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Config文件路径:");
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
m_ExcelPath = EditorGUILayout.TextField("", m_ExcelPath);
|
||||
if (GUILayout.Button("Browse", GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
m_ExcelPath = EditorUtility.OpenFilePanel("Resource path", m_ExcelPath,"");
|
||||
EditorPrefs.SetString("IMPORTSPINE_SOURCESFOLDERPATH", m_ExcelPath);
|
||||
LoadConfigFile(m_ExcelPath);
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
if (m_dic != null)
|
||||
{
|
||||
InitGuiLayout(m_dic);
|
||||
}
|
||||
else if(dic != null)
|
||||
{
|
||||
InitGuiLayout(dic);
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
|
||||
void InitGuiLayout(Dictionary<string, Object> localDic)
|
||||
{
|
||||
EditorGUILayout.BeginVertical();
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("新建"))
|
||||
{
|
||||
Debug.Log("新建");
|
||||
}
|
||||
|
||||
if (GUILayout.Button("保存"))
|
||||
{
|
||||
Debug.Log("保存");
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
|
||||
void LoadTempConfigFile(string path)
|
||||
{
|
||||
dic = new Dictionary<string, Object>();
|
||||
StreamReader sr = File.OpenText(path);
|
||||
if (sr != null)
|
||||
{
|
||||
string strinfo = sr.ReadToEnd();
|
||||
Debug.Log(strinfo);
|
||||
ReadJson(strinfo);
|
||||
}
|
||||
}
|
||||
|
||||
static void ReadJson(string strinfo)
|
||||
{
|
||||
var data = JsonMapper.ToObject<Hashtable>(strinfo);
|
||||
foreach (DictionaryEntry de in data)
|
||||
{
|
||||
Debug.Log(string.Format("{0}-{1}", de.Key, de.Value));
|
||||
if (de.Value as string != null)
|
||||
{
|
||||
Debug.Log(string.Format("de.Value{0}", (de.Value as string)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void LoadConfigFile(string m_ExcelPath)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static string shellPath;
|
||||
public static void OpenDirectory(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path)) return;
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
UnityEngine.Debug.LogError("No Directory: " + path);
|
||||
return;
|
||||
}
|
||||
|
||||
//Application.dataPath 只能在主线程中获取
|
||||
int lastIndex = Application.dataPath.LastIndexOf("/");
|
||||
shellPath = Application.dataPath.Substring(0, lastIndex) + "/Shell/";
|
||||
|
||||
// 新开线程防止锁死
|
||||
Thread newThread = new Thread(new ParameterizedThreadStart(CmdOpenDirectory));
|
||||
newThread.Start(path);
|
||||
}
|
||||
private static void CmdOpenDirectory(object obj)
|
||||
{
|
||||
Process p = new Process();
|
||||
#if UNITY_EDITOR_WIN
|
||||
p.StartInfo.FileName = "cmd.exe";
|
||||
p.StartInfo.Arguments = "/c start " + obj.ToString();
|
||||
#elif UNITY_EDITOR_OSX
|
||||
p.StartInfo.FileName = "bash";
|
||||
string shPath = shellPath + "openDir.sh";
|
||||
p.StartInfo.Arguments = shPath + " " + obj.ToString();
|
||||
#endif
|
||||
//UnityEngine.Debug.Log(p.StartInfo.Arguments);
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardInput = true;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
p.StartInfo.RedirectStandardError = true;
|
||||
p.StartInfo.CreateNoWindow = true;
|
||||
p.Start();
|
||||
|
||||
p.WaitForExit();
|
||||
p.Close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c5a300f37d187ef47a2716d103575b1b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue