void MovePanel(StatPanel obj, string pos, ref Tweener t) { UIPanel.Position target = obj.panel[pos]; if (obj.panel.CurrentPosition != target) { if (t != null && t.easingControl != null) { t.easingControl.Stop(); } t = obj.panel.SetPosition(pos, true); t.easingControl.duration = 0.5f; t.easingControl.equation = EasingEquations.EaseOutQuad; } }
void Start() { panel = GetComponent <UIPanel> (); UIPanel.Position centerPos = new UIPanel.Position(Center, TextAnchor.MiddleCenter, TextAnchor.MiddleCenter); panel.AddPosition(centerPos); }