예제 #1
0
 internal void OnSelectableObjectEnter(ISelectableObjectSystem selectableObject)
 {
     if (!interactableObjects.Contains(selectableObject))
     {
         interactableObjects.Add(selectableObject);
     }
 }
예제 #2
0
 public void OnSelectableObjectNoMoreSelected(ISelectableObjectSystem selectableObject)
 {
     if (OnSelectableObjectNoMoreSelectedEvent != null)
     {
         OnSelectableObjectNoMoreSelectedEvent.Invoke(selectableObject);
     }
 }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
        internal void RemoveInteractiveObjectFromSelectable(ISelectableObjectSystem selectableObject)
        {
            if (CurrentSelectedObject != null && interactableObjects.Contains(CurrentSelectedObject))
            {
                SetCurrentSelectedObject(default(ISelectableObjectSystem));
            }

            interactableObjects.Remove(selectableObject);
        }
예제 #5
0
        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;
        }
예제 #6
0
 private void OnSelectableObjectDeSelected(ISelectableObjectSystem SelectableObject)
 {
     this.PlayerActionManager.RemoveActionToAvailable(SelectableObject.AssociatedPlayerAction as RTPPlayerAction);
     this.PlayerActionWheelManager.PlayerActionWheelRefresh(this.PlayerActionManager.GetCurrentAvailablePlayerActions());
 }