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.")]
|
2022-10-27 12:32:06 +08:00
|
|
|
|
private float RotateSpeed = 1.0f;
|
|
|
|
|
private float rotation = 0.0f;
|
2022-10-25 01:34:46 +08:00
|
|
|
|
[SerializeField]
|
2022-11-08 15:02:08 +08:00
|
|
|
|
private CallbackEvent emptyEvent;
|
|
|
|
|
[SerializeField]
|
2022-10-25 01:34:46 +08:00
|
|
|
|
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) { }
|
|
|
|
|
|
2022-11-07 19:32:12 +08:00
|
|
|
|
|
2022-09-28 23:55:44 +08:00
|
|
|
|
protected override void awake()
|
|
|
|
|
{
|
2022-11-08 15:02:08 +08:00
|
|
|
|
emptyEvent = new CallbackEvent();
|
|
|
|
|
emptyEvent.RegisterAction(() => Debug.Log("Empty event action!"));
|
2022-11-07 19:32:12 +08:00
|
|
|
|
testEvent = new CallbackEvent<int>();
|
|
|
|
|
Action<int> action = (x) => Debug.Log($"{x}");
|
|
|
|
|
testEvent.RegisterAction(action);
|
|
|
|
|
|
2022-09-28 23:55:44 +08:00
|
|
|
|
Transform = GetComponent<Transform>();
|
|
|
|
|
if (Transform == null)
|
|
|
|
|
{
|
|
|
|
|
Debug.LogError("Transform is NULL!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|