public void reSetText(extraMoveUp theMoveEffect, string theText, int colorNumber = 0) { theMoveEffect.transform.position = this.thePlayer.transform.position + new Vector3(Random.Range(0f, 0.6f) - 0.3f, 1f, 0); Vector3 theTextMoveAim = this.thePlayer.transform.position + new Vector3(Random.Range(0f, 0.9f) - 0.45f, 1.75f, 0); theMoveEffect.makeStart(theTextMoveAim, theText, showTimer); theMoveEffect.makeColor(colorNumber); }
public Color theShowColorForSELFUp = Color.green; //显示的颜色,回血效果 public void makeShowForHpUp(float hpup = 0) { if (theShowTextForUp == null || !theShowTextForUp.gameObject.activeInHierarchy || theShowTextForUp.thePlayer != this.thePlayer) { GameObject theOBJ = systemValues.getTextFromTextPool(); theShowTextForUp = theOBJ.GetComponent <extraMoveUp> (); theShowTextForUp.thePlayer = this.thePlayer; reSetText(theShowTextForUp, hpup.ToString("f0"), 2); } else { theShowTextForUp.makeUpdate(hpup); } }
public void makeShowForDamage(float damage = 0) { if (damage <= 0) { return; } if (theShowText == null || !theShowText.gameObject.activeInHierarchy || theShowText.thePlayer != this.thePlayer) { GameObject theOBJ = systemValues.getTextFromTextPool(); theShowText = theOBJ.GetComponent <extraMoveUp> (); theShowText.thePlayer = this.thePlayer; theShowText.valueSave = damage; int colorNumber = this.thePlayer == systemValues.thePlayer ? 1 : 0; reSetText(theShowText, damage.ToString("f0"), colorNumber); } else { //print ("update"); theShowText.makeUpdate(damage); } }