Exemplo n.º 1
0
    /// <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);
    }
Exemplo n.º 2
0
 /// <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)));
 }
Exemplo n.º 3
0
 /// <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)));
 }