mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
CameraFacingBillboard: move to proper namespace
This commit is contained in:
parent
4f4f630dd2
commit
a0d1ab5e22
@ -1,30 +1,33 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class CameraFacingBillboard : MonoBehaviour
|
||||
namespace QSB.ConversationSync
|
||||
{
|
||||
private OWCamera _activeCam;
|
||||
|
||||
private void Awake()
|
||||
=> GlobalMessenger<OWCamera>.AddListener("SwitchActiveCamera", OnSwitchActiveCamera);
|
||||
|
||||
private void Start()
|
||||
public class CameraFacingBillboard : MonoBehaviour
|
||||
{
|
||||
_activeCam = Locator.GetActiveCamera();
|
||||
UpdateRotation();
|
||||
private OWCamera _activeCam;
|
||||
|
||||
private void Awake()
|
||||
=> GlobalMessenger<OWCamera>.AddListener("SwitchActiveCamera", OnSwitchActiveCamera);
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_activeCam = Locator.GetActiveCamera();
|
||||
UpdateRotation();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
=> GlobalMessenger<OWCamera>.RemoveListener("SwitchActiveCamera", OnSwitchActiveCamera);
|
||||
|
||||
private void OnSwitchActiveCamera(OWCamera activeCamera)
|
||||
{
|
||||
_activeCam = activeCamera;
|
||||
UpdateRotation();
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
=> UpdateRotation();
|
||||
|
||||
private void UpdateRotation()
|
||||
=> transform.LookAt(transform.position + (_activeCam.transform.rotation * Vector3.forward), _activeCam.transform.rotation * Vector3.up);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
=> GlobalMessenger<OWCamera>.RemoveListener("SwitchActiveCamera", OnSwitchActiveCamera);
|
||||
|
||||
private void OnSwitchActiveCamera(OWCamera activeCamera)
|
||||
{
|
||||
_activeCam = activeCamera;
|
||||
UpdateRotation();
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
=> UpdateRotation();
|
||||
|
||||
private void UpdateRotation()
|
||||
=> transform.LookAt(transform.position + (_activeCam.transform.rotation * Vector3.forward), _activeCam.transform.rotation * Vector3.up);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user