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.
 
 
 
 
 
 

31 lines
1.3 KiB

using ET.EventType;
namespace ET
{
using FUIBuilding;
[FriendClass(typeof(Construct))]
public class AfterCreateConstruct_AddComponent : AEvent<EventType.AfterCreateConstruct>
{
protected override void Run(AfterCreateConstruct args)
{
var unit = args.Unit;
var construct = args.Construct;
// if (construct.IsUpgrade)
// {
// var buildingComp = unit.GetComponent<BuildingComponent>();
// Building building = buildingComp.GetChild<Building>(construct.BuildingId);
// BuildingViewComponent buildingViewComponent = building.GetComponent<BuildingViewComponent>();
// buildingViewComponent?.Upgrade();
// }
var buildingViewComp = construct.AddComponent<ConstructViewComponent>();
if (args.IsNew)
{
// 第一次创建时,弹出选择劳力界面
var prepareBuildingWindowComponent = unit.ZoneScene().GetComponent<FUIComponent>()
.ShowWindow<FUI_PrepareBuildingWindow, FUIPrepareBuildingWindowComponent>(FUI_PrepareBuildingWindow.UIPackageName);
prepareBuildingWindowComponent.ShowInfo(construct);
}
}
}
}