Пример #1
0
        private void CheckIn()
        {
            if (!isAnIn)
            {
                RaycastHit2D hit = Physics2D.Raycast(left.position, Vector2.up, detectionLine,
                                                     1 << LayerMask.NameToLayer("AN"));
                if (hit.transform != null)
                {
                    isAnIn = true;
                    an     = hit.transform.GetComponent <An>();
                    anMass = an.GetComponent <Rigidbody2D>().mass;
                }
            }

            if (!isPankapuIn)
            {
                RaycastHit2D hit = Physics2D.Raycast(left.position, Vector2.up, detectionLine,
                                                     1 << LayerMask.NameToLayer("Pankapu"));
                if (hit.transform != null)
                {
                    isPankapuIn = true;
                    pankapu     = hit.transform.GetComponent <Pankapu>();
                    pankapuMass = pankapu.GetComponent <Rigidbody2D>().mass;
                }
            }
        }
Пример #2
0
        private void OnTriggerEnter2D(Collider2D collision)
        {
            Pankapu pankapu = collision.GetComponent <Pankapu>();

            if (pankapu != null)
            {
                EventCenter.Braodcast(EventType.BossCamera);
            }
        }
Пример #3
0
        private void OnTriggerEnter2D(Collider2D collision)
        {
            An an = collision.GetComponent <An>();

            if (an != null)
            {
                an.SetCheckPoint(this);

                Pankapu.SetCheckPoint(this);
            }
        }