/*----------------------------------------------------------------------*/ 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); }
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)); }
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)); }
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); }
//**************************************************************************************************** // //**************************************************************************************************** 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; } } }
//**************************************************************************************************** // //**************************************************************************************************** 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; } } }
public GLCall(int vertexCount, Color color, SPACE space) { VertexCount = vertexCount; Color = color; Space = space; }