Files
Fishing2/Assets/ThirdParty/Rewired/Documentation/Html/SaveDataStore.html
2025-05-10 12:49:47 +08:00

136 lines
8.3 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/BasicTemplate.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Rewired Documentation | Save Data Store</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<!-- InstanceParam name="isRoot" type="boolean" value="false" -->
<link href="files/css/styles.css" rel="stylesheet" type="text/css" />
<!-- Favicons -->
<link rel="icon" type="image/x-icon" href="/projects/rewired/files/images/favicon.ico?v=1" />
<!-- Apple Icons -->
<!-- For iPad with high-resolution Retina display running iOS = 7: -->
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="files/images/favicon_152x152.png?v=1">
<!-- For iPad with high-resolution Retina display running iOS = 6: -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="files/images/favicon_144x144.png?v=1">
<!-- For iPhone with high-resolution Retina display running iOS = 7: -->
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="files/images/favicon_120x120.png?v=1">
<!-- For iPhone with high-resolution Retina display running iOS = 6: -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="files/images/favicon_114x114.png?v=1">
<!-- For the iPad mini and the first- and second-generation iPad on iOS = 7: -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="files/images/favicon_76x76.png?v=1">
<!-- For the iPad mini and the first- and second-generation iPad on iOS = 6: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="files/images/favicon_72x72.png?v=1">
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="files/images/favicon_57x57.png?v=1">
</head>
<body>
<div class="container">
<div class="content">
<div class="page-body">
<div class="sidebar-nav">
<h4><a href="Documentation.html">Documentation</a></h4>
<strong>The Essentials:</strong>
<ol>
<li><a href="Overview.html">Overview</a></li>
<li><a href="Installation.html">Installation</a></li>
<li><a href="QuickStart.html">Quick Start</a></li>
<li><a href="BasicUsage.html">Basic Usage</a></li>
<li><a href="Deployment.html">Deployment</a></li>
<li><a href="RewiredEditor.html">Rewired Editor</a></li>
<li><a href="http://guavaman.com/projects/rewired/docs/api-reference" target="_blank">API Reference</a></li>
</ol>
<strong>Tools:</strong>
<ul>
<li><a href="SaveDataStore.html" title="Save Data Store">Save Data Store</a></li>
<li><a href="ControlMapper.html" title="Control Mapper">Control Mapper</a></li>
</ul>
<strong>Concepts:</strong>
<ul>
<li><a href="InputManager.html">Input Manager</a></li>
<li><a href="Players.html">Players</a></li>
<li><a href="Actions.html">Actions</a></li>
<li><a href="InputBehaviors.html">Input Behaviors</a></li>
<li><a href="ControllerMaps.html">Controller Maps</a></li>
<li><a href="MapCategories.html">Map Categories</a></li>
<li><a href="ControllerMaps.html"></a><a href="Layouts.html">Layouts</a></li>
<li><a href="CustomControllers.html">Custom Controllers</a></li>
</ul>
<strong>How To's</strong>
<ul>
<li><a href="HowTos.html">See all topics...</a></li>
</ul>
<strong>Help:</strong>
<ul>
<li><a href="SupportedControllers.html" title="Supported Controllers">Supported Controllers</a></li>
<li><a href="SpecialPlatformSupport.html" title="Special Platform Support">Special Platform Support</a></li>
<li><a href="Examples.html" title="Examples">Examples</a></li>
<li><a href="Integration.html">Integrations</a></li>
<li><a href="Updating.html" title="Updating Rewired">Updating Rewired</a></li>
<li><a href="Troubleshooting.html" title="Troubleshooting">Troubleshooting</a></li>
<li><a href="KnownIssues.html">Known Issues</a></li>
</ul>
<strong>Unity Help:</strong>
<ul>
<li><a href="http://docs.unity3d.com/Manual/" target="_blank">Unity Manual</a></li>
<li><a href="http://docs.unity3d.com/ScriptReference/" target="_blank">Unity Script Reference</a></li>
<li><a href="http://unity3d.com/learn/tutorials/modules" target="_blank">Unity Tutorials</a></li>
</ul>
<strong>Links:</strong>
<ul>
<li><a href="http://guavaman.com/projects/rewired">Rewired Website</a></li>
<li><a href="http://guavaman.com/projects/rewired/docs">Web Documentation</a></li>
</ul>
</div>
<div class="main-body">
<div class="logo"><a href="http://guavaman.com/projects/rewired" title="Rewired"><img src="files/images/rewired-logo.png" width="173" height="139" alt="Rewired" /></a></div>
<h1>
<!-- InstanceBeginEditable name="PageHeader" -->Save Data Store
<!-- InstanceEndEditable -->
</h1>
<!-- InstanceBeginEditable name="MainBody" -->
<p>The SaveDataStore component can be used to easily save and load user control configuration data from Rewired. This component is a base class which you can extend to support any data storage format you like.</p>
<p>Rewired also comes with a SaveDataStore_PlayerPrefs component complete with source code which you can use as a template for designing your own custom data storage system using any storage medium (database, binary files, etc.). The SaveDataStore_PlayerPrefs component can also be used directly in your game and will store your user data in Unity's PlayerPrefs.</p>
<p><strong>Usage</strong></p>
<p>Just add a component derived from SaveDataStore (such as SaveDataStore_PlayerPrefs) to your Rewired Input Manager Game Object. When the Rewired Input Manager initializes, it will automatically initialize the SaveDataStore component and make a reference to it accessible via the ReInput.saveDataStore property.</p>
<p>To save user data: ReInput.saveDataStore.Save().<br />
To load user data: ReInput.saveDataStore.Load().</p>
<p><strong>SaveDataStore_PlayerPrefs</strong></p>
<p>This is a user data storage component that uses Unity's PlayerPrefs class for storing data. Whenever a controller is attached, if any data has been saved before for that controller, it will be loaded from PlayerPrefs. If the user has customized his control mappings, these will be loaded on a per-player, per-controller basis. Controller calibration settings and customized Input Behavior settings will also be loaded. Data will be saved manually when Save() is called or automatically when a controller is disconnected from the system.</p>
<p>If &quot;Load Data on Start&quot; is checked in the inspector, all controller data will be loaded at the beginning of the session. This is useful if you want the player's last settings to be loaded automatically for any controllers already attached to the system at runtime.</p>
<p>&nbsp;</p>
<div class="bottom-pager clearfix">
<a class="back-button" href="Actions.html" title="Actions"><span class="button-img"></span>Actions</a>
<a class="forward-button" href="ControllerMaps.html" title="Controller Maps"><span class="button-img"></span>Controller Maps</a>
</div>
<!-- InstanceEndEditable -->
</div>
</div>
<div class="footer clearfix">
<p class="left">Copyright &copy;2014 <a href="http://guavaman.com" title="Guavaman Enterprises">Guavaman Enterprises</a>. All rights reserved. No materials may be reproduced without permission.</p>
<p class="right"><a href="http://guavaman.com/projects/rewired" title="Return to Rewired Website">Return to Rewired Website</a></p>
</div>
<!-- end .content --></div>
<!-- end .container --></div>
</body>
<!-- InstanceEnd --></html>