コード例 #1
0
ファイル: Game.cs プロジェクト: safonce/sayur
    public Game()
    {
        Coins            = 0;
        Level            = 1;
        ExperiencePoints = 0;

        CurrentLevel = "Suburb";

        Bag = new Bag();

        InventoryWeapons = new List <InventoryWeapon> ();

        InventoryWeapon inventoryWeapon = new InventoryWeapon(WeaponDatabase.GetWeapon(0), true);

        InventoryWeapons.Add(inventoryWeapon);

        Bag.AddWeapon(InventoryWeapons [0].Weapon.ID);

        Heroes = new List <HeroParty> ();

        HeroParty heroParty = new HeroParty(HeroDatabase.GetHero(0), true);

        Heroes.Add(heroParty);

        CurrentHero = Heroes [0].Hero;

        Paused         = false;
        AutoAimTarget  = true;
        savedTimeScale = 1;

        achievementManager = new AchievementManager();
    }
コード例 #2
0
ファイル: LobbyManager.cs プロジェクト: safonce/sayur
 void CheckWeaponForUpdate()
 {
     for (int i = 0; i < WeaponDatabase.GetWeaponsLength(); i++)
     {
         WeaponData weapon = WeaponDatabase.GetWeapon(i);
         Game.current.AddWeaponToInventory(weapon);
     }
 }
コード例 #3
0
        private void ChangeWeaponRPC(int index, bool isUpgrade)
        {
            if (isUpgrade)
            {
                OnUpgradeWeapon?.Invoke();
            }


            var newWeapon = WeaponDatabase.GetWeapon(index);

            SetWeapon(newWeapon);
        }
コード例 #4
0
    public void AddWeapon(int weaponIndex)
    {
        if (InventoryIsFull())
        {
            return;
        }

        bool isExist = false;

        for (int i = 0; i < weapons.Length; i++)
        {
            if (weapons [i] == null)
            {
                continue;
            }

            if (weapons[i].ID == weaponIndex)
            {
                isExist = true;
                break;
            }
        }

        if (!isExist)
        {
            for (int i = 0; i < weapons.Length; i++)
            {
                if (weapons [i] == null)
                {
                    weapons [i] = WeaponDatabase.GetWeapon(weaponIndex);

                    return;
                }
            }
        }
    }