コード例 #1
0
        private void SaveControllerMap(Player player, ControllerMapSaveData saveData)
        {
            string key = this.GetControllerMapPlayerPrefsKey(player, saveData.controller, saveData.categoryId, saveData.layoutId);

            PlayerPrefs.SetString(key, saveData.map.ToXmlString());
            key = this.GetControllerMapKnownActionIdsPlayerPrefsKey(player, saveData.controller, saveData.categoryId, saveData.layoutId);
            PlayerPrefs.SetString(key, this.GetAllActionIdsString());
        }
コード例 #2
0
        private void SaveControllerMap(Player player, ControllerMapSaveData saveData)
        {
            // Save the Controller Map
            string key = GetControllerMapPlayerPrefsKey(player, saveData.controller, saveData.categoryId, saveData.layoutId);

            PlayerPrefs.SetString(key, saveData.map.ToXmlString()); // save the map to player prefs in XML format

            // Save the Action ids list for this Controller Map used to allow new Actions to be added to the
            // Rewired Input Manager and have the new mappings show up when saved data is loaded
            key = GetControllerMapKnownActionIdsPlayerPrefsKey(player, saveData.controller, saveData.categoryId, saveData.layoutId);
            PlayerPrefs.SetString(key, GetAllActionIdsString());
        }
コード例 #3
0
 private string GetControllerMapPlayerPrefsKey(Player player, ControllerMapSaveData saveData) {
     // Create a player prefs key like a web querystring so we can search for player prefs key when loading maps
     string key = GetBasePlayerPrefsKey(player);
     key += "|dataType=ControllerMap";
     key += "|controllerMapType=" + saveData.mapTypeString;
     key += "|categoryId=" + saveData.map.categoryId + "|" + "layoutId=" + saveData.map.layoutId;
     key += "|hardwareIdentifier=" + saveData.controllerHardwareIdentifier; // the hardware identifier string helps us identify maps for unknown hardware because it doesn't have a Guid
     if(saveData.mapType == typeof(JoystickMap)) { // store special info for joystick maps
         key += "|hardwareGuid=" + ((JoystickMapSaveData)saveData).joystickHardwareTypeGuid.ToString(); // the identifying GUID that determines which known joystick this is
     }
     return key;
 }
コード例 #4
0
ファイル: InputMapping.cs プロジェクト: Bruno13/TheForest
        private string GetControllerMapPlayerPrefsKey(Player player, ControllerMapSaveData saveData)
        {
            string text = this.GetBasePlayerPrefsKey(player);

            text += "&dataType=ControllerMap";
            text  = text + "&controllerMapType=" + saveData.mapTypeString;
            string text2 = text;

            text = string.Concat(new object[]
            {
                text2,
                "&categoryId=",
                saveData.map.categoryId,
                "&layoutId=",
                saveData.map.layoutId
            });
            text = text + "&hardwareIdentifier=" + saveData.controllerHardwareIdentifier;
            if (saveData.mapType == typeof(JoystickMap))
            {
                text = text + "&hardwareGuid=" + ((JoystickMapSaveData)saveData).joystickHardwareTypeGuid.ToString();
            }
            return(text);
        }
コード例 #5
0
 private string GetControllerMapPlayerPrefsKey(Player player, ControllerMapSaveData saveData) {
     // Create a player prefs key like a web querystring so we can search for player prefs key when loading maps
     string key = GetBasePlayerPrefsKey(player);
     key += "|dataType=ControllerMap";
     key += "|controllerMapType=" + saveData.mapTypeString;
     key += "|categoryId=" + saveData.map.categoryId + "|" + "layoutId=" + saveData.map.layoutId;
     key += "|hardwareIdentifier=" + saveData.controllerHardwareIdentifier; // the hardware identifier string helps us identify maps for unknown hardware because it doesn't have a Guid
     if(saveData.mapType == typeof(JoystickMap)) { // store special info for joystick maps
         key += "|hardwareGuid=" + ((JoystickMapSaveData)saveData).joystickHardwareTypeGuid.ToString(); // the identifying GUID that determines which known joystick this is
     }
     return key;
 }
コード例 #6
0
ファイル: InputMapping.cs プロジェクト: GameDiffs/TheForest
 private string GetControllerMapPlayerPrefsKey(Player player, ControllerMapSaveData saveData)
 {
     string text = this.GetBasePlayerPrefsKey(player);
     text += "&dataType=ControllerMap";
     text = text + "&controllerMapType=" + saveData.mapTypeString;
     string text2 = text;
     text = string.Concat(new object[]
     {
         text2,
         "&categoryId=",
         saveData.map.categoryId,
         "&layoutId=",
         saveData.map.layoutId
     });
     text = text + "&hardwareIdentifier=" + saveData.controllerHardwareIdentifier;
     if (saveData.mapType == typeof(JoystickMap))
     {
         text = text + "&hardwareGuid=" + ((JoystickMapSaveData)saveData).joystickHardwareTypeGuid.ToString();
     }
     return text;
 }