void OnDrawGizmosSelected()
        {
            // エリアの表示
            Color color = new Color(0.7f, 0.9f, 0.2f);

            GizmoUtility.DrawCircle(transform.position, 3, color);
            GizmoUtility.DrawCircle(transform.position, radius, color);

            // オフセットの表示
            color = new Color(0.6f, 0.6f, 0.6f);
            GizmoUtility.DrawCircle(transform.position, radius * m_TargetSize, color);

            // フォースフィールドの表示
            if (m_Force > 0)
            {
                color = new Color(0.9f, 0.4f, 0.6f);
                float val = Mathf.Lerp(m_TargetSize, 1, m_Force);
                GizmoUtility.DrawCircle(transform.position, radius * val, color);
            }
            else if (m_Force < 0)
            {
                color = new Color(0.5f, 0.7f, 0.95f);
                float val = Mathf.Lerp(-m_TargetSize, -1, -m_Force);
                GizmoUtility.DrawCircle(transform.position, radius * val, color);
            }
        }
Esempio n. 2
0
    void OnDrawGizmos()
    {
        if (_physicsCollider == null || _visibilityCollider == null)
        {
            Awake();
        }

        if ((int)_physicsCollider.bounds.extents.x != width ||
            (int)_physicsCollider.bounds.extents.y != height)
        {
            _physicsCollider.size = new Vector2(width, height);
        }
        if ((int)_visibilityCollider.bounds.extents.x != width ||
            (int)_visibilityCollider.bounds.extents.y != height)
        {
            _visibilityCollider.size = new Vector2(width + Screen.width / 2, height + Screen.height / 2); // add some padding
        }

        if (showCameraGizmoOutline)
        {
            GizmoUtility.DrawBoundingBox(transform, _visibilityCollider.bounds.extents, outlineVisibilityMaskGizmoColor);
        }
        if (showGizmoOutline)
        {
            GizmoUtility.DrawBoundingBox(transform, _physicsCollider.bounds.extents, outlineGizmoColor);
        }
    }
    void OnDrawGizmos()
    {
        if (ShowGizmoOutline && PlatformGroups.Count > 0)
        {
            BoxCollider2D boxCollider = null;

            for (var i = 0; i < PlatformGroups.Count; i++)
            {
                if (PlatformGroups[i].EnabledGameObject != null)
                {
                    boxCollider = PlatformGroups[i].EnabledGameObject.GetComponent <BoxCollider2D>();

                    break;
                }

                if (PlatformGroups[i].DisabledGameObject != null)
                {
                    boxCollider = PlatformGroups[i].DisabledGameObject.GetComponent <BoxCollider2D>();

                    break;
                }
            }

            if (boxCollider != null)
            {
                _gizmoCenter = Vector2.zero;

                _gizmoExtents = new Vector3(
                    Width + boxCollider.size.x / 2,
                    Height + boxCollider.size.y / 2);
            }

            GizmoUtility.DrawBoundingBox(transform.TransformPoint(_gizmoCenter), _gizmoExtents, OutlineGizmoColor);
        }
    }
    void OnDrawGizmos()
    {
        if (showGizmoOutline && platformGroups.Count > 0)
        {
            BoxCollider2D boxCollider2D = null;
            for (int i = 0; i < platformGroups.Count; i++)
            {
                if (platformGroups[i].enabledGameObject != null)
                {
                    boxCollider2D = platformGroups[i].enabledGameObject.GetComponent <BoxCollider2D>();
                    break;
                }
                if (platformGroups[i].disabledGameObject != null)
                {
                    boxCollider2D = platformGroups[i].disabledGameObject.GetComponent <BoxCollider2D>();
                    break;
                }
            }

            if (boxCollider2D != null)
            {
                _gizmoCenter  = Vector2.zero;
                _gizmoExtents = new Vector3(
                    width + boxCollider2D.size.x / 2
                    , height + boxCollider2D.size.y / 2
                    );
            }

            GizmoUtility.DrawBoundingBox(this.transform.TransformPoint(_gizmoCenter), _gizmoExtents, outlineGizmoColor);
        }
    }
