Esempio n. 1
0
		/// <summary>
		/// Loads the given input file form a Unity resource.
		/// </summary>
		/// <param name="nameAndPref">Menu item anme and resource name.</param>
		protected void LoadInput(NameAndPref nameAndPref)
		{
			StandardInputData data = StandardInputData.LoadFromResource (nameAndPref.resourceName);
			if (data != null)
			{
				input.LoadInputData (data);
				input.SaveInputData ();
				PlayerPrefs.SetString(CurrentInputPlayerPrefName, nameAndPref.name);
			} 
			else
			{
				Debug.LogError("Tried to load input from a resource but LoadFromResource() returned null");
			}
			UIBasicMenu menu = gameObject.GetComponentInParent<UIBasicMenu>();
			if (menu != null) menu.Refresh();
		}
 /// <summary>
 /// Loads the given input file form a Unity resource.
 /// </summary>
 /// <param name="nameAndPref">Menu item anme and resource name.</param>
 protected void LoadInput(NameAndPref nameAndPref)
 {
     StandardInputData data = StandardInputData.LoadFromResource (nameAndPref.resourceName);
     if (data != null)
     {
         input.LoadInputData (data);
         input.SaveInputData ();
         PlayerPrefs.SetString(CurrentInputPlayerPrefName, nameAndPref.name);
     }
     else
     {
         Debug.LogError("Tried to load input from a resource but LoadFromResource() returned null");
     }
     UIBasicMenu menu = gameObject.GetComponentInParent<UIBasicMenu>();
     if (menu != null) menu.Refresh();
 }