예제 #1
0
 void EquipSpell(int index)
 {
     DeactivateSpells();
     canFire     = true;
     activeSpell = spells[index];
     activeSpell.Equip();
     spells[index].gameObject.SetActive(true);
 }
예제 #2
0
 void Equip(int index)
 {
     DeactivateWeapons();
     canFire      = true;
     activeWeapon = weapons[index];
     activeWeapon.Equip();
     weapons[index].gameObject.SetActive(true);
 }
예제 #3
0
 void EquipWeapon(int index)
 {
     DeactivateWeapons();
     activeWeapon = weapons[index];
     canFire      = true;
     activeWeapon.gameObject.SetActive(true);
     activeWeapon.Equip();
     OnWeaponSwitch?.Invoke(activeWeapon);
 }
예제 #4
0
 void Equip(int index)
 {
     DeactivateWeapons();
     canFire      = true;
     activeWeapon = weapons[index];
     activeWeapon.Equip();
     weapons[index].gameObject.SetActive(true);
     if (OnWeaponSwitch != null)
     {
         OnWeaponSwitch(activeWeapon);
     }
 }
예제 #5
0
    internal void EquipWeapon(int index)
    {
        DeactivateWeapons();
        m_ActiveWeapon = weapons [index];
        m_ActiveWeapon.Equip();
        weapons [index].gameObject.SetActive(true);
        CanFire = true;

        if (OnWeaponSwitched != null)
        {
            OnWeaponSwitched(m_ActiveWeapon);
        }
    }
예제 #6
0
 void Equip(int index)
 {
     // Deactivate all the weapons for momenteraly after default weapon chosen
     DeactiveWeapons();
     canFire = true;
     // activate default weapon gameObject
     activeWeapon = weapons[index];
     activeWeapon.Equip();
     weapons[index].gameObject.SetActive(true);
     if (onWeaponSwitch != null)
     {
         onWeaponSwitch(activeWeapon);
     }
 }
예제 #7
0
    internal void Equip(int indexOfWeapon)
    {
        DeactivateWeapons();
        CanFire = true;

        indexOfWeapon = CheckInactive(indexOfWeapon);

        m_ActiveWeapon = weapons[indexOfWeapon];
        m_ActiveWeapon.Equip();

        weapons[indexOfWeapon].gameObject.SetActive(true);
        weapons[indexOfWeapon].GetComponent <WeaponReloader>().WeaponImage.GetComponent <Image>().enabled = true;
        weapons[indexOfWeapon].GetComponent <WeaponReloader>().BulletImage.GetComponent <Image>().enabled = true;
        weaponSwitch.Play();
        if (OnWeaponSwitch != null)
        {
            OnWeaponSwitch(m_ActiveWeapon);
        }
    }
예제 #8
0
 public void Equip(Shooter shooter)
 {
     currentWeapon         = shooter;
     shooter.isLocalPlayer = true;
     shooter.Equip();
 }