等待编队步骤实现

main
yurui 2024-07-04 13:48:56 +08:00
parent e93c6790f5
commit 8ee23c544d
6 changed files with 80 additions and 93 deletions

View File

@ -887,18 +887,42 @@ namespace Gameplay.Guide
/// </summary>
internal sealed class WaitEditTeamComplete : GuideCompleteBase
{
/// <summary>
/// 队伍人数
/// </summary>
private readonly int cCount;
public WaitEditTeamComplete(DataGuideCfg cfg, Action complete) : base(cfg, complete)
{
if (cfg.CompleteTypeParams.Length <= 0)
throw new Exception($"引导id:{cfg.Id}, 引导类型:{cfg.GuideCompleteType},参数错误");
if (int.TryParse(cfg.CompleteTypeParams[0], out int count))
cCount = count;
}
public override void AddListener()
{
EventManager.Instance.Register(EventManager.EventName.TeamModified, (Action<int>)OnTeamModfied);
}
public override void RemoveListener()
{
EventManager.Instance.Unregister(EventManager.EventName.TeamModified, (Action<int>)OnTeamModfied);
}
private void OnTeamModfied(int teamIndex)
{
Team team = TeamEditManager.Instance.GetTeamByIndex((uint)teamIndex);
if (null == team)
return;
if (team.GetCharacterCount() < cCount)
return;
GuideManager.Instance.IsEditTeamGuide = false;
Complete();
}
}
}

View File

@ -47,6 +47,10 @@ namespace Gameplay.Guide
/// 指定地板索引
/// </summary>
public int FloorIndex = -1;
/// <summary>
/// 是否编队引导
/// </summary>
public bool IsEditTeamGuide = false;
public void Init()
{

View File

@ -651,7 +651,8 @@ namespace Gameplay.Guide
protected override async void DoGuide()
{
await UI_GuideController.Open(false);
GuideManager.Instance.IsEditTeamGuide = true;
await UI_GuideController.Open(Cfg, false);
}
}
}

View File

@ -614,8 +614,24 @@ public class Team
{
return _vehicleID == id;
}
/// <summary>
/// 获取队伍角色数量
/// </summary>
/// <returns></returns>
public int GetCharacterCount()
{
int count = 0;
foreach (uint id in _characterIDs)
{
if (NONE_ID == id)
continue;
++count;
}
return count;
}
}
public class TeamEditStoreData

View File

@ -29,12 +29,11 @@ public sealed partial class DataGuideCfg : Bright.Config.BeanBase
{ var __json0 = _json["CompleteTypeParams"]; if(!__json0.IsArray) { throw new SerializationException(); } int _n0 = __json0.Count; CompleteTypeParams = new string[_n0]; int __index0=0; foreach(JSONNode __e0 in __json0.Children) { string __v0; { if(!__e0.IsString) { throw new SerializationException(); } __v0 = __e0; } CompleteTypeParams[__index0++] = __v0; } }
{ if(!_json["ArrowDirection"].IsNumber) { throw new SerializationException(); } ArrowDirection = (GuideCfg.E_ArrowDirection)_json["ArrowDirection"].AsInt; }
{ var _json2 = _json["ArrowOffset"]; if(!_json2.IsObject) { throw new SerializationException(); } float __x; { if(!_json2["x"].IsNumber) { throw new SerializationException(); } __x = _json2["x"]; } float __y; { if(!_json2["y"].IsNumber) { throw new SerializationException(); } __y = _json2["y"]; } ArrowOffset = new UnityEngine.Vector2(__x, __y); }
{ if(!_json["ArrowTipKey"].IsString) { throw new SerializationException(); } ArrowTipKey = _json["ArrowTipKey"]; }
{ if(!_json["TipKey"].IsString) { throw new SerializationException(); } TipKey = _json["TipKey"]; }
PostInit();
}
public DataGuideCfg(int Id, int GroupId, int BeginCondition, int NextId, float StepStartDelay, GuideCfg.E_GuideStepType GuideStepType, string[] GuideTypeParams, GuideCfg.E_GuideCompleteType GuideCompleteType, string[] CompleteTypeParams, GuideCfg.E_ArrowDirection ArrowDirection, UnityEngine.Vector2 ArrowOffset, string ArrowTipKey, string TipKey )
public DataGuideCfg(int Id, int GroupId, int BeginCondition, int NextId, float StepStartDelay, GuideCfg.E_GuideStepType GuideStepType, string[] GuideTypeParams, GuideCfg.E_GuideCompleteType GuideCompleteType, string[] CompleteTypeParams, GuideCfg.E_ArrowDirection ArrowDirection, UnityEngine.Vector2 ArrowOffset, string TipKey )
{
this.Id = Id;
this.GroupId = GroupId;
@ -47,7 +46,6 @@ public sealed partial class DataGuideCfg : Bright.Config.BeanBase
this.CompleteTypeParams = CompleteTypeParams;
this.ArrowDirection = ArrowDirection;
this.ArrowOffset = ArrowOffset;
this.ArrowTipKey = ArrowTipKey;
this.TipKey = TipKey;
PostInit();
}
@ -102,10 +100,6 @@ public sealed partial class DataGuideCfg : Bright.Config.BeanBase
/// </summary>
public UnityEngine.Vector2 ArrowOffset { get; private set; }
/// <summary>
/// 箭头提示文本
/// </summary>
public string ArrowTipKey { get; private set; }
/// <summary>
/// 提示文本
/// </summary>
public string TipKey { get; private set; }
@ -136,7 +130,6 @@ public sealed partial class DataGuideCfg : Bright.Config.BeanBase
+ "CompleteTypeParams:" + Bright.Common.StringUtil.CollectionToString(CompleteTypeParams) + ","
+ "ArrowDirection:" + ArrowDirection + ","
+ "ArrowOffset:" + ArrowOffset + ","
+ "ArrowTipKey:" + ArrowTipKey + ","
+ "TipKey:" + TipKey + ","
+ "}";
}

