コード例 #1
0
    protected virtual void OnDrawGizmos()
    {
        Gizmos.color = Color.red;

        GizmosEx.DrawCross(Vector3.zero, 1);

        GizmosEx.DrawWireRectangle(Vector3.one, 1, 1);
    }
コード例 #2
0
    protected virtual void OnDrawGizmos()
    {
        Gizmos.color = Color.red;

        GizmosEx.DrawCross(base.transform.position, 1);

        Gizmos.color = Color.green;

        GizmosEx.DrawArrow(base.transform.position, base.transform.position + new Vector3(1, 1, 1) * 3);
    }
コード例 #3
0
ファイル: CurveView.cs プロジェクト: xenosl/ShuHai
        protected void OnDrawGizmos()
        {
            if (Curve == null)
            {
                return;
            }

            for (int s = 0; s < Curve.SegmentCount; ++s)
            {
                var segment = Curve.GetSegment(s);
                var points  = segment.Points;

                if (ShowSegments)
                {
                    using (new GizmosColorScope(SegmentColors.LoopedAt(s, Color.cyan)))
                    {
                        for (int i = 0; i < points.Count - 1; ++i)
                        {
                            var p0 = points[i];
                            var p1 = points[i + 1];
                            GizmosEx.DrawLine(p0, p1, transform);
                        }
                    }
                }

                if (ShowPoints)
                {
                    using (new GizmosColorScope(Color.yellow))
                    {
                        foreach (var point in points)
                        {
                            GizmosEx.DrawCross(point, PointSize, transform);
                        }
                    }
                }
            }

            if (ShowKeyPoints)
            {
                using (new GizmosColorScope(Color.magenta))
                {
                    foreach (var point in Curve.KeyPoints)
                    {
                        GizmosEx.DrawCross(point, PointSize, transform);
                    }
                }
            }
        }