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

51 lines
1.4 KiB
C#

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
{
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
});
var team = TeamComponent.Instance.Get(GlobalVariable.LeaderId);
foreach (var unit in team.GetAll())
{
try
{
Game.EventSystem.Publish_Sync(new ET.EventType.SetHudCharacter_ChangeHp
{
unit = unit
});
}
catch (Exception e)
{
Log.Error(e);
}
}
}
catch (Exception e)
{
Log.Error(e);
}
}
}
}