Esempio n. 5
0
 void OnDrawGizmos()
 {
     if (ShowGizmoOutline)
     {
         GizmoUtility.DrawBoundingBox(transform.position, Size / 2, OutlineGizmoColor);
     }
 }
 public override void DrawGizmos()
 {
     if (doDrawDebugBoundingBox)
     {
         GizmoUtility.DrawBoundingBox(_playerController.transform.position + _playerController.boxCollider.offset.ToVector3()
                                      , _playerController.boxCollider.bounds.extents, debugBoundingBoxColor);
     }
 }
Esempio n. 7
0
 void OnDrawGizmos()
 {
     foreach (var bc in GetComponents <BoxCollider2D>())
     {
         GizmoUtility.DrawBoundingBox(transform.position, bc.bounds.extents, gizmoColor);
         break;
     }
 }
    void OnDrawGizmos()
    {
        for (var i = 0; i < PlatformGroupPositions.Count; i++)
        {
            if (PlatformGroupPositions[i].ShowGizmoOutline)
            {
                var gizmoCenter = Vector3.zero;

                var gizmoExtents = new Vector3(16, 16, 0);

                if (PlatformGroupPositions[i].EnabledGameObject != null)
                {
                    for (int j = 0; j < PlatformGroupPositions[i].Positions.Count; j++)
                    {
                        var rectangleMeshBuildScript =
                            PlatformGroupPositions[i].EnabledGameObject.GetComponent <RectangleMeshBuildScript>();

                        if (rectangleMeshBuildScript != null)
                        {
                            switch (rectangleMeshBuildScript.Anchor)
                            {
                            case TextAnchor.MiddleCenter:

                                gizmoCenter = Vector3.zero;

                                gizmoExtents = new Vector3(rectangleMeshBuildScript.Width / 2, rectangleMeshBuildScript.Height / 2);

                                break;

                            case TextAnchor.LowerLeft:

                                gizmoCenter = new Vector3(rectangleMeshBuildScript.Width / 2, rectangleMeshBuildScript.Height / 2);

                                gizmoExtents = new Vector3(rectangleMeshBuildScript.Width / 2, rectangleMeshBuildScript.Height / 2);

                                break;

                            default:
                                throw new ArgumentException("rectangleMeshBuildScript anchor " + rectangleMeshBuildScript.Anchor + " not supported.");
                            }
                        }
                        else
                        {
                            var boxCollider = PlatformGroupPositions[i].EnabledGameObject.GetComponent <BoxCollider2D>();

                            if (boxCollider != null)
                            {
                                gizmoCenter  = boxCollider.offset;
                                gizmoExtents = boxCollider.size / 2;
                            }
                        }

                        GizmoUtility.DrawBoundingBox(transform.TransformPoint(PlatformGroupPositions[i].Positions[j] + gizmoCenter), gizmoExtents, PlatformGroupPositions[i].OutlineGizmoColor);
                    }
                }
            }
        }
    }
Esempio n. 9
0
 public override void DrawGizmos()
 {
     if (DoDrawDebugBoundingBox)
     {
         GizmoUtility.DrawBoundingBox(
             PlayerController.transform.position + PlayerController.EnvironmentBoxCollider.offset.ToVector3(),
             PlayerController.EnvironmentBoxCollider.bounds.extents, DebugBoundingBoxColor);
     }
 }
Esempio n. 10
0
 void OnDrawGizmosSelected()
 {
     if (Application.isPlaying && m_IsMoving)
     {
         Color gizmoColor = new Color(0.2f, 0.8f, 0);
         Gizmos.color = gizmoColor;
         Gizmos.DrawLine(transform.position, transform.TransformPoint(-m_Delay));
         GizmoUtility.DrawCircle(transform.position, 10f, gizmoColor);
         GizmoUtility.DrawCircle(transform.TransformPoint(-m_Delay), 10f, gizmoColor);
     }
 }
