[Core.ATTR.UCL_DrawTexture2D]//(128, 128, TextureFormat.ARGB32, typeof(UCL_EaseTexture)) Core.TextureLib.UCL_Texture2D DrawEaseCurve() { if (m_Texture == null) { m_Texture = new UCL_EaseTexture(128, 128, TextureFormat.ARGB32); } if (UCL.Core.EditorLib.EditorApplicationMapper.isPlaying && m_Seq != null) { UCL_EaseTexture.DrawEase(m_CurEase, m_Texture); } else { UCL_EaseTexture.DrawEase(m_Ease, m_Texture); } if (m_Cur != null) { Vector2 pos = m_Cur.GetPos(); var tex = m_Texture as UCL_EaseTexture; if (tex != null) { pos.y -= tex.m_Min; pos.y /= tex.m_Range; //pos.y *= 0.99f; } m_Texture.DrawDot(pos.x, pos.y, Color.red, 2); } return(m_Texture); }
public void Editor_DebugCurve(Core.TextureLib.UCL_Texture2D m_CurveTexture) { m_CurveTexture.SetColor(Color.black); float min = 0, max = 1.2f; if (m_Datas.Count > 1) { m_CurveTexture.DrawLineAutoFit(delegate(float u) { return(u); }, Color.red, min, max, true, true); m_CurveTexture.DrawLineAutoFit(delegate(float u) { return(MathLib.LinearMapping.GetY(m_Datas, u)); }, Color.green, min, max, false, false); m_CurveTexture.DrawLineAutoFit(delegate(float u) { return(CurveFunc(u)); }, Color.yellow, min, max, false, false); m_CurveTexture.DrawDot(m_TargetVal, MathLib.LinearMapping.GetY(m_Datas, m_TargetVal) / max, Color.white, 2); m_CurveTexture.DrawDot(m_TargetVal, MathLib.LinearMapping.GetX(m_Datas, m_TargetVal) / max, Color.cyan, 2); } }
public void DrawEaseCurve(Core.TextureLib.UCL_Texture2D texture) { UCL_EaseTexture.DrawEase(m_Ease, texture); if (m_Cur != null) { Vector2 pos = m_Cur.GetPos(); var tex = texture as UCL_EaseTexture; if (tex != null) { pos.y -= tex.m_Min; pos.y /= tex.m_Range; //pos.y *= 0.99f; } texture.DrawDot(pos.x, pos.y, Color.red, 2); } }
public Core.TextureLib.UCL_Texture2D DrawRandomPoints() { if (m_Texture == null) { m_Texture = new TextureLib.UCL_Texture2D(new Vector2Int(256, 256), TextureFormat.RGB24); } m_Texture.SetColor(Color.white); if (m_RandomPoints != null) { foreach (var point in m_RandomPoints) { m_Texture.DrawDot((0.98f * point).ToTextureSpace(), m_DotColor, 1); } } return(m_Texture); }