Class GroupingInputManager
This class handles grouping input actions on the controller
Namespace: XRC.Students.SU2023.IN03.Chen
Assembly: cs.temp.dll.dll
Syntax
public class GroupingInputManager : MonoBehaviour, ICreateCube, ICubeVisualFeedback
Fields
Grabbale
The cube - the simplest unit of grouping interactions. Since the outer layer of the cube is a grab interactable, it's called Grabbable in Prefabs.
Declaration
public GameObject Grabbale
Field Value
Type | Description |
---|---|
GameObject | The Grabbale prefab |
Methods
EnableInputAction()
Enable all grouping input actions in the asset
Declaration
public void EnableInputAction()
NewChild(InputAction.CallbackContext)
Create a child of the selected cube
Declaration
public void NewChild(InputAction.CallbackContext input)
Parameters
Type | Name | Description |
---|---|---|
InputAction.CallbackContext | input | Create a child cube of the cube currently being selected input action callback |
NewParallel(InputAction.CallbackContext)
Create a cube on the same layer as the selected cube
Declaration
public void NewParallel(InputAction.CallbackContext input)
Parameters
Type | Name | Description |
---|---|---|
InputAction.CallbackContext | input | Create a parallel cube on the same layer as the cube being selected input action callback |
OnDestroy()
Disable all grouping input actions in the asset onDestroy
Declaration
public void OnDestroy()
SetAsChild(InputAction.CallbackContext)
Set the selected cube as child
Declaration
public void SetAsChild(InputAction.CallbackContext input)
Parameters
Type | Name | Description |
---|---|---|
InputAction.CallbackContext | input | Set child input action callback |
SetAsParent(InputAction.CallbackContext)
Set the selected cube as parent
Declaration
public void SetAsParent(InputAction.CallbackContext input)
Parameters
Type | Name | Description |
---|---|---|
InputAction.CallbackContext | input | Set parent input action callback |
SetColor(GameObject, GameObject)
Declaration
public void SetColor(GameObject sourceCube, GameObject newCube)
Parameters
Type | Name | Description |
---|---|---|
GameObject | sourceCube | |
GameObject | newCube |
SetDetach(InputAction.CallbackContext)
The action to detach the selected cube from its parent If the selected cube is a parent, detach all its children cubes
Declaration
public void SetDetach(InputAction.CallbackContext input)
Parameters
Type | Name | Description |
---|---|---|
InputAction.CallbackContext | input | Set detach input action callback |
SetScale(Transform, Vector3)
Set the renderer of the cube to the scale
Declaration
public static void SetScale(Transform outerCube, Vector3 scale)
Parameters
Type | Name | Description |
---|---|---|
Transform | outerCube | The outer cube containing the renderer |
Vector3 | scale | The desired scale |
SetupCallbacks()
Add the input actions when performed Remove the input actions when canceled
Declaration
public void SetupCallbacks()
Start()
Get the ray interactor attached to Enable grouping input actions and set up callbacks
Declaration
public void Start()