Esempio n. 1
0
 // 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);
         }
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 4
0
 public override void UpdateView()
 {
     base.UpdateView();
     DoorBuilder.PlaceDoors(this);
 }
 public WindowBuilder(DoorBuilder builder)
     : base(builder)
 {
 }
Esempio n. 6
0
 public void Awake()
 {
     instance = this;
 }