Beispiel #1
0
    void OnTriggerEnter(Collider _Collider)
    {
        CometMovement comet = _Collider.GetComponent <CometMovement>();

        if (comet != null && !comets.Contains(comet))
        {
            comets.Add(comet);
        }
    }
    void OnCollisionEnter(Collision _collision)
    {
        CometMovement comet = _collision.transform.GetComponent <CometMovement>();

        if (comet != null)
        {
            if (m_parent != null)
            {
                m_parent.childHit(_collision.contacts[0].point, comet.GetComponent <SphereCollider>().radius *comet.transform.localScale.x);
                m_parent.removeComet(comet);
            }

            Destroy(comet.gameObject);
        }
    }
Beispiel #3
0
 public void removeComet(CometMovement _comet)
 {
     GetComponent <Planet>().removeComet(_comet);
 }
Beispiel #4
0
 public void removeComet(CometMovement _comet)
 {
     comets.Remove(_comet);
 }