// Update is called once per frame void Update() { if (Input.GetKeyDown(increaseHealthbar)) { ui.DamageKing(-0.1f); } if (Input.GetKeyDown(decreaseHealthbar)) { ui.DamageKing(0.1f); } if (Input.GetKeyDown(speedUpTime)) { if (Time.timeScale == 1) { Time.timeScale = timeMultiplier; } else { Time.timeScale = 1; } } if (Input.GetKeyDown(showAlert)) { StartCoroutine(ui.ShowAlertText()); } if (Input.GetKeyDown(showText)) { StartCoroutine(textBox.SetText(textToUse, 2.0f)); } if (Input.GetKeyDown(strike1)) { listScript.CrossOut(toDoListScript.ToDoTasks.SUPERMARKET); } if (Input.GetKeyDown(strike2)) { listScript.CrossOut(toDoListScript.ToDoTasks.BLACKSMITH); } if (Input.GetKeyDown(strike3)) { listScript.CrossOut(toDoListScript.ToDoTasks.CHURCH); } if (Input.GetKeyDown(strike4)) { listScript.CrossOut(toDoListScript.ToDoTasks.TAXCOLLECTION); } if (Input.GetKeyDown(strike5)) { listScript.CrossOut(toDoListScript.ToDoTasks.ATTENDEXECUTION); } }
public void AttemptToCompleteObjective() { foreach (Objective obj in objectives) { // If king is outside objective radius then return float sqrDistanceFromWaypoint = Vector3.SqrMagnitude(obj.gameObj.transform.position - gameObject.transform.position); if (sqrDistanceFromWaypoint < obj.radius && !obj.completed) { obj.completed = true; StartCoroutine(Dialogue((int)obj.objType)); toDoListScript.CrossOut(obj.objType); totalObj -= 1; if (totalObj <= 0) { uiScript.SuccessState(); } } } }
public void CompleteTask(toDoListScript.ToDoTasks tasks) { toDoList.CrossOut(tasks); }