// when attacked public virtual void getHit(int damage) { //calculate how damage is taken here Hp -= damage; //HS Vector3 tempPos = gameObject.transform.position; scene = SceneManager.GetActiveScene(); if (scene.name == "Tutorial") { tempPos.y += 1.0f; } else { tempPos.y += gameObject.GetComponent <Transform>().localScale.y / 2; } DamageTextManager.GenerateSprite(tempPos, damage); }
public virtual void getHit(int damage, bool careAboutTrigger) { //calculate how damage is taken here if (careAboutTrigger) { if (!isHit) { Hp -= damage; //HS Vector3 tempPos = gameObject.transform.position; tempPos.y += gameObject.GetComponent <Transform>().localScale.y / 2; DamageTextManager.GenerateSprite(tempPos, damage); } } else { getHit(damage); } }