示例#1
0
    protected virtual void Awake()
    {
        TrackedObject obj = GetComponent <TrackedObject>();

        if (obj != null)
        {
            controller = obj.source;
        }
        if (controller == ControllerType.None)
        {
            m_Input = ControllerInputManager.GetInput(name);
        }
        else
        {
            m_Input = ControllerInputManager.GetInput(controller);
        }
        //
        if (m_Input != null)
        {
            for (int i = 0, imax = axes.Length; i < imax; ++i)
            {
                axes[i].Awake(m_Input);
            }
            for (int i = 0, imax = buttons.Length; i < imax; ++i)
            {
                buttons[i].Awake(m_Input);
            }
        }
    }
示例#2
0
 internal XDeviceControllerProvider()
 {
     m_ControllerInputs = new ControllerInput[2] {
         ControllerInputManager.GetInput(ControllerType.LeftController),
         ControllerInputManager.GetInput(ControllerType.RightController),
     };
 }
示例#3
0
 protected virtual void Start()
 {
     m_Input = ControllerInputManager.GetInput(ControllerType.Hmd);
 }