initial upload

This commit is contained in:
niko
2026-05-24 12:14:04 +02:00
parent 213ed4c965
commit 2526aab9c7
961 changed files with 457060 additions and 10 deletions
@@ -0,0 +1,50 @@
using System;
using UnityEngine;
[Serializable]
[AddComponentMenu("Camera-Control/Smooth Look At")]
public class SmoothLookAt : MonoBehaviour
{
public Transform target;
public float damping;
public bool smooth;
public SmoothLookAt()
{
damping = 6f;
smooth = true;
}
public virtual void LateUpdate()
{
if (GetComponent<NetworkView>().isMine)
{
}
if ((bool)target)
{
if (smooth)
{
Quaternion to = Quaternion.LookRotation(target.position - transform.position);
transform.rotation = Quaternion.Slerp(transform.rotation, to, Time.deltaTime * damping);
}
else
{
transform.LookAt(target);
}
}
}
public virtual void Start()
{
if (GetComponent<NetworkView>().isMine && (bool)GetComponent<Rigidbody>())
{
GetComponent<Rigidbody>().freezeRotation = true;
}
}
public virtual void Main()
{
}
}