public void SetupWeaponIco() { UiManager.Instance.SetWeaponMainIcon(CurrWeapon.weaponUiIcon); if (WeaponBag.Count > 1) { UiManager.Instance.SetWeaponSecondIcon(WeaponBag.IndexOf(CurrWeapon) == 0 ? WeaponBag[1].weaponUiIcon : WeaponBag[0].weaponUiIcon); } }
/// <summary> /// 切换至下个武器 /// </summary> public void NextWeapon() { if (CurrWeapon == null || WeaponBag.Count < 2) { return; } var index = WeaponBag.IndexOf(CurrWeapon); index++; if (index > WeaponBag.Count - 1) { index = 0; } UnEquipWeapon(false); EquipWeapon(WeaponBag[index], false); UiManager.Instance.SetWeaponMainIcon(WeaponBag[index].weaponUiIcon); UiManager.Instance.SetWeaponSecondIcon(WeaponBag[index + 1 > WeaponBag.Count - 1 ? 0 : index + 1] .weaponUiIcon); }