protected override void InitTween() { m_Ease = null; foreach (var com in m_Components) { com.Init(); } }
public void SetEase(UCL_Ease ease) { m_Ease = ease; if (m_Ease == null) { return; } m_RangeCheck.Init(0, 1); for (int i = 0; i < m_Size.x; i++) { float at = (i / (float)(m_Size.x - 1)); float val = m_Ease.GetEase(at); m_RangeCheck.AddValue(val); } SetColor(Color.black); m_Min = m_RangeCheck.Min; m_Max = m_RangeCheck.Max; m_Range = m_Max - m_Min; if (m_Min < 0) { float z_pos = -m_Min / m_Range; DrawLine(delegate(float y) { return(z_pos); }, Color.white); } if (m_Max > 1.0f) { float z_pos = (1.0f - m_Min) / m_Range; DrawLine(delegate(float y) { return(z_pos); }, Color.blue); } float range = ((Mathf.CeilToInt(m_Range * (m_Size.y + 1))) / (float)m_Size.y); DrawLine( delegate(float x) { float val = m_Ease.GetEase(x); float y = ((val - m_Min) / range); return(y); }, m_EaseCol); }
private void Update() { if (f_LoopDir) { m_LoopTimer++; if (m_LoopTimer > m_LoopTime) { m_LoopTimer = 0; int val = (int)m_Dir; val++; if (val >= Enum.GetNames(typeof(EaseDir)).Length) { val = 0; } m_Dir = (EaseDir)val; } } m_Ease = EaseCreator.Get(m_Type, m_Dir); /* * if(!f_SetByEaseType) { * m_EaseType = EaseCreator.GetType(m_Type, m_Dir); * } else { * m_Type = EaseCreator.GetClass(m_EaseType); * m_Dir = EaseCreator.GetDir(m_EaseType); * } */ //m_Ease.SetDir(m_Dir); m_Texture.SetEase(m_Ease); Core.DebugLib.UCL_DebugOnGUI.Instance.CreateData().AddOnGUIAct(() => { GUILayout.BeginVertical(); //string target_name = this.GetType().UnderlyingSystemType.Name.Replace("UCL_", ""); GUILayout.Box("Min:" + m_Texture.m_Min.ToString("N2") + ",Max:" + m_Texture.m_Max.ToString("N2"), GUILayout.Width(m_TextureSize.x + 4)); GUILayout.Box(m_Type.ToString() + " " + m_Ease.m_Dir.ToString(), GUILayout.Width(m_TextureSize.x + 4)); //GUILayout.Box("Range:" + m_Texture.m_Range, GUILayout.Width(m_TextureSize.x + 4)); //GUILayout.Box(name, GUILayout.Width(m_TextureSize.x + 4)); GUILayout.Box(m_Texture.texture); GUILayout.EndVertical(); }); }
virtual public UCL_Tweener SetEase(Ease.UCL_Ease _ease) { m_Ease = _ease; return(this); }