/*private void processBattleSkillMP(){ * if(usingBattleSkill) * //currentCharacter.Mp -= usingBattleSkill.needMP; * * Debug.Log ("XXXX"); * }*/ // 告知battle check manager 目前使用的賭技 // (這個function設置在下一步按鈕上,當選完技能後,點擊下一步按鈕進入下個階段的同時,告知battle check manager) private void setGambleSkill() { usingGambleSkillIndex = -1; for (int i = 0; i < gambleSkill.Length; i++) { SkillButtonGestureManager sbgm = gambleSkill[i].gameObject.GetComponent <SkillButtonGestureManager>(); if (sbgm.state) { usingGambleSkillIndex = i; break; } } bcManager.setUsingGambleSkill(usingGambleSkillIndex); if (usingGambleSkillIndex != -1) { tipManager.showGambleSkillTip(usingGambleSkillIndex); } else { tipManager.hideTips(); } }
//-----------------------------------Button Function---------------------------------- // 告知battle check manager 目前角色選用的技能 // (這個function設置在下一步按鈕上,當選完技能後,點擊下一步按鈕進入下個階段的同時,告知battle check manager) private void setBattleSkill() { usingBattleSkill = null; for (int i = 0; i < battleSkill.Length; i++) { SkillButtonGestureManager sbgm = battleSkill[i].gameObject.GetComponent <SkillButtonGestureManager>(); if (sbgm.state) { usingBattleSkill = currentCharacter.skill[i]; break; } } bcManager.setUsingBattleSkill(usingBattleSkill); }
public void lockSkillButton(bool toLock) { if (currentState == State.BattleState.SelectBattleSkill) { for (int i = 0; i < battleSkill.Length; i++) { SkillButtonGestureManager sbgm = battleSkill [i].gameObject.GetComponent <SkillButtonGestureManager> (); sbgm.isLocked = toLock; } } else if (currentState == State.BattleState.SelectGambleSkill) { for (int i = 0; i < gambleSkill.Length; i++) { SkillButtonGestureManager sbgm = gambleSkill [i].gameObject.GetComponent <SkillButtonGestureManager> (); sbgm.isLocked = toLock; } } nextButton.interactable = !toLock; }
public void showGambleSkillPanel() { showNextButton(); tipManager.showLastResultTip(lastRollResult); int[] gambleSkillTimes = dataManager.gambleSkillTimes; for (int i = 0; i < gambleSkillTimes.Length; i++) { SkillButtonGestureManager sbgm = gambleSkill[i].gameObject.GetComponent <SkillButtonGestureManager>(); sbgm.state = false; // 如果技能次數=0,則封鎖技能按鈕,並呈現半透明 if (gambleSkillTimes[i] == 0) { sbgm.isLocked = true; gambleSkill[i].color = new Color(1f, 1f, 1f, 0.5f); } gambleSkillTimesText[i].text = "" + gambleSkillTimes[i]; } playSwipeToGambleSkillAnimation(); }
//-----------------------------------Show & Hide Panel By State---------------------------------- public void showBattleSkillPanel() { showNextButton(); battleSkillOn = currentCharacter.battleSkillOn; battleSkillOff = currentCharacter.battleSkillOff; for (int i = 0; i < battleSkill.Length; i++) { battleSkill[i].sprite = battleSkillOff[i]; SkillButtonGestureManager sbgm = battleSkill[i].gameObject.GetComponent <SkillButtonGestureManager>(); sbgm.skillOff = battleSkillOff[i]; sbgm.skillOn = battleSkillOn[i]; sbgm.state = false; // 如果角色MP不夠,則封鎖技能按鈕,並呈現半透明 if (currentCharacter.Mp < currentCharacter.skill[i].needMP) { sbgm.isLocked = true; battleSkill[i].color = new Color(1f, 1f, 1f, 0.5f); } } currentCharacter.transform.position = mark.transform.position; currentCharacter.transform.rotation = mark.transform.rotation; currentCharacter.gameObject.transform.parent = mark.transform; //SpriteRenderer tempRenderer = currentCharacter.GetComponentInChildren<SpriteRenderer> (); //tempRenderer.enabled = true; //currentCharacterHalf.sprite = currentCharacter.characterHalf; currentCharacterHP.text = "" + currentCharacter.Hp; currentCharacterMP.text = "" + currentCharacter.Mp; currentCharacterDEF.text = "" + currentCharacter.Def; currentCharacterDODGE.text = "" + currentCharacter.noHurtTurn; playShowBattleSkillAnimation(); }