2022-09-28 23:55:44 +08:00
|
|
|
|
using SHADE;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
public class RaccoonSpin : Script
|
|
|
|
|
{
|
2022-10-18 20:09:50 +08:00
|
|
|
|
[SerializeField]
|
|
|
|
|
[Tooltip("Speed of the rotation in radians per second.")]
|
|
|
|
|
private double RotateSpeed = 1.0;
|
2022-09-28 23:55:44 +08:00
|
|
|
|
private double rotation = 0.0;
|
2022-10-25 01:34:46 +08:00
|
|
|
|
[SerializeField]
|
|
|
|
|
private CallbackEvent<int> testEvent;
|
|
|
|
|
[SerializeField]
|
|
|
|
|
private CallbackEvent<int, double, Vector3> testEvent3 = new CallbackEvent<int, double, Vector3>();
|
2022-09-28 23:55:44 +08:00
|
|
|
|
private Transform Transform;
|
|
|
|
|
public RaccoonSpin(GameObject gameObj) : base(gameObj) { }
|
|
|
|
|
|
|
|
|
|
protected override void awake()
|
|
|
|
|
{
|
|
|
|
|
Transform = GetComponent<Transform>();
|
|
|
|
|
if (Transform == null)
|
|
|
|
|
{
|
|
|
|
|
Debug.LogError("Transform is NULL!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
protected override void update()
|
|
|
|
|
{
|
|
|
|
|
rotation += RotateSpeed * 0.16;
|
|
|
|
|
Transform.LocalRotation = new Vector3(0.0f, rotation, 0.0f);
|
|
|
|
|
}
|
|
|
|
|
}
|