/// <summary>
        /// Get the stat object representing a named stat. If it does not already
        /// exist it will be created with a base value.
        /// </summary>
        /// <param name="name">Tha name of the stat to Get or Create for this controller</param>
        /// <returns>A StatSO representing the named stat</returns>
        public StatSO GetOrCreateStat(string name, float value = 0)
        {
            StatSO stat = GetStat(name);

            if (stat != null)
            {
                return(stat);
            }

            stat       = ScriptableObject.CreateInstance <StatSO>();
            stat.name  = name;
            stat.value = value;
            for (int i = 0; i < desiredStates.Length; i++)
            {
                if (stat.GetType() == desiredStates[i].stat.GetType())
                {
                    stat.desiredState = desiredStates[i];
                    break;
                }
            }

            m_Stats.Add(stat);
            return(stat);
        }