1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 17:26:03 +08:00
2015-03-18 19:30:48 +01:00

29 lines
793 B
C#

using DG.Tweening;
using System.Collections;
using UnityEngine;
public class Rigidbodies : BrainBase
{
public Transform[] targets;
public Rigidbody2D r2D;
IEnumerator Start()
{
yield return new WaitForSeconds(1);
DOTween.Sequence()
.Append(targets[0].GetComponent<Rigidbody>().DORotate(new Vector3(0, 0, 90), 1, RotateMode.WorldAxisAdd))
.Append(targets[0].GetComponent<Rigidbody>().DORotate(new Vector3(90, 0, 0), 1, RotateMode.LocalAxisAdd))
.Append(targets[0].GetComponent<Rigidbody>().DORotate(new Vector3(0, 810, 0), 1, RotateMode.LocalAxisAdd));
}
void OnGUI()
{
DGUtils.BeginGUI();
if (GUILayout.Button("Rotate 2D 360")) r2D.DORotate(360, 1);
if (GUILayout.Button("Rotate 2D 360 Relative")) r2D.DORotate(360, 1).SetRelative();
DGUtils.EndGUI();
}
}