/// <summary> /// Removes a target from the list. This will typically be called an enemy is out of reach but should also be called when an enemy /// dies so that the camera does not follow it after the fact /// </summary> /// <param name="cameraFocusable"></param> public void RemoveSecondaryTargetToFollow(ICameraFocusable cameraFocusable) { if (secondaryTargetList.Contains(cameraFocusable)) { secondaryTargetList.Remove(cameraFocusable); } }
/// <summary> /// Adds a secondary target to the list. Because it is added to the list, does not necessarily automatically /// make the camera follow it. The object must also be engaged with the player or in an active state /// </summary> /// <param name="cameraFocusable"></param> public void AddSecondaryTargetToFollow(ICameraFocusable cameraFocusable) { if (!secondaryTargetList.Contains(cameraFocusable)) { secondaryTargetList.Add(cameraFocusable); } }
private void CheckRetainedFocusDestroyed(ICameraFocusable focusable) { if (focusable != null && focusable.IsRetainedFocusEligible) { if (focusable == _retainedFocus) { RefreshReadout(string.Empty); _retainedFocus = null; } } }
private void OnTriggerExit2D(Collider2D collision) { ICameraFocusable cameraFocusable = collision.GetComponent <ICameraFocusable>(); if (cameraFocusable != null) { RemoveSecondaryTargetToFollow(cameraFocusable); } }
private void TryRetainingFocus(ICameraFocusable focus) { if (focus != null && focus.IsRetainedFocusEligible) { _retainedFocus = focus; AItem itemWithData = (focus as Component).gameObject.GetSafeMonoBehaviourComponent<AItem>(); string focusName = "No Data"; if (itemWithData != null) { focusName = itemWithData.Data.Name; } RefreshReadout(focusName); } }
private void CloseScreenAndFocusOnItem(ICameraFocusable item) { GameObject doneButtonGo = gameObject.GetSingleComponentInChildren<InputModeControlButton>().gameObject; GameInputHelper.Instance.Notify(doneButtonGo, "OnClick"); item.IsFocus = true; }
private void TryRetainingFocus(ICameraFocusable focus) { if (focus != null && focus.IsRetainedFocusEligible) { _retainedFocus = focus; RefreshReadout(focus.DebugName); } }
public TableRowFocusUserActionEventArgs(ICameraFocusable itemToFocusOn) { ItemToFocusOn = itemToFocusOn; }