Example #1
0
    //To create profile
    public void OnProfile()
    {
        Debug.Log("Profile Canvas");



        current = MainScrStates.Profile;
    }
Example #2
0
    //To create profile
    public void OnProfile()
    {
        Debug.Log("Profile Canvas");

        current = MainScrStates.Profile;
        if (PlayerPrefs.GetString("edad") != null && PlayerPrefs.GetString("nombre") != null)
        {
            name_Input.text = PlayerPrefs.GetString("nombre");
        }
        age_Input.text = PlayerPrefs.GetString("edad");
    }
Example #3
0
 //To save profile
 public void OnSave()
 {
     name_Input = GameObject.Find("NAME_INPT").GetComponent <InputField>();
     age_Input  = GameObject.Find("AGE_INPT").GetComponent <InputField>();
     if (name_Input != null && age_Input != null)
     {
         SaveSystem.SavePlayer(this);
     }
     Debug.Log("Back to Main Saved");
     current = MainScrStates.Main;
 }
Example #4
0
 void Start()
 {
     current = MainScrStates.Main;
     if (PlayerPrefs.GetString("edad") != "" && PlayerPrefs.GetString("nombre") != "")
     {
         startBTN.GetComponent <Button>().interactable = true;
     }
     else
     {
         startBTN.GetComponent <Button>().interactable = false;
     }
 }
Example #5
0
    //To save profile
    public void OnSave()
    {
        if (age_Input.text != "" && name_Input.text != "")
        {
            PlayerPrefs.SetString("edad", age_Input.text);
            PlayerPrefs.SetString("nombre", name_Input.text);
            PlayerPrefs.Save();
            Debug.Log("Edad is:" + PlayerPrefs.GetString("edad"));
            Debug.Log("Name is:" + PlayerPrefs.GetString("nombre"));
            startBTN.GetComponent <Button>().interactable = true;
        }
        else
        {
            startBTN.GetComponent <Button>().interactable = false;
        }


        Debug.Log("edad: " + int.Parse(PlayerPrefs.GetString("edad")));

        current = MainScrStates.Main;
    }
Example #6
0
 //To view Game info
 public void OnInfo()
 {
     Debug.Log("Info Canvas");
     current = MainScrStates.Info;
 }
Example #7
0
 //To view posible and collected badges
 public void OnBadges()
 {
     Debug.Log("Badges Canvas");
     current = MainScrStates.Badges;
 }
Example #8
0
 //To go back to mainMenu
 public void OnBack()
 {
     Debug.Log("Back to Main");
     current = MainScrStates.Main;
 }
Example #9
0
 void Awake()
 {
     current = MainScrStates.Main;
 }