public static void StartTween(this GameObject go, ref TweenBase variable, TweenBase tween, TweenStartMode startMode = TweenStartMode.Immediate) { if (variable != null) { variable.Cancel(); } variable = tween; go.GetTweener().StartTween(tween, startMode); }
void OnEnable() { #if UNITY_EDITOR if (m_asset == null) { Debug.LogWarningFormat(this, "UITweenAsset == null at {0}", name); enabled = false; return; } #endif m_tween.Cancel(); m_tween = m_asset.CreateTween(this); gameObject.StartTween(m_tween); }