From 0cb88b8fc64cceb8866734bd88f093a30e484097 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 23 Oct 2025 21:33:28 -0400 Subject: [PATCH] fix: singleton operation for LockOnManager --- Assets/Scripts/Core/LockOnManager.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/Core/LockOnManager.cs b/Assets/Scripts/Core/LockOnManager.cs index 8ac5582..3de8a43 100644 --- a/Assets/Scripts/Core/LockOnManager.cs +++ b/Assets/Scripts/Core/LockOnManager.cs @@ -15,7 +15,7 @@ using Vector2 = UnityEngine.Vector2; using Vector3 = UnityEngine.Vector3; namespace Reset.Units{ - public class LockOnManager : MonoBehaviour{ + public class LockOnManager : UnitComponent, IUnitTargetProvider { public class ActiveLockOnTarget{ public GameObject gameObject; public float targetWeight; @@ -47,13 +47,13 @@ namespace Reset.Units{ private VisualElement elementRoot; private void Awake(){ - // // Register as singleton - // if (Instance == null) { - // Instance = this; - // } else { - // this.enabled = false; - // return; - // } + // Register as singleton + if (Instance == null && Unit.UnitIsLocal()) { + Instance = this; + } else { + enabled = false; + return; + } // References from camera targetGroup = PlayerManager.Camera.transform.Find("Target Group").GetComponent();