コード例 #1
0
 // 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);
     }
 }
コード例 #2
0
 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();
             }
         }
     }
 }
コード例 #3
0
 public void CompleteTask(toDoListScript.ToDoTasks tasks)
 {
     toDoList.CrossOut(tasks);
 }