Beispiel #1
0
        void OnTriggerExit2D(Collider2D other)
        {
            NoteId nid = other.gameObject.GetComponent <NoteId>();

            if (nid == null)
            {
                return;
            }

            if (nid.info.isActive)
            {
                nid.TurnOff();
            }
        }
Beispiel #2
0
        void OnTriggerEnter2D(Collider2D other)
        {
            NoteId nid = other.gameObject.GetComponent <NoteId>();

            if (nid == null)
            {
                return;
            }

            if (!nid.info.isActive)
            {
                return;
            }

            nid.Play();
        }