예제 #1
0
        private void OnDrawGizmosSelected()
        {
            foreach (var switchController in this.switchControllers)
            {
                if (switchController != null)
                {
                    var position  = switchController.transform.position;
                    var gizmoRect = new Rect(position.x - 0.5f, position.y - 0.5f, 1, 1);
                    GizmosEx.DrawRect(gizmoRect.Expand(-0.01f), GizmoColorSwitch);
                    GizmosEx.DrawRect(gizmoRect.Expand(-0.05f), GizmoColorSwitch);
                }
            }

            const float crossSize = 0.25f;

            foreach (var triggerEvent in this.triggerEvents)
            {
                if (triggerEvent != null && triggerEvent.TileObject != null)
                {
                    var position  = triggerEvent.TileObject.transform.position;
                    var gizmoRect = new Rect(position.x - 0.5f, position.y - 0.5f, 1, 1);
                    GizmosEx.DrawRect(gizmoRect, GizmoColorTrigger);
                    GizmosEx.DrawRect(gizmoRect.Expand(0.04f), GizmoColorTrigger);
                    GizmosEx.DrawRect(gizmoRect.Expand(0.08f), GizmoColorTrigger);
                    Gizmos.color = GizmoColorTrigger;
                    Gizmos.DrawLine(new Vector3(position.x, position.y - crossSize), new Vector3(position.x, position.y + crossSize));
                    Gizmos.DrawLine(new Vector3(position.x - crossSize, position.y), new Vector3(position.x + crossSize, position.y));
                }
            }
        }
    void OnDrawGizmosSelected()
    {
        var pos   = transform.position;
        var color = ColorUtils.FromRGB(0x91ef8c);

        GizmosEx.DrawRect(pos.x + m_colliderRect.x - 0.5f * m_colliderRect.width, pos.y + m_colliderRect.y - 0.5f * m_colliderRect.height, m_colliderRect.width, m_colliderRect.height, color);
    }