Beispiel #1
0
    /*----------------------------------------------------------------------*/

    public Vector2 Clip(Vector2 point)
    {
        SPACE space = IsInSpace(point);

        switch (space)
        {
        case SPACE.RIGHT:
            return(right.PointXOnLine(point.y));

        case SPACE.RIGHT_TOP:
            return(rightTop);

        case SPACE.TOP:
            return(top.PointYOnLine(point.x));

        case SPACE.LEFT_TOP:
            return(leftTop);

        case SPACE.LEFT:
            return(left.PointXOnLine(point.y));

        case SPACE.LEFT_BOTTOM:
            return(leftBottom);

        case SPACE.BOTTOM:
            return(bottom.PointYOnLine(point.x));

        case SPACE.RIGHT_BOTTOM:
            return(rightBottom);
        }
        return(point);
    }
Beispiel #2
0
        public override void Write(int indent, string textToAppend)
        {
            var action = new Action(() =>
            {
                this.Write(SPACE.Repeat(indent) + textToAppend);
            });

            this.WriterActions.AddToDictionaryListCreateIfNotExist(this.CurrentNodeKind, new WriterAction(this.CurrentNode, action));
        }
Beispiel #3
0
        public override void Write(int indent, string format, params object[] args)
        {
            var action = new Action(() =>
            {
                this.Write(SPACE.Repeat(indent) + string.Format(format, args));
            });

            this.WriterActions.AddToDictionaryListCreateIfNotExist(this.CurrentNodeKind, new WriterAction(this.CurrentNode, action));
        }
Beispiel #4
0
 public void ToString(StringBuilder sb, int space)
 {
     sb.AppendFormat("*{0}{1} [Use Time:{2:0.000}ms]\r\n", SPACE.Substring(0, space), Name, EndTime - StartTime);
     foreach (WatchItem item in Childs)
     {
         item.ToString(sb, space + 3);
     }
     // sb.AppendFormat("*{0}{1} End:{2:0.000}ms|Use Time:{3:0.000}ms\r\n", SPACE.Substring(0, space), Name, EndTime, EndTime -StartTime);
 }
Beispiel #5
0
        //****************************************************************************************************
        //
        //****************************************************************************************************

        public void ToTransform(Transform transform, SPACE space)
        {
            if (transform != null)
            {
                if (space == SPACE.WORLD)
                {
                    transform.position = m_pos;

                    transform.rotation = m_quat;

                    transform.localScale = LocalScaleForWorldScale(m_scale, transform);
                }
                else
                {
                    transform.localPosition = m_pos;

                    transform.localRotation = m_quat;

                    transform.localScale = m_scale;
                }
            }
        }
Beispiel #6
0
        //****************************************************************************************************
        //
        //****************************************************************************************************

        public void FromTransform(Transform transform, SPACE space)
        {
            if (transform != null)
            {
                if (space == SPACE.WORLD)
                {
                    m_pos = transform.position;

                    m_quat = transform.rotation;

                    m_scale = transform.lossyScale;
                }
                else
                {
                    m_pos = transform.localPosition;

                    m_quat = transform.localRotation;

                    m_scale = transform.localScale;
                }
            }
        }
Beispiel #7
0
 public GLCall(int vertexCount, Color color, SPACE space)
 {
     VertexCount = vertexCount;
     Color       = color;
     Space       = space;
 }