当前位置: 首页>>代码示例>>C#>>正文


C# Inventory.AddAmmo方法代码示例

本文整理汇总了C#中Inventory.AddAmmo方法的典型用法代码示例。如果您正苦于以下问题:C# Inventory.AddAmmo方法的具体用法?C# Inventory.AddAmmo怎么用?C# Inventory.AddAmmo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Inventory的用法示例。


在下文中一共展示了Inventory.AddAmmo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnAdded

        // Called when the item is added to the inventory list.
        public override void OnAdded(Inventory inventory)
        {
            base.OnAdded(inventory);
            int[] maxAmounts = { 20, 30, 50 };

            this.currentAmmo = 0;

            this.ammo = new Ammo[] {
                inventory.AddAmmo(
                    new AmmoSatchelSeeds(
                        "ammo_ember_seeds", "Ember Seeds", "A burst of fire!",
                        new Sprite(GameData.SHEET_ITEMS_SMALL, new Point2I(0, 3)),
                        0, maxAmounts[level]
                    ),
                    false
                ),
                inventory.AddAmmo(
                    new AmmoSatchelSeeds(
                        "ammo_scent_seeds", "Scent Seeds", "An aromatic blast!",
                        new Sprite(GameData.SHEET_ITEMS_SMALL, new Point2I(1, 3)),
                        0, maxAmounts[level]
                    ),
                    false
                ),
                inventory.AddAmmo(
                    new AmmoSatchelSeeds(
                        "ammo_pegasus_seeds", "Pegasus Seeds", "Steals speed?",
                        new Sprite(GameData.SHEET_ITEMS_SMALL, new Point2I(2, 3)),
                        0, maxAmounts[level]
                    ),
                    false
                ),
                inventory.AddAmmo(
                    new AmmoSatchelSeeds(
                        "ammo_gale_seeds", "Gale Seeds", "A mighty blow!",
                        new Sprite(GameData.SHEET_ITEMS_SMALL, new Point2I(3, 3)),
                        0, maxAmounts[level]
                    ),
                    false
                ),
                inventory.AddAmmo(
                    new AmmoSatchelSeeds(
                        "ammo_mystery_seeds", "Mystery Seeds", "A producer of unknown effects.",
                        new Sprite(GameData.SHEET_ITEMS_SMALL, new Point2I(4, 3)),
                        0, maxAmounts[level]
                    ),
                    false
                )
            };
        }
开发者ID:dreamsxin,项目名称:ZeldaOracle,代码行数:51,代码来源:ItemSeedSatchel.cs

示例2: OnAdded

        //-----------------------------------------------------------------------------
        // Virtual
        //-----------------------------------------------------------------------------
        // Called when the item is added to the inventory list
        public override void OnAdded(Inventory inventory)
        {
            base.OnAdded(inventory);
            int[] maxAmounts = { 99, 300, 999 };

            inventory.AddAmmo(
                new Ammo(
                    "rupees", "Rupees", "A currency.",
                    new Sprite(GameData.SHEET_ITEMS_SMALL, new Point2I(5, 3)),
                    0, maxAmounts[level]
                ),
                false
            );
        }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:18,代码来源:ItemWallet.cs

示例3: OnAdded

        // Called when the item is added to the inventory list.
        public override void OnAdded(Inventory inventory)
        {
            base.OnAdded(inventory);
            int[] maxAmounts = { 30, 40, 50 };

            this.currentAmmo = 0;
            this.ammo = new Ammo[] {
                inventory.AddAmmo(
                    new Ammo(
                        "ammo_arrows", "Arrows", "A standard arrow.",
                        new Sprite(GameData.SHEET_ITEMS_SMALL, new Point2I(15, 1)),
                        maxAmounts[level], maxAmounts[level]
                    ),
                    false
                )
            };
        }
开发者ID:dreamsxin,项目名称:ZeldaOracle,代码行数:18,代码来源:ItemBow.cs


注:本文中的Inventory.AddAmmo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。