1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 17:26:03 +08:00
Demigiant 0e63b84837 Added SetLink chainable method
+ Fixed possible error where killAdd was increased only by maxTweeners if capacity was set to increase both by tweeners and by sequences
2019-02-24 15:16:00 +01:00

22 lines
601 B
C#

using System.Collections;
using DG.Tweening;
using UnityEngine;
public class SetLink : BrainBase
{
public Transform tweenTarget;
public bool autoKill = true;
public bool pauseAtStartup = true;
public int loops = 2;
public float duration = 1;
public GameObject linkTarget;
public LinkBehaviour linkBehaviour;
void Start()
{
Tween t = tweenTarget.DOMoveX(3, duration).SetLoops(loops, LoopType.Yoyo).SetEase(Ease.Linear)
.SetLink(linkTarget, linkBehaviour);
if (autoKill) t.SetAutoKill();
if (pauseAtStartup) t.Pause();
}
}