// 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 void UpdateView() { base.UpdateView(); DoorBuilder.PlaceDoors(this); }