Beautify addon

This commit is contained in:
Williams
2026-08-13 16:49:22 +02:00
parent 4c5f11522d
commit d2d75a6656
140 changed files with 9943 additions and 0 deletions
@@ -0,0 +1,77 @@
using UnityEngine;
using UnityEngine.UI;
#if ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem;
#endif
namespace EdgeFusion {
public class CameraOrbit : MonoBehaviour {
[Tooltip("The target object to orbit around")]
public Transform target;
[Tooltip("Rotation speed in degrees per second")]
public float rotationSpeed = 20f;
[Tooltip("Distance from the target")]
public float distance = 5f;
[Tooltip("Height offset from the target")]
public float height = 2f;
[Tooltip("Volume GameObject to toggle with Space key")]
public GameObject volumeObject;
[Tooltip("UI Text label to show current state")] public Text stateLabel;
Vector3 targetPosition;
float currentAngle;
void Start() {
if (target != null) {
targetPosition = target.position;
Vector3 offset = transform.position - targetPosition;
distance = new Vector3(offset.x, 0, offset.z).magnitude;
height = offset.y;
currentAngle = Mathf.Atan2(offset.x, offset.z) * Mathf.Rad2Deg;
}
UpdateStateLabel();
}
void LateUpdate() {
if (target == null) return;
targetPosition = target.position;
currentAngle += rotationSpeed * Time.deltaTime;
float radians = currentAngle * Mathf.Deg2Rad;
float x = Mathf.Sin(radians) * distance;
float z = Mathf.Cos(radians) * distance;
transform.position = targetPosition + new Vector3(x, height, z);
transform.LookAt(targetPosition);
if (volumeObject != null) {
bool toggled = false;
#if ENABLE_INPUT_SYSTEM
if (Keyboard.current != null && Keyboard.current.spaceKey.wasPressedThisFrame) toggled = true;
#endif
#if ENABLE_LEGACY_INPUT_MANAGER
if (!toggled && Input.GetKeyDown(KeyCode.Space)) toggled = true;
#endif
if (toggled) {
volumeObject.SetActive(!volumeObject.activeSelf);
UpdateStateLabel();
}
}
}
void UpdateStateLabel() {
if (stateLabel == null) return;
bool isOn = volumeObject != null && volumeObject.activeSelf;
stateLabel.text = isOn ? "Press Space to Toggle Effect (Currently ON)" : "Press Space to Toggle Effect (Currently OFF)";
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e8a36d16532023e4cbb6c621a2532150
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,44 @@
using UnityEngine;
namespace EdgeFusion {
public class RockBob : MonoBehaviour {
[Tooltip("Movement amplitude in meters")] public float amplitude = 0.2f;
[Tooltip("Oscillation period in seconds")] public float period = 2.5f;
[Tooltip("Ease-in/out factor (0=sinusoidal)")] [Range(0f,1f)] public float smooth = 0.25f;
Vector3 initialPosition;
float angularSpeed;
float phase;
void Awake() {
initialPosition = transform.position;
angularSpeed = period > 0f ? (Mathf.PI * 2f) / period : 0f;
phase = Random.value * Mathf.PI * 2f;
}
void OnEnable() {
angularSpeed = period > 0f ? (Mathf.PI * 2f) / period : 0f;
}
void Update() {
if (angularSpeed <= 0f || amplitude == 0f) return;
phase += angularSpeed * Time.deltaTime;
if (phase > Mathf.PI * 2f) phase -= Mathf.PI * 2f;
float s = Mathf.Sin(phase);
if (smooth > 0f) {
float t = (s + 1f) * 0.5f; // [0..1]
float eased = t * t * (3f - 2f * t);
s = Mathf.LerpUnclamped(-1f, 1f, eased);
}
Vector3 p = initialPosition;
p.y += s * amplitude;
transform.position = p;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5603399823bda1f4a94515b17c4090ea
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: