public void Hit(float amount) { mCurrentHP -= amount; //Show HPBar if (mHPBar == null) { mHPBar = GaugeBarPool.Instance.GetFromPool(); } if (mCurrentHP <= 0) { mState = eEnemyState.Die; mDelayCount = 0; mController.AddCoin(mReward); mHPBar.gameObject.SetActive(false); mHPBar = null; TextEffect textEffect = mController.GetTextEffect(); textEffect.ShowText(mReward); textEffect.transform.position = mHPBarPos.position;// 월드좌표 카메라 //textEffect.transform.position = Camera.main.WorldToScreenPoint(mHPBarPos.position);// 오버레이일때 tag가 MainCamera돼어야 Camera.가능 //text effect } else { mHPBar.SetGauge(mCurrentHP, mMaxHP); mHPBar.transform.position = mHPBarPos.position; // 위치 변경하려면 Update에 넣으면됨. } }
public void Hit(float amount) { mCurrentHP -= amount; if (mCurrentHP <= 0) { mState = eEnemyState.Die; mDelayCount = 0; mController.AddCoin(mReward); } }
public void Hit(float amount) { mCurrentHP -= amount; //Show HPBar if (mCurrentHP <= 0) { mState = eEnemyState.Die; mDelayCount = 0; mController.AddCoin(mReward); TextEffect textEffect = mController.GetTextEffect(); textEffect.ShowText(mReward); textEffect.transform.position = mHPBarPos.position;// 월드좌표 카메라 //textEffect.transform.position = Camera.main.WorldToScreenPoint(mHPBarPos.position);// 오버레이일때 tag가 MainCamera돼어야 Camera.가능 //text effect } }