Esempio n. 11
0
    void OnDrawGizmos()
    {
        if (ShowGizmoOutline)
        {
            if (PlatformPrefab != null)
            {
                var rectangleMeshBuildScript = PlatformPrefab.GetComponent <RectangleMeshBuildScript>();

                if (rectangleMeshBuildScript != null)
                {
                    switch (rectangleMeshBuildScript.Anchor)
                    {
                    case TextAnchor.MiddleCenter:

                        _gizmoCenter = Vector3.zero;

                        _gizmoExtents = new Vector3(rectangleMeshBuildScript.Width / 2, rectangleMeshBuildScript.Height / 2);

                        break;

                    case TextAnchor.LowerLeft:

                        _gizmoCenter = new Vector3(rectangleMeshBuildScript.Width / 2, rectangleMeshBuildScript.Height / 2);

                        _gizmoExtents = new Vector3(rectangleMeshBuildScript.Width / 2, rectangleMeshBuildScript.Height / 2);

                        break;

                    default:
                        throw new ArgumentException("rectangleMeshBuildScript anchor " + rectangleMeshBuildScript.Anchor + " not supported.");
                    }
                }
                else
                {
                    var boxCollider = PlatformPrefab.GetComponent <BoxCollider2D>();

                    if (boxCollider != null)
                    {
                        _gizmoCenter  = boxCollider.offset;
                        _gizmoExtents = boxCollider.bounds.extents;
                    }
                }
            }

            for (var i = 0; i < PlatformPositions.Count; i++)
            {
                GizmoUtility.DrawBoundingBox(
                    transform.TransformPoint(PlatformPositions[i] + _gizmoCenter),
                    _gizmoExtents,
                    OutlineGizmoColor);
            }
        }
    }
    void OnDrawGizmos()
    {
        if (showGizmoOutline)
        {
            BoxCollider2D boxCollider2D = this.GetComponent <BoxCollider2D>();
            if (boxCollider2D != null)
            {
                _gizmoCenter  = boxCollider2D.offset;
                _gizmoExtents = boxCollider2D.size / 2;
            }

            GizmoUtility.DrawBoundingBox(this.transform.TransformPoint(_gizmoCenter), _gizmoExtents, outlineGizmoColor);
        }
    }
Esempio n. 13
0
    void OnDrawGizmos()
    {
        if (ShowGizmoOutline)
        {
            var boxCollider = GetComponent <BoxCollider2D>();

            if (boxCollider != null)
            {
                _gizmoCenter  = boxCollider.offset;
                _gizmoExtents = boxCollider.size / 2;
            }

            GizmoUtility.DrawBoundingBox(transform.TransformPoint(_gizmoCenter), _gizmoExtents, OutlineGizmoColor);
        }
    }
Esempio n. 14
0
    void OnDrawGizmos()
    {
        for (int i = 0; i < platformGroupPositions.Count; i++)
        {
            if (platformGroupPositions[i].showGizmoOutline)
            {
                Vector3 gizmoCenter  = Vector3.zero;
                Vector3 gizmoExtents = new Vector3(16, 16, 0);

                if (platformGroupPositions[i].enabledGameObject != null)
                {
                    for (int j = 0; j < platformGroupPositions[i].positions.Count; j++)
                    {
                        RectangleMeshBuildScript rectangleMeshBuildScript = platformGroupPositions[i].enabledGameObject.GetComponent <RectangleMeshBuildScript>();
                        if (rectangleMeshBuildScript != null)
                        {
                            switch (rectangleMeshBuildScript.anchor)
                            {
                            case TextAnchor.MiddleCenter:
                                gizmoCenter  = Vector3.zero;
                                gizmoExtents = new Vector3(rectangleMeshBuildScript.width / 2, rectangleMeshBuildScript.height / 2);
                                break;

                            case TextAnchor.LowerLeft:
                                gizmoCenter  = new Vector3(rectangleMeshBuildScript.width / 2, rectangleMeshBuildScript.height / 2);
                                gizmoExtents = new Vector3(rectangleMeshBuildScript.width / 2, rectangleMeshBuildScript.height / 2);
                                break;

                            default:
                                throw new ArgumentException("rectangleMeshBuildScript anchor " + rectangleMeshBuildScript.anchor + " not supported.");
                            }
                        }
                        else
                        {
                            BoxCollider2D boxCollider2D = platformGroupPositions[i].enabledGameObject.GetComponent <BoxCollider2D>();
                            if (boxCollider2D != null)
                            {
                                gizmoCenter  = boxCollider2D.offset;
                                gizmoExtents = boxCollider2D.size / 2;
                            }
                        }

                        GizmoUtility.DrawBoundingBox(this.transform.TransformPoint(platformGroupPositions[i].positions[j] + gizmoCenter), gizmoExtents, platformGroupPositions[i].outlineGizmoColor);
                    }
                }
            }
        }
    }
    void OnDrawGizmos()
    {
        if (_physicsCollider == null || _visibilityCollider == null)
        {
            Awake();
        }

        if (showCameraGizmoOutline)
        {
            GizmoUtility.DrawBoundingBox(transform, _visibilityCollider.bounds.extents, outlineVisibilityMaskGizmoColor);
        }
        if (showGizmoOutline)
        {
            GizmoUtility.DrawBoundingBox(transform, new Vector3(width / 2, height / 2), outlineGizmoColor);
        }
    }
