コード例 #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "player")
     {
         RubyController rubyController = other.GetComponent <RubyController>();
         if (rubyController.GetCurHp() < rubyController.m_fMaxHp)
         {
             rubyController.ChangeHp(1);
             rubyController.PlaySound(m_acPickUp);
             Instantiate(m_effectPickUp, transform.position, Quaternion.identity);
             Destroy(gameObject);
         }
     }
 }