public void setRare(int newRare) { if (newRare > RareType.SS) { newRare = RareType.SS; } spBackground.spriteName = RareType.getRareBgSprite(newRare); spRareBorder.spriteName = RareType.getRareLineSprite(newRare); }
public void setData(GameIDData d) { isChecked = false; spSelectBorder.enabled = false; data = d; spRareBorder.spriteName = RareType.getRareLineSprite(d.rare); spRareBg.spriteName = RareType.getRareBgSprite(d.rare); Icon.setEquipIcon(data.partsData.getIcon(), spIcon, defaultDepth); lbCount.text = "l" + d.level; Util.setTranscendLevel(lbTranscendLevel, d.totalPLevel); }
public void init(PVPPlayerSkillSlot aiSkillSlot, Player player) { _player = player; _playerTagIndex = player.playerTagIndex; chargingEffect.Stop(); chargingFullNoticeEffect.Stop(); chargingFullEffect.Stop(); _isFullCharging = false; skillSlot = aiSkillSlot; _lastClickState = false; lastClickedSlotIndex = -1; blockThis = false; isClicked = false; _isPress = false; isWaitingPress = false; isLocked = false; //Debug.Log(skillId); skillSlot.skillData.exeData.init(AttackData.AttackerType.Hero, AttackData.AttackType.Skill, skillSlot.skillData, skillSlot.skillInfo.transcendData, skillSlot.skillInfo.transcendLevel); chargingTimeLimit = skillSlot.skillData.getChargingTime(skillSlot.skillInfo.reinforceLevel).AsFloat(); lbLeftItemNum.text = Mathf.RoundToInt(skillSlot.useMp / player.maxMp * 100.0f).ToString(); //Mathf.CeilToInt(useMp).ToString(); tfItemName.text = skillSlot.skillData.name; spBackground.spriteName = RareType.getRareBgSprite(skillSlot.skillInfo.rare); spFrameBorder.spriteName = RareType.getRareLineSprite(skillSlot.skillInfo.rare); Icon.setSkillIcon(skillSlot.skillInfo.getSkillIcon(), spSkillIcon); spSkillIcon.MakePixelPerfect(); resetCoolTime(); btn.isEnabled = true; }
public void setData(GameIDData infoData, GamePlayerData gpd = null) { if (infoData == null) { gamePlayerData = null; data = null; spIcon.gameObject.SetActive(false); spSkillRare.gameObject.SetActive(false); } else { gamePlayerData = gpd; data = infoData; spIcon.gameObject.SetActive(true); Icon.setSkillIcon(data.getSkillIcon(), spIcon); spSkillRare.gameObject.SetActive(true); spSkillRare.spriteName = RareType.getRareLineSprite(infoData.rare); } }
void setInventorySlot(GameIDData gd) { gameObject.name = string.Empty; // isChecked = false; if (gd == null) { data = null; btn.isEnabled = false; spLock.enabled = false; spIcon.enabled = false; spRareBorder.enabled = true; // spSkillNameNum.enabled = false; lbItemLevel.enabled = false; Util.setTranscendLevel(lbTranscendLevel); spRareBorder.spriteName = UIHeroInventorySlot.SLOT_LINE_GRADE_NORMAL; if (spLabelBg != null) { spLabelBg.enabled = false; } if (spCantUse != null) { spCantUse.enabled = false; } } else { btn.isEnabled = true; // if(d.StartsWith("#")) // { // d = d.Substring(1); // isChecked = true; // } data = gd; spLock.enabled = false; spRareBorder.enabled = true; // spSkillNameNum.enabled = true; lbItemLevel.enabled = true; Icon.setSkillIcon(data.getSkillIcon(), spIcon); spIcon.MakePixelPerfect(); spIcon.enabled = true; spRareBorder.spriteName = RareType.getRareLineSprite(data.rare); // if(spSkillNameNum != null) // { //// spSkillNameNum.spriteName = data.getGradeSprite(); // spSkillNameNum.enabled = false; // } lbItemLevel.text = "l" + data.level; Util.setTranscendLevel(lbTranscendLevel, data.totalPLevel); if (spLabelBg != null) { spLabelBg.enabled = true; } refreshCanUse(); } if (spSelectBorder != null) { spSelectBorder.enabled = false; } }
void setCategorySlot(GameIDData gd) { if (spCantUse != null) { spCantUse.enabled = false; } gameObject.name = string.Empty; if (gd == null) { data = null; btn.isEnabled = false; spSlotName.enabled = true; spIcon.enabled = false; spRareBorder.enabled = false; // spSkillNameNum.enabled = false; lbItemLevel.enabled = false; Util.setTranscendLevel(lbTranscendLevel); if (spLabelBg != null) { spLabelBg.enabled = false; } } else { btn.isEnabled = true; // if(d.StartsWith("#")) // { // d = d.Substring(1); // isChecked = true; // } data = gd; spSlotName.enabled = false; spRareBorder.enabled = true; // spSkillNameNum.enabled = true; lbItemLevel.enabled = true; Icon.setSkillIcon(data.getSkillIcon(), spIcon, defaultDepth); spIcon.MakePixelPerfect(); spIcon.enabled = true; spRareBorder.spriteName = RareType.getRareLineSprite(data.rare); // if(spSkillNameNum != null) // { // // spSkillNameNum.spriteName = data.getGradeSprite(); // spSkillNameNum.enabled = false; // } lbItemLevel.text = "l" + data.level; Util.setTranscendLevel(lbTranscendLevel, data.totalPLevel); if (spLabelBg != null) { spLabelBg.enabled = true; } } if (spSelectBorder != null) { spSelectBorder.enabled = false; } }
void setInventorySlot(GameIDData gd) { // isChecked = false; gameObject.name = ""; if (gd == null) { data = null; spIcon.enabled = false; spSlot.spriteName = UIHeroInventorySlot.SLOT_BG_GRADE_NORMAL; spRareBorder.spriteName = UIHeroInventorySlot.SLOT_LINE_GRADE_NORMAL; spRareBorder.enabled = true; btn.isEnabled = false; lbItemLevel.enabled = false; Util.setTranscendLevel(lbTranscendLevel); if (spLabelBg != null) { spLabelBg.enabled = false; } if (spCantUse != null) { spCantUse.enabled = false; } } else { data = gd; lbItemLevel.enabled = true; spIcon.enabled = true; // Debug.Log("data.unitData.resource : " + data.unitData.resource + " " + data.serverId); data.setUnitIcon(spIcon, iconDepth); spIcon.MakePixelPerfect(); spIcon.width = 102; lbItemLevel.text = "l" + data.level; Util.setTranscendLevel(lbTranscendLevel, data.totalPLevel); btn.isEnabled = true; spRareBorder.spriteName = RareType.getRareLineSprite(data.rare); spSlot.spriteName = RareType.getRareBgSprite(data.rare); spRareBorder.enabled = true; if (TutorialManager.instance.isTutorialMode && TutorialManager.instance.nowTutorialId == "T44") { gameObject.name = data.serverId; } if (spLabelBg != null) { // spGrade.enabled = true; // spGrade.spriteName = data.getGradeSprite(); spLabelBg.enabled = true; } refreshCanUse(); } if (spSelectBorder != null) { spSelectBorder.enabled = false; } }
void setCategorySlot(GameIDData gd) { if (spCantUse != null) { spCantUse.enabled = false; } if (gd == null) { data = null; spIcon.enabled = false; spRareBorder.enabled = false; spSlot.enabled = false; spSlotName.enabled = true; btn.isEnabled = false; lbItemLevel.enabled = false; if (lbTranscendLevel != null) { lbTranscendLevel.enabled = false; } if (spLabelBg != null) { spLabelBg.enabled = false; } } else { // if(str.StartsWith("#")) // { // str = str.Substring(1); // isChecked = true; // } data = gd; spIcon.enabled = true; spRareBorder.enabled = true; spSlot.enabled = true; spSlotName.enabled = false; data.setUnitIcon(spIcon, iconDepth); spIcon.MakePixelPerfect(); spIcon.width = 102; lbItemLevel.enabled = true; lbItemLevel.text = "l" + data.level; Util.setTranscendLevel(lbTranscendLevel, data.totalPLevel); btn.isEnabled = true; spSlot.spriteName = RareType.getRareBgSprite(data.rare); spRareBorder.spriteName = RareType.getRareLineSprite(data.rare); if (spLabelBg != null) { // spGrade.spriteName = data.getGradeSprite(); spLabelBg.enabled = true; } } }
public void init(UnitData md, TranscendData td, int[] tLevel, Player player) { _player = player; spDamageEffect.cachedGameObject.SetActive(false); _state = 0; leftNum = 0; lastActiveSkillUseSlotIndex = -1; // unitSlot.activeSkillState = STATE_ACTIVE_SKILL_COOLTIME; mon = null; blockThis = false; isClicked = false; isLocked = false; unitData = md; transcendData = td; transcendLevel = tLevel; tfUnitName.text = md.name; #if UNITY_EDITOR // Debug.Log(unitData.resource); #endif monsterData = GameManager.info.monsterData[unitData.resource]; // unitSlot.useSp = unitData.sp; // unitSlot.useSp -= (unitSlot.useSp * _player.summonSpPercent(unitData)); if (player != null) { tfUseSp.text = Mathf.RoundToInt(unitSlot.useSp / player.maxSp * 100.0f) + ""; //Mathf.CeilToInt(unitSlot.useSp - 0.4f) + ""; } else { tfUseSp.text = Mathf.RoundToInt(unitSlot.useSp / _player.maxSp * 100.0f) + ""; //Mathf.CeilToInt(unitSlot.useSp - 0.4f) + ""; } #if UNITY_EDITOR Debug.LogError("***** " + slotIndex + " - icon: " + monsterData.resource); #endif MonsterData.setUnitIcon(monsterData, spPetIcon, iconDepth); spPetIcon.MakePixelPerfect(); spPetIcon.width = 102; // if( unitData.cooltime <= 0.1f) unitSlot.maxCoolTime = 0.0f; // else unitSlot.maxCoolTime = unitData.cooltime; spBackground.spriteName = RareType.getRareBgSprite(md.rare); spFrameBorder.spriteName = RareType.getRareLineSprite(md.rare); updateSummonNum(); goActiveSkillContainer.SetActive(false); spHpBar.cachedGameObject.SetActive(false); tfUseSp.enabled = true; resetCoolTime(true); resetActiveSkillCoolTime(); }
public void setData(GameIDData gd, bool useCantUseCover = true, int slotIndex = -1) { slotType = BaseSlot.InventorySlotType.Normal; //gameObject.name = string.Empty; if (gd == null) { btn.isEnabled = false; data = null; spCantUse.gameObject.SetActive(false); spPartsIcon.gameObject.SetActive(false); spSelect.gameObject.SetActive(false); spRareBorder.gameObject.SetActive(true); spSlotRareBg.gameObject.SetActive(true); lbInforceLevel.gameObject.SetActive(false); spRareBorder.spriteName = SLOT_LINE_GRADE_NORMAL; spSlotRareBg.spriteName = SLOT_BG_GRADE_NORMAL; if (spLock != null) { spLock.enabled = false; } if (spLabelBg != null) { spLabelBg.enabled = false; } if (spNew != null) { spNew.enabled = false; } Util.setTranscendLevel(lbTranscendLevel); } else { btn.isEnabled = true; data = gd; if (UIReinforceBarPanel.isReinforceMode) { spCantUse.gameObject.SetActive(false); } else { spCantUse.gameObject.SetActive(data.partsData.character != UIHero.nowHero && useCantUseCover); } spSelect.gameObject.SetActive(false); spPartsIcon.gameObject.SetActive(true); spSlotRareBg.gameObject.SetActive(true); spRareBorder.gameObject.SetActive(true); spRareBorder.spriteName = RareType.getRareLineSprite(data.rare); spSlotRareBg.spriteName = RareType.getRareBgSprite(data.rare); Icon.setEquipIcon(data.partsData.getIcon(), spPartsIcon, iconDepth); lbInforceLevel.gameObject.SetActive(true); if (data.level > 0) { lbInforceLevel.text = "l" + data.level; } else { lbInforceLevel.text = "-"; } Util.setTranscendLevel(lbTranscendLevel, data.totalPLevel); index = slotIndex; bool isLock = false; if (UIReinforceBarPanel.isReinforceMode) { if (index == UIReinforceBarPanel.originalSlotIndex) { isLock = true; } if (isLock == false) { select = (UIReinforceBarPanel.sourceListIndex.Contains(index)); } } else if (UIMultiSellPanel.isMultiSell) { select = (UIMultiSellPanel.sourceListIndex.Contains(index)); } else if (UIComposePanel.isComposeMode) { if (index == UIComposePanel.originalSlotIndex) { isLock = true; } else if (UIComposePanel.originalData.rare != data.rare || data.reinforceLevel < GameIDData.MAX_LEVEL ) { isLock = true; } if (isLock == false) { select = (UIComposePanel.sourceIndex == index); } } else { spLock.enabled = false; } spLock.enabled = isLock; btn.isEnabled = !isLock; if (spLabelBg != null) { spLabelBg.enabled = true; } } if (spNew != null) { spNew.enabled = (data != null && data.isNew); } }
void draw(bool visibleLevelUpBar = true, int rare = -1) { switch (type) { case Type.GameItem: spDefaultIcon.spriteName = _iconResourceId; spDefaultIcon.enabled = true; spDefaultIcon.MakePixelPerfect(); spEquipIcon.enabled = false; spSkillIcon.enabled = false; spUnitIcon.enabled = false; if (rare > -1) { spBackground.spriteName = RareType.getRareBgSprite(rare); spRareBorder.spriteName = RareType.getRareLineSprite(rare); } else { spRareBorder.spriteName = UIHeroInventorySlot.SLOT_LINE_GRADE_NORMAL; spBackground.spriteName = UIHeroInventorySlot.SLOT_BG_GRADE_NORMAL; } break; case Type.Equip: Icon.setEquipIcon(infoData.getHeroPartsIcon(), spEquipIcon); spEquipIcon.enabled = true; spEquipIcon.MakePixelPerfect(); spEquipIcon.width = 102; spEquipIcon.height = 102; // spEquipIcon.cachedTransform.localScale = new Vector3(0.8f, 0.8f, 0.8f); spDefaultIcon.enabled = false; spSkillIcon.enabled = false; spUnitIcon.enabled = false; spBackground.spriteName = RareType.getRareBgSprite(infoData.rare); spRareBorder.spriteName = RareType.getRareLineSprite(infoData.rare); lbInforceLevel.text = "l" + infoData.level; break; case Type.Unit: //spUnitIcon.atlas = //spUnitIcon.spriteName = infoData.getUnitIcon(); infoData.setUnitIcon(spUnitIcon, unitSpriteDepth); spUnitIcon.enabled = true; spUnitIcon.MakePixelPerfect(); spUnitIcon.width = 102; spEquipIcon.height = 102; //spUnitIcon.cachedTransform.localScale = new Vector3(0.8f, 0.8f, 0.8f); spDefaultIcon.enabled = false; spSkillIcon.enabled = false; spEquipIcon.enabled = false; spBackground.spriteName = RareType.getRareBgSprite(infoData.rare); spRareBorder.spriteName = RareType.getRareLineSprite(infoData.rare); lbInforceLevel.text = "l" + infoData.level; break; case Type.Skill: Icon.setSkillIcon(infoData.getSkillIcon(), spSkillIcon); spSkillIcon.enabled = true; spSkillIcon.MakePixelPerfect(); spDefaultIcon.enabled = false; spUnitIcon.enabled = false; spEquipIcon.enabled = false; spBackground.spriteName = RareType.getRareBgSprite(infoData.rare); spRareBorder.spriteName = RareType.getRareLineSprite(infoData.rare); lbInforceLevel.text = "l" + infoData.level; break; } // Util.setTranscendLevel(lbTranscendLevel, infoData.transcendLevel.Get()); showLevelBar = visibleLevelUpBar; check = false; if (spSlotBlackLock != null) { spSlotBlackLock.enabled = false; } }