Example #1
0
 /// <summary>
 ///
 /// </summary>
 public void InitInput(XHawkInputManager manager, int index, string fmt)
 {
     m_Manager = manager;
     m_Index   = index;
     //
     m_Controller = XHawkInputManager.GetController((XCobraHands)m_Index);
     if (m_Controller == null)
     {
         return;
     }
     //
     InitInput(manager, fmt);
 }
        /// <summary>
        ///  Initialize the X-Hawk and allocate the X-Cobra Controllers.
        /// </summary>
        protected virtual void Awake()
        {
            //
            int ret = LibXHawkAPI.Init();

            m_JoyInfos = new LibXHawkAPI.joyinfo[2];
            for (int i = 0; i < MAX_CONTROLLERS; ++i)
            {
                m_JoyInfos[i].Init();
                m_Controllers[i] = new XCobraController();
                m_Controllers[i].Awake(this);
                m_Controllers[i].HandBind = (XCobraHands)i;              // Modify the hand type.
            }
            //
            if (ret != 0)
            {
                enabled = false;
                return;
            }
        }