zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Unity/Assets/Hotfix/Logic/Behaviour/Game/Event/Battle/BattleStartEvent.cs

52 lines
1.5 KiB
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using ET.EventType;
using ET;
using System;
using System.Collections.Generic;
namespace ET
{
public class BattleStartEvent : AEvent_Sync<EventType.BattleStart>
{
public override void Run(BattleStart args)
{
try
{
var zoneScene = args.zoneScene;
2021-04-08 20:09:59 +08:00
Game.EventSystem.Publish_Sync(new ET.EventType.TranslateSceneStart
{
isAutoEnd = false
});
Game.EventSystem.Publish(new ET.EventType.StateBuffUI_Init
{
zoneScene = args.zoneScene
}).Coroutine();
Game.EventSystem.Publish_Sync(new ET.EventType.HideOthersUnit
{
zoneScene = args.zoneScene
});
Team team = args.zoneScene.GetComponent<TeamComponent>().Get(zoneScene.GetComponent<GlobalVariable>().LeaderId);
2021-04-11 19:50:39 +08:00
foreach (Unit unit in team.GetAll())
2021-04-08 20:09:59 +08:00
{
try
{
Game.EventSystem.Publish_Sync(new ET.EventType.SetHudCharacter_ChangeHp
{
unit = unit
});
}
catch (Exception e)
{
Log.Error(e);
}
}
}
catch (Exception e)
{
Log.Error(e);
}
}
}
}