コード例 #1
0
        void OnTriggerEnter2D(Collider2D other)
        {
            Pushable pushable = other.GetComponent <Pushable>();

            if (pushable != null)
            {
                m_CurrentPushables.Add(pushable);
            }
            Climbable climbable = other.GetComponent <Climbable>();

            if (climbable != null)
            {
                m_CurrentClimbable = climbable;
            }
        }
コード例 #2
0
        void OnTriggerExit2D(Collider2D other)
        {
            Pushable pushable = other.GetComponent <Pushable>();

            if (pushable != null)
            {
                if (m_CurrentPushables.Contains(pushable))
                {
                    m_CurrentPushables.Remove(pushable);
                }
            }
            Climbable climbable = other.GetComponent <Climbable>();

            if (climbable != null)
            {
                m_CurrentClimbable = null;
            }
        }