/// <inheritdoc cref="IDrawer.GetRandomValue" />
        protected override object GetRandomValue()
        {
            var type = Type;

            if (type.IsPrimitive)
            {
                if (type == Types.Int)
                {
                    return(RandomUtils.Int());
                }
                else if (type == Types.Float)
                {
                    return(RandomUtils.Float(float.MinValue, float.MaxValue));
                }
                else if (type == Types.Char)
                {
                    return(RandomUtils.Char());
                }
                else if (type == Types.Bool)
                {
                    return(RandomUtils.Bool());
                }
                else if (type == Types.Double)
                {
                    return(RandomUtils.Double(double.MinValue, double.MaxValue));
                }
            }
            else if (type == Types.String)
            {
                return(RandomUtils.String(0, 100));
            }

                        #if DEV_MODE
            Debug.LogError(GetType().Name + " Randomize was not supported for type " + StringUtils.ToString(type));
                        #endif

            return(type.DefaultValue());
        }
示例#2
0
 /// <inheritdoc />
 protected override char GetRandomValue()
 {
     return(RandomUtils.Char());
 }