Tweening

Updated: 2018-09-06

Chronos can be used along many third-party tweening libraries. The following article gives some examples for the most common ones.


DOTween

tween.OnUpdate(()=> tween.timeScale = timeline.timeScale);

LeanTween

LeanTween.dtManual = GetComponent<Timeline>().deltaTime;
LeanTween.scale(this.gameObject, Vector3.one*3f, 1.0f).setUseManualTime(true);

iTween

iTween uses its own custom scripts with Time functions from Unity. You have to replace these with Chronos equivalents.

Do the following changes in iTween.cs and it should become compatible with Chronos.

Search: Time.deltaTime
Replace: GetComponent<Timeline>().deltaTime

Search: Time.time
Replace: GetComponent<Timeline>().time

Search: new WaitForSeconds
Replace: GetComponent<Timeline>().WaitForSeconds

Add the Chronos namespace in usings:

#region Namespaces
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
using Chronos;
#endregion

Add a require component to the class: (optional, but a good reminder)

[RequireComponent(typeof(Timeline))]
public class iTween : MonoBehaviour {
Was this article helpful?
Be the first to vote!
Yes, helpful
No, not for me