private void Update() { CantBuy.gameObject.SetActive(!(GameSystem.Instance.money - item.Cost >= 0)); if (pointerDown) { pointerDownTimer += Time.unscaledDeltaTime; // Debug.Log(pointerDownTimer); if (pointerDownTimer >= requiredHoldTime) { Reset(); if (GameSystem.Instance.money - item.Cost >= 0) { this.gameObject.transform.parent.parent.parent.parent.parent.gameObject.SetActive(false); changer.ActivateBuildState(); objectGrid.SpawnNewObjectWithID(itemID, item.Cost, item.HappinessFactor); GameSystem.Instance.SubMoney(item.Cost); GameSystem.Instance.AddHappiness(item.HappinessFactor); } } } }
// Keyboard Input for Debuging void Update() { if (Input.GetKeyUp("h")) { Debug.Log("Place"); objectGridPlacement.UIPlaceObjectOnGrid(); } if (Input.GetKeyUp("j")) { Debug.Log("Not Place"); objectGridPlacement.UISetObjectOnGridBack(); } if (Input.GetKeyUp("k")) { Debug.Log("Rotate"); objectGridPlacement.UIRotateObjectOnGrid(); } if (Input.GetKeyUp("l")) { Debug.Log("Delete"); objectGridPlacement.UIRemoveObjectOnGrid(); } if (Input.GetKeyUp("v")) { Debug.Log("Activate UI State"); stateChange.ActivateUIState(); } if (Input.GetKeyUp("b")) { Debug.Log("Activate Bar State"); stateChange.ActivateBarState(); } if (Input.GetKeyUp("n")) { Debug.Log("Activate Build State"); stateChange.ActivateBuildState(); } if (Input.GetKeyUp("m")) { Debug.Log("Activate Space State"); stateChange.ActivateSpaceState(); } if (Input.GetKeyDown("space")) { stateChange.ActivateBarState(); objectGridInstantiate.SpawnNewObjectWithID(4, 0, 0); } if (Input.GetKeyDown("a")) { objectGridInstantiate.LoadObjects(); } if (Input.GetKeyDown("s")) { objectGridInstantiate.EmptyObjectGrid(); } }