本文整理汇总了C#中UnityEngine.TouchScreenKeyboard类的典型用法代码示例。如果您正苦于以下问题:C# TouchScreenKeyboard类的具体用法?C# TouchScreenKeyboard怎么用?C# TouchScreenKeyboard使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TouchScreenKeyboard类属于UnityEngine命名空间,在下文中一共展示了TouchScreenKeyboard类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
void Awake()
{
List<GameObject> eventSystems = new List<GameObject>();
foreach (GameObject obj in FindObjectsOfType(typeof(GameObject)))
if(obj.GetComponent<EventSystem>())
eventSystems.Add(obj);
if(eventSystems.Count == 0)
{
eventSystem = new GameObject();
eventSystem.AddComponent<EventSystem>();
eventSystem.AddComponent<TouchInputModule>();
eventSystem.AddComponent<StandaloneInputModule>();
}
callback = FBWrapper.Instance.uploadCallback;
image = FBWrapper.Instance.uploadImage;
if(image != null)
{
uploadImage.sprite = Sprite.Create(image,
new Rect(0, 0, image.width, image.height),
new Vector2(.5f, .5f));
}
keyboard = TouchScreenKeyboard.Open ("");
}
示例2: Open
public void Open(string text, bool autocorrection, bool multiline, bool secure, bool alert, string textPlaceholder, int keyboardType)
{
if (_keyboard != null)
return;
_keyboard = UnityEngine.TouchScreenKeyboard.Open(text, (TouchScreenKeyboardType)keyboardType, autocorrection, multiline, secure, alert, textPlaceholder);
}
示例3: Update
void Update()
{
if(Input.touchCount==3){
TouchScreenKeyboard.hideInput=true;
teclado = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.NamePhonePad,false,false,false,true,"");
}
}
示例4: OnEnter
public override void OnEnter()
{
if (keyboard == null)
{
keyboard = TouchScreenKeyboard.Open(text.Value,keyBoardType,autoCorrection.Value,multiLine.Value,secure.Value,alert.Value,textPlaceHolder.Value);
}
}
示例5: OpenKeyboard
public void OpenKeyboard()
{
if (keyboard != null && keyboard.active)
return;
keyboard = TouchScreenKeyboard.Open(inputFieldText.text);
}
示例6: ButtonClicked
void ButtonClicked(int buttonNo)
{
Debug.Log ("Button clicked = " + buttonNo);
keyboard = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default);
keyboard.active = true;
//dlt.setBrush (buttonNo);
}
示例7: ButtonPress
public void ButtonPress(string buttonName)
{
if(buttonName.CompareTo("Menu")==0)
{
if(gameMode == _PlayGame || gameMode == _Menu || gameMode == _View)
Menu();
}
else if(buttonName.CompareTo("Solve")==0)
{
Solve();
}
else if(buttonName.CompareTo("Confirm")==0)
{
if(gameMode == _Menu)
{
Time.timeScale = 1;
Application.LoadLevel("menu");
}
}
else if(buttonName.CompareTo("Cancel")==0)
{
if(gameMode == _Menu)
{
Menu();
}
}
else if(buttonName.CompareTo("Keyboard")==0)
{
if(touchScreenKeyboard == null && letter != null)
{
touchScreenKeyboard = TouchScreenKeyboard.Open("0", TouchScreenKeyboardType.Default);
}
else if(touchScreenKeyboard == null && gameMode == _EnterName)
{
touchScreenKeyboard = TouchScreenKeyboard.Open("0", TouchScreenKeyboardType.Default);
}
}
else if(buttonName.CompareTo("Scoreboard")==0)
{
if(gameMode == _EnterName)
{
if(touchScreenKeyboard == null)
{
touchScreenKeyboard = TouchScreenKeyboard.Open("0", TouchScreenKeyboardType.Default);
}
else
{
touchScreenKeyboard.active = false;
touchScreenKeyboard = null;
Enter();
}
}
else if(gameMode == _ScoreBoard)
{
Enter();
}
}
}
示例8: NameText
protected IEnumerator NameText()
{
Debug.Log("We have executed NameText");
yield return 0;
Keyboard = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default, false, false, false, false, "Enter Text");
Open = true;
//Statics.GuiTouch.ToggleTouch(false);
//Reset();
}
示例9: bottom_scoring
IEnumerator bottom_scoring()
{
bot_needs = true;
while(scoring_top)
yield return new WaitForSeconds(.2f);
keyboard2 = TouchScreenKeyboard.Open(pname, TouchScreenKeyboardType.Default, false);
scoring_bot = true;
}
示例10: OpenKeyboard
public static void OpenKeyboard(string text, TouchScreenKeyboardType keyboardType, bool autocorrection, bool multiline, bool secure, bool alert, bool hideInput)
{
#if UNITY_IPHONE || UNITY_ANDROID
if( !Application.isEditor )
{
keyboard = TouchScreenKeyboard.Open(text, keyboardType, autocorrection, multiline, secure, alert);
TouchScreenKeyboard.hideInput = hideInput;
lastMobileKeyboardText = "";
}
#endif
}
示例11: OnEnter
public override void OnEnter()
{
_done = false;
UnityEngine.Debug.Log("OpenDeviceKeyBoard OPEN");
if (keyboard == null)
{
keyboard = TouchScreenKeyboard.Open(text.Value,keyBoardType,autoCorrection.Value,multiLine.Value,secure.Value,alert.Value,textPlaceHolder.Value);
}else{
UnityEngine.Debug.Log("OpenDeviceKeyBoard OPEN NOT NULL");
}
}
示例12: handleTouchKeyboardFocusIn
protected void handleTouchKeyboardFocusIn( TextField txt ) {
#if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8
// Set text for input change detection
string prevText = txt.text;
lastTxt = prevText;
// Open keyboard on focus change
keyboard = TouchScreenKeyboard.Open(prevText, keyboardType );
activeInput = txt;
#endif
}
示例13: _OnChangeTextDone
private IEnumerator _OnChangeTextDone(TouchScreenKeyboard keyboard)
{
while (!keyboard.done)
yield return null;
if (PlayerData.Current.gold >= chatItem.Price)
{
CoinController.Instance.SetCoins(PlayerData.Current.gold - chatItem.Price);
chatItem.Text = keyboard.text;
chatItem.Save();
Reload();
}
else
{
WarningDialogController.Instance.ShowNotEnoughCoins();
}
}
示例14: OnDeselectEvent
protected void OnDeselectEvent()
{
if (this.mDoInit)
{
this.Init();
}
if ((this.label != null) && NGUITools.IsActive(this))
{
this.mValue = this.value;
if (mKeyboard != null)
{
mKeyboard.active = false;
mKeyboard = null;
}
if (string.IsNullOrEmpty(this.mValue))
{
this.label.text = this.mDefaultText;
this.label.color = this.mDefaultColor;
}
else
{
this.label.text = this.mValue;
}
Input.imeCompositionMode = IMECompositionMode.Off;
this.RestoreLabelPivot();
}
selection = null;
this.UpdateLabel();
}
示例15: Close
public void Close()
{
if (_keyboard != null)
{
_keyboard.active = false;
_keyboard = null;
}
}