BIG HEAD MODE

This commit is contained in:
_nebula 2023-11-16 11:46:16 +00:00
parent 7ece9e92e5
commit 593656db36

View File

@ -34,7 +34,11 @@ public class AnimationSync : PlayerSyncObject
RequestInitialStatesMessage.SendInitialState += SendInitialState;
}
protected void OnDestroy() => RequestInitialStatesMessage.SendInitialState -= SendInitialState;
protected void OnDestroy()
{
RequestInitialStatesMessage.SendInitialState -= SendInitialState;
GlobalMessenger.RemoveListener("EnableBigHeadMode", new Callback(OnEnableBigHeadMode));
}
/// <summary>
/// This wipes the NetworkAnimator's fields, so it assumes the parameters have changed.
@ -98,6 +102,8 @@ public class AnimationSync : PlayerSyncObject
Delay.RunWhen(() => Player.CameraBody != null,
() => body.GetComponent<PlayerHeadRotationSync>().Init(Player.CameraBody.transform));
GlobalMessenger.AddListener("EnableBigHeadMode", new Callback(OnEnableBigHeadMode));
}
private void InitAccelerationSync()
@ -107,6 +113,12 @@ public class AnimationSync : PlayerSyncObject
Player.JetpackAcceleration.Init(thrusterModel);
}
private void OnEnableBigHeadMode()
{
var bone = GetComponent<Animator>().GetBoneTransform(HumanBodyBones.Head);
bone.localScale = new Vector3(2.5f, 2.5f, 2.5f);
}
public void SetSuitState(bool suitedUp)
{
if (!Player.IsReady)