Skip to content

Commit

Permalink
BIG HEAD MODE
Browse files Browse the repository at this point in the history
  • Loading branch information
misternebula committed Nov 16, 2023
1 parent 7ece9e9 commit 593656d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion QSB/Animation/Player/AnimationSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/// <summary>
/// This wipes the NetworkAnimator's fields, so it assumes the parameters have changed.
Expand Down Expand Up @@ -98,6 +102,8 @@ public void InitRemote(Transform body)

Delay.RunWhen(() => Player.CameraBody != null,
() => body.GetComponent<PlayerHeadRotationSync>().Init(Player.CameraBody.transform));

GlobalMessenger.AddListener("EnableBigHeadMode", new Callback(OnEnableBigHeadMode));
}

private void InitAccelerationSync()
Expand All @@ -107,6 +113,12 @@ private void InitAccelerationSync()
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)
Expand Down

0 comments on commit 593656d

Please sign in to comment.