Scriptum/Assets/UpdateControls.cs
2023-01-15 21:08:32 +01:00

44 lines
3.6 KiB
C#

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"));
}
}