/// <summary> /// Sets up the ammo type image based on ammo being used. /// </summary> private void RefreshAmmoTypeImage() { // get currently equipped ammo pouch AmmoPouch equippedAmmoPouch = _uiManager.UiPlayerCharacter.GetEquippedAmmoPouch(); // if pouch found if (equippedAmmoPouch != null) { // load sprite icon associated with type of ammo being used Sprite ammoTypeIcon = AssetRefMethods.LoadBundleAssetWeaponTypeSetIcon( equippedAmmoPouch.ammoType.setId); // if sprite successfully loaded if (ammoTypeIcon != null) { // set ammo type image to loaded sprite imageAmmoType.sprite = ammoTypeIcon; // turn ON ammo type image object imageAmmoType.gameObject.SetActive(true); // DONT continue code return; } } // getting here means that ammo type image should NOT be used, so turn OFF the image object imageAmmoType.gameObject.SetActive(false); }