您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
21 行
658 B
21 行
658 B
using UnityEngine;
|
|
|
|
namespace GameplayIngredients.Rigs
|
|
{
|
|
[AddComponentMenu(ComponentMenu.rigsPath + "Rotation Rig")]
|
|
public class RotationRig : Rig
|
|
{
|
|
public override int defaultPriority => 0;
|
|
public override UpdateMode defaultUpdateMode => UpdateMode.Update;
|
|
public override bool canChangeUpdateMode => false;
|
|
|
|
public Space Space = Space.World;
|
|
public Vector3 RotationAxis = Vector3.up;
|
|
public float RotationSpeed = 30.0f;
|
|
|
|
public override void UpdateRig(float deltaTime)
|
|
{
|
|
transform.Rotate(RotationAxis.normalized, RotationSpeed * deltaTime, Space);
|
|
}
|
|
}
|
|
}
|