示例#1
0
        protected bool CheckBox(Bounds bounds)
        {
            if (PhysicsExtensions.OverlapBox(bounds).Has(GetMeshCollider()))
            {
                return(true);
            }

            return(false);
        }
示例#2
0
        public override bool IsGameObjectPlacementValid(GameObject game_object)
        {
            Bounds bounds = game_object.GetSpacarMeshBounds().GetScaled(bounds_scale);

            if (PhysicsExtensions.OverlapBox(bounds, layer_mask).Has(c => c.gameObject != game_object))
            {
                return(false);
            }

            return(true);
        }
示例#3
0
        protected override void GenerateBoxWadInternal()
        {
            Bounds bounds = GetMeshCollider().bounds;

            for (float y = bounds.min.y; y < bounds.max.y; y += size)
            {
                for (float x = bounds.min.x; x < bounds.max.x; x += size)
                {
                    for (float z = bounds.min.z; z < bounds.max.z; z += size)
                    {
                        Bounds b = BoundsExtensions.CreateMinMaxBounds(
                            new Vector3(x, y, z),
                            new Vector3(x + size, y + size, z + size)
                            );

                        if (PhysicsExtensions.OverlapBox(b).Has(GetMeshCollider()))
                        {
                            AddWadBox(b);
                        }
                    }
                }
            }
        }