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();