// Finds the stat of the given name and compares it to is_ // If the stat is not found, false is given as the stat value public static bool Compare_Bool_Stat_To(string stat_name, bool is_) { // Check if the stat exists if (!StatsManager.Boolean_Stat_Exists(stat_name) && VNSceneManager.verbose_debug_logs) { Debug.Log("Comparing bool stat. " + stat_name + " does not exist"); } return(StatsManager.Get_Boolean_Stat(stat_name) == is_); }
void Update() { // Don't do anything if no Stat name is defined if (string.IsNullOrEmpty(name_of_stat_to_retrieve)) { return; } string stat = ""; // Retrieve the correct stat switch (type_of_stat_to_retrieve) { case Type_of_Stat.Numbered_Stat: // Check if we should display nothing if the stat does not exist if (display_nothing_if_stat_not_present && !StatsManager.Numbered_Stat_Exists(name_of_stat_to_retrieve)) { text_element.text = ""; return; } stat = "" + StatsManager.Get_Numbered_Stat(name_of_stat_to_retrieve); break; case Type_of_Stat.String_Stat: if (display_nothing_if_stat_not_present && !StatsManager.String_Stat_Exists(name_of_stat_to_retrieve)) { text_element.text = ""; return; } stat = StatsManager.Get_String_Stat(name_of_stat_to_retrieve); break; case Type_of_Stat.Boolean_Stat: if (display_nothing_if_stat_not_present && !StatsManager.Boolean_Stat_Exists(name_of_stat_to_retrieve)) { text_element.text = ""; return; } stat = "" + StatsManager.Get_Boolean_Stat(name_of_stat_to_retrieve); break; } // Construct the actual string text_element.text = message_before_stat + stat + message_after_stat; }