CSUI:大地图显示
This commit is contained in:
parent
3cc1908a98
commit
026a9ad995
File diff suppressed because it is too large
Load Diff
@ -126,6 +126,17 @@ function _G_PartnerData_DataSortPartnerData()
|
||||
local json = ManagerContainer.DataMgr.PartnerData:SortPartnerDataJson()
|
||||
return json
|
||||
end
|
||||
function _G_BigMapData_GetSelfRankInfo_Json()
|
||||
local rank, rankPercent = ManagerContainer.DataMgr.BigMapData:GetSelfRankInfo()
|
||||
local rankInfo = {}
|
||||
if rank == nil then
|
||||
rankInfo.rank = 0
|
||||
end
|
||||
if rankPercent == nil then
|
||||
rankInfo.rankPercent = 0
|
||||
end
|
||||
return JSON:encode(rankInfo)
|
||||
end
|
||||
function _G_LuaUIMgr_ShowMinTips(contentKey)
|
||||
LogError(contentKey)
|
||||
ManagerContainer.LuaUIMgr:ShowMinTips(contentKey)
|
||||
@ -153,6 +164,12 @@ function _G_LuaBattleMgr_rewardItemList_JSON()
|
||||
local rewardList = ManagerContainer.LuaBattleMgr.rewardItemList
|
||||
return JSON:encode(rewardList)
|
||||
end
|
||||
function _G_UIStoryMgr_MapStartStoryByStoryId(storyId)
|
||||
ManagerContainer.UIStoryMgr.MapStartStoryByStoryId(storyId)
|
||||
end
|
||||
function _G_StoryMgr_StartStorySection(storySection, pos)
|
||||
return ManagerContainer.StoryMgr:StartStorySection(storySection, pos)
|
||||
end
|
||||
-------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
@ -862,7 +862,7 @@ function UIBattleView:BattleLoadingCompeleted()
|
||||
end
|
||||
|
||||
function UIBattleView:OnClickMiniMap()
|
||||
ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIBigMap, {id = ManagerContainer.LuaBattleMgr:GetCurMapId()})
|
||||
ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIBigMap, JSON:encode({id = ManagerContainer.LuaBattleMgr:GetCurMapId()}))
|
||||
end
|
||||
|
||||
function UIBattleView:OnBossDead()
|
||||
|
||||
@ -516,6 +516,8 @@ function BigMapView:_PreloadedAssets()
|
||||
end
|
||||
local smallStartIdx = 1
|
||||
local smallEndIdx = levelDataNum
|
||||
|
||||
-- Part1
|
||||
for i = 1, levelDataNum do
|
||||
local pointPos = levelPoss[i]
|
||||
if not showRect or showRect:Contains(pointPos) then
|
||||
@ -590,6 +592,7 @@ function BigMapView:_PreloadedAssets()
|
||||
end
|
||||
end
|
||||
|
||||
-- Part2
|
||||
if enterType ~= Enum.BigMapEnterType.DropPoint then
|
||||
if smallStartIdx < smallEndIdx and smallEndIdx <= levelDataNum then
|
||||
for i = smallStartIdx, smallEndIdx do
|
||||
@ -620,6 +623,7 @@ function BigMapView:_PreloadedAssets()
|
||||
end
|
||||
end
|
||||
|
||||
-- Part3
|
||||
if enterType == Enum.BigMapEnterType.DropPoint then
|
||||
if not self.executeSequenceData:HasDelayMethod() then
|
||||
self.executeSequenceData:AppendInterval(1)
|
||||
|
||||
@ -7,6 +7,7 @@ end
|
||||
|
||||
--@param data table {id = integer, enterType = Enum.BigMapEnterType} 当前地图id
|
||||
function UIBigMapCtr:SetData(data)
|
||||
PrintJson("TAG", data)
|
||||
self.asyncIdx = 0
|
||||
self.data = data
|
||||
self:InitData()
|
||||
|
||||
45
Assets/Src/GameLogic/FrameTimer.cs
Normal file
45
Assets/Src/GameLogic/FrameTimer.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
|
||||
public class FrameTimer
|
||||
{
|
||||
private Action onUpdate;
|
||||
private bool isStart = false;
|
||||
private int du = 0;
|
||||
private int loop = 0;
|
||||
private int frameCount = 0;
|
||||
private int loopCount = 0;
|
||||
|
||||
public FrameTimer(Action onUpdate, int du = 1, int loop = 1)
|
||||
{
|
||||
this.onUpdate = onUpdate;
|
||||
this.du = du;
|
||||
this.loop = loop;
|
||||
GameMgr.Instance.AddFrameTimer(this);
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
frameCount = 0;
|
||||
loopCount = this.loop;
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
GameMgr.Instance.RemoveFrameTimer(this);
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (loopCount == 0) return;
|
||||
frameCount++;
|
||||
if (frameCount >= this.du)
|
||||
{
|
||||
this.onUpdate.Invoke();
|
||||
frameCount = 0;
|
||||
if (loopCount != -1)
|
||||
{
|
||||
loopCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Src/GameLogic/FrameTimer.cs.meta
Normal file
3
Assets/Src/GameLogic/FrameTimer.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 94f87152169640b195313d05bb3e2589
|
||||
timeCreated: 1743732796
|
||||
38
Assets/Src/GameLogic/FrameTimer1.cs
Normal file
38
Assets/Src/GameLogic/FrameTimer1.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class FrameTimer1 : SingletonMono<FrameTimer1>
|
||||
{
|
||||
private Dictionary<int, Action> _frameTimers = new();
|
||||
private int _timerCount = 0;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public int StartTimer(Action callback)
|
||||
{
|
||||
_timerCount++;
|
||||
_frameTimers[_timerCount] = callback;
|
||||
return _timerCount;
|
||||
}
|
||||
|
||||
public void StopTimer(int timerId)
|
||||
{
|
||||
_frameTimers.Remove(timerId);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
foreach (var kv in _frameTimers)
|
||||
{
|
||||
kv.Value.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Src/GameLogic/FrameTimer1.cs.meta
Normal file
3
Assets/Src/GameLogic/FrameTimer1.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf5cf6ef921d40eb9a47e601079e5ba3
|
||||
timeCreated: 1743732190
|
||||
@ -10,6 +10,8 @@ using UnityEngine.Networking;
|
||||
|
||||
public class GameMgr : SingletonMono<GameMgr>
|
||||
{
|
||||
private List<FrameTimer> _frameTimers = new();
|
||||
|
||||
public const string VersionUpdateState = "VersionUpdateState";
|
||||
public const string LoginState = "LoginState";
|
||||
public const string LoadingState = "LoadingState";
|
||||
@ -220,7 +222,17 @@ public class GameMgr : SingletonMono<GameMgr>
|
||||
|
||||
bInited = true;
|
||||
}
|
||||
|
||||
public void AddFrameTimer(FrameTimer frameTimer)
|
||||
{
|
||||
_frameTimers.Add(frameTimer);
|
||||
}
|
||||
|
||||
public void RemoveFrameTimer(FrameTimer frameTimer)
|
||||
{
|
||||
_frameTimers.Remove(frameTimer);
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class WXCode2SessionData
|
||||
{
|
||||
@ -436,6 +448,11 @@ public class GameMgr : SingletonMono<GameMgr>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < _frameTimers.Count; i++)
|
||||
{
|
||||
_frameTimers[i].Update();
|
||||
}
|
||||
}
|
||||
|
||||
// private void OnGUI() {
|
||||
|
||||
245
Assets/Src/UI/CsUIPage/Core/ExecuteSequenceData.cs
Normal file
245
Assets/Src/UI/CsUIPage/Core/ExecuteSequenceData.cs
Normal file
@ -0,0 +1,245 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CSUI
|
||||
{
|
||||
public class ExecuteSequenceData
|
||||
{
|
||||
private bool? isExecuting;
|
||||
private List<SequenceData> datas = new List<SequenceData>();
|
||||
private FrameTimer timer;
|
||||
|
||||
public ExecuteSequenceData()
|
||||
{
|
||||
isExecuting = null;
|
||||
datas = new List<SequenceData>();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
isExecuting = null;
|
||||
datas = null;
|
||||
StopTimer();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Dispose();
|
||||
datas = new List<SequenceData>();
|
||||
}
|
||||
|
||||
public void ClearDatas()
|
||||
{
|
||||
datas = new List<SequenceData>();
|
||||
StopTimer();
|
||||
}
|
||||
|
||||
// 核心数据结构
|
||||
public enum ExecuteSequenceType
|
||||
{
|
||||
Func,
|
||||
FuncAfterListener,
|
||||
Listener,
|
||||
UIViewFunc,
|
||||
UIViewFuncAfterListener,
|
||||
Interval
|
||||
}
|
||||
public class SequenceData
|
||||
{
|
||||
public ExecuteSequenceType type;
|
||||
public bool forceAfterErr;
|
||||
public object owner;
|
||||
public Action<object> ownerFunc; // 可以是委托或方法名
|
||||
public object[] args;
|
||||
public int id;
|
||||
public string eventName;
|
||||
public string funcName;
|
||||
public float duration;
|
||||
public bool isFrame;
|
||||
}
|
||||
|
||||
// 添加执行函数
|
||||
public void AppendFunc(bool forceAfterErr, object owner, Action<object> ownerFunc, params object[] args)
|
||||
{
|
||||
if (ownerFunc == null) return;
|
||||
var data = new SequenceData
|
||||
{
|
||||
type = ExecuteSequenceType.Func,
|
||||
forceAfterErr = forceAfterErr,
|
||||
owner = owner,
|
||||
ownerFunc = ownerFunc,
|
||||
args = args
|
||||
};
|
||||
AppendData(data);
|
||||
}
|
||||
|
||||
public void InsertNextFunc(bool forceAfterErr, object owner, Action<object> ownerFunc, params object[] args)
|
||||
{
|
||||
if (ownerFunc == null) return;
|
||||
var data = new SequenceData
|
||||
{
|
||||
type = ExecuteSequenceType.Func,
|
||||
forceAfterErr = forceAfterErr,
|
||||
owner = owner,
|
||||
ownerFunc = ownerFunc,
|
||||
args = args
|
||||
};
|
||||
InsertDataNext(data);
|
||||
}
|
||||
|
||||
public int FindFunc(bool forceAfterErr, object owner, Delegate ownerFunc, params object[] args)
|
||||
{
|
||||
if (ownerFunc == null || datas == null) return 0;
|
||||
|
||||
for (int i = 0; i < datas.Count; i++)
|
||||
{
|
||||
var data = datas[i];
|
||||
if (data.type == ExecuteSequenceType.Func &&
|
||||
data.forceAfterErr == forceAfterErr &&
|
||||
data.owner == owner &&
|
||||
data.ownerFunc.Equals(ownerFunc))
|
||||
{
|
||||
if (CheckArgsSame(data.args, args))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 添加UI消息监听
|
||||
public void AppendUIListener(int id, string eventName, float? timeOut = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(eventName)) return;
|
||||
|
||||
var data = new SequenceData
|
||||
{
|
||||
type = ExecuteSequenceType.Listener,
|
||||
id = id,
|
||||
eventName = eventName,
|
||||
duration = timeOut ?? 0
|
||||
};
|
||||
AppendData(data);
|
||||
}
|
||||
|
||||
// 添加延迟
|
||||
public void AppendInterval(float duration)
|
||||
{
|
||||
if (duration <= 0) return;
|
||||
|
||||
var data = new SequenceData
|
||||
{
|
||||
type = ExecuteSequenceType.Interval,
|
||||
duration = duration,
|
||||
isFrame = false
|
||||
};
|
||||
AppendData(data);
|
||||
}
|
||||
|
||||
// 添加帧延迟
|
||||
public void AppendFrameInterval(int frameCount)
|
||||
{
|
||||
if (frameCount <= 0) return;
|
||||
|
||||
var data = new SequenceData
|
||||
{
|
||||
type = ExecuteSequenceType.Interval,
|
||||
duration = frameCount,
|
||||
isFrame = true
|
||||
};
|
||||
AppendData(data);
|
||||
}
|
||||
|
||||
public bool HasDelayMethod()
|
||||
{
|
||||
if (datas == null) return false;
|
||||
|
||||
foreach (var data in datas)
|
||||
{
|
||||
if (data.type == ExecuteSequenceType.Interval ||
|
||||
data.type == ExecuteSequenceType.Listener)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 数据操作
|
||||
private void AppendData(SequenceData data)
|
||||
{
|
||||
datas.Add(data);
|
||||
}
|
||||
|
||||
private void InsertDataNext(SequenceData data)
|
||||
{
|
||||
datas.Insert(0, data);
|
||||
}
|
||||
|
||||
private bool CheckArgsSame(object[] args1, object[] args2)
|
||||
{
|
||||
if (args1 == null || args2 == null) return args1 == args2;
|
||||
if (args1.Length != args2.Length) return false;
|
||||
|
||||
for (int i = 0; i < args1.Length; i++)
|
||||
{
|
||||
if (!Equals(args1[i], args2[i]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// 获取当前执行数据
|
||||
public SequenceData GetCurExecuteData()
|
||||
{
|
||||
return datas.Count > 0 ? datas[0] : null;
|
||||
}
|
||||
|
||||
public void RemoveCurExecuteData()
|
||||
{
|
||||
if (datas.Count > 0)
|
||||
{
|
||||
datas.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
|
||||
// 计时器控制
|
||||
public void StartTimer(Action func, SequenceData data)
|
||||
{
|
||||
StopTimer();
|
||||
|
||||
if (data.isFrame)
|
||||
{
|
||||
timer = new FrameTimer(func, (int)data.duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
timer = new FrameTimer(func, (int)data.duration, 1);
|
||||
}
|
||||
timer.Start();
|
||||
}
|
||||
|
||||
public void StopTimer()
|
||||
{
|
||||
timer.Stop();
|
||||
timer = null;
|
||||
}
|
||||
|
||||
public void InsertNextUIListener(int pageId, string eventName, float timeout = 0)
|
||||
{
|
||||
var data = new SequenceData
|
||||
{
|
||||
type = ExecuteSequenceType.Listener,
|
||||
id = pageId,
|
||||
eventName = eventName,
|
||||
duration = timeout
|
||||
};
|
||||
|
||||
InsertDataNext(data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
3
Assets/Src/UI/CsUIPage/Core/ExecuteSequenceData.cs.meta
Normal file
3
Assets/Src/UI/CsUIPage/Core/ExecuteSequenceData.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2c3d153c2e2412ea647b6e1225b9bd7
|
||||
timeCreated: 1743775918
|
||||
22
Assets/Src/UI/CsUIPage/Core/MultiTypeAssetLoadSystem.cs
Normal file
22
Assets/Src/UI/CsUIPage/Core/MultiTypeAssetLoadSystem.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
|
||||
namespace CSUI
|
||||
{
|
||||
public class MultiTypeAssetLoadSystem
|
||||
{
|
||||
public void SetCompleteCB(object owner, Action onComplete, Action<float> onProgress)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void AddLoadAsset(int resourceType, string assetPath, string assetName)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8acf196e332c4046a553646dd55dc9a2
|
||||
timeCreated: 1743771695
|
||||
33
Assets/Src/UI/CsUIPage/Data/BigMapData.cs
Normal file
33
Assets/Src/UI/CsUIPage/Data/BigMapData.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using LuaInterface;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CSUI
|
||||
{
|
||||
public class BigMapData
|
||||
{
|
||||
public class SelfRankInfo
|
||||
{
|
||||
[JsonProperty("rank")]
|
||||
public int rank { get; set; }
|
||||
[JsonProperty("rankPercent")]
|
||||
public int rankPercent { get; set; }
|
||||
}
|
||||
private LuaFunction _G_BigMapData_GetSelfRankInfo_Json;
|
||||
|
||||
public void SendGetData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SelfRankInfo GetSelfRankInfo()
|
||||
{
|
||||
if (_G_BigMapData_GetSelfRankInfo_Json == null)
|
||||
{
|
||||
_G_BigMapData_GetSelfRankInfo_Json = LuaMgr.Instance.luaState.GetFunction("_G_BigMapData_GetSelfRankInfo_Json");
|
||||
}
|
||||
var jsonstr = _G_BigMapData_GetSelfRankInfo_Json.Invoke<string>();
|
||||
var rankInfo = JsonConvert.DeserializeObject<SelfRankInfo>(jsonstr);
|
||||
return rankInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Src/UI/CsUIPage/Data/BigMapData.cs.meta
Normal file
3
Assets/Src/UI/CsUIPage/Data/BigMapData.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b31e095b4274538a29d73deda0aec7b
|
||||
timeCreated: 1743765653
|
||||
10
Assets/Src/UI/CsUIPage/Data/UserData.cs
Normal file
10
Assets/Src/UI/CsUIPage/Data/UserData.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace CSUI
|
||||
{
|
||||
public class UserData
|
||||
{
|
||||
public string GetUserHeadIcon()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Src/UI/CsUIPage/Data/UserData.cs.meta
Normal file
3
Assets/Src/UI/CsUIPage/Data/UserData.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34b077ce46f14e1f88e4d5cfe7fb1629
|
||||
timeCreated: 1743823114
|
||||
@ -178,6 +178,153 @@ namespace CSUI
|
||||
public int ZenyOl { get; set; }
|
||||
}
|
||||
|
||||
public class CfgMapData
|
||||
{
|
||||
[JsonProperty("AreaPic")]
|
||||
public string AreaPic { get; set; }
|
||||
|
||||
[JsonProperty("AreaStartPos")]
|
||||
public List<int> AreaStartPos { get; set; }
|
||||
|
||||
[JsonProperty("BattleMusic")]
|
||||
public string BattleMusic { get; set; }
|
||||
|
||||
[JsonProperty("BgmMusic")]
|
||||
public string BgmMusic { get; set; }
|
||||
|
||||
[JsonProperty("BossBattleMusic")]
|
||||
public string BossBattleMusic { get; set; }
|
||||
|
||||
[JsonProperty("Center")]
|
||||
public List<int> Center { get; set; }
|
||||
|
||||
[JsonProperty("Description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[JsonProperty("Id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonProperty("LevelName")]
|
||||
public string LevelName { get; set; }
|
||||
|
||||
[JsonProperty("MinimapIcon")]
|
||||
public string MinimapIcon { get; set; }
|
||||
|
||||
[JsonProperty("MinimapScale")]
|
||||
public int MinimapScale { get; set; }
|
||||
|
||||
[JsonProperty("MinimapSizeX")]
|
||||
public int MinimapSizeX { get; set; }
|
||||
|
||||
[JsonProperty("MinimapSizeZ")]
|
||||
public int MinimapSizeZ { get; set; }
|
||||
|
||||
[JsonProperty("Name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("PicSize")]
|
||||
public List<int> PicSize { get; set; }
|
||||
|
||||
[JsonProperty("RealSizeX")]
|
||||
public int RealSizeX { get; set; }
|
||||
|
||||
[JsonProperty("RealSizeZ")]
|
||||
public int RealSizeZ { get; set; }
|
||||
|
||||
[JsonProperty("ScrollSize")]
|
||||
public List<int> ScrollSize { get; set; }
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class CfgStorySectionData
|
||||
{
|
||||
[JsonProperty("Id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonProperty("Type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
[JsonProperty("Content")]
|
||||
public ContentData Content { get; set; }
|
||||
|
||||
[JsonProperty("ArtType")]
|
||||
public int ArtType { get; set; }
|
||||
|
||||
[JsonProperty("ArtRes")]
|
||||
public string ArtRes { get; set; }
|
||||
|
||||
[JsonProperty("StartDropPos")]
|
||||
public Vector2 StartDropPos { get; set; }
|
||||
|
||||
[JsonProperty("StartDropMoveTime")]
|
||||
public float StartDropMoveTime { get; set; }
|
||||
|
||||
[JsonProperty("StartDropDlgId")]
|
||||
public int StartDropDlgId { get; set; }
|
||||
|
||||
[JsonProperty("EndDropDlgId")]
|
||||
public int EndDropDlgId { get; set; }
|
||||
|
||||
[JsonProperty("ClickDlgId")]
|
||||
public int ClickDlgId { get; set; }
|
||||
|
||||
[JsonProperty("TriggerDlgId")]
|
||||
public int TriggerDlgId { get; set; }
|
||||
|
||||
[JsonProperty("CanSkip")]
|
||||
public bool CanSkip { get; set; }
|
||||
|
||||
[JsonProperty("ForceGuideId")]
|
||||
public int ForceGuideId { get; set; }
|
||||
|
||||
// 嵌套内容数据结构
|
||||
[System.Serializable]
|
||||
public class ContentData
|
||||
{
|
||||
[JsonProperty("0")] // 第一个元素
|
||||
public int[] FirstPart { get; set; } = new int[2]; // {517, 2}
|
||||
|
||||
[JsonProperty("1")] // 第二个元素
|
||||
public string Message { get; set; } // "Congratulation"
|
||||
|
||||
[JsonProperty("2")] // 第三个元素
|
||||
public string ItemId { get; set; } // "Item507"
|
||||
|
||||
// 自定义反序列化逻辑
|
||||
public static ContentData FromJson(Newtonsoft.Json.Linq.JToken token)
|
||||
{
|
||||
if (token is Newtonsoft.Json.Linq.JArray array)
|
||||
{
|
||||
return new ContentData
|
||||
{
|
||||
FirstPart = array[0].ToObject<int[]>(),
|
||||
Message = array[1].ToString(),
|
||||
ItemId = array[2].ToString()
|
||||
};
|
||||
}
|
||||
return token.ToObject<ContentData>();
|
||||
}
|
||||
}
|
||||
|
||||
// 自定义JsonConverter处理Vector2
|
||||
public class Vector2Converter : JsonConverter<Vector2>
|
||||
{
|
||||
public override Vector2 ReadJson(JsonReader reader, System.Type objectType, Vector2 existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
var array = serializer.Deserialize<float[]>(reader);
|
||||
return new Vector2(array[0], array[1]);
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, Vector2 value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteStartArray();
|
||||
writer.WriteValue(value.x);
|
||||
writer.WriteValue(value.y);
|
||||
writer.WriteEndArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CfgMgr
|
||||
{
|
||||
LuaFunction _G_GetCfg_LuaFunction = null;
|
||||
@ -186,6 +333,10 @@ namespace CSUI
|
||||
public CfgMgr()
|
||||
{
|
||||
Debug.LogError("TAG: ---CfgMgr Create---");
|
||||
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
|
||||
{
|
||||
Converters = new List<JsonConverter> { new CfgStorySectionData.Vector2Converter() }
|
||||
};
|
||||
}
|
||||
public CfgUIData GetUIData(int id)
|
||||
{
|
||||
@ -239,6 +390,34 @@ namespace CSUI
|
||||
var data = JsonConvert.DeserializeObject<CfgLevelData>(json);
|
||||
return data;
|
||||
}
|
||||
|
||||
public CfgLevelData GetLevelDataByMapAndLevel(int mapId, int levelId)
|
||||
{
|
||||
var id = mapId * 10000 + levelId;
|
||||
return GetLevelDataById(id);
|
||||
}
|
||||
|
||||
public CfgMapData GetMapData(int id)
|
||||
{
|
||||
if (_G_GetCfgJson_LuaFunction == null)
|
||||
{
|
||||
_G_GetCfgJson_LuaFunction = LuaMgr.Instance.luaState.GetFunction("_G_GetCfgJson");
|
||||
}
|
||||
var json = _G_GetCfgJson_LuaFunction.Invoke<string, int, string>("MapCfg", id);
|
||||
var data = JsonConvert.DeserializeObject<CfgMapData>(json);
|
||||
return data;
|
||||
}
|
||||
|
||||
public CfgStorySectionData GetStorySectionById(int id)
|
||||
{
|
||||
if (_G_GetCfgJson_LuaFunction == null)
|
||||
{
|
||||
_G_GetCfgJson_LuaFunction = LuaMgr.Instance.luaState.GetFunction("_G_GetCfgJson");
|
||||
}
|
||||
var json = _G_GetCfgJson_LuaFunction.Invoke<string, int, string>("StorySectionCfg", id);
|
||||
var data = JsonConvert.DeserializeObject<CfgStorySectionData>(json);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9,10 +9,14 @@ namespace CSUI
|
||||
public class DataMgr
|
||||
{
|
||||
public PartnerData PartnerData;
|
||||
public BigMapData BigMapData;
|
||||
public UserData UserData;
|
||||
|
||||
public DataMgr()
|
||||
{
|
||||
PartnerData = new PartnerData();
|
||||
BigMapData = new BigMapData();
|
||||
UserData = new UserData();
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Assets/Src/UI/CsUIPage/Managers/ExecuteSequenceMgr.cs
Normal file
15
Assets/Src/UI/CsUIPage/Managers/ExecuteSequenceMgr.cs
Normal file
@ -0,0 +1,15 @@
|
||||
namespace CSUI
|
||||
{
|
||||
public class ExecuteSequenceMgr
|
||||
{
|
||||
public void Execute(ExecuteSequenceData data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Exit(ExecuteSequenceData data)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c3c918049964fb39be5a21d64985d48
|
||||
timeCreated: 1743822182
|
||||
@ -42,6 +42,7 @@ namespace CSUI
|
||||
public LuaUIMgr()
|
||||
{
|
||||
_uiCtrDict[UIPageName.UIMain] = new UIMainCtr();
|
||||
_uiCtrDict[UIPageName.UIBattle] = new UIBattleCtr();
|
||||
}
|
||||
|
||||
public UIViewBase CreateUIView(int pageID)
|
||||
@ -50,8 +51,11 @@ namespace CSUI
|
||||
switch (pageID)
|
||||
{
|
||||
case UIPageName.UIBattleWin:
|
||||
view = new UIBattleWinView();
|
||||
break;
|
||||
view = new UIBattleWinView();
|
||||
break;
|
||||
case UIPageName.UIBigMap:
|
||||
view = new UIBigMapView();
|
||||
break;
|
||||
}
|
||||
return view;
|
||||
}
|
||||
@ -83,6 +87,16 @@ namespace CSUI
|
||||
_G_OpenUI_LuaFunction.Call(ui, data);
|
||||
}
|
||||
|
||||
public void ClosePage(int ui, bool v)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Hide(int ui)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void POPGotAnimNotice(GotAnimNotice_Data data)
|
||||
{
|
||||
var uiData = ManagerContainer.CfgMgr.GetUIData(UIPageName.UIPOPGotAnims);
|
||||
|
||||
@ -15,6 +15,9 @@ namespace CSUI
|
||||
public static DataMgr DataMgr;
|
||||
public static LuaBattleMgr LuaBattleMgr;
|
||||
public static UIFuncUnlockMgr UIFuncUnlockMgr;
|
||||
public static UIStoryMgr UIStoryMgr;
|
||||
public static ExecuteSequenceMgr ExecuteSequenceMgr;
|
||||
public static StoryMgr StoryMgr;
|
||||
|
||||
[NoToLua]
|
||||
public static void Init()
|
||||
@ -26,6 +29,9 @@ namespace CSUI
|
||||
LuaUIMgr = new LuaUIMgr();
|
||||
DataMgr = new DataMgr();
|
||||
LuaBattleMgr = new LuaBattleMgr();
|
||||
UIStoryMgr = new UIStoryMgr();
|
||||
ExecuteSequenceMgr = new ExecuteSequenceMgr();
|
||||
StoryMgr = new StoryMgr();
|
||||
}
|
||||
|
||||
[NoToLua]
|
||||
|
||||
20
Assets/Src/UI/CsUIPage/Managers/StoryMgr.cs
Normal file
20
Assets/Src/UI/CsUIPage/Managers/StoryMgr.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using LuaInterface;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CSUI
|
||||
{
|
||||
public class StoryMgr
|
||||
{
|
||||
private LuaFunction _G_StoryMgr_StartStorySection;
|
||||
|
||||
public bool StartStorySection(int storySection, Vector2 pos)
|
||||
{
|
||||
if (_G_StoryMgr_StartStorySection == null)
|
||||
{
|
||||
_G_StoryMgr_StartStorySection = LuaMgr.Instance.luaState.GetFunction("_G_StoryMgr_StartStorySection");
|
||||
}
|
||||
|
||||
return _G_StoryMgr_StartStorySection.Invoke<int, Vector2, bool>(storySection, pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Src/UI/CsUIPage/Managers/StoryMgr.cs.meta
Normal file
3
Assets/Src/UI/CsUIPage/Managers/StoryMgr.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e92b0d8a41fe44c7a219977d866936cc
|
||||
timeCreated: 1743850096
|
||||
20
Assets/Src/UI/CsUIPage/Managers/UIStoryMgr.cs
Normal file
20
Assets/Src/UI/CsUIPage/Managers/UIStoryMgr.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using LuaInterface;
|
||||
|
||||
namespace CSUI
|
||||
{
|
||||
public class UIStoryMgr
|
||||
{
|
||||
private LuaFunction _G_UIStoryMgr_MapStartStoryByStoryId;
|
||||
|
||||
public void MapStartStoryByStoryId(object param)
|
||||
{
|
||||
var storyId = Convert.ToInt32(param);
|
||||
if (_G_UIStoryMgr_MapStartStoryByStoryId == null)
|
||||
{
|
||||
_G_UIStoryMgr_MapStartStoryByStoryId = LuaMgr.Instance.luaState.GetFunction("_G_UIStoryMgr_MapStartStoryByStoryId");
|
||||
}
|
||||
_G_UIStoryMgr_MapStartStoryByStoryId.Call(storyId);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Src/UI/CsUIPage/Managers/UIStoryMgr.cs.meta
Normal file
3
Assets/Src/UI/CsUIPage/Managers/UIStoryMgr.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b94a022fd5f444b38e6cd61cf5bdf5c8
|
||||
timeCreated: 1743775685
|
||||
200
Assets/Src/UI/CsUIPage/UI/Generate/UIBigMapView_Generate.cs
Normal file
200
Assets/Src/UI/CsUIPage/UI/Generate/UIBigMapView_Generate.cs
Normal file
@ -0,0 +1,200 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
namespace CSUI
|
||||
{
|
||||
public partial class UIBigMapView : UIViewBase
|
||||
{
|
||||
protected Transform _UIAnimator;
|
||||
protected UnityEngine.Animator _UIAnimator_Animator;
|
||||
protected Transform _AnyBtn;
|
||||
protected UnityEngine.UI.Button _AnyBtn_Button;
|
||||
protected UnityEngine.UI.Image _AnyBtn_Image;
|
||||
protected Transform _Window;
|
||||
protected Transform _BigMap;
|
||||
protected UnityEngine.UI.Image _BigMap_Image;
|
||||
protected Transform _Content;
|
||||
protected Transform _BottomImage;
|
||||
protected UnityEngine.UI.Image _BottomImage_Image;
|
||||
protected Transform _LinePath;
|
||||
protected Transform _SmallPoints;
|
||||
protected Transform _BigPoints;
|
||||
protected Transform _StartPoint;
|
||||
protected Transform _StoryPoints;
|
||||
protected Transform _OneRank;
|
||||
protected UnityEngine.Animator _OneRank_Animator;
|
||||
protected Transform _SelfContainer;
|
||||
protected Transform _NameTxt;
|
||||
protected UnityEngine.UI.Text _NameTxt_Text;
|
||||
protected Transform _BtnBack;
|
||||
protected UnityEngine.Animator _BtnBack_Animator;
|
||||
protected UnityEngine.UI.Button _BtnBack_Button;
|
||||
protected Transform _BtnBigMap;
|
||||
protected UnityEngine.Animator _BtnBigMap_Animator;
|
||||
protected UnityEngine.UI.Button _BtnBigMap_Button;
|
||||
protected Transform _AwardTips;
|
||||
protected UnityEngine.Animator _AwardTips_Animator;
|
||||
protected Transform _Des;
|
||||
protected UnityEngine.UI.Text _Des_Text;
|
||||
protected Transform _IconItem;
|
||||
protected UnityEngine.UI.LayoutElement _IconItem_LayoutElement;
|
||||
protected Transform _shadow;
|
||||
protected UnityEngine.UI.Button _shadow_Button;
|
||||
protected UnityEngine.UI.Image _shadow_Image;
|
||||
protected Transform _bg;
|
||||
protected UnityEngine.UI.Button _bg_Button;
|
||||
protected UnityEngine.UI.Image _bg_Image;
|
||||
protected Transform _Icon;
|
||||
protected UnityEngine.UI.Image _Icon_Image;
|
||||
protected UIEventTriggerListener _Icon_UIEventTriggerListener;
|
||||
protected Transform _Frame;
|
||||
protected UnityEngine.UI.Image _Frame_Image;
|
||||
protected Transform _FrameLead;
|
||||
protected UnityEngine.UI.Image _FrameLead_Image;
|
||||
protected Transform _Level;
|
||||
protected UnityEngine.UI.Image _Level_Image;
|
||||
protected Transform _Job;
|
||||
protected UnityEngine.UI.Image _Job_Image;
|
||||
protected Transform _Limited;
|
||||
protected UnityEngine.UI.Image _Limited_Image;
|
||||
protected Transform _SexLabel;
|
||||
protected UnityEngine.UI.Image _SexLabel_Image;
|
||||
protected Transform _CardLabel;
|
||||
protected UnityEngine.UI.Image _CardLabel_Image;
|
||||
protected Transform _Piece;
|
||||
protected UnityEngine.UI.Image _Piece_Image;
|
||||
protected Transform _Num;
|
||||
protected TMPro.TextMeshProUGUI _Num_TextMeshProUGUI;
|
||||
protected Transform _RefineLv;
|
||||
protected TMPro.TextMeshProUGUI _RefineLv_TextMeshProUGUI;
|
||||
protected Transform _QualityFX;
|
||||
protected Transform _Conertips;
|
||||
protected Transform _Text;
|
||||
protected TMPro.TextMeshProUGUI _Text_TextMeshProUGUI;
|
||||
protected Transform _RepeatSign;
|
||||
protected Transform _Advence;
|
||||
protected UnityEngine.UI.Image _Advence_Image;
|
||||
protected Transform _AdvenceLv;
|
||||
protected TMPro.TextMeshProUGUI _AdvenceLv_TextMeshProUGUI;
|
||||
protected Transform _Vip;
|
||||
protected Transform _label;
|
||||
protected UnityEngine.UI.Image _label_Image;
|
||||
protected Transform _RedPoint;
|
||||
protected Transform _ArtifactStar;
|
||||
protected Transform _Star1;
|
||||
protected UnityEngine.UI.Image _Star1_Image;
|
||||
protected Transform _Star;
|
||||
protected UnityEngine.UI.Image _Star_Image;
|
||||
protected Transform _Star2;
|
||||
protected UnityEngine.UI.Image _Star2_Image;
|
||||
protected Transform _Star3;
|
||||
protected UnityEngine.UI.Image _Star3_Image;
|
||||
protected Transform _Star4;
|
||||
protected UnityEngine.UI.Image _Star4_Image;
|
||||
protected Transform _Star5;
|
||||
protected UnityEngine.UI.Image _Star5_Image;
|
||||
protected Transform _ArtifactLv;
|
||||
protected TMPro.TextMeshProUGUI _ArtifactLv_TextMeshProUGUI;
|
||||
protected Transform _Selected;
|
||||
protected Transform _Locked;
|
||||
protected Transform _ItemName;
|
||||
protected UnityEngine.UI.Text _ItemName_Text;
|
||||
public override void InitGenerate(Transform root, object data)
|
||||
{
|
||||
_UIAnimator = root.Find("UIAnimator");
|
||||
_UIAnimator_Animator = _UIAnimator.GetComponent<UnityEngine.Animator>();
|
||||
_AnyBtn = root.Find("UIAnimator/Alpha");
|
||||
_AnyBtn_Button = _AnyBtn.GetComponent<UnityEngine.UI.Button>();
|
||||
_AnyBtn_Image = _AnyBtn.GetComponent<UnityEngine.UI.Image>();
|
||||
_Window = root.Find("UIAnimator/Window");
|
||||
_BigMap = root.Find("UIAnimator/Window/BigMap");
|
||||
_BigMap_Image = _BigMap.GetComponent<UnityEngine.UI.Image>();
|
||||
_Content = root.Find("UIAnimator/Window/BigMap/Viewport/Content");
|
||||
_BottomImage = root.Find("UIAnimator/Window/BigMap/Viewport/Content/BottomImage");
|
||||
_BottomImage_Image = _BottomImage.GetComponent<UnityEngine.UI.Image>();
|
||||
_LinePath = root.Find("UIAnimator/Window/BigMap/Viewport/Content/LinePath");
|
||||
_SmallPoints = root.Find("UIAnimator/Window/BigMap/Viewport/Content/SmallPoints");
|
||||
_BigPoints = root.Find("UIAnimator/Window/BigMap/Viewport/Content/BigPoints");
|
||||
_StartPoint = root.Find("UIAnimator/Window/BigMap/Viewport/Content/StartPoint");
|
||||
_StoryPoints = root.Find("UIAnimator/Window/BigMap/Viewport/Content/StoryPoints");
|
||||
_OneRank = root.Find("UIAnimator/Window/BigMap/Viewport/Content/OneRank");
|
||||
_OneRank_Animator = _OneRank.GetComponent<UnityEngine.Animator>();
|
||||
_SelfContainer = root.Find("UIAnimator/Window/BigMap/Viewport/Content/SelfContainer");
|
||||
_NameTxt = root.Find("UIAnimator/Window/TopView/Title/Title/NameTxt");
|
||||
_NameTxt_Text = _NameTxt.GetComponent<UnityEngine.UI.Text>();
|
||||
_BtnBack = root.Find("UIAnimator/Window/BottomView/BtnBack");
|
||||
_BtnBack_Animator = _BtnBack.GetComponent<UnityEngine.Animator>();
|
||||
_BtnBack_Button = _BtnBack.GetComponent<UnityEngine.UI.Button>();
|
||||
_BtnBigMap = root.Find("UIAnimator/Window/BottomView/BtnBigMap");
|
||||
_BtnBigMap_Animator = _BtnBigMap.GetComponent<UnityEngine.Animator>();
|
||||
_BtnBigMap_Button = _BtnBigMap.GetComponent<UnityEngine.UI.Button>();
|
||||
_AwardTips = root.Find("UIAnimator/Window/AwardTips");
|
||||
_AwardTips_Animator = _AwardTips.GetComponent<UnityEngine.Animator>();
|
||||
_Des = root.Find("UIAnimator/Window/AwardTips/Window/Des");
|
||||
_Des_Text = _Des.GetComponent<UnityEngine.UI.Text>();
|
||||
_IconItem = root.Find("UIAnimator/Window/AwardTips/Window/IconItem");
|
||||
_IconItem_LayoutElement = _IconItem.GetComponent<UnityEngine.UI.LayoutElement>();
|
||||
_shadow = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/shadow");
|
||||
_shadow_Button = _shadow.GetComponent<UnityEngine.UI.Button>();
|
||||
_shadow_Image = _shadow.GetComponent<UnityEngine.UI.Image>();
|
||||
_bg = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/bg");
|
||||
_bg_Button = _bg.GetComponent<UnityEngine.UI.Button>();
|
||||
_bg_Image = _bg.GetComponent<UnityEngine.UI.Image>();
|
||||
_Icon = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Icon");
|
||||
_Icon_Image = _Icon.GetComponent<UnityEngine.UI.Image>();
|
||||
_Icon_UIEventTriggerListener = _Icon.GetComponent<UIEventTriggerListener>();
|
||||
_Frame = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Frame");
|
||||
_Frame_Image = _Frame.GetComponent<UnityEngine.UI.Image>();
|
||||
_FrameLead = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/FrameLead");
|
||||
_FrameLead_Image = _FrameLead.GetComponent<UnityEngine.UI.Image>();
|
||||
_Level = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Level");
|
||||
_Level_Image = _Level.GetComponent<UnityEngine.UI.Image>();
|
||||
_Job = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Job");
|
||||
_Job_Image = _Job.GetComponent<UnityEngine.UI.Image>();
|
||||
_Limited = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Limited");
|
||||
_Limited_Image = _Limited.GetComponent<UnityEngine.UI.Image>();
|
||||
_SexLabel = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/SexLabel");
|
||||
_SexLabel_Image = _SexLabel.GetComponent<UnityEngine.UI.Image>();
|
||||
_CardLabel = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/CardLabel");
|
||||
_CardLabel_Image = _CardLabel.GetComponent<UnityEngine.UI.Image>();
|
||||
_Piece = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Piece");
|
||||
_Piece_Image = _Piece.GetComponent<UnityEngine.UI.Image>();
|
||||
_Num = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Num");
|
||||
_Num_TextMeshProUGUI = _Num.GetComponent<TMPro.TextMeshProUGUI>();
|
||||
_RefineLv = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/RefineLv");
|
||||
_RefineLv_TextMeshProUGUI = _RefineLv.GetComponent<TMPro.TextMeshProUGUI>();
|
||||
_QualityFX = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/QualityFX");
|
||||
_Conertips = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Conertips");
|
||||
_Text = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Conertips/Text");
|
||||
_Text_TextMeshProUGUI = _Text.GetComponent<TMPro.TextMeshProUGUI>();
|
||||
_RepeatSign = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/RepeatSign");
|
||||
_Advence = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Advence");
|
||||
_Advence_Image = _Advence.GetComponent<UnityEngine.UI.Image>();
|
||||
_AdvenceLv = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Advence/AdvenceLv");
|
||||
_AdvenceLv_TextMeshProUGUI = _AdvenceLv.GetComponent<TMPro.TextMeshProUGUI>();
|
||||
_Vip = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Vip");
|
||||
_label = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Vip/label");
|
||||
_label_Image = _label.GetComponent<UnityEngine.UI.Image>();
|
||||
_RedPoint = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/RedPoint");
|
||||
_ArtifactStar = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/ArtifactStar");
|
||||
_Star1 = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/ArtifactStar/Star1");
|
||||
_Star1_Image = _Star1.GetComponent<UnityEngine.UI.Image>();
|
||||
_Star = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/ArtifactStar/Star1/Star");
|
||||
_Star_Image = _Star.GetComponent<UnityEngine.UI.Image>();
|
||||
_Star2 = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/ArtifactStar/Star2");
|
||||
_Star2_Image = _Star2.GetComponent<UnityEngine.UI.Image>();
|
||||
_Star3 = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/ArtifactStar/Star3");
|
||||
_Star3_Image = _Star3.GetComponent<UnityEngine.UI.Image>();
|
||||
_Star4 = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/ArtifactStar/Star4");
|
||||
_Star4_Image = _Star4.GetComponent<UnityEngine.UI.Image>();
|
||||
_Star5 = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/ArtifactStar/Star5");
|
||||
_Star5_Image = _Star5.GetComponent<UnityEngine.UI.Image>();
|
||||
_ArtifactLv = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/ArtifactLv");
|
||||
_ArtifactLv_TextMeshProUGUI = _ArtifactLv.GetComponent<TMPro.TextMeshProUGUI>();
|
||||
_Selected = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Selected");
|
||||
_Locked = root.Find("UIAnimator/Window/AwardTips/Window/IconItem/Locked");
|
||||
_ItemName = root.Find("UIAnimator/Window/AwardTips/Window/ItemName");
|
||||
_ItemName_Text = _ItemName.GetComponent<UnityEngine.UI.Text>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 346a55afbef4eb748bf9f9153fe0d9a0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
12
Assets/Src/UI/CsUIPage/UI/UIBattle/UIBattleCtr.cs
Normal file
12
Assets/Src/UI/CsUIPage/UI/UIBattle/UIBattleCtr.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace CSUI
|
||||
{
|
||||
public class UIBattleCtr
|
||||
{
|
||||
public Vector3 GetMiniMapPosition()
|
||||
{
|
||||
return new Vector3(0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Src/UI/CsUIPage/UI/UIBattle/UIBattleCtr.cs.meta
Normal file
3
Assets/Src/UI/CsUIPage/UI/UIBattle/UIBattleCtr.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dfe48a983a4f4140a9170b0563e12adf
|
||||
timeCreated: 1743734846
|
||||
@ -18,12 +18,12 @@ namespace CSUI
|
||||
_UIMainCtr = ManagerContainer.LuaUIMgr.GetViewCtrById(UIPageName.UIMain) as UIMainCtr;
|
||||
}
|
||||
|
||||
public void AddEventListener()
|
||||
public override void AddEventListener()
|
||||
{
|
||||
ManagerContainer.LuaEventMgr.RegisterEvent(UIEventNames.BIGMAP_SELF_RANK_CHANGED, this, OnSelfRankChanged);
|
||||
}
|
||||
|
||||
public void RemoveEventListener()
|
||||
public override void RemoveEventListener()
|
||||
{
|
||||
ManagerContainer.LuaEventMgr.UnregisterEvent(UIEventNames.BIGMAP_SELF_RANK_CHANGED, this, OnSelfRankChanged);
|
||||
}
|
||||
@ -45,18 +45,18 @@ namespace CSUI
|
||||
this.Init();
|
||||
}
|
||||
|
||||
public void OnHide()
|
||||
public override void OnHide()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnClose()
|
||||
public override void OnClose()
|
||||
{
|
||||
ManagerContainer.LuaEventMgr.Dispatch(UIEventNames.BATTLE_WIN_CLOSE);
|
||||
ManagerContainer.LuaEventMgr.Dispatch(UIEventNames.NEW_LEVEL_INCREASE_NTF);
|
||||
}
|
||||
|
||||
public void OnDispose()
|
||||
public override void OnDispose()
|
||||
{
|
||||
// TODO: bigMapView
|
||||
this.controller.OnDispose();
|
||||
|
||||
8
Assets/Src/UI/CsUIPage/UI/UIBigMap.meta
Normal file
8
Assets/Src/UI/CsUIPage/UI/UIBigMap.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98dc0ea6385b7eb42907b220817a3e12
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1108
Assets/Src/UI/CsUIPage/UI/UIBigMap/BigMapView.cs
Normal file
1108
Assets/Src/UI/CsUIPage/UI/UIBigMap/BigMapView.cs
Normal file
File diff suppressed because it is too large
Load Diff
3
Assets/Src/UI/CsUIPage/UI/UIBigMap/BigMapView.cs.meta
Normal file
3
Assets/Src/UI/CsUIPage/UI/UIBigMap/BigMapView.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca93532172aa453d9a9b6717395c3120
|
||||
timeCreated: 1743729853
|
||||
87
Assets/Src/UI/CsUIPage/UI/UIBigMap/UIBigMapCtr.cs
Normal file
87
Assets/Src/UI/CsUIPage/UI/UIBigMap/UIBigMapCtr.cs
Normal file
@ -0,0 +1,87 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets.Initialization;
|
||||
|
||||
namespace CSUI
|
||||
{
|
||||
public class UIBigMapData
|
||||
{
|
||||
public int id;
|
||||
public int enterType;
|
||||
}
|
||||
public class UIBigMapCtr
|
||||
{
|
||||
private Transform view;
|
||||
private int asyncIdx = 0;
|
||||
private UIBigMapData data;
|
||||
|
||||
public int CurMapId { get; set; }
|
||||
public int CurLevelId { get; set; }
|
||||
public int MapId { get; set; }
|
||||
public int EnterType { get; set; }
|
||||
|
||||
public void Init(Transform view)
|
||||
{
|
||||
this.view = view;
|
||||
}
|
||||
|
||||
public void SetData(object data)
|
||||
{
|
||||
var json = data as string;
|
||||
Dictionary<string, int> dictionary = JsonConvert.DeserializeObject<Dictionary<string, int>>(json);
|
||||
var mapId = dictionary["id"];
|
||||
|
||||
this.data = new UIBigMapData()
|
||||
{
|
||||
id = mapId,
|
||||
enterType = 0
|
||||
};
|
||||
asyncIdx = 0;
|
||||
InitData();
|
||||
}
|
||||
|
||||
public int GetAsyncIdx()
|
||||
{
|
||||
asyncIdx = asyncIdx + 1;
|
||||
return asyncIdx;
|
||||
}
|
||||
|
||||
public UIBigMapData GetData()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
private void InitData()
|
||||
{
|
||||
if (data.id == 0)
|
||||
{
|
||||
data.id = ManagerContainer.LuaBattleMgr.GetCurMap();
|
||||
}
|
||||
|
||||
if (data.enterType == 0)
|
||||
{
|
||||
data.enterType = BigMapEnterType.Default;
|
||||
}
|
||||
this.MapId = data.id;
|
||||
this.EnterType = data.enterType;
|
||||
RefreshLevelData();
|
||||
}
|
||||
|
||||
public void RefreshLevelData()
|
||||
{
|
||||
this.CurMapId = ManagerContainer.LuaBattleMgr.GetCurMap();
|
||||
this.CurLevelId = ManagerContainer.LuaBattleMgr.GetCurLevel();
|
||||
}
|
||||
|
||||
public void OnDisable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public CfgMapData GetMapData()
|
||||
{
|
||||
return ManagerContainer.CfgMgr.GetMapData(this.MapId);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Src/UI/CsUIPage/UI/UIBigMap/UIBigMapCtr.cs.meta
Normal file
3
Assets/Src/UI/CsUIPage/UI/UIBigMap/UIBigMapCtr.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b51e07fdd7c941f2b6f33d044222038e
|
||||
timeCreated: 1743680956
|
||||
165
Assets/Src/UI/CsUIPage/UI/UIBigMap/UIBigMapView.cs
Normal file
165
Assets/Src/UI/CsUIPage/UI/UIBigMap/UIBigMapView.cs
Normal file
@ -0,0 +1,165 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace CSUI
|
||||
{
|
||||
public partial class UIBigMapView : UIViewBase
|
||||
{
|
||||
private UIBattleCtr _UIBattleCtr;
|
||||
private UIBigMapCtr controller;
|
||||
private BigMapView bigMapView;
|
||||
private FrameTimer delayFrameTimer;
|
||||
private bool isWaitBattleOpen = false;
|
||||
private object data;
|
||||
|
||||
public override void OnAwake(object data)
|
||||
{
|
||||
this.data = data;
|
||||
_UIBattleCtr = ManagerContainer.LuaUIMgr.GetViewCtrById(UIPageName.UIBattle) as UIBattleCtr;
|
||||
}
|
||||
|
||||
public override void AddEventListener()
|
||||
{
|
||||
ManagerContainer.LuaEventMgr.RegisterEvent(UIEventNames.EID_LEVEL_CHANGED, this, OnLevelChanged);
|
||||
ManagerContainer.LuaEventMgr.RegisterEvent(UIEventNames.BIGMAP_SELF_RANK_CHANGED, this, OnSelfRankChanged);
|
||||
ManagerContainer.LuaEventMgr.RegisterEvent(UIEventNames.UI_PAGE_IN_END_NTF, this, OnUIPageInEndNtf);
|
||||
}
|
||||
|
||||
public override void RemoveEventListener()
|
||||
{
|
||||
ManagerContainer.LuaEventMgr.UnregisterEvent(UIEventNames.EID_LEVEL_CHANGED, this, OnLevelChanged);
|
||||
ManagerContainer.LuaEventMgr.UnregisterEvent(UIEventNames.BIGMAP_SELF_RANK_CHANGED, this, OnSelfRankChanged);
|
||||
ManagerContainer.LuaEventMgr.UnregisterEvent(UIEventNames.UI_PAGE_IN_END_NTF, this, OnUIPageInEndNtf);
|
||||
}
|
||||
|
||||
public override void AddUIEventListener()
|
||||
{
|
||||
_BtnBack_Button.onClick.RemoveAllListeners();
|
||||
_BtnBack_Button.onClick.AddListener(OnClickBtnBack);
|
||||
_BtnBigMap_Button.onClick.RemoveAllListeners();
|
||||
_BtnBigMap_Button.onClick.AddListener(OnClickBtnBigMap);
|
||||
_AwardTips.Find("Alpha").GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
_AwardTips.Find("Alpha").GetComponent<Button>().onClick.AddListener(OnClickBtnAlpha);
|
||||
}
|
||||
|
||||
public void OnLevelChanged(object[] paramList)
|
||||
{
|
||||
controller.RefreshLevelData();
|
||||
var curMapId = controller.CurMapId;
|
||||
var curLevelId = controller.CurLevelId;
|
||||
var mapId = controller.MapId;
|
||||
bigMapView.OnLevelChanged(curMapId, curLevelId, mapId);
|
||||
}
|
||||
|
||||
public void OnSelfRankChanged(object[] paramList)
|
||||
{
|
||||
bigMapView.RefreshSelfRank();
|
||||
}
|
||||
|
||||
public void OnUIPageInEndNtf(object[] paramList)
|
||||
{
|
||||
var id = (int)paramList[0];
|
||||
if (isWaitBattleOpen == false) return;
|
||||
if (id != UIPageName.UIBattle) return;
|
||||
_Window.localPosition = Vector3.zero;
|
||||
var boxPos = _UIBattleCtr.GetMiniMapPosition();
|
||||
boxPos = _Window.parent.InverseTransformPoint(boxPos);
|
||||
TweenPosition.Begin(_Window.gameObject, 0.15f, boxPos, false);
|
||||
UIClose();
|
||||
isWaitBattleOpen = false;
|
||||
}
|
||||
|
||||
private void RefreshMap()
|
||||
{
|
||||
var mapData = controller.GetMapData();
|
||||
if (mapData == null) return;
|
||||
_NameTxt_Text.text = mapData.Name;
|
||||
}
|
||||
|
||||
public void UIClose()
|
||||
{
|
||||
isWaitBattleOpen = true;
|
||||
ManagerContainer.LuaUIMgr.Open(UIPageName.UIBattle, null);
|
||||
}
|
||||
|
||||
public void BigMapViewComplete(bool hasFollow)
|
||||
{
|
||||
UIClose();
|
||||
}
|
||||
|
||||
private void OnPageInEnd()
|
||||
{
|
||||
bigMapView.OnPageInEnd();
|
||||
delayFrameTimer.Stop();
|
||||
TweenPosition.Begin(_Window.gameObject, 0, Vector3.zero, false);
|
||||
base.OnPageInEnd();
|
||||
}
|
||||
|
||||
public void OnClickBtnBigMap()
|
||||
{
|
||||
ManagerContainer.LuaUIMgr.Open(UIPageName.UIWorldMap, null);
|
||||
ManagerContainer.LuaUIMgr.ClosePage(base.Data.id, false);
|
||||
}
|
||||
|
||||
public void OnClickBtnAlpha()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnClickBtnBack()
|
||||
{
|
||||
UIClose();
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
controller = new UIBigMapCtr();
|
||||
controller.Init(_BigMap);
|
||||
controller.SetData(this.data);
|
||||
bigMapView = new BigMapView(_BigMap);
|
||||
var curMapId = controller.CurLevelId;
|
||||
var curLevelId = controller.CurLevelId;
|
||||
var mapId = controller.CurMapId;
|
||||
var enterType = controller.EnterType;
|
||||
this.bigMapView.InitData(curMapId, curLevelId, mapId, enterType, Rect.zero, b =>
|
||||
{
|
||||
UIClose();
|
||||
});
|
||||
|
||||
_BtnBack.gameObject.SetActive(enterType == BigMapEnterType.Default);
|
||||
_BtnBigMap.gameObject.SetActive(enterType == BigMapEnterType.Default);
|
||||
|
||||
//RefreshMap();
|
||||
delayFrameTimer = new FrameTimer(() =>
|
||||
{
|
||||
var boxPos = _UIBattleCtr.GetMiniMapPosition();
|
||||
_Window.position = boxPos;
|
||||
TweenPosition.Begin(_Window.gameObject, 0.15f, Vector3.zero, false);
|
||||
}, 1, 1);
|
||||
delayFrameTimer.Start();
|
||||
|
||||
_AwardTips.gameObject.SetActive(false);
|
||||
ManagerContainer.LuaUIMgr.Hide(UIPageName.UIBattle);
|
||||
}
|
||||
|
||||
public override void OnShow(object data)
|
||||
{
|
||||
controller.SetData(data);
|
||||
}
|
||||
|
||||
public override void OnHide()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void OnClose()
|
||||
{
|
||||
delayFrameTimer.Stop();
|
||||
}
|
||||
|
||||
public void OnDispose()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Src/UI/CsUIPage/UI/UIBigMap/UIBigMapView.cs.meta
Normal file
3
Assets/Src/UI/CsUIPage/UI/UIBigMap/UIBigMapView.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57dfaebf283444f699d7ac3261e7d359
|
||||
timeCreated: 1743680547
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user