Esempio n. 1
0
        void OnDrawGizmosSelected()
        {
            Gizmos.color = Color.red;

            Rect rect = GetGlobalBounds();

            Gizmos.DrawWireCube(WorldConversion.ToVector3(rect.center),
                                WorldConversion.ToVector3(rect.size));
        }
Esempio n. 2
0
        void OnDrawGizmos()
        {
            if (!_drawGizmos)
            {
                return;
            }

            Gizmos.color = Color.green;
            Gizmos.DrawWireCube(WorldConversion.ToVector3(_worldBounds.center),
                                WorldConversion.ToVector3(_worldBounds.size));
            Gizmos.color = Color.white;

            if (_debugThisLayerIndex >= 0 && _debugThisLayerIndex < _quadTrees.Count)
            {
                _quadTrees[_debugThisLayerIndex].OnDrawGizmos(_heightGizmosStatic,
                                                              _heightGizmosDynamic);
            }
        }
Esempio n. 3
0
        void DrawGizmosNode(QuadTreeNode <QTCircleCollider> node,
                            Color nodeColor,
                            Color objectColor,
                            float height)
        {
            Vector3 heightVector = new Vector3(0f, height, 0f);

            Gizmos.color = nodeColor;
            Gizmos.DrawWireCube(WorldConversion.ToVector3(node.bounds.center) + heightVector,
                                WorldConversion.ToVector3(node.bounds.size));

            Gizmos.color = objectColor;
            for (int i = 0; i < node.objects.Count; i++)
            {
                if (node.objects[i].obj.isEnable)
                {
                    Rect rect = node.objects[i].rect;

                    Gizmos.DrawWireCube(WorldConversion.ToVector3(rect.center) + heightVector,
                                        WorldConversion.ToVector3(rect.size));
                }
            }

            for (int i = 0; i < node.nodes.Length; i++)
            {
                if (node.nodes[i] != null)
                {
                    DrawGizmosNode(node.nodes[i],
                                   nodeColor,
                                   objectColor,
                                   height);
                }
            }

            Gizmos.color = Color.white;
        }