public void SetupChip(ChipSphereIconButton.Parameter parameter) { NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, false); NGUITools.SetActiveSelf(this.chipDescriptLabel.gameObject, false); this.myParameter = parameter; switch (parameter.menuType) { case CMD_ChipSphere.MenuType.Empty: this.SetupEmpty(); break; case CMD_ChipSphere.MenuType.Extendable: this.SetupExtendable(); break; case CMD_ChipSphere.MenuType.NotYet: this.SetupNotYet(); break; case CMD_ChipSphere.MenuType.Detail: this.SetupDetail(this.myParameter.userChipId, this.myParameter.GetChipMainData()); break; default: global::Debug.LogError("ありえない."); break; } }
private void ChangeStatusRoot(ChipSphereIconButton.Parameter parameter) { for (int i = 0; i < this.chipSphereStatus.Length; i++) { this.chipSphereStatus[i].gameObject.SetActive(false); } switch (parameter.menuType) { case CMD_ChipSphere.MenuType.Empty: this.chipSphereStatus[0].gameObject.SetActive(true); this.chipSphereStatus[0].SetupDetail(parameter); break; case CMD_ChipSphere.MenuType.Extendable: this.chipSphereStatus[0].gameObject.SetActive(true); this.chipSphereStatus[0].SetupDetail(parameter); this.consumeItemCount = parameter.itemCount; break; case CMD_ChipSphere.MenuType.NotYet: this.chipSphereStatus[1].gameObject.SetActive(true); this.chipSphereStatus[1].SetupDetail(parameter); break; case CMD_ChipSphere.MenuType.Detail: this.chipSphereStatus[2].gameObject.SetActive(true); this.chipSphereStatus[2].SetupDetail(parameter); break; default: global::Debug.LogError("ありえない."); break; } }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (!(obj is ChipSphereIconButton.Parameter)) { return(false); } ChipSphereIconButton.Parameter rhs = (ChipSphereIconButton.Parameter)obj; return(this == rhs); }
public void OnTouchChipIcon(ChipSphereIconButton.Parameter parameter, bool doAnimationOff = true) { if (this.selectedChipParameter == parameter) { if (this.myMenuType == CMD_ChipSphere.MenuType.Empty || this.myMenuType == CMD_ChipSphere.MenuType.Detail) { this.HideLoopAnim(); this.ShowAttachPage(doAnimationOff); } return; } if (this.isTouchGuard) { return; } this.HideLoopAnim(); this.selectedChipParameter = parameter; if (!parameter.IsEmpty()) { this.currentUserChipList = ChipDataMng.GetUserChip(parameter.userChipId); } else { this.currentUserChipList = null; } this.chipSphereIconButtons[this.oldButtonIndex].SetUnChoose(); this.chipSphereIconButtons[parameter.buttonNo - 1].SetChoose(); this.oldButtonIndex = parameter.buttonNo - 1; this.myMenuType = parameter.menuType; if (!this.onceAnimFlag) { this.onceAnimFlag = true; this.ChangeStatusRoot(parameter); } else { this.cachedParameter = parameter; this.isTouchGuard = true; this.MoveAnim(); } }
public void SetupDetail(ChipSphereIconButton.Parameter parameter) { switch (parameter.menuType) { case CMD_ChipSphere.MenuType.Empty: NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, "ChipThumbnail/Chip_Empty", false, null); NGUITools.SetActiveSelf(this.chipTexture.gameObject, true); NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, false); NGUITools.SetActiveSelf(this.rareSprite.gameObject, false); NGUITools.SetActiveSelf(this.chipLookTexture.gameObject, false); NGUITools.SetActiveSelf(this.lookGO, false); this.messageLabel.text = StringMaster.GetString("ChipInstalling-03"); this.buttonLabel.text = StringMaster.GetString("ChipInstalling-04"); this.chipNameLabel.color = Color.white; this.myMenuType = parameter.menuType; this.buttonSprite.spriteName = "Common02_Btn_Green"; this.buttonCollider.enabled = true; this.buttonLabel.color = Color.white; this.buttonLabel.effectColor = this.defaultButtonLabelEffectColor; break; case CMD_ChipSphere.MenuType.Extendable: { NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, "ChipThumbnail/Chip_NotOpen", true, null); NGUITools.SetActiveSelf(this.lookGO, true); NGUITools.SetActiveSelf(this.rareSprite.gameObject, false); NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, true); NGUITools.SetActiveSelf(this.chipLookTexture.gameObject, false); NGUITools.SetActiveSelf(this.chipTexture.gameObject, true); int itemCount = parameter.itemCount; this.chipNameLabel.text = string.Format("×{0}", itemCount); this.buttonLabel.text = StringMaster.GetString("ChipInstalling-08"); global::Debug.LogFormat("{0} >= {1}, isOpened:{2}", new object[] { this.extendItemCount, itemCount, parameter.isOpened }); bool flag = this.extendItemCount >= itemCount; if (flag) { this.chipNameLabel.color = Color.white; } else { this.chipNameLabel.color = Color.red; } if (flag && parameter.isExtendable) { this.messageLabel.text = StringMaster.GetString("ChipInstalling-07"); this.buttonSprite.spriteName = "Common02_Btn_Green"; this.buttonCollider.enabled = true; this.buttonLabel.color = Color.white; this.buttonLabel.effectColor = this.defaultButtonLabelEffectColor; } else { this.messageLabel.text = StringMaster.GetString("ChipInstalling-11"); this.buttonSprite.spriteName = "Common02_Btn_Gray"; this.buttonCollider.enabled = false; this.buttonLabel.color = ConstValue.DEACTIVE_BUTTON_LABEL; this.buttonLabel.effectColor = ConstValue.DEACTIVE_BUTTON_LABEL; } this.myMenuType = parameter.menuType; break; } case CMD_ChipSphere.MenuType.NotYet: { this.chipNameLabel.text = parameter.chipName; NGUITools.SetActiveSelf(this.rareSprite.gameObject, false); string text = string.Format(StringMaster.GetString("ChipInstalling-10"), parameter.chipDetail); this.messageLabel.text = text; break; } case CMD_ChipSphere.MenuType.Detail: { this.chipNameLabel.text = parameter.chipName; this.messageLabel.text = parameter.chipDetail; NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, parameter.chipIconPath, false, null); NGUITools.SetActiveSelf(this.chipTexture.gameObject, true); this.rareSprite.spriteName = ChipTools.GetRankPath(parameter.chipRank); NGUITools.SetActiveSelf(this.rareSprite.gameObject, true); this.buttonSprite.spriteName = "Common02_Btn_Red"; this.buttonCollider.enabled = true; this.buttonLabel.color = Color.white; this.buttonLabel.effectColor = this.defaultButtonLabelEffectColor; GameWebAPI.RespDataMA_ChipM.Chip chipEnhancedData = ChipDataMng.GetChipEnhancedData(parameter.ConvertChipId()); if (chipEnhancedData != null) { if (this.reinforcementButtonSprite != null) { this.reinforcementButtonSprite.spriteName = "Common02_Btn_Green"; } if (this.reinforcementButtonCollider != null) { this.reinforcementButtonCollider.enabled = true; } if (this.reinforcementButtonLabel != null) { this.reinforcementButtonLabel.color = Color.white; } if (this.buttonLabel != null) { this.buttonLabel.effectColor = this.defaultReinforcementButtonLabelEffectColor; } } else { if (this.reinforcementButtonSprite != null) { this.reinforcementButtonSprite.spriteName = "Common02_Btn_Gray"; } if (this.reinforcementButtonCollider != null) { this.reinforcementButtonCollider.enabled = false; } if (this.reinforcementButtonLabel != null) { this.reinforcementButtonLabel.color = ConstValue.DEACTIVE_BUTTON_LABEL; } if (this.buttonLabel != null) { this.buttonLabel.effectColor = ConstValue.DEACTIVE_BUTTON_LABEL; } } break; } } }
private void SetupChipButtons() { GameObject original = Resources.Load <GameObject>("UICommon/Parts/Parts_Sphere_CHIP"); this.chipSphereIconButtons = new ChipSphereIconButton[this.chipButtonsPositions.Length]; DepthController component = this.sphereRoot.GetComponent <DepthController>(); int depth = this.sphereRoot.GetComponent <UIWidget>().depth; int myGrowStep = CMD_ChipSphere.DataChg.monsterMG.growStep.ToInt32(); int arousal = CMD_ChipSphere.DataChg.monsterM.GetArousal(); this.myMaxChipSlot = 5; int num = 0; if (CMD_ChipSphere.DataChg.GetChipEquip().GetSlotStatus() == null) { global::Debug.LogError("DataChg.GetSlotStatus() == null"); } else { GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.Manage slotStatus = CMD_ChipSphere.DataChg.GetChipEquip().GetSlotStatus(); global::Debug.LogFormat("無料:{0}/{1}, 課金:{2}/{3}", new object[] { slotStatus.slotNum, slotStatus.maxSlotNum, slotStatus.extraSlotNum, slotStatus.maxExtraSlotNum }); num = slotStatus.extraSlotNum; this.myMaxChipSlot = slotStatus.maxSlotNum + slotStatus.maxExtraSlotNum; if (this.myMaxChipSlot != 5 && this.myMaxChipSlot != 10) { global::Debug.LogErrorFormat("スロット数がありえない. myMaxChipSlot:{0} [{1}, {2}]", new object[] { this.myMaxChipSlot, slotStatus.maxSlotNum, slotStatus.maxExtraSlotNum }); this.myMaxChipSlot = 10; } } for (int i = 0; i < this.myMaxChipSlot; i++) { Transform transform = UnityEngine.Object.Instantiate <GameObject>(original).transform; transform.name = string.Format("Parts_Sphere_CHIP_{0}", i + 1); ChipSphereIconButton component2 = transform.GetComponent <ChipSphereIconButton>(); component.AddWidgetDepth(transform, depth); component2.cmdChipSphere = this; transform.SetParent(this.sphereRoot); transform.localScale = Vector3.one; transform.localPosition = this.chipButtonsPositions[i]; int num2 = i + 1; ChipSphereIconButton.Parameter parameter = this.CreateParameter(myGrowStep, arousal, num2); component2.SetupChip(parameter); component2.RefreshItemCountColor(this.extraPatchCount); component2.SetUnChoose(); this.chipSphereIconButtons[i] = component2; if (num2 >= 6) { if (num >= 0) { this.chipSphereIconButtons[num2 - 1].SetChipColor(true); } else { this.chipSphereIconButtons[num2 - 1].SetChipColor(false); } num--; } } this.RefreshYellowLines(); this.RefreshStatus(); this.chipSphereIconButtons[0].OnTouch(); }