mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-10 06:51:36 +00:00
797f4de50d
* syncing animation triggers * suit sync
42 lines
976 B
C#
42 lines
976 B
C#
using QSB.Animation;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.TransformSync
|
|
{
|
|
public class PlayerTransformSync : TransformSync
|
|
{
|
|
public static PlayerTransformSync LocalInstance { get; private set; }
|
|
|
|
private Transform _playerModel;
|
|
|
|
private Transform GetPlayerModel()
|
|
{
|
|
if (!_playerModel)
|
|
{
|
|
_playerModel = Locator.GetPlayerBody().transform.Find("Traveller_HEA_Player_v2");
|
|
}
|
|
return _playerModel;
|
|
}
|
|
|
|
protected override Transform InitLocalTransform()
|
|
{
|
|
LocalInstance = this;
|
|
var body = GetPlayerModel();
|
|
|
|
GetComponent<AnimationSync>().InitLocal(body);
|
|
|
|
return body;
|
|
}
|
|
|
|
protected override Transform InitRemoteTransform()
|
|
{
|
|
var body = Instantiate(GetPlayerModel());
|
|
|
|
GetComponent<AnimationSync>().InitRemote(body);
|
|
|
|
return body;
|
|
}
|
|
|
|
}
|
|
}
|