Beispiel #1
0
 private void Start()
 {
     InputMappingIcons.TextIconBacking = this._textIconBacking;
     InputMappingIcons.TexturesByName  = this._textures.ToDictionary((Texture2D t) => t.name);
     InputMappingIcons.Version         = 1;
     InputMappingIcons.RefreshMappings();
 }
Beispiel #2
0
 private void Update()
 {
     OVRInput.Update();
     if (InputMappingIcons.LastController != null)
     {
         Player.ControllerHelper controllers = ReInput.players.GetPlayer(0).controllers;
         if (InputMappingIcons._trackedInputs == null)
         {
             InputMappingIcons._trackedInputs = new Dictionary <string, List <string> >();
         }
         foreach (ControllerMap controllerMap in controllers.maps.GetAllMaps())
         {
             Controller controller = controllers.GetController(controllerMap.controllerType, controllerMap.controllerId);
             string     name       = controller.name;
             if (!InputMappingIcons._trackedInputs.ContainsKey(name))
             {
                 InputMappingIcons._trackedInputs.Add(name, new List <string>());
             }
             List <string> list = InputMappingIcons._trackedInputs[name];
             foreach (ActionElementMap actionElementMap in controllerMap.AllMaps)
             {
                 if (!list.Contains(actionElementMap.elementIdentifierName))
                 {
                     list.Add(actionElementMap.elementIdentifierName);
                 }
             }
         }
     }
     if (TheForest.Utils.Input.IsGamePad)
     {
         Controller lastActiveController = TheForest.Utils.Input.player.controllers.GetLastActiveController();
         if (lastActiveController != InputMappingIcons.LastController && lastActiveController != null)
         {
             if (InputMappingIcons.LastController != null)
             {
                 Debug.Log("===> Changing gamepad icons: currentController=" + lastActiveController.name + ", LastController=" + InputMappingIcons.LastController.name);
             }
             else
             {
                 Debug.Log("===> Init gamepad icons: currentController=" + lastActiveController.name);
             }
             InputMappingIcons.LastController = lastActiveController;
             InputMappingIcons.RefreshMappings();
             InputMappingIcons.Version++;
         }
     }
     if (this._usingGamePadVersion != TheForest.Utils.Input.IsGamePad)
     {
         this._usingGamePadVersion = TheForest.Utils.Input.IsGamePad;
         InputMappingIcons.Version++;
         if (TheForest.Utils.Input.IsGamePad)
         {
             Debug.Log("===> Switching from KM to gamepad     Version=" + InputMappingIcons.Version);
         }
         else
         {
             Debug.Log("===> Switching from gamepad to KM     Version = " + InputMappingIcons.Version);
         }
     }
 }
Beispiel #3
0
 private void Update()
 {
     if (TheForest.Utils.Input.IsGamePad)
     {
         Controller lastActiveController = TheForest.Utils.Input.player.controllers.GetLastActiveController();
         if (lastActiveController != InputMappingIcons.LastController)
         {
             InputMappingIcons.LastController = lastActiveController;
             InputMappingIcons.RefreshMappings();
             InputMappingIcons.Version++;
         }
     }
     if (this._usingGamePadVersion != TheForest.Utils.Input.IsGamePad)
     {
         this._usingGamePadVersion = TheForest.Utils.Input.IsGamePad;
         InputMappingIcons.Version++;
     }
 }
Beispiel #4
0
 private void Update()
 {
     if (TheForest.Utils.Input.IsGamePad)
     {
         Controller lastActiveController = TheForest.Utils.Input.player.controllers.GetLastActiveController();
         if (lastActiveController != InputMappingIcons.LastController)
         {
             if (InputMappingIcons.LastController != null)
             {
                 Debug.Log(string.Concat(new object[]
                 {
                     "===> Changing gamepad icons: currentController=",
                     lastActiveController.name,
                     ", LastController=",
                     InputMappingIcons.LastController
                 }));
             }
             else
             {
                 Debug.Log("===> Init gamepad icons: currentController=" + lastActiveController.name);
             }
             InputMappingIcons.LastController = lastActiveController;
             InputMappingIcons.RefreshMappings();
             InputMappingIcons.Version++;
         }
     }
     if (this._usingGamePadVersion != TheForest.Utils.Input.IsGamePad)
     {
         this._usingGamePadVersion = TheForest.Utils.Input.IsGamePad;
         InputMappingIcons.Version++;
         if (TheForest.Utils.Input.IsGamePad)
         {
             Debug.Log("===> Switching from KM to gamepad     Version=" + InputMappingIcons.Version);
         }
         else
         {
             Debug.Log("===> Switching from gamepad to KM     Version = " + InputMappingIcons.Version);
         }
     }
 }
Beispiel #5
0
 private void Start()
 {
     InputMappingIcons.RefreshMappings();
 }