Пример #1
0
        public static void AddDustCloudWithResources(string name, string type, LuaTable position, float resources, LuaTable color, float spin, float radius, int refill)
        {
            //Log.WriteLine("Adding dust cloud \"" + name + "\".");

            Vector3 pos = LuaTableToVector3(position);
            Vector4 col = LuaTableToVector4(color);

            string        newType       = type.ToLower();
            DustCloudType dustCloudType = DustCloudType.GetTypeFromName(newType);

            bool bRefill = false;

            if (refill != 0)
            {
                bRefill = true;
            }

            if (dustCloudType == null)
            {
                new Problem(ProblemTypes.WARNING, "Dust cloud type \"" + newType + "\" not found. Skipping dust cloud \"" + name + "\".");
                return;
            }

            new DustCloud(name, dustCloudType, pos, resources, col, spin, radius, bRefill);
        }
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            if (value is string)
            {
                DustCloudType type = DustCloudType.GetTypeFromName((string)value);

                if (type != null)
                {
                    return(type);
                }
                else
                {
                    return(DustCloudType.DustCloudTypes[0]);
                }
            }
            return(base.ConvertFrom(context, culture, value));
        }
Пример #3
0
        public static void AddDustCloud(string name, string type, LuaTable position, LuaTable color, float spin, float radius)
        {
            //Log.WriteLine("Adding dust cloud \"" + name + "\".");

            Vector3 pos = LuaTableToVector3(position);
            Vector4 col = LuaTableToVector4(color);

            string        newType       = type.ToLower();
            DustCloudType dustCloudType = DustCloudType.GetTypeFromName(newType);

            if (dustCloudType == null)
            {
                new Problem(ProblemTypes.WARNING, "Dust cloud type \"" + newType + "\" not found. Skipping dust cloud \"" + name + "\".");
                return;
            }

            new DustCloud(name, dustCloudType, pos, col, spin, radius);
        }