ReserveProjectileID() static private method

static private ReserveProjectileID ( ) : int
return int
Beispiel #1
0
        protected sealed override void Register()
        {
            ModTypeLookup <ModProjectile> .Register(this);

            projectile.type = ProjectileLoader.ReserveProjectileID();
            DisplayName     = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.ProjectileName.{Name}");

            ProjectileLoader.projectiles.Add(this);
        }
Beispiel #2
0
        public void AddProjectile(string name, ModProjectile projectile, string texture)
        {
            int id = ProjectileLoader.ReserveProjectileID();

            projectile.projectile.name       = name;
            projectile.Name                  = name;
            projectile.projectile.type       = id;
            projectiles[name]                = projectile;
            ProjectileLoader.projectiles[id] = projectile;
            projectile.texture               = texture;
            projectile.mod = this;
        }