-
Notifications
You must be signed in to change notification settings - Fork 153
Open
Description
So i using uitext to showing pop up text that show amount of score player from each enemy that destroyed and it show up only in the beginning of the game after the enemies getting more and more the uitext start being weird, first the "+" disappear and after that it only show 0 and then not showing anything....
any idea why? or maybe my way of implementing it wrong?
i put this script in my enemies gameobject
bellow is the void for handle taking damage and showing pop up text when enemies dies
public void Damage(float damageCount)
{
hp -= damageCount;
healthMeter -= damageCount;
if (healthMeter <= 0)
{
if (hp > 0)
{
healthMeter = 1;
}
}
if(hp <= 0)
{
healthMeter = 0;
SpecialEffectHelper.Instance.Explosion(transform.position);
if (isEnemy)
{
int points = scorePoint * gameGUIScript.combo;
var text = new UIText("spritefont", "spritefont.png");
UITextInstance pointText = text.addTextInstance("+" + points,0,0);
pointText.textScale = .7f;
Color pointTextColor = pointText.color;
pointTextColor.a = .3f;
pointText.color = pointTextColor;
pointText.positionFromTopRight(.06f, .08f);
pointText.alphaTo(.5f, 0, Easing.Linear.easeIn);
}
Destroy(gameObject);
}
}
Metadata
Metadata
Assignees
Labels
No labels