// Update is called once per frame public void Update() { if (_lastSelectedCount != WindowCount) { WindowCountChanged(WindowCount); _lastSelectedCount = WindowCount; } if (_door != Door) { DoorChanged(Door); _door = Door; } if (_houseMaterial != HouseMaterial) { HouseMaterialChanged(HouseMaterial); _houseMaterial = HouseMaterial; } if (_doorMaterial != DoorMaterial) { DoorMaterialChanged(DoorMaterial); _doorMaterial = DoorMaterial; } if (_windowColor != WindowColor) { WindowColorChanged(WindowColor); _windowColor = WindowColor; } }
public void WindowCountChanged(WindowCount value) { if (value == WindowCount.Zero) { SetNumberOfActiveWindows(0); } else if (value == WindowCount.One) { SetNumberOfActiveWindows(1); } else if (value == WindowCount.Two) { SetNumberOfActiveWindows(2); } else if (value == WindowCount.Three) { SetNumberOfActiveWindows(3); } else if (value == WindowCount.Four) { SetNumberOfActiveWindows(4); } }
private void AddButtons(string Filter = "") { wallCount = 0; doorCount = 0; WindowCount = 0; furnCount = 0; floorCount = 0; for (int i = 0; i < itemList.Count; i++) { Item item = itemList[i]; if (item.icon.name.Contains("Wall") && (Filter.Contains("Wall") || Filter == string.Empty)) { GameObject newButton = buttonObjectPool.GetObject(); newButton.transform.SetParent(contentPanel); newButton.name = "WaBtn" + wallCount.ToString(); wallCount += 1; ToggleObject sampleButton = newButton.GetComponent <ToggleObject>(); sampleButton.enabled = disableButtons; sampleButton.Setup(item, this); } if (item.icon.name.Contains("Door") && (Filter.Contains("Door") || Filter == string.Empty)) { GameObject newButton = buttonObjectPool.GetObject(); newButton.transform.SetParent(contentPanel); newButton.name = "DoBtn" + doorCount.ToString(); doorCount += 1; ToggleObject sampleButton = newButton.GetComponent <ToggleObject>(); sampleButton.enabled = disableButtons; sampleButton.Setup(item, this); } if (item.icon.name.Contains("Window") && (Filter.Contains("Window") || Filter == string.Empty)) { GameObject newButton = buttonObjectPool.GetObject(); newButton.transform.SetParent(contentPanel); newButton.name = "WiBtn" + WindowCount.ToString(); WindowCount += 1; ToggleObject sampleButton = newButton.GetComponent <ToggleObject>(); sampleButton.enabled = disableButtons; sampleButton.Setup(item, this); } if (item.icon.name.Contains("Furniture") && (Filter.Contains("Furniture") || Filter == string.Empty)) { GameObject newButton = buttonObjectPool.GetObject(); newButton.transform.SetParent(contentPanel); newButton.name = "FuBtn" + furnCount.ToString(); furnCount += 1; ToggleObject sampleButton = newButton.GetComponent <ToggleObject>(); sampleButton.enabled = disableButtons; sampleButton.Setup(item, this); } if (item.icon.name.Contains("Floor") && (Filter.Contains("Floor") || Filter == string.Empty)) { GameObject newButton = buttonObjectPool.GetObject(); newButton.transform.SetParent(contentPanel); newButton.name = "FlBtn" + floorCount.ToString(); floorCount += 1; ToggleObject sampleButton = newButton.GetComponent <ToggleObject>(); sampleButton.enabled = disableButtons; sampleButton.Setup(item, this); } } }
// Use this for initialization public void Start() { SetNumberOfActiveWindows(0); _lastSelectedCount = WindowCount; }
public _(WindowCount <TSource> parent, IObserver <ISubscribable <TSource> > observer) : base(parent, observer) { }