コード例 #1
0
 public void OnInputClicked(InputEventData eventData)
 {
     if (IsEnabled)
     {
         ButtonPressed.RaiseEvent();
     }
 }
コード例 #2
0
 public void OnInputClicked(InputEventData eventData)
 {
     if (isLocalPlayer)
     {
         CmdFire();
     }
 }
コード例 #3
0
        public void OnInputClicked(InputEventData eventData)
        {
            // If we have a text to speech manager on the target object, say something.
            // This voice will appear to emanate from the object.
            if (TextToSpeech != null)
            {
                // Get the name
                var voiceName = Enum.GetName(typeof(TextToSpeechVoice), TextToSpeech.Voice);

                // Create message
                var msg = string.Format("This is the {0} voice. It should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.", voiceName);

                // Speak message
                TextToSpeech.SpeakText(msg);
            }
        }
コード例 #4
0
        public void OnInputClicked(InputEventData eventData)
        {
            // On each tap gesture, toggle whether the user is in placing mode.
            placing = !placing;

            // If the user is in placing mode, display the spatial mapping mesh.
            if (placing)
            {
                spatialMappingManager.DrawVisualMeshes = true;

                Debug.Log(gameObject.name + " : Removing existing world anchor if any.");

                anchorManager.RemoveAnchor(gameObject);
            }
            // If the user is not in placing mode, hide the spatial mapping mesh.
            else
            {
                spatialMappingManager.DrawVisualMeshes = false;
                // Add world anchor when object placement is done.
                anchorManager.AttachAnchor(gameObject, SavedAnchorFriendlyName);
            }
        }
コード例 #5
0
 public void OnInputClicked(InputEventData eventData)
 {
     PlaneTargetGroupPicker.Instance.PickNewTarget();
 }
コード例 #6
0
        public void OnInputDown(InputEventData eventData)
        {
            if (isDragging)
            {
                // We're already handling drag input, so we can't start a new drag operation.
                return;
            }

            if (!eventData.InputSource.SupportsInputInfo(eventData.SourceId, SupportedInputInfo.Position))
            {
                // The input source must provide positional data for this script to be usable
                return;
            }

            currentInputSource = eventData.InputSource;
            currentInputSourceId = eventData.SourceId;
            StartDragging();
        }
コード例 #7
0
 public void OnInputUp(InputEventData eventData)
 {
     if (currentInputSource != null &&
         eventData.SourceId == currentInputSourceId)
     {
         StopDragging();
     }
 }
コード例 #8
0
 /// <summary>
 /// Function for consuming the OnInputUp events
 /// </summary>
 /// <param name="eventData"></param>
 public virtual void OnInputUp(InputEventData eventData)
 {
     IsInputSourceDown = false;
 }
コード例 #9
0
 /// <summary>
 /// Function for receiving OnInputDown events from InputManager
 /// </summary>
 /// <param name="eventData"></param>
 public virtual void OnInputDown(InputEventData eventData)
 {
     IsInputSourceDown = true;
 }
コード例 #10
0
 /// <summary>
 /// Function for receiving OnInputClicked events from InputManager
 /// </summary>
 /// <param name="eventData"></param>
 public virtual void OnInputClicked(InputEventData eventData)
 {
     // Open input socket for other cool stuff...
 }
コード例 #11
0
 public void OnInputUp(InputEventData eventData)
 {
     throw new NotImplementedException();
 }
コード例 #12
0
 void IInputHandler.OnInputDown(InputEventData eventData)
 {
     HandleInputAction(eventData);
 }
コード例 #13
0
 void IInputHandler.OnInputUp(InputEventData eventData)
 {
     // Let the input fall to the next interactable object.
 }