SaveSystem.GetVector2
Declaration#
public static Vector2 GetVector2(string section, string id, Vector2 defaultValue)Parameters#
| Name | Description |
|---|---|
| section | Section to read |
| id | Key to read |
| defaultValue | Default value |
Description#
Gets vector2 value for a key on a specific section
Usage#
Example
using NullSave.GDTK;using UnityEngine;
public class CodeSample : MonoBehaviour{
public void ExampleMethod() { // Persistent data can be set directly // You can separate your data into sections for faster save/load // The same key can be present on multiple sections // This value will be persisted on save/load var permResult = SaveSystem.GetVector2("demoSection", "vector2", new Vector2(1.2f, 3.4f));
// Temporary data may be used to keep values locally or between scenes // This data is never saved or loaded. var tempResult = SaveSystem.tempData.GetVector2("vector2Temp", new Vector2(5.6f, 7.8f)); }
}