// Update is called once per frame void Update() { if (toggle) { if (myObjective.myObjectiveChecker.GetValue() == 1) { toggle.isOn = true; } else { toggle.isOn = false; } } if (slider) { slider.maxValue = myObjective.requiredValue; slider.value = myObjective.myObjectiveChecker.GetValue(); } if (numText) { switch (myObjective.myDisplayType) { case Objective.displayType.justValue: numText.text = ((int)myObjective.myObjectiveChecker.GetValue()).ToString(); break; case Objective.displayType.fraction: numText.text = ((int)myObjective.myObjectiveChecker.GetValue()).ToString() + "/" + myObjective.requiredValue.ToString(); break; case Objective.displayType.countdown: numText.text = GameObjectiveMaster.TimeToString(((int)myObjective.requiredValue - (int)myObjective.myObjectiveChecker.GetValue())); break; } } if (myObjective.isDone) { Done(); } else { NotDone(); } }
void Awake() { s = this; isFinished = false; }