ReserveProjectileID() static private method

static private ReserveProjectileID ( ) : int
return int
コード例 #1
0
ファイル: ModProjectile.cs プロジェクト: Tea-Mod-Loader/Tea
        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;
        }