예제 #1
0
        void OnDrawGizmos()
        {
            if (_isInitialized && showDebug)
            {
                for (int r = 0; r < rows; ++r)
                {
                    for (int c = 0; c < cols; ++c)
                    {
                        Cell cell = _grid[r, c];

                        if (cell.parent != null)
                        {
                            Vector3 dirn = cell.parent.GetPosition() - cell.GetPosition();
                            ZUtils.DrawGizmoArrow(cell.GetPosition(), dirn / 3, SteeringManager.Instance.useXYPlane);
                        }
                    }
                }
            }
        }
예제 #2
0
        void OnDrawGizmos()
        {
            if (showDebugGizmos && SteeringManager.Instance != null)
            {
                Gizmos.color = _currentDebugColor;
                if (SteeringManager.Instance.useXYPlane)
                {
                    Gizmos.DrawCube(transform.position, new Vector3(width, height, 0));
                }
                else
                {
                    Gizmos.DrawCube(transform.position, new Vector3(width, 0, height));
                }
                Gizmos.color = Color.green;
                ZUtils.DrawGizmoArrow(transform.position, avoidDirn * 5, SteeringManager.Instance.useXYPlane);

                Gizmos.color = Color.yellow;
                Gizmos.DrawSphere(transform.position, 0.5f);
                Gizmos.DrawSphere(_p2, 0.5f);
                Gizmos.DrawSphere(_p3, 0.5f);
                Gizmos.DrawLine(_p2, _p3);
            }
        }