private wuling theWuling = null; //没有必要每一次都获取五灵引用 public void setWuling(wulingType theType) { theEypeNow = theType; lingBasic yinWuling = null; lingBasic YangWuling = null; if (!theWuling) { theWuling = systemValues.thePlayer.GetComponent <wuling> (); } for (int i = 0; i < theWuling.lingEffects.Count; i++) { if (theWuling.lingEffects [i].theType == theEypeNow && theWuling.lingEffects [i].getYinYagType() == 1) { YangWuling = theWuling.lingEffects [i]; } if (theWuling.lingEffects [i].theType == theEypeNow && theWuling.lingEffects [i].getYinYagType() == 2) { yinWuling = theWuling.lingEffects [i]; } } theYangButton.setLing(YangWuling); theYinButton.setLing(yinWuling); }
public void setLing(lingBasic theLingIn) { theWuling = theLingIn; theSliderImage.fillAmount = theLingIn.getLearningPercent(); }