Scriptum/Assets/UpdateControls.cs

44 lines
3.5 KiB
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UpdateControls : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
InventoryUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Inventory"));
EquipmentUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Inventory"));
UIBaseManager<EquipmentUIManager>.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Inventory"));
UIBaseManager<InventoryUIManager>.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Inventory"));
UIBaseManager<Task>.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Quests"));
ChestUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Interaction"));
ShopUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Interaction"));
SkillsUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Skills"));
TaskUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Quests"));
DisplayExpStatus.keyToExp = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("EXP HEALTH"));
DisplayHealthStatus.keyToHealth = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("EXP HEALTH"));
DisplayExpStatus.keyToExp = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("ExpHlth"));
DisplayHealthStatus.keyToHealth = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("ExpHlth"));
PlayerPrefs.Save();
}
// Update is called once per frame
void Update()
{
InventoryUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Inventory"));
EquipmentUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Inventory"));
UIBaseManager<EquipmentUIManager>.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Inventory"));
UIBaseManager<InventoryUIManager>.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Inventory"));
UIBaseManager<Task>.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Quests"));
ChestUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Interaction"));
ShopUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Interaction"));
SkillsUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Skills"));
TaskUIManager.Instance.keyToOpen = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("Quests"));
DisplayExpStatus.keyToExp = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("EXP HEALTH"));
DisplayHealthStatus.keyToHealth = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("EXP HEALTH"));
DisplayExpStatus.keyToExp = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("ExpHlth"));
DisplayHealthStatus.keyToHealth = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("ExpHlth"));
}
}