Immerseum SDK: VR Simulator (version: RC-1.0.0)
       [view as Desktop | Tablet | Mobile]
setControllerPrefab(Int32,GameObject) Method
Example 
Integer which indicates the controller. Accepts either 0 (left-hand) or 1 (right-hand).
(Optional) The prefab to apply to the indicated controller. If null, clears the indicated controller prefab reference.
Assigns a supplied prefab as the prefab to use when simulating an indicated position-tracked controller.
Syntax
public static void setControllerPrefab( 
   int controller,
   GameObject prefab
)

Parameters

controller
Integer which indicates the controller. Accepts either 0 (left-hand) or 1 (right-hand).
prefab
(Optional) The prefab to apply to the indicated controller. If null, clears the indicated controller prefab reference.
Exceptions
ExceptionDescription
IndexOutOfRangeExceptionThrown when an unrecognized value is passed for controller.
Example
Instantiates a prefab and assigns it to the simulated right-hand controller.Clears the simulated right-hand controller's prefab.
GameObject prefabObject = (GameObject)Instantiate(Resources.load("prefabName"));
 
setControllerPrefab(1, prefabObject);
setControllerPrefab(1, null);
See Also

Reference

HMDSimulator Class
HMDSimulator Members
Overload List

 

 


Copyright (c) 2016-2017 Immerseum Inc. All rights reserved.

Send Feedback