public bool RunFixAction() { Vector2 fixLocation; if (actions.Count > 0) { if (actions[0].GetActionType() == UnitAction.ActionType.FIX) { actionTimer += Time.deltaTime; fixLocation = actions[0].GetActionTarget(); if (actionTimer >= ACTION_TIME) { if (Random.value < GetFixChance(fixLocation)) { SkillStorage.AddUpgradePoint(); TileManager.Instance.ClearDisaster(actions[0].GetActionTarget()); } else { SoundSystem.Instance.PlaySound(SoundEvents.DisasterRepairFailure); } Debug.Log("Attempted fix at " + Time.time); actionTimer = 0f; actions.RemoveAt(0); return(true); } return(false); } } return(true); }
// Update is called once per frame void Update() { remainingPoints.text = SkillStorage.GetRemainingPoints().ToString(); if (Input.GetKeyDown(KeyCode.Space)) { SkillStorage.AddUpgradePoint(); } }