private void onClickHandler(int index) { selectIndex = indexs[index]; audioController.SoundPlay(AudioEunm.btnClick); for (int i = 0; i < roleBtns.Length; ++i) { indexs[i] = getIndex(selectIndex + i - 1); roleBtns[i].GetComponent <Image>().sprite = ResourcesTools.getRole(roles[indexs[i]].roleId); } RoleName.text = roles[selectIndex].name; skillIcon.sprite = ResourcesTools.getSkillIcon(roles[selectIndex].skillId); skillDescribe.text = roles[selectIndex].skillDescribe; ackIcon.sprite = ResourcesTools.getSkillIcon(roles[selectIndex].ackId); ackDescribe.text = roles[selectIndex].ackDescribe; if (isFirstIntroduction) { if (!introduction.gameObject.activeInHierarchy) { introduction.gameObject.SetActive(true); } } if (!isFirstIntroduction) { isFirstIntroduction = true; } LocalStorage.SetInt("ROLE", selectIndex); }
// 加/减蓝函数,正数加蓝,负数减蓝 public void ChangeMp(float value) { if (mp + value > mpMax) { mp = mpMax; } else if (mp + value < 0) { mp = 0; } else { mp += value; } if (RoomData.isMainRole(seat)) { if (mp == mpMax) { FightScene.instance.skillBtns[0].image.sprite = ResourcesTools.getSkillIcon(1); } else { FightScene.instance.skillBtns[0].image.sprite = ResourcesTools.getSkillIcon(-1); } } }
public void Init() { skillBtns = FightScene.instance.skillBtns; for (int i = 0; i < skillIds.Count; ++i) { skills.Add(addSkill(skillIds[i])); } if (RoomData.isMainRole(attr.seat)) { for (int i = 0; i < skillIds.Count; ++i) { skillBtns[i].GetComponent <Image>().sprite = ResourcesTools.getSkillIcon(skills[i].skillId); cdMasks.Add(skillBtns[i].transform.Find("CDMask").gameObject.GetComponent <Image>()); cdTexts.Add(skillBtns[i].transform.Find("Text").gameObject.GetComponent <Text>()); if (i > 0) { haloCoroutines.Add(null); cDHalos.Add(skillBtns[i].transform.Find("CDHalo").gameObject.GetComponent <Image>()); anims.Add(skillBtns[i].GetComponent <Animation>()); } } } }