void ForciblySummonGuide(TOUCH_KEY key) { SkillBtnCD summonBtn = null; switch (key) { case TOUCH_KEY.Summon1: summonBtn = fightTouchIns.summon1; break; case TOUCH_KEY.Summon2: summonBtn = fightTouchIns.summon2; break; case TOUCH_KEY.Summon3: summonBtn = fightTouchIns.summon3; break; } if (null == summonBtn) { Debug.Log("summonBtn is null"); return; } copyBtn = Instantiate(summonBtn.gameObject) as GameObject; if (null == copyBtn) { Debug.Log("copyBtn is null"); return; } copyBtn.transform.parent = mask.transform; copyBtn.transform.localScale = Vector3.one; copyBtn.transform.position = summonBtn.transform.position; copyBtn.transform.FindComponent <UISprite>("CD").enabled = false; ShowGuide(copyBtn.transform); if (mask.activeSelf) { mask.transform.Find("Sprite").GetComponent <UISprite>().alpha = 1f; } else { mask.SetActive(true); } fightTouchIns.CopySummonBtn(copyBtn.GetComponent <SkillBtnCD>(), key); for (int i = 0; i < elite.Count; i++) { elite[i].GetComponent <CharacterState>().moveSpeed = 0; } player.moveSpeed = 0; }
List <float> GetCds() { List <float> ret = new List <float>(); List <long> sids = playerCS.GetSkills(); for (int i = 0; i < sids.Count; i++) { SkillBtnCD sBtn = FightTouch._instance.GetSkillBtnBySkillId(sids[i]); //if(sBtn != null) ret.Add(sBtn.CD); } return(ret); }
void InitSkillBtnState(SkillBtnCD skillBtn, int index) { SkillNode skillNode = GetSkillNodeBySeat(index); if (skillNode != null) { skillBtn.index = skillNode.site; skillBtn.skillNode = skillNode; skillBtn.SetCd(skillNode.cooling); #if UNITY_EDITOR skillBtn.SetCd(1); #endif skillBtn.IconSprite.spriteName = skillNode.skill_icon; skillBtn.onPressed = OnClickSkillBtn; } }
public void CopySummonBtn(SkillBtnCD summonBtn, TOUCH_KEY key) { switch (key) { case TOUCH_KEY.Summon1: InitSummonBtnState(summonBtn, 5); break; case TOUCH_KEY.Summon2: InitSummonBtnState(summonBtn, 6); break; case TOUCH_KEY.Summon3: InitSummonBtnState(summonBtn, 7); break; } }
void InitSummonBtnState(SkillBtnCD summonBtn, int index) { summonBtn.index = index; HeroData hd = Globe.Heros()[index - 4]; if (null == hd || hd.id == 0) { summonBtn.GetComponent <UISprite>().spriteName = ""; } else { summonBtn.SetCd(Globe.isFightGuide ? 1 : 30); #if UNITY_EDITOR summonBtn.SetCd(1); #endif summonBtn.onPressed = OnSummon; summonBtn.GetComponent <UISprite>().spriteName = hd.node.icon_name; } }