public void Dispose() { InteractiveObjectCursorScreenIntersectionManager.Get().UnRegisterOnCursorOverObjectEvent(this.OnCursorOverObject); InteractiveObjectCursorScreenIntersectionManager.Get().UnRegisterOnCursorNoMoreOverObjectEvent(this.OnCursorNoMoreOverObject); foreach (var selectableTargettedInteractiveObject in AllSelectableTargettedInteractiveObject) { selectableTargettedInteractiveObject.UnRegisterInteractiveObjectDestroyedEventListener(this.OnCurrentlyTargettedInteractiveObjectDestroyed); } }
public FiringLockSelectionSystem(Action <CoreInteractiveObject> OnNewInteractiveObjectTargettedCallback) { this.GameInputManager = GameInputManager.Get(); this.AllSelectableTargettedInteractiveObject = new List <CoreInteractiveObject>(); this.OnNewInteractiveObjectTargettedCallback = OnNewInteractiveObjectTargettedCallback; this.CurrentlyTargettedInteractiveObject = default; this.CurrentlyTargettedInteractiveObject = new ObjectVariable <CoreInteractiveObject>( OnObjectValueChanged: this.OnCurrentlytargettedObjectChanged ); this.InitializeEvents(); /// Initialization foreach (var cursorIntersectedInteractiveObject in InteractiveObjectCursorScreenIntersectionManager.Get().IntersectingInteractiveObjects) { this.OnCursorOverObject(cursorIntersectedInteractiveObject); } }
private void InitializeEvents() { InteractiveObjectCursorScreenIntersectionManager.Get().RegisterOnCursorOverObjectEvent(this.OnCursorOverObject); InteractiveObjectCursorScreenIntersectionManager.Get().RegisterOnCursorNoMoreOverObjectEvent(this.OnCursorNoMoreOverObject); }