// Use this for initialization public override void UpdateView() { base.UpdateView(); (GetComponent <Collider>() as BoxCollider).size = new Vector3(roomInfo.size * Cell.defaultCellWidth, Cell.defaultCellHeight, 0f); DoorBuilder.PlaceDoors(this); roomView.SetSprite(roomInfo.spriteName); roomMenu.transform.localPosition = new Vector3(roomInfo.size * 0.5f * defaultCellWidth - 0.08f, defaultCellHeight * 0.5f - 0.08f, 0f); selection.dimensions = new Vector2(roomInfo.size * Cell.defaultCellWidth * 100f, Cell.defaultCellHeight * 100f); if (roomInfo is StorageRoomInfo) { if (!GetComponent <Storage>()) { var storage = gameObject.AddComponent <Storage>(); storage.Init(roomInfo as StorageRoomInfo); StorageManager.AddStorage(storage); } } else if (roomInfo is FactoryRoomInfo) { if (!GetComponent <Factory>()) { var factory = gameObject.AddComponent <Factory>(); factory.Init(roomInfo as FactoryRoomInfo); } } }
public override Entity FactoryMethod(Resources resources, Vector2 position) { ISimpleTileBuilder builder = new DoorBuilder(resources, position); director.Construct(builder); return(builder.GetResult()); }
protected new DoorBuilder GetParentBuilder() { DoorBuilder parentBuilder = this; while ((parentBuilder.ParentBuilder as DoorBuilder) != null) { parentBuilder = parentBuilder.ParentBuilder as DoorBuilder; } return(parentBuilder); }
public override void UpdateView() { base.UpdateView(); DoorBuilder.PlaceDoors(this); }
public WindowBuilder(DoorBuilder builder) : base(builder) { }
public void Awake() { instance = this; }