View File

@ -17,7 +17,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -37,7 +36,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -57,7 +55,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -77,7 +74,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -98,7 +94,6 @@
"x": 50,
"y": 50
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -118,7 +113,6 @@
"x": 0,
"y": 50
},
"ArrowTipKey": "点击这个地板",
"TipKey": ""
},
{
@ -136,7 +130,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -157,7 +150,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -177,7 +169,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -197,7 +188,6 @@
"x": 0,
"y": 50
},
"ArrowTipKey": "点击这个地板",
"TipKey": ""
},
{
@ -217,7 +207,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -238,7 +227,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -258,7 +246,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -276,7 +263,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -297,7 +283,6 @@
"x": 50,
"y": 50
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -318,7 +303,6 @@
"x": 50,
"y": 50
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -338,7 +322,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -359,7 +342,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -379,7 +361,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -397,7 +378,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -419,7 +399,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -439,7 +418,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -459,7 +437,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -477,7 +454,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -499,7 +475,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -519,7 +494,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -539,7 +513,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -562,7 +535,6 @@
"x": -25,
"y": 25
},
"ArrowTipKey": "点击关卡",
"TipKey": ""
},
{
@ -585,7 +557,6 @@
"x": -150,
"y": 0
},
"ArrowTipKey": "点击主线",
"TipKey": ""
},
{
@ -608,7 +579,6 @@
"x": -150,
"y": -25
},
"ArrowTipKey": "点击预章",
"TipKey": ""
},
{
@ -631,7 +601,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "点击第二关",
"TipKey": ""
},
{
@ -654,7 +623,6 @@
"x": 0,
"y": 20
},
"ArrowTipKey": "点击准备战斗",
"TipKey": ""
},
{
@ -677,7 +645,6 @@
"x": 50,
"y": 0
},
"ArrowTipKey": "点击编队",
"TipKey": ""
},
{
@ -700,7 +667,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -723,7 +689,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -731,6 +696,25 @@
"GroupId": 100,
"BeginCondition": 0,
"NextId": 110,
"StepStartDelay": 0,
"GuideStepType": 18,
"GuideTypeParams": [],
"GuideCompleteType": 23,
"CompleteTypeParams": [
"5"
],
"ArrowDirection": 0,
"ArrowOffset": {
"x": 0,
"y": 0
},
"TipKey": "请上阵5个角色"
},
{
"Id": 110,
"GroupId": 100,
"BeginCondition": 0,
"NextId": 111,
"StepStartDelay": 0.5,
"GuideStepType": 3,
"GuideTypeParams": [
@ -746,14 +730,13 @@
"x": 50,
"y": -50
},
"ArrowTipKey": "点击返回",
"TipKey": ""
},
{
"Id": 110,
"Id": 111,
"GroupId": 100,
"BeginCondition": 0,
"NextId": 111,
"NextId": 112,
"StepStartDelay": 0.5,
"GuideStepType": 3,
"GuideTypeParams": [
@ -767,14 +750,13 @@
"x": -50,
"y": 0
},
"ArrowTipKey": "点击指挥官技能",
"TipKey": ""
},
{
"Id": 111,
"Id": 112,
"GroupId": 100,
"BeginCondition": 0,
"NextId": 112,
"NextId": 113,
"StepStartDelay": 0.5,
"GuideStepType": 3,
"GuideTypeParams": [
@ -788,14 +770,13 @@
"x": 0,
"y": 50
},
"ArrowTipKey": "点击确定",
"TipKey": ""
},
{
"Id": 112,
"Id": 113,
"GroupId": 100,
"BeginCondition": 0,
"NextId": 113,
"NextId": 114,
"StepStartDelay": 0.5,
"GuideStepType": 3,
"GuideTypeParams": [
@ -811,14 +792,13 @@
"x": -50,
"y": 50
},
"ArrowTipKey": "点击进入战斗",
"TipKey": ""
},
{
"Id": 113,
"Id": 114,
"GroupId": 100,
"BeginCondition": 0,
"NextId": 114,
"NextId": 115,
"StepStartDelay": 0.5,
"GuideStepType": 13,
"GuideTypeParams": [
@ -831,14 +811,13 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
"Id": 114,
"Id": 115,
"GroupId": 100,
"BeginCondition": 0,
"NextId": 115,
"NextId": 116,
"StepStartDelay": 0,
"GuideStepType": 6,
"GuideTypeParams": [
@ -851,11 +830,10 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
"Id": 115,
"Id": 116,
"GroupId": 100,
"BeginCondition": 0,
"NextId": 200,
@ -871,7 +849,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -891,7 +868,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -914,7 +890,6 @@
"x": 40,
"y": 40
},
"ArrowTipKey": "点击战斗员",
"TipKey": ""
},
{
@ -937,7 +912,6 @@
"x": 40,
"y": -40
},
"ArrowTipKey": "点击角色",
"TipKey": ""
},
{
@ -959,7 +933,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -982,7 +955,6 @@
"x": -20,
"y": 0
},
"ArrowTipKey": "点击升级养成",
"TipKey": ""
},
{
@ -1003,7 +975,6 @@
"x": -20,
"y": 0
},
"ArrowTipKey": "点击升级",
"TipKey": ""
},
{
@ -1024,7 +995,6 @@
"x": -40,
"y": 40
},
"ArrowTipKey": "确定升级",
"TipKey": ""
},
{
@ -1047,7 +1017,6 @@
"x": 40,
"y": -40
},
"ArrowTipKey": "返回主界面",
"TipKey": ""
},
{
@ -1070,7 +1039,6 @@
"x": -25,
"y": 25
},
"ArrowTipKey": "点击关卡",
"TipKey": ""
},
{
@ -1093,7 +1061,6 @@
"x": -150,
"y": 0
},
"ArrowTipKey": "点击主线",
"TipKey": ""
},
{
@ -1116,7 +1083,6 @@
"x": -150,
"y": -25
},
"ArrowTipKey": "点击预章",
"TipKey": ""
},
{
@ -1139,7 +1105,6 @@
"x": -150,
"y": -25
},
"ArrowTipKey": "点击第二关",
"TipKey": ""
},
{
@ -1162,7 +1127,6 @@
"x": 0,
"y": 20
},
"ArrowTipKey": "点击准备战斗",
"TipKey": ""
},
{
@ -1185,7 +1149,6 @@
"x": 50,
"y": 0
},
"ArrowTipKey": "点击编队",
"TipKey": ""
},
{
@ -1207,7 +1170,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -1230,7 +1192,6 @@
"x": -40,
"y": 40
},
"ArrowTipKey": "点击载具选择",
"TipKey": ""
},
{
@ -1253,7 +1214,6 @@
"x": 0,
"y": 20
},
"ArrowTipKey": "选择载具",
"TipKey": ""
},
{
@ -1276,7 +1236,6 @@
"x": 50,
"y": -50
},
"ArrowTipKey": "点击返回",
"TipKey": ""
},
{
@ -1299,7 +1258,6 @@
"x": -50,
"y": 50
},
"ArrowTipKey": "点击进入战斗",
"TipKey": ""
},
{
@ -1321,7 +1279,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -1341,7 +1298,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -1361,7 +1317,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -1381,7 +1336,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -1401,7 +1355,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -1421,7 +1374,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -1444,7 +1396,6 @@
"x": 40,
"y": -40
},
"ArrowTipKey": "点击招募",
"TipKey": ""
},
{
@ -1466,7 +1417,6 @@
"x": 0,
"y": 0
},
"ArrowTipKey": "",
"TipKey": ""
},
{
@ -1487,7 +1437,6 @@
"x": 0,
"y": -20
},
"ArrowTipKey": "点击单抽",
"TipKey": ""
}
]