public static object GetValue(this ConfigValue value, Type type)
        {
            if (type.TypeEquals <string>())
            {
                return(value.StringValue);
            }
            if (type.TypeEquals <long>())
            {
                return(value.LongValue);
            }
            if (type.TypeEquals <int>())
            {
                return(Convert.ToInt32(value.LongValue));
            }
            if (type.TypeEquals <double>())
            {
                return(value.DoubleValue);
            }
            if (type.TypeEquals <float>())
            {
                return(Convert.ToSingle(value.DoubleValue));
            }
            if (type.TypeEquals <bool>())
            {
                return(value.BooleanValue);
            }
            if (type.TypeEquals <Color>())
            {
                return(value.ColorValue(Color.white));
            }
            if (type.TypeEquals <Color[]>())
            {
                return(value.ColorArrayValue());
            }
            if (type.TypeEquals <int[]>())
            {
                return(value.IntArrayValue());
            }
            if (type.TypeEquals <long[]>())
            {
                return(value.LongArrayValue());
            }
            if (type.TypeEquals <float[]>())
            {
                return(value.FloatArrayValue());
            }
            if (type.TypeEquals <double[]>())
            {
                return(value.DoubleArrayValue());
            }
            if (type.TypeEquals <string[]>())
            {
                return(value.StringArrayValue());
            }

            throw new Exception($"RemoteConfig got confused by {type}");
        }
        public static Color[] ColorArrayValue(this ConfigValue value, Color[] defaultValue = null)
        {
            if (!value.HasValue())
            {
                return(defaultValue);
            }
            var strings = value.StringArrayValue();
            var retval  = new List <Color>(strings.Length);

            foreach (var s in strings)
            {
                retval.Add(s.ToColor());
            }
            return(retval.ToArray());
        }