Fluid, Slime, SlimeTestSpawner, LightningCompute and MouseRotate still imported Unity.Mathematics and compiled only because Burst and Collections pull the package in. Fluid, Slime and LightningCompute now use CultMath (LightningCompute's snoise included, which CultMath carries as the same Ashima simplex noise); SlimeTestSpawner and MouseRotate imported it without using it, so the usings are gone. LightningCompute converts its float3 offsets with ToUnity() instead of the Unity.Mathematics implicit cast. None of these are Burst-compiled or jobs. Their ComputeBuffer structs are built from UnityEngine Vector2/Vector3 and floats, not math types, so no buffer layout changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
40 lines
951 B
C#
40 lines
951 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
|
|
public class MouseRotate : MonoBehaviour
|
|
{
|
|
public float Speed;
|
|
public ClickRaycaster Click;
|
|
|
|
private bool _rotating = false;
|
|
private Vector3 _euler;
|
|
|
|
void Start()
|
|
{
|
|
Click.OnClickMiss += data =>
|
|
{
|
|
_rotating = true;
|
|
//Debug.Log("Started Rotating");
|
|
};
|
|
_euler = transform.localEulerAngles;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (_rotating && !Mouse.current.leftButton.isPressed)
|
|
{
|
|
_rotating = false;
|
|
//Debug.Log("Stopped Rotating");
|
|
}
|
|
if (_rotating)
|
|
{
|
|
var mouse = Mouse.current.delta.ReadValue();
|
|
_euler.x -= mouse.y*Speed;
|
|
_euler.y += mouse.x*Speed;
|
|
transform.rotation = Quaternion.Euler(_euler);
|
|
}
|
|
}
|
|
}
|