internal void OnSelectableObjectEnter(ISelectableObjectSystem selectableObject) { if (!interactableObjects.Contains(selectableObject)) { interactableObjects.Add(selectableObject); } }
public void OnSelectableObjectNoMoreSelected(ISelectableObjectSystem selectableObject) { if (OnSelectableObjectNoMoreSelectedEvent != null) { OnSelectableObjectNoMoreSelectedEvent.Invoke(selectableObject); } }
public void Tick(float d, ISelectableObjectSystem currentSelectedObject, bool hasMultipleAvailableSelectionObjects) { CommandBufer.Clear(); if (currentSelectedObject != null) { SelectableObjectIconAnimation.Tick(d, hasMultipleAvailableSelectionObjects); var averageBoundsLocalSpace = currentSelectedObject.GetAverageModelBoundLocalSpace(); if (!averageBoundsLocalSpace.IsNull()) { if (hasMultipleAvailableSelectionObjects) { SelectionDoticonMaterialProperty.SetTexture("_MainTex", SelectableObjectsConfiguration.SelectionDotSwitchIconTexture); } else { SelectionDoticonMaterialProperty.SetTexture("_MainTex", SelectableObjectsConfiguration.SelectionDotIconTexture); } var targetTransform = currentSelectedObject.GetTransform(); //icon CommandBufer.DrawMesh(SelectableObjectsConfiguration.ForwardPlane, Matrix4x4.TRS(targetTransform.position + Vector3.Project(new Vector3(0, averageBoundsLocalSpace.SideDistances.y * 0.5f, 0), targetTransform.up), Quaternion.LookRotation(Camera.main.transform.position - targetTransform.position) * Quaternion.Euler(0, 0, SelectableObjectIconAnimation.GetRotationAngleDeg()), Vector3.one * SelectableObjectIconAnimation.GetIconScale()), SelectableObjectsConfiguration.SelectionDoticonMaterial, 0, 0, SelectionDoticonMaterialProperty); } } }
internal void RemoveInteractiveObjectFromSelectable(ISelectableObjectSystem selectableObject) { if (CurrentSelectedObject != null && interactableObjects.Contains(CurrentSelectedObject)) { SetCurrentSelectedObject(default(ISelectableObjectSystem)); } interactableObjects.Remove(selectableObject); }
private void SetCurrentSelectedObject(ISelectableObjectSystem SelectableObject) { if (CurrentSelectedObject != null) { if (!CurrentSelectedObject.Equals(SelectableObject)) { SelectableObjectEventsManager.OnSelectableObjectNoMoreSelected(CurrentSelectedObject); if (SelectableObject != null) { SelectableObjectEventsManager.OnSelectableObjectSelected(SelectableObject); } } } else if (CurrentSelectedObject == null) { if (SelectableObject != null) { SelectableObjectEventsManager.OnSelectableObjectSelected(SelectableObject); } } CurrentSelectedObject = SelectableObject; }
private void OnSelectableObjectDeSelected(ISelectableObjectSystem SelectableObject) { this.PlayerActionManager.RemoveActionToAvailable(SelectableObject.AssociatedPlayerAction as RTPPlayerAction); this.PlayerActionWheelManager.PlayerActionWheelRefresh(this.PlayerActionManager.GetCurrentAvailablePlayerActions()); }