void OnLifeChange(BossLifeChangeEvent e) { if (e.life <= 0) { gameObject.SetActive(false); return; } gameObject.SetActive(true); m_barSprite.size = new Vector2(m_initialWidth * e.life / e.maxLife, m_barSprite.size.y); m_barSprite.transform.localPosition = m_initialPos + new Vector3((-m_initialWidth + m_barSprite.size.x) / 2.0f, 0, 0); }
void OnLifeUpdate(BossLifeChangeEvent e) { m_isPowered = (e.life / e.maxLife) < 0.5f; }