예제 #1
0
        public void SetSubgroup(IShipDockEntitas entitas, ICommonOverlayMapper commonCollider)
        {
            bool hasData = commonCollider.IsDataValid(ref entitas);

            if (hasData)
            {
                BehaviourIDs ids = commonCollider.GetEntitasData(ref entitas);
                SubgroupID = ids.gameItemID;

                mCommonColliderMapper = commonCollider;
                mCommonColliderMapper.PhysicsChecked(SubgroupID, true);
                mBridge = new ComponentBridge(OnInit);
                mBridge.Start();
            }
        }
예제 #2
0
        public void UpdatePhysicsCheck(ref Transform transform, bool isTrigger, bool isCollider)
        {
            if (m_CheckGapper.isStart)
            {
                m_CheckGapper.TimeAdvanced(Time.deltaTime);
                return;
            }
            else
            {
                m_CheckGapper.Start();
            }

            if (SubgroupID == int.MaxValue)
            {
                return;
            }
            mCollidersOverlay = Physics.OverlapSphere(transform.position, mRayAndHitInfo.radius, mRayAndHitInfo.layerMask);
            int max = mCollidersOverlay != default ? mCollidersOverlay.Length : 0;

            if (max > 0)
            {
                "log: Update physics start check, SubgroupID = {0}".Log(SubgroupID.ToString());
                int id;
                for (int i = 0; i < max; i++)
                {
                    mColliderItem = mCollidersOverlay[i];
                    id            = mColliderItem.GetInstanceID();
                    if (id != SubgroupID)
                    {
                        AddColliding(id, isTrigger, isCollider, out _);
                    }
                }
            }
            mCommonColliderMapper.PhysicsChecked(SubgroupID);
#if UNITY_EDITOR
            UpdateInfoForEditor();
#endif
        }