ReserveProjectileID() static private method

static private ReserveProjectileID ( ) : int
return int
示例#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);
        }
示例#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;
        }