JMRSDK Development
v4.57
v4.57
  • Jio Mixed Reality SDK Documentation
    • Changelog
      • Upgrade Guide
    • Application Requirements
  • Device Information
    • JioGlass
    • JioDive
  • Supported Smartphones
  • Controller Specifications
    • Physical Controllers
    • External Gamepad
    • Virtual Controller
  • Getting Started
    • Development Platform
    • Setting Up Jio Mixed Reality Project in Unity
    • Video Tutorials
    • URP Support
      • Setting Up Your Project With URP
  • JMRSDK
    • JMRSDK Content
    • JMRMixedReality Prefab
    • System Dock
    • JMRRig
      • Local Rig
      • Setting Homepage (Quit functionality)
    • Webcast
  • Develop
    • Editor Emulator
    • JioGlass Controller Interactions
    • Cameras
    • Tesseract Mixed Reality UI Toolkits
    • In-app purchase
    • Examples
  • Interaction
    • Gaze Interaction
      • Gaze and Click
      • Gaze and Dwell
    • Interaction
      • Pointer Manager
        • Examples
      • Active Input Source
    • Interfaces
      • IFocusable
      • ISelectHandler
      • ISelectClickHandler
      • IBackHandler
      • IHomeHandler
      • IMenuHandler
      • IFn1Handler
      • IFn2Handler
      • ITouchHandler
      • ISwipeHandler
      • IManipulationHandler
    • Controller Input Actions
      • Touchpad - Touch
      • Touchpad - Swipe
      • Source Buttons
      • Manipulation
    • Actions
    • Device State
      • JioDive Device State
      • JioGlass Device State
      • Controller Device State
  • Tracking
    • Tracking
      • Coordinate System
    • Tracking Framework
      • TrackerManager Actions
        • Get Head Position
        • Get Head Rotation
        • Get Head Transform
      • TrackerManager Methods
        • Get Head Position
        • Get Head Rotation
        • Get Head Transform
    • Recenter
  • Building and Testing
    • Building to Target Device
      • Merging AndroidManifest
      • Performance Optimization
      • App optimization
    • Running your application
      • JioImmerse App For Jio Mixed Reality (JMR) Devices
      • Running the application
      • IPD Calibration
    • Licensing Journey In Android JioImmerse
    • Licensing Journey in iOS JioImmerse
  • Publish
    • Branding Guidelines
    • Signing your App
    • Publishing to Google Play Store
      • Play Store Upload Journey
    • Publishing to JioImmerse Developer Console
    • Publishing to Apple Store
    • iOS Deep linking
  • Capturing and Recording
    • Capture Videos and Screenshots
      • Capturing Screenshot/Videos using scrcpy
      • Capturing Screenshot/Videos using Vysor
  • Troubleshooting
    • FAQs - Develop
    • FAQs - Building to device
      • Gradle
      • FAQs - iOS
    • FAQs - Running and Publishing
    • Laser Point Not Visible
Powered by GitBook
On this page
  • Global Listener Usage
  • Pointer Interaction Requirement
  • Example
  1. Interaction
  2. Interfaces

IFocusable

The IFocusable interface handles pointer focus events on a GameObject, such as when the pointer targets the object (OnFocusEnter) or leaves the object (OnFocusExit).

Method
Description

OnFocusEnter

Called when hovering the pointer on gameobject

OnFocusExit

Called when removing the pointer from gameobject

Global Listener Usage

Utilize Global Listener with IFocusable to know if the pointer focus enters/exits on something.

When both the IFocusable interface and Global Listener are used on the same GameObject, the event-handling methods may be triggered twice:

  1. Once by the pointer event.

  2. Once by the Global Listener capturing the same event globally.

This behavior can lead to duplicate responses if not managed properly.

Pointer Interaction Requirement

For the pointer to interact with a GameObject and trigger the IFocusable events:

  • 3D Objects: The GameObject must have a collider component.

  • UI Elements: The UI element must have the Raycast Target property enabled.

Without these, the pointer will not detect the GameObject, and IFocusable events will not be triggered.

Example

using JMRSDK.InputModule;
using UnityEngine;
public class InterfaceExample: MonoBehaviour, IFocusable
{
    public void OnFocusEnter() {
        Debug.Log("OnFocusEnter");
    }
    public void OnFocusExit() {
        Debug.Log("OnFocusExit");
    }   
}
PreviousInterfacesNextISelectHandler

Last updated 5 months ago