Beispiel #1
0
 public void GenerateFloorButtons(int floors, Action <int, FloorPanel.Direction> onFloorPanelClicked)
 {
     for (int i = 0; i < floors; i++)
     {
         FloorPanel newPanel = Instantiate(FloorPanelPrefab, Vector3.zero, Quaternion.identity, FloorPanelsContent).GetComponent <FloorPanel>();
         newPanel.InitFloor(i, onFloorPanelClicked, i == floors - 1, i == 0);
         _panels.Add(newPanel);
     }
 }
Beispiel #2
0
 public void Init(int floors, Action <int, FloorPanel.Direction> onFloorPanelClicked)
 {
     for (int i = 0; i < floors; i++)
     {
         FloorPanel newPanel = Instantiate(ShaftPanelPrefab, Vector3.zero, Quaternion.identity, FloorsParent).GetComponent <FloorPanel>();
         newPanel.InitFloor(i, onFloorPanelClicked, i == floors - 1, i == 0);
         _panels.Add(newPanel);
         newPanel.transform.SetAsFirstSibling();
     }
     Cabin.SetAsLastSibling();
     Cabin.sizeDelta = _floorSize * Vector2.one;
     ChangePosition(0);
     StartCoroutine(MoveToBottom());
 }