File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System . Numerics ;
2+ using HarmonyLib ;
3+
4+ namespace SmolMod . Patches ;
5+
6+ [ HarmonyPatch ( typeof ( CosmeticsLayer ) , nameof ( CosmeticsLayer . SetScale ) ) ]
7+ public static class CosmeticsLayerPatch
8+ {
9+ public static void Prefix ( ref Vector3 playerScale , ref Vector3 cosmeticsScale )
10+ {
11+ playerScale /= SmolModPlugin . ScaleMod ;
12+ cosmeticsScale /= SmolModPlugin . ScaleMod ;
13+ }
14+ }
Original file line number Diff line number Diff line change 11using HarmonyLib ;
2- using UnityEngine ;
32
43namespace SmolMod . Patches ;
54
65[ HarmonyPatch ( typeof ( PlayerControl ) , nameof ( PlayerControl . Start ) ) ]
76public static class PlayerControlPatch
87{
98 // adapted from https://github.com/Among-Us-Modding/Laboratory/blob/main/Laboratory/Player/SizeModifier.cs
10- private static readonly Vector3 DefaultSize = new ( 0.7f , 0.7f , 1f ) ;
11-
129 public static void Postfix ( PlayerControl __instance )
1310 {
1411 __instance . UpdateSize ( ) ;
1512 }
1613
1714 public static void UpdateSize ( this PlayerControl player )
1815 {
19- var size = DefaultSize / SmolModPlugin . ScaleMod ;
20-
21- player . Collider . Cast < CircleCollider2D > ( ) . radius = 0.2233912f / ( size . x / DefaultSize . x ) ;
22- player . transform . localScale = size ;
16+ player . cosmetics . SetScale ( player . MyPhysics . Animations . DefaultPlayerScale , player . defaultCosmeticsScale ) ;
2317 }
2418}
You can’t perform that action at this time.
0 commit comments