Esempio n. 16
0
 void OnDrawGizmos()
 {
     if (showGizmoOutline)
     {
         if (floatingAttachedPlatform != null)
         {
             BoxCollider2D boxCollider2D = floatingAttachedPlatform.GetComponent <BoxCollider2D>();
             if (boxCollider2D != null)
             {
                 _gizmoCenter  = Vector2.zero;
                 _gizmoExtents = new Vector3(
                     width + boxCollider2D.size.x / 2
                     , height + boxCollider2D.size.y / 2
                     );
             }
         }
         GizmoUtility.DrawBoundingBox(this.transform.TransformPoint(_gizmoCenter), _gizmoExtents, outlineGizmoColor);
     }
 }
Esempio n. 17
0
    void OnDrawGizmos()
    {
        if (ShowGizmoOutline)
        {
            if (FloatingAttachedPlatform != null)
            {
                var boxCollider = FloatingAttachedPlatform.GetComponent <BoxCollider2D>();
                if (boxCollider != null)
                {
                    _gizmoCenter  = Vector2.zero;
                    _gizmoExtents = new Vector3(
                        Radius + boxCollider.size.x / 2,
                        Radius + boxCollider.size.y / 2);
                }
            }

            GizmoUtility.DrawBoundingBox(transform.TransformPoint(_gizmoCenter), _gizmoExtents, OutlineGizmoColor);
        }
    }
