コード例 #1
0
        public static void Start(Context context, MainWeapon weapon)
        {
            var intent = new Intent(context, typeof(WeaponDetailActivity));

            var bundle = new Bundle();

            bundle.PutString("weapon", JsonSerializer.SerializeToString <MainWeapon>(weapon));

            intent.PutExtras(bundle);

            context.StartActivity(intent);
        }
コード例 #2
0
    private void InitializeEquipment()
    {
        WeaponLeft = (Resources.Load <MainWeapon>("Equipment/Weapons/" + Loadout.WeaponLeft.name));
        WeaponLeft.InitializeModel(WeaponLeftPivot.transform);
        WeaponLeft.mech = this;

        WeaponRight = (Resources.Load <MainWeapon>("Equipment/Weapons/" + Loadout.WeaponRight.name));
        WeaponRight.InitializeModel(WeaponRightPivot.transform);
        WeaponRight.mech = this;

        SubWeapon = (Resources.Load <SubWeapon>("Equipment/Weapons/" + Loadout.SubWeapon.name));
        SubWeapon.InitializeModel(SubWeaponPivot.transform);
        SubWeapon.mech = this;

        Mod = (Resources.Load <Mod>("Equipment/Mods/" + Loadout.Mod.name));
        Mod.InitializeModel(ModPivot.transform);
        Mod.mech = this;
    }
コード例 #3
0
ファイル: Player.cs プロジェクト: HendricksonTyler/ambrosia
 public Player(ammoType theAmmoType, bombType theBombtype)
 {
     blenderBlaster = new MainWeapon(theAmmoType);
     omNomBomb      = new SubWeapon(theBombtype);
 }
コード例 #4
0
 void RemoveWeapon()
 {
     mainWeapon = null;
     animator.SetInteger("WeaponType", 0);
 }
コード例 #5
0
 void UpdateWeapon(MainWeapon weapon)
 {
     mainWeapon = weapon;
     animator.SetInteger("WeaponType", (int)mainWeapon.type);
 }
コード例 #6
0
ファイル: Player.cs プロジェクト: pingerman/Serafim
 /// <summary>
 /// Установка основного, активного оружия игрока
 /// </summary>
 /// <param name="weapon">Основное оружие</param>
 public void SetMainWeapon(MainWeapon weapon)
 {
     mainWeapon = weapon;
 }
コード例 #7
0
ファイル: WeaponManager.cs プロジェクト: Cteps/MechCommando
 // Start is called before the first frame update
 void Start()
 {
     currentPrimary = GetComponentInChildren <MainWeapon>();
 }
コード例 #8
0
ファイル: Zombie.cs プロジェクト: ArtemUgrimov/ThirdPerson
 void UpdateWeapon(MainWeapon weapon)
 {
     mainWeapon = weapon;
 }
コード例 #9
0
    public void UpdateStatBlocks(String name)
    {
        switch (name)
        {
        case "Sub Weapon":
            SelectedSubWeapon = Resources.LoadAll <SubWeapon>(ResourcePaths.WeaponPath)
                                .FirstOrDefault(x => x.Name == SubWeapon.DropDown.GetComponentInChildren <Text>().text);

            if (SelectedSubWeapon == null)
            {
                SelectedSubWeapon = Resources.LoadAll <SubWeapon>(ResourcePaths.WeaponPath)[0];
                SubWeapon.DropDown.GetComponentInChildren <Text>().text = SelectedSubWeapon.Name;

                Debug.Log("auto-picked " + name + ".");
            }

            SubWeapon.Damage       = SelectedSubWeapon.BaseDamage;
            SubWeapon.Health       = SelectedSubWeapon.Health;
            SubWeapon.Element      = SelectedSubWeapon.Element;
            SubWeapon.ElementPower = SelectedSubWeapon.ElementPower;
            SubWeapon.UpdateUI();
            break;

        case "Left Weapon":

            SelectedLeftWeapon = Resources.LoadAll <MainWeapon>(ResourcePaths.WeaponPath)
                                 .FirstOrDefault(x => x.Name == LeftWeapon.DropDown.GetComponentInChildren <Text>().text);

            if (SelectedLeftWeapon == null)
            {
                SelectedLeftWeapon = Resources.LoadAll <MainWeapon>(ResourcePaths.WeaponPath)[0];
                LeftWeapon.DropDown.GetComponentInChildren <Text>().text = SelectedLeftWeapon.Name;

                Debug.Log("auto-picked " + name + ".");
            }

            LeftWeapon.Damage       = SelectedLeftWeapon.BaseDamage;
            LeftWeapon.Health       = SelectedLeftWeapon.Health;
            LeftWeapon.Element      = SelectedLeftWeapon.Element;
            LeftWeapon.ElementPower = SelectedLeftWeapon.ElementPower;
            LeftWeapon.UpdateUI();
            break;

        case "Right Weapon":

            SelectedRightWeapon = Resources.LoadAll <MainWeapon>(ResourcePaths.WeaponPath)
                                  .FirstOrDefault(x => x.Name == RightWeapon.DropDown.GetComponentInChildren <Text>().text);

            if (SelectedRightWeapon == null)
            {
                SelectedRightWeapon = Resources.LoadAll <MainWeapon>(ResourcePaths.WeaponPath)[0];
                RightWeapon.DropDown.GetComponentInChildren <Text>().text = SelectedRightWeapon.Name;

                Debug.Log("auto-picked " + name + ".");
            }

            RightWeapon.Damage       = SelectedRightWeapon.BaseDamage;
            RightWeapon.Health       = SelectedRightWeapon.Health;
            RightWeapon.Element      = SelectedRightWeapon.Element;
            RightWeapon.ElementPower = SelectedRightWeapon.ElementPower;
            RightWeapon.UpdateUI();
            break;

        case "Mod":

            SelectedMod = Resources.LoadAll <Mod>(ResourcePaths.ModPath)
                          .FirstOrDefault(x => x.Name == Mod.DropDown.GetComponentInChildren <Text>().text);

            if (SelectedMod == null)
            {
                SelectedMod = Resources.LoadAll <Mod>(ResourcePaths.ModPath)[0];
                Mod.DropDown.GetComponentInChildren <Text>().text = SelectedMod.Name;

                Debug.Log("auto-picked " + name + ".");
            }

            Mod.Health = SelectedMod.Health;
            Mod.UpdateUI();
            break;

        case "Armor":
            break;
        }
    }