Beispiel #1
0
        public override void Run_Node()
        {
            switch (stat_type)
            {
            case Stat_Type.Set_Number:
                StatsManager.Set_Numbered_Stat(stat_name, set_number_to);
                break;

            case Stat_Type.Modify_Number:
                StatsManager.Add_To_Numbered_Stat(stat_name, modify_number_amount);
                break;

            case Stat_Type.Set_Boolean:
                StatsManager.Set_Boolean_Stat(stat_name, set_bool_to);
                break;

            case Stat_Type.Toggle_Boolean:
                StatsManager.Toggle_Boolean_Stat(stat_name);
                break;

            case Stat_Type.Set_String:
                StatsManager.Set_String_Stat(stat_name, set_string_to);
                break;
            }

            if (print_all_stats_to_console)
            {
                StatsManager.Print_All_Stats();
            }

            Finish_Node();
        }
        public void InputfieldInputToStats(string stat_name)
        {
            switch (stat_type)
            {
            case Stat.Boolean_Stat:
                Debug.LogError("Boolean stats are not supported in InputfieldToStat", this.gameObject);
                break;

            case Stat.Numbered_Stat:
                StatsManager.Set_Numbered_Stat(stat_name, float.Parse(this.GetComponent <InputField>().text));
                break;

            case Stat.String_Stat:
                StatsManager.Set_String_Stat(stat_name, this.GetComponent <InputField>().text);
                break;
            }
        }