本文整理汇总了C#中Transform.DOMove方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.DOMove方法的具体用法?C# Transform.DOMove怎么用?C# Transform.DOMove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform
的用法示例。
在下文中一共展示了Transform.DOMove方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
DOTween.Init();
tf = GetComponent<Transform>();
if(from == false)
{
tf.DOMove(target, duration, false).SetRelative(relative).SetEase(ease);
}
else
{
tf.DOMove(target, duration, false).SetEase(ease).From(relative);
}
}
示例2: DOMove
public static Tweener DOMove(Transform target, Vector3 endValue, float duration, int loops = -1, LoopType loopType = LoopType.Yoyo, float delay = 0, System.Action doComplete = null)
{
Tweener tweener = target.DOMove(endValue, duration);
tweener.SetLoops(loops, loopType);
SetTweenerComplete(tweener, delay, doComplete);
return tweener;
}
示例3: Attack
// L'attaque qui instantie des boules de feu
IEnumerator Attack()
{
bulletTf = (Instantiate(bulletHell, transform.position, transform.rotation) as GameObject).GetComponent<Transform>();
bulletTf.SetParent(bulletHellInstances);
bulletTf.DOMove(player.position, timeDuration).SetEase(ease);
bulletTf.rotation = Quaternion.AngleAxis(GetComponent<BossAttack>().lookRotation, Vector3.forward);
yield return new WaitForSeconds(bulletCoolDown);
bulletDispo = true;
}
示例4: FromTween
void FromTween()
{
t = ((GameObject)Instantiate(prefab)).transform;
t.DOMove(new Vector3(0, 2, 0), 1)
.From()
.OnKill(() => Destroy(t.gameObject));
Debug.Log(t.position);
}
示例5: EmitDOTweenPositionFor
void EmitDOTweenPositionFor(Transform t, Vector3 to, float twDuration, DG.Tweening.Ease ease)
{
t.position = Vector3.zero;
t.DOMove(to, twDuration).SetEase(ease).OnComplete(()=> EmitDOTweenPositionFor(t, to, twDuration, ease));
}
示例6: ResetParticleAndAssignTween
void ResetParticleAndAssignTween(Transform t, Material m)
{
t.position = Vector3.zero;
Color col = m.color;
col.a = 1;
m.color = col;
float duration = Random.Range(0.2f, 2f);
m.DOFade(0, duration).SetRecyclable(recycle);
t.DOMove(RandomVector3(), duration)
.SetRecyclable(recycle)
.OnComplete(()=> ResetParticleAndAssignTween(t, m));
}
示例7: TransformPosition
public static Tweener TransformPosition(Transform trans, Vector3 targetPosition, float time, float delay, Ease ease = Ease.OutElastic)
{
return trans.DOMove(targetPosition, time).SetEase(ease).SetDelay(delay);
}