Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1.  
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4.  
  5. public class CharacterName : MonoBehaviour
  6. {
  7.     public InputField heroNameInputField;
  8.     public Text heroNameIF;
  9.     public string heroName;
  10.  
  11.     void Start()
  12.     {
  13.         heroNameInputField = heroNameInputField.GetComponent<InputField>();
  14.         heroName = heroNameInputField.text;
  15.         Debug.Log(heroNameInputField);
  16.     }
  17.  
  18. }
  19.  
  20. /*
  21.  
  22.         public InputField heroNameInputField;
  23.     public string hName;
  24.     void Start()
  25.     {
  26.         heroNameInputField.onEndEdit.AddListener(SetHeroName);
  27.     }
  28.  
  29.     void SetHeroName(string s)
  30.     {
  31.         hName = s;
  32.         Debug.Log("ustawiono nazwe " + s);
  33.     }
  34.  
  35. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement