Ejemplo n.º 1
0
 public void ValidateName()
 {
     name       = inputField.text;
     validName  = !AvailableMoves.ContainsName(name);
     validName &= !name.Equals(string.Empty);
     alreadyUsedText.SetActive(AvailableMoves.ContainsName(name));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Generates a valid name. Names take the form Move0, Move1, etc. The first one that is not used is returned.
 /// </summary>
 /// <returns>A valid name.</returns>
 public string GenerateValidName()
 {
     //Start from 0 and go to the highest possible value. Break loop and return as soon as a valid name is found.
     for (int i = 0; i < Int32.MaxValue; i++)
     {
         string name = "Move" + i;
         if (!AvailableMoves.ContainsName(name))
         {
             return(name);
         }
     }
     return("NO_VALID_NAME");
 }
Ejemplo n.º 3
0
 public void SaveMove()
 {
     if (!AvailableMoves.ContainsName(move.GetName()) && !move.GetName().Equals(string.Empty))
     {
         AvailableMoves.AddMove((Move)move.Clone());
         SaveLoad.Save(AvailableMoves.GetMoves());             //Save every time save button is clicked in case game crashes while still in scene.
         ResetMoveEditor();
     }
     else
     {
         saveButton.interactable = false;
     }
 }