public static Keep CreateNew(ILevelManager level, IBuilding building, KeepType myType) { Keep newKeep = null; try { newKeep = new Keep(level, building, myType); newKeep.CreatePathfindingNodes(); StaticRangeTarget.CreateNew(newKeep, level, building.Center); newKeep.clicker = Clicker.CreateNew(newKeep, level); newKeep.clicker.Clicked += newKeep.KeepClicked; newKeep.healthBar = new HealthBarControl(level, building, 100, new Vector3(0, 3, 0), new Vector2(2f, 0.2f), false); newKeep.window = building.Player == level.HumanPlayer ? new KeepWindow(newKeep) : null; return(newKeep); } catch (Exception e) { newKeep?.Dispose(); throw; } }
public override BuildingInstancePlugin GetInstanceForLoading(ILevelManager level, IBuilding building) { return(Keep.CreateForLoading(level, building, this)); }
public override BuildingInstancePlugin CreateNewInstance(ILevelManager level, IBuilding building) { return(Keep.CreateNew(level, building, this)); }
public KeepWindow(Keep keep) { this.keep = keep; instance = new KeepWindowInstance(this); }