mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 01:06:02 +08:00
+ Fixed possible error where killAdd was increased only by maxTweeners if capacity was set to increase both by tweeners and by sequences
22 lines
601 B
C#
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();
|
|
}
|
|
} |