/// <summary> /// Used to create a tween object. /// </summary> /// <param name="targetObject">GameObject to be targeted.</param> /// <param name="duration">The duration of a single run of the tween.</param> /// <param name="config">Tween config.</param> public static NT.Instance Create(GameObject targetObject, float duration, NT.Config config) { if (targetObject == null) { return(null); } if (config == null) { return(null); } if (container == null) { container = new GameObject("NightTween"); Object.DontDestroyOnLoad(container); } NT.Instance t = container.AddComponent <NT.Instance>(); t.Setup(targetObject, duration, config); return(t); }
/// <summary> /// Used to create a tween object. /// </summary> /// <param name="targetObject">GameObject to be targeted.</param> /// <param name="duration">The duration of a single run of the tween.</param> /// <param name="property">Target property to animate.</param> /// <param name="finalValue">Final value.</param> /// <param name="easeType">Ease type.</param> /// <param name="config">Tween config.</param> public static NT.Instance Create(GameObject targetObject, float duration, NT.EaseType easeType, NT.Config config) { return(Create(targetObject, duration, config.Ease(easeType))); }
/// <summary> /// Used to create a tween object. /// </summary> /// <param name="targetObject">GameObject to be targeted.</param> /// <param name="duration">The duration of a single run of the tween.</param> /// <param name="property">Target property to animate.</param> /// <param name="finalValue">Final value.</param> /// <param name="easeType">Ease type.</param> /// <param name="config">Tween config.</param> public static NT.Instance Create(GameObject targetObject, float duration, NT.Property property, object finalValue, NT.EaseType easeType, NT.Config config) { return(Create(targetObject, duration, config.Property(property, finalValue).Ease(easeType))); }