Esempio n. 18
0
    void OnDrawGizmos()
    {
        if (_collider != null ||
            (Application.isEditor && !Application.isPlaying))
        {
            _walkingJumpRadiusPositions = null;
            _runningJumpRadiusPositions = null;

            Gizmos.color = Color.gray;
            if (_walkingJumpRadiusPositions == null)
            {
                _walkingJumpRadiusPositions = GizmoUtility.CreateEllipse(
                    walkingJumpDistance
                    , jumpHeight
                    , 0, 0//-playerDimensions.y * .5f
                    , 0f
                    , _jumpRadiusResolution);
            }
            if (_runningJumpRadiusPositions == null)
            {
                _runningJumpRadiusPositions = GizmoUtility.CreateEllipse(
                    runningJumpDistance
                    , jumpHeight
                    , 0, 0//-playerDimensions.y * .5f
                    , 0f
                    , _jumpRadiusResolution);
            }

            for (int i = 1; i < _walkingJumpRadiusPositions.Length; i++)
            {
                Gizmos.DrawLine(_walkingJumpRadiusPositions[i - 1] + this.transform.position, _walkingJumpRadiusPositions[i] + this.transform.position);
            }
            Gizmos.DrawLine(_walkingJumpRadiusPositions[_walkingJumpRadiusPositions.Length - 1] + this.transform.position, _walkingJumpRadiusPositions[0] + this.transform.position);

            for (int i = 1; i < _runningJumpRadiusPositions.Length; i++)
            {
                Gizmos.DrawLine(_runningJumpRadiusPositions[i - 1] + this.transform.position, _runningJumpRadiusPositions[i] + this.transform.position);
            }
            Gizmos.DrawLine(_runningJumpRadiusPositions[_runningJumpRadiusPositions.Length - 1] + this.transform.position, _runningJumpRadiusPositions[0] + this.transform.position);


            float comfortableJumpHeightYPos = this.transform.position.y + comfortableJumpHeight; // -playerDimensions.y * .5f;
            float maxJumpHeightYPos         = this.transform.position.y + maxJumpHeight;         //  - playerDimensions.y * .5f;

            Gizmos.color = Color.gray;
            Gizmos.DrawLine(
                new Vector3(this.transform.position.x - walkingJumpHeightWidth * .4f, maxJumpHeightYPos, this.transform.position.z)
                , new Vector3(this.transform.position.x + walkingJumpHeightWidth * .4f, maxJumpHeightYPos, this.transform.position.z));
            Gizmos.color = Color.white;
            Gizmos.DrawLine(
                new Vector3(this.transform.position.x - walkingJumpHeightWidth * .7f, comfortableJumpHeightYPos, this.transform.position.z)
                , new Vector3(this.transform.position.x + walkingJumpHeightWidth * .7f, comfortableJumpHeightYPos, this.transform.position.z));

            Gizmos.DrawLine(new Vector3(transform.position.x - playerDimensions.x, transform.position.y - playerDimensions.y * .5f, transform.position.z)
                            , new Vector3(transform.position.x + playerDimensions.x, transform.position.y - playerDimensions.y * .5f, transform.position.z));

            // draw player visible rect
            GizmoUtility.DrawBoundingBox(transform.position, new Vector3(950f, 540f, 0f), Color.blue);

            // draw default camera locked
            // draw player visible rect
            GizmoUtility.DrawBoundingBox(new Vector3(transform.position.x, 540f, transform.position.z), new Vector3(950f, 540f, 0f), Color.cyan);
            Gizmos.color = Color.cyan;
            Gizmos.DrawLine(
                new Vector3(this.transform.position.x - 1000f, 540f, this.transform.position.z)
                , new Vector3(this.transform.position.x + 1000f, 540f, this.transform.position.z));
            Gizmos.DrawLine(
                new Vector3(this.transform.position.x - 1000f, 720f, this.transform.position.z)
                , new Vector3(this.transform.position.x + 1000f, 720f, this.transform.position.z));
            Gizmos.DrawLine(
                new Vector3(this.transform.position.x - 1000f, 360f, this.transform.position.z)
                , new Vector3(this.transform.position.x + 1000f, 360f, this.transform.position.z));
        }
    }
Esempio n. 19
0
File: Map.cs Progetto: jaoel/LD44
    public void DrawDebug()
    {
        if (_drawBounds && Bounds != null)
        {
            GizmoUtility.DrawRectangle(Bounds.ToRectInt(), Color.cyan);
        }

        if (_drawCells && Cells != null)
        {
            Cells.ForEach(x =>
            {
                switch (x.Type)
                {
                case MapNodeType.Default:
                    {
                        GizmoUtility.DrawRectangle(x.Cell, Color.black);
                    }
                    break;

                case MapNodeType.Room:
                    {
                        if (x.Lockable)
                        {
                            GizmoUtility.DrawRectangle(x.Cell, Color.green);
                        }
                        else
                        {
                            GizmoUtility.DrawRectangle(x.Cell, Color.red);
                        }
                    }
                    break;

                case MapNodeType.Corridor:
                    {
                        GizmoUtility.DrawRectangle(x.Cell, Color.blue);
                    }
                    break;

                default:
                    break;
                }
            });

            ChokePoints.ForEach(x =>
            {
                GizmoUtility.DrawRectangle(x.ToRectInt(), Color.magenta);
            });
        }

        if (_drawDelaunay && DelaunayGraph != null)
        {
            DelaunayGraph.ForEach(x =>
            {
                GizmoUtility.DrawLine(x, Color.cyan);
            });
        }

        if (_drawGabriel && GabrielGraph != null)
        {
            GabrielGraph.ForEach(x =>
            {
                GizmoUtility.DrawLine(x, Color.magenta);
            });
        }

        if (_drawEMST && EMSTGraph != null)
        {
            EMSTGraph.ForEach(x =>
            {
                GizmoUtility.DrawLine(x, Color.cyan);
            });
        }

        if (_drawLayout && LayoutGraph != null)
        {
            LayoutGraph.ForEach(x =>
            {
                GizmoUtility.DrawLine(x, Color.magenta);
            });

            if (StartToGoalPath != null)
            {
                StartToGoalPath.ForEach(x =>
                {
                    GizmoUtility.DrawLine(x, new Color(159 / 255.0f, 90 / 255.0f, 253 / 255.0f, 1));
                });
            }
        }

        if (_drawCorridors && CorridorGraph != null)
        {
            CorridorGraph.ForEach(x =>
            {
                GizmoUtility.DrawLine(x, Color.red);
            });
        }
    }
Esempio n. 20
0
    void OnDrawGizmos()
    {
        if (_collider != null ||
            (Application.isEditor && !Application.isPlaying))
        {
            _walkingJumpRadiusPositions = null;

            _runningJumpRadiusPositions = null;

            Gizmos.color = Color.gray;
            if (_walkingJumpRadiusPositions == null)
            {
                _walkingJumpRadiusPositions = GizmoUtility.CreateEllipse(
                    WalkingJumpDistance,
                    JumpHeight,
                    0,
                    0,
                    0f,
                    _jumpRadiusResolution);
            }
            if (_runningJumpRadiusPositions == null)
            {
                _runningJumpRadiusPositions = GizmoUtility.CreateEllipse(
                    RunningJumpDistance,
                    JumpHeight,
                    0,
                    0,
                    0f,
                    _jumpRadiusResolution);
            }

            for (var i = 1; i < _walkingJumpRadiusPositions.Length; i++)
            {
                Gizmos.DrawLine(_walkingJumpRadiusPositions[i - 1] + transform.position, _walkingJumpRadiusPositions[i] + transform.position);
            }

            Gizmos.DrawLine(_walkingJumpRadiusPositions[_walkingJumpRadiusPositions.Length - 1] + transform.position, _walkingJumpRadiusPositions[0] + transform.position);

            for (var i = 1; i < _runningJumpRadiusPositions.Length; i++)
            {
                Gizmos.DrawLine(_runningJumpRadiusPositions[i - 1] + transform.position, _runningJumpRadiusPositions[i] + transform.position);
            }

            Gizmos.DrawLine(_runningJumpRadiusPositions[_runningJumpRadiusPositions.Length - 1] + transform.position, _runningJumpRadiusPositions[0] + transform.position);

            var comfortableJumpHeightYPos = transform.position.y + ComfortableJumpHeight; // -playerDimensions.y * .5f;

            var maxJumpHeightYPos = transform.position.y + MaxJumpHeight;                 //  - playerDimensions.y * .5f;

            Gizmos.color = Color.gray;

            Gizmos.DrawLine(
                new Vector3(transform.position.x - WalkingJumpHeightWidth * .4f, maxJumpHeightYPos, transform.position.z),
                new Vector3(transform.position.x + WalkingJumpHeightWidth * .4f, maxJumpHeightYPos, transform.position.z));

            Gizmos.color = Color.white;

            Gizmos.DrawLine(
                new Vector3(transform.position.x - WalkingJumpHeightWidth * .7f, comfortableJumpHeightYPos, transform.position.z),
                new Vector3(transform.position.x + WalkingJumpHeightWidth * .7f, comfortableJumpHeightYPos, transform.position.z));

            Gizmos.DrawLine(
                new Vector3(transform.position.x - PlayerDimensions.x, transform.position.y - PlayerDimensions.y * .5f, transform.position.z),
                new Vector3(transform.position.x + PlayerDimensions.x, transform.position.y - PlayerDimensions.y * .5f, transform.position.z));

            // draw player visible rect
            GizmoUtility.DrawBoundingBox(transform.position, SafeAreaBounds, Color.blue);
        }
    }