// System using System; // Unity using UnityEngine; namespace GUPS.AntiCheat.Protected.Prefs { /// /// Provides an class for accessing protected vector2 player preferences via properties, offering a more structured approach than /// interacting directly with the static ProtectedPlayerPrefs class. Also allows to easily assign the protected player preferences /// in the unity inspector. /// [Serializable] public class ProtectedVector2Pref : IProtectedPref { /// /// Gets the unique key associated with the player preference. /// [SerializeField] [Tooltip("The unique key associated with the player preference.")] private string key; /// /// Gets the unique key associated with the player preference. /// public String Key => this.Key; /// /// The default value if the player preference is not set. /// [SerializeField] [Tooltip("The default value if the player preference is not set.")] private Vector2 defaultValue; /// /// Gets or sets the value of the player preference. /// public Vector2 Value { get { return ProtectedPlayerPrefs.GetVector2(key, this.defaultValue); } set { ProtectedPlayerPrefs.SetVector2(key, value); } } } }