1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 09:16:02 +08:00
2020-01-17 00:11:15 +09: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();
}
}