From e7d660514b6266cf5fb6e544caa939956956e36e Mon Sep 17 00:00:00 2001 From: flibber-hk <76987839+flibber-hk@users.noreply.github.com> Date: Fri, 24 Dec 2021 23:42:45 +0000 Subject: [PATCH] Use less derived Collider2D where possible (#35) This has no change in isolation - for a BoxCollider2D x.bounds.size and x.size return the same Vector2. --- HKMP/Game/Client/PlayerManager.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/HKMP/Game/Client/PlayerManager.cs b/HKMP/Game/Client/PlayerManager.cs index 35179e11..b99d1819 100644 --- a/HKMP/Game/Client/PlayerManager.cs +++ b/HKMP/Game/Client/PlayerManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Hkmp.Fsm; using Hkmp.Game.Client.Skin; @@ -201,12 +201,13 @@ byte skinId // Obtain colliders from both objects var collider = playerObject.GetComponent(); - var localCollider = localPlayerObject.GetComponent(); + // We're not using the fact that the knight has a BoxCollider as opposed to any other collider + var localCollider = localPlayerObject.GetComponent(); // Copy collider offset and size collider.isTrigger = true; collider.offset = localCollider.offset; - collider.size = localCollider.size; + collider.size = localCollider.bounds.size; collider.enabled = true; // Copy collider bounds