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