From 593656db36885fc9f5b71d51037e127b3a1e91ee Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:46:16 +0000 Subject: [PATCH] BIG HEAD MODE --- QSB/Animation/Player/AnimationSync.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/QSB/Animation/Player/AnimationSync.cs b/QSB/Animation/Player/AnimationSync.cs index 8620c8355..0971f5e65 100644 --- a/QSB/Animation/Player/AnimationSync.cs +++ b/QSB/Animation/Player/AnimationSync.cs @@ -34,7 +34,11 @@ protected void Awake() RequestInitialStatesMessage.SendInitialState += SendInitialState; } - protected void OnDestroy() => RequestInitialStatesMessage.SendInitialState -= SendInitialState; + protected void OnDestroy() + { + RequestInitialStatesMessage.SendInitialState -= SendInitialState; + GlobalMessenger.RemoveListener("EnableBigHeadMode", new Callback(OnEnableBigHeadMode)); + } /// /// This wipes the NetworkAnimator's fields, so it assumes the parameters have changed. @@ -98,6 +102,8 @@ public void InitRemote(Transform body) Delay.RunWhen(() => Player.CameraBody != null, () => body.GetComponent().Init(Player.CameraBody.transform)); + + GlobalMessenger.AddListener("EnableBigHeadMode", new Callback(OnEnableBigHeadMode)); } private void InitAccelerationSync() @@ -107,6 +113,12 @@ private void InitAccelerationSync() Player.JetpackAcceleration.Init(thrusterModel); } + private void OnEnableBigHeadMode() + { + var bone = GetComponent().GetBoneTransform(HumanBodyBones.Head); + bone.localScale = new Vector3(2.5f, 2.5f, 2.5f); + } + public void SetSuitState(bool suitedUp) { if (!Player.IsReady)