protected void PrevImage() { int num = Array.IndexOf(mSlotItemAlbumDetailTextureInfos, mCurrentShipAlbumDetailTextureInfo); int num2 = num - 1; SlotItemAlbumDetailTextureInfo slotItemAlbumDetailTextureInfo = (0 > num2) ? mSlotItemAlbumDetailTextureInfos[mSlotItemAlbumDetailTextureInfos.Length - 1] : mSlotItemAlbumDetailTextureInfos[num2]; ChangeFocusTexture(slotItemAlbumDetailTextureInfo); }
protected void NextImage() { int num = Array.IndexOf(mSlotItemAlbumDetailTextureInfos, mCurrentShipAlbumDetailTextureInfo); int num2 = num + 1; SlotItemAlbumDetailTextureInfo slotItemAlbumDetailTextureInfo = (num2 >= mSlotItemAlbumDetailTextureInfos.Length) ? mSlotItemAlbumDetailTextureInfos[0] : mSlotItemAlbumDetailTextureInfos[num2]; ChangeFocusTexture(slotItemAlbumDetailTextureInfo); }
private void ChangeFocusTexture(SlotItemAlbumDetailTextureInfo slotItemAlbumDetailTextureInfo) { mCurrentShipAlbumDetailTextureInfo = slotItemAlbumDetailTextureInfo; mTexture_SlotItem.mainTexture = mCurrentShipAlbumDetailTextureInfo.RequestTexture(); if (mCurrentShipAlbumDetailTextureInfo.NeedPixelPerfect()) { mTexture_SlotItem.MakePixelPerfect(); } else { int width = mCurrentShipAlbumDetailTextureInfo.GetWidth(); int height = mCurrentShipAlbumDetailTextureInfo.GetHeight(); mTexture_SlotItem.SetDimensions(width, height); } mTransform_OffsetForTexture.transform.localScale = mCurrentShipAlbumDetailTextureInfo.GetScale(); mTransform_OffsetForTexture.transform.localPosition = mCurrentShipAlbumDetailTextureInfo.GetOffset(); }
private void OnDestroy() { mPanelThis = null; mButtonManager = null; mTransform_OffsetForTexture = null; mTexture_SlotItem = null; mTexture_TypeIcon = null; mTexture_SlotItemTypeBackground = null; mButton_Next = null; mButton_Prev = null; mLabel_No = null; mLabel_Name = null; mLabel_Description = null; mLabel_TypeName = null; mParameters = null; mTextures_EquipmentShipIcon = null; mButtons_Focasable = null; mSlotItemAlbumDetailTextureInfos = null; mCurrentShipAlbumDetailTextureInfo = null; mCurrentFocusButton = null; mKeyController = null; mAlbumSlotModel = null; }
public void Initialize(AlbumSlotModel albumSlotModel) { _Stc_R = false; mAlbumSlotModel = albumSlotModel; int maxLineInFullWidthChar = 22; int fullWidthCharBuffer = 1; if (mSlotItemAlbumDetailTextureInfos != null) { SlotItemAlbumDetailTextureInfo[] array = mSlotItemAlbumDetailTextureInfos; foreach (SlotItemAlbumDetailTextureInfo slotItemAlbumDetailTextureInfo in array) { slotItemAlbumDetailTextureInfo.ReleaseTexture(); } } mSlotItemAlbumDetailTextureInfos = SlotItemAlbumDetailTextureInfo.GenerateSlotItemGraphicsInfo(albumSlotModel); if (mTexture_SlotItemTypeBackground.mainTexture != null) { Resources.UnloadAsset(mTexture_SlotItemTypeBackground.mainTexture); mTexture_SlotItemTypeBackground.mainTexture = null; } mTexture_SlotItemTypeBackground.mainTexture = RequestTextureShipTypeBackGround(mAlbumSlotModel.Type2); mLabel_TypeName.text = Utils.GetSlotitemType3Name(mAlbumSlotModel.Type3); mLabel_No.text = $"{mAlbumSlotModel.Id:000}"; mLabel_Name.text = mAlbumSlotModel.Name; InitializeEquipmentShipIcons(mAlbumSlotModel); InitializeParameters(mAlbumSlotModel); if (mTexture_TypeIcon.mainTexture != null) { Resources.UnloadAsset(mTexture_TypeIcon.mainTexture); } mTexture_TypeIcon.mainTexture = null; mTexture_TypeIcon.mainTexture = RequestTextureTypeIcon(mAlbumSlotModel.Type4); mLabel_Description.text = UserInterfaceAlbumManager.Utils.NormalizeDescription(maxLineInFullWidthChar, fullWidthCharBuffer, mAlbumSlotModel.Detail); mButtons_Focasable = GetFocasableButtons(); ChangeFocusTexture(mSlotItemAlbumDetailTextureInfos[0]); }