ReserveDustID() static private méthode

static private ReserveDustID ( ) : int
Résultat int
Exemple #1
0
        protected override sealed void Register()
        {
            Type = ModDust.ReserveDustID();

            ModTypeLookup <ModDust> .Register(this);

            ModDust.dusts.Add(this);
            Texture2D = !string.IsNullOrEmpty(Texture) ? ModContent.GetTexture(Texture).Value : TextureAssets.Dust.Value;
        }
Exemple #2
0
        public void AddDust(string name, ModDust dust, string texture = "")
        {
            int id = ModDust.ReserveDustID();

            ModDust.dusts[id] = dust;
            dust.Type         = id;
            dust.Name         = name;
            if (texture.Length > 0)
            {
                dust.Texture = ModLoader.GetTexture(texture);
            }
            else
            {
                dust.Texture = Main.dustTexture;
            }
            dust.mod    = this;
            dusts[name] = dust;
        }