public void StoreStair(GameObject stair) { stair.SetActive(false); stairQueue.Enqueue(stair); OnStairChange?.Invoke(stairQueue.Count); }
public void SpawnStair(Vector3 position, int direction) { if (stairQueue.Count == 0) // No stair to spawn { return; } GameObject stairObj = stairQueue.Dequeue(); Stair stair = stairObj.GetComponent <Stair>(); stair.SetOrientation(Stair.Orientation.Horizontal); Vector3 scale = stair.transform.localScale; scale.x = stair.transform.localScale.x * direction; stair.transform.localScale = scale; stairObj.transform.position = position; stairObj.SetActive(true); OnStairChange?.Invoke(stairQueue.Count); }