Пример #1
0
        // Checks if the given stat is > or < the value. Returns true/false.
        // If no stat of that name is found, 0 is given as the stat's value
        public static bool Compare_Float_Stat(string stat_name, Float_Stat_Comparator than, float value)
        {
            // Check if the stat exists
            if (!StatsManager.Numbered_Stat_Exists(stat_name))
            {
                Debug.Log(stat_name + " Numbered Stat does not exist. Returning default value for stat: 0");
            }

            bool result = false;
            // Check if it meets the requirements
            float stat = StatsManager.Get_Numbered_Stat(stat_name);

            switch (than)
            {
            case Float_Stat_Comparator.Greater_than:
                result = stat > value;
                break;

            case Float_Stat_Comparator.Less_than:
                result = stat < value;
                break;
            }
            return(result);
        }
Пример #2
0
    // Checks if the given stat is > or < the value. Returns true/false.
    // If no stat of that name is found, 0 is given as the stat's value
    public static bool Compare_Float_Stat(string stat_name, Float_Stat_Comparator than, float value)
    {
        // Check if the stat exists
        if (!StatsManager.Numbered_Stat_Exists(stat_name))
        {
            Debug.Log(stat_name + " Numbered Stat does not exist. Returning default value for stat: 0");
        }

        bool result = false;
        // Check if it meets the requirements
        float stat = StatsManager.Get_Numbered_Stat(stat_name);
        switch (than)
        {
            case Float_Stat_Comparator.Greater_than:
                result = stat > value;
                break;
            case Float_Stat_Comparator.Less_than:
                result = stat < value;
                break;
        }
        return result;
    }