/// <summary> /// Sets up the aiming reticle image. /// </summary> private void RefreshAimReticle() { // get player char the UI is associated with PlayerCharacterMasterController playerChar = _uiManager.UiPlayerCharacter; // if player char found if (playerChar != null) { // get weapon slot currently being used WeaponSlotData equippedWepSlot = playerChar.GetEquippedWeaponSlot(); // if weapon slot found if (equippedWepSlot != null) { // get currently equipped weapon WeaponData equippedWep = playerChar.GetEquippedWeapon(); // if a weapon IS equipped if (equippedWep != null) { // load the aiming reticle associated with equipped weapon Sprite loadedAimReticle = AssetRefMethods. LoadBundleAssetWeaponTypeReticle(equippedWep.weaponType); // if a reticle was found if (loadedAimReticle != null) { // set reticle image to loaded sprite reticle.sprite = loadedAimReticle; // activate aim reticle reticle.gameObject.SetActive(true); // DONT continue code return; } // else NO reticle was loaded else { // print warning to console Debug.LogWarning("No aiming reticle assoicated with weapon " + $"type: {equippedWep.weaponType.ToString()}"); } } } } // deactivate aim reticle reticle.gameObject.SetActive(false); }