예제 #1
0
        void OnTriggerEnter2D(Collider2D col)
        {
            if (col.gameObject.tag == "Player")
            {
                if (m_enableCoin)
                {
                    PlayerScore score = col.gameObject.GetComponent <PlayerScore>();
                    if (score != null)
                    {
                        score.AddScorePoints(m_value);
                    }

                    DisableCoin();

                    if (CoinEvent != null)
                    {
                        CoinEvent();
                    }
                }
            }
        }
예제 #2
0
 private void GetComponents()
 {
     m_controller = GetComponent <PlayerController>();
     m_health     = GetComponent <PlayerHealth>();
     m_score      = GetComponent <PlayerScore>();
 }