mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-11 00:52:19 +00:00
5dce7a8a03
* Added probe + probe launcher, with general event/transformsync/player refactors and improvements
42 lines
1002 B
C#
42 lines
1002 B
C#
using QSB.Tools;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.TransformSync
|
|
{
|
|
public class PlayerCameraSync : TransformSync
|
|
{
|
|
public static PlayerCameraSync LocalInstance { get; private set; }
|
|
|
|
public override void OnStartLocalPlayer()
|
|
{
|
|
LocalInstance = this;
|
|
}
|
|
|
|
protected override uint PlayerId => netId.Value - 2;
|
|
|
|
protected override Transform InitLocalTransform()
|
|
{
|
|
var body = Locator.GetPlayerCamera().gameObject.transform;
|
|
|
|
PlayerToolsManager.Init(body);
|
|
|
|
Player.Camera = body.gameObject;
|
|
|
|
return body;
|
|
}
|
|
|
|
protected override Transform InitRemoteTransform()
|
|
{
|
|
var body = new GameObject("PlayerCamera");
|
|
|
|
PlayerToolsManager.Init(body.transform);
|
|
|
|
Player.Camera = body;
|
|
|
|
return body.transform;
|
|
}
|
|
|
|
protected override bool IsReady => Locator.GetPlayerTransform() != null && Player != null;
|
|
}
|
|
}
|