internal static void SetRotateStart(GameObject obj, float speed, bool isclockwise, bool isuseacc) { if (obj.GetComponent <RotControl>() != null) { Destroy(obj.GetComponent <RotControl>()); } RotControl rotControl = obj.AddComponent <RotControl>(); rotControl.SetRotControl(speed, isclockwise, isuseacc); }
internal static void SetRotateTo(GameObject obj, float speedlerp, float targetrot) { if (obj.GetComponent <RotControl>() != null) { Destroy(obj.GetComponent <RotControl>()); } RotControl rotControl = obj.AddComponent <RotControl>(); rotControl.SetRotControl(speedlerp, targetrot); }