SCInputField.cs 530 B

1234567891011121314151617181920212223242526272829303132333435
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. namespace SC
  4. {
  5. public class SCInputField : MonoBehaviour{
  6. public SCKeyboard keyboard;
  7. public Text placeholderCompontent;
  8. public Text textCompontent;
  9. private string _text;
  10. public string text{
  11. set{
  12. _text = value;
  13. textCompontent.text = _text;
  14. placeholderCompontent.enabled = _text == string.Empty;
  15. }
  16. get{
  17. return _text;
  18. }
  19. }
  20. void Start()
  21. {
  22. text = string.Empty;
  23. }
  24. public void onClick()
  25. {
  26. keyboard.show (this, _text);
  27. }
  28. }
  29. }