Upload files to "/"
This commit is contained in:
commit
1d0f8360d3
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 812fa61a641329a4e8837aeebadb1e21
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: daf65223fa520944c8af872f13e1142c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a6dae22a96146de4eb5b489c331eb7e2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,67 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
|
||||
public class KeyboardInputManager : MonoBehaviour
|
||||
{
|
||||
|
||||
private TMP_InputField inputField;
|
||||
private string editText;
|
||||
private string oldEditText;
|
||||
private bool keepOldTextInField;
|
||||
|
||||
void Start()
|
||||
{
|
||||
inputField = gameObject.GetComponent<TMP_InputField>();
|
||||
inputField.onEndEdit.AddListener(EndEdit);
|
||||
inputField.onValueChanged.AddListener(Editing);
|
||||
inputField.onTouchScreenKeyboardStatusChanged.AddListener(ReportChangeStatus);
|
||||
}
|
||||
|
||||
private void ReportChangeStatus(TouchScreenKeyboard.Status newStatus)
|
||||
{
|
||||
if (newStatus == TouchScreenKeyboard.Status.Canceled)
|
||||
{
|
||||
keepOldTextInField = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void Editing(string currentText)
|
||||
{
|
||||
oldEditText = editText;
|
||||
editText = currentText;
|
||||
|
||||
}
|
||||
|
||||
private void EndEdit(string currentText)
|
||||
{
|
||||
if (keepOldTextInField)
|
||||
{
|
||||
//IMPORTANT ORDER
|
||||
editText = oldEditText;
|
||||
inputField.text = oldEditText;
|
||||
|
||||
keepOldTextInField = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void ValidateInput()
|
||||
{
|
||||
string inputText = inputField.text;
|
||||
|
||||
if (inputText.Length < 10)
|
||||
{
|
||||
inputField.GetComponent<Image>().color = Color.black;
|
||||
}
|
||||
else
|
||||
{
|
||||
inputField.GetComponent<Image>().color = Color.red;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ee4f2ab84d76f2340b28e0fde4af54c4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue