You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
894 B
34 lines
894 B
3 years ago
|
using System.Collections.Generic;
|
||
|
using ET.EventType;
|
||
|
|
||
|
namespace ET
|
||
|
{
|
||
|
[FriendClass(typeof(Construct))]
|
||
|
public class PeopleMoveEnd_Construct : AEvent<EventType.PeopleMoveEnd>
|
||
|
{
|
||
|
protected override void Run(PeopleMoveEnd args)
|
||
|
{
|
||
|
People p = args.People;
|
||
|
|
||
|
var unit = UnitHelper.GetMyUnitFromZoneScene(p.ZoneScene());
|
||
|
|
||
|
var cc = unit.GetComponent<ConstructComponent>();
|
||
|
|
||
|
if (cc == null)
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
foreach (var child in cc.Children)
|
||
|
{
|
||
|
Construct c = (Construct)child.Value;
|
||
|
if (c.PreparePeopleIdList.Contains(p.Id))
|
||
|
{
|
||
|
|
||
|
ConstructHelper.StartConstruct(unit, c.Id, p.Id).Coroutine();
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|