• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# UnityEngine.TouchScreenKeyboard类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UnityEngine.TouchScreenKeyboard的典型用法代码示例。如果您正苦于以下问题:C# TouchScreenKeyboard类的具体用法?C# TouchScreenKeyboard怎么用?C# TouchScreenKeyboard使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TouchScreenKeyboard类属于UnityEngine命名空间,在下文中一共展示了TouchScreenKeyboard类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 ("");
    }
开发者ID:shawmakesmusic,项目名称:leo,代码行数:28,代码来源:FBUploadImage.cs


示例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);
        }
开发者ID:fairygui,项目名称:FairyGUI-unity,代码行数:7,代码来源:TouchScreenKeyboard.cs


示例3: Update

 void Update()
 {
     if(Input.touchCount==3){
         TouchScreenKeyboard.hideInput=true;
         teclado = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.NamePhonePad,false,false,false,true,"");
     }
 }
开发者ID:tejerolucas,项目名称:Social-Drive,代码行数:7,代码来源:WhatsappLayout.cs


示例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);
     }
 }
开发者ID:realshyfox,项目名称:PlayMakerCustomActions_U3,代码行数:7,代码来源:OpenDeviceKeyBoard.cs


示例5: OpenKeyboard

    public void OpenKeyboard()
    {
        if (keyboard != null && keyboard.active)
            return;

        keyboard = TouchScreenKeyboard.Open(inputFieldText.text);
    }
开发者ID:JoshSauter,项目名称:MTGFinance,代码行数:7,代码来源:InputFieldMobile.cs


示例6: ButtonClicked

 void ButtonClicked(int buttonNo)
 {
     Debug.Log ("Button clicked = " + buttonNo);
     keyboard = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default);
     keyboard.active = true;
     //dlt.setBrush (buttonNo);
 }
开发者ID:rinkenuyten,项目名称:ExpoDraw,代码行数:7,代码来源:PainterBoard.cs


示例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();
         }
     }
 }
开发者ID:iaconic,项目名称:Crossword,代码行数:58,代码来源:Game.cs


示例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();
 }
开发者ID:Xellos1010,项目名称:Unity4GUISystem,代码行数:9,代码来源:SubmitNameCheck_Phone.cs


示例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;
    }
开发者ID:Zaandaa,项目名称:onionsurprise,代码行数:10,代码来源:touchscript.cs


示例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
 }
开发者ID:KittyMac,项目名称:PlanetUnity,代码行数:11,代码来源:PlanetUnityKeyboardInput.cs


示例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");
            }
        }
开发者ID:nothiphop,项目名称:PlayMakerCustomActions_U3,代码行数:13,代码来源:OpenDeviceKeyBoard.cs


示例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		
	}
开发者ID:Angryman80,项目名称:spi,代码行数:13,代码来源:TouchInputHelper.cs


示例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();
        }
    }
开发者ID:trongthien18,项目名称:race-of-dragons,代码行数:17,代码来源:ChatEmojiController.cs


示例14: OnGUI

    void OnGUI()
    {
        if (GUI.Button (new Rect (170, 100, 300, 50), "open Keyboard"))
        {
            keyBoard = TouchScreenKeyboard.Open ("test", TouchScreenKeyboardType.Default);
        }

        if (keyBoard != null)
        {
            //GUI.enabled = false;
            if (keyBoard.done)
            {
                        //把中文字畫在 texture 上
                dynaFont.genTexture (tex.GetNativeTextureID (), keyBoard.text, "Arial", 18, 128, 128);
                keyBoard = null;
                //GUI.enabled = true;
            }
        }

        GUI.DrawTexture (new Rect (100, 100, 128, 128), tex);
    }
开发者ID:madjonr,项目名称:Dynamic-Font,代码行数:21,代码来源:main.cs


示例15: SetFocus

    // ***********************************************
    // SetFocus
    // -----------------------------------------------
    public void SetFocus(bool inShowTouchKeyboard = false)
    {
#if UNITY_IOS || UNITY_ANDROID
        
        if (FocusedTextbox)
        {
            FocusedTextbox.mFocused = false;
            if (FocusedTextbox.mKeyboard != null)
                FocusedTextbox.mKeyboard = null;
			FocusedTextbox = null;
        }
		
        mFocused = true;
        if (inShowTouchKeyboard)
            mKeyboard = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default, false, false, Secure);
		
#else

        if (!mCarotInitSaved)
        {
            mCarotInitPos = Carot.transform.localPosition;
            mCarotInitSaved = true;
        }

        // select all
        mCarotIndex = 0;
        Carot.transform.localPosition = mCarotInitPos;
        
        if (Carot)
            Carot.SetActive(true);

        mFocused = true;
        SelectAll();
     
#endif
		
		// assign in GUI -VM
        Gui.FocusControl = this.transform;
        FocusedTextbox = this;
    }
开发者ID:uvcteam,项目名称:univercity3d_uofo,代码行数:43,代码来源:UITextbox.cs


示例16: KeyBoardBehaviour

 /// <summary>
 /// Enables keyboard when the save button is pressed and saves the ADF with required metadata when Keyboard is
 /// done.
 /// </summary>
 private void KeyBoardBehaviour()
 {
     if (m_keyboardState == KeyboardState.OPEN)
     {
         m_keyboard = TouchScreenKeyboard.Open(m_keyboardString, TouchScreenKeyboardType.Default, false);
         m_keyboardState = KeyboardState.ACTIVE;
     }
     if (m_keyboard != null)
     {
         if (m_keyboard.done && m_keyboardState != KeyboardState.DONE)
         {
             m_keyboardState = KeyboardState.DONE;
             m_keyboardString = m_keyboard.text;
             PoseProvider.SaveAreaDescription(m_adfUnityHolder);
             PoseProvider.GetAreaDescriptionMetaData(m_adfUnityHolder);
             PoseProvider.AreaDescriptionMetaData_set(Common.MetaDataKeyType.KEY_NAME, m_keyboardString, m_adfUnityHolder);
             PoseProvider.SaveAreaDescriptionMetaData(m_adfUnityHolder);
         }
         else
         {
             m_keyboardString = m_keyboard.text;
         }
     }
 }
开发者ID:reactivestudios,项目名称:MarcoTango,代码行数:28,代码来源:SaveADFController.cs


示例17: OnEnterFocus

    protected internal override void OnEnterFocus( dfFocusEventArgs args )
    {
        base.OnEnterFocus( args );

        this.undoText = this.Text;

        if( !ReadOnly )
        {

            whenGotFocus = Time.realtimeSinceStartup;
            StopAllCoroutines();
            StartCoroutine( doCursorBlink() );

            if( selectOnFocus )
            {
                selectionStart = 0;
                selectionEnd = text.Length;
            }
            else
            {
                selectionStart = selectionEnd = 0;
            }

        #if ( UNITY_IPHONE || UNITY_ANDROID || UNITY_BLACKBERRY || UNITY_WP8 ) && !UNITY_EDITOR
        if( useMobileKeyboard && mobileKeyboard == null && this.mobileKeyboardTrigger == dfMobileKeyboardTrigger.ShowOnFocus )
        {
            ClearSelection();
            SelectToEnd();
            TouchScreenKeyboard.hideInput = mobileHideInputField;
            mobileKeyboard = TouchScreenKeyboard.Open( this.text, (TouchScreenKeyboardType)mobileKeyboardType, mobileAutoCorrect, false, IsPasswordField );
        }
        #endif

        }

        Invalidate();
    }
开发者ID:BjarkeHou,项目名称:ProjectGuard,代码行数:37,代码来源:dfTextbox.cs


示例18: OnClick

    protected internal override void OnClick( dfMouseEventArgs args )
    {
        base.OnClick( args );

        // http://www.daikonforge.com/dfgui/forums/topic/variable-bug-with-mobile-keyboard/
        this.Focus();

        if( useMobileKeyboard && this.mobileKeyboardTrigger == dfMobileKeyboardTrigger.ShowOnClick )
        {

        ClearSelection();
        SelectToEnd();

        TouchScreenKeyboard.hideInput = mobileHideInputField;

        mobileKeyboard = TouchScreenKeyboard.Open( this.text, (TouchScreenKeyboardType)mobileKeyboardType, mobileAutoCorrect, false, IsPasswordField );

        #if UNITY_ANDROID
        // HACK: This is a hacky workaround for a bug in Unity's mobile keyboard on Android
        if( mobileHideInputField )
        {
            mobileKeyboard = TouchScreenKeyboard.Open( this.text, (TouchScreenKeyboardType)mobileKeyboardType, mobileAutoCorrect, false, IsPasswordField );
        }
        #endif

        }
    }
开发者ID:BjarkeHou,项目名称:ProjectGuard,代码行数:27,代码来源:dfTextbox.cs


示例19: InputSelected

    private void InputSelected()
    {
        if (text.Length == 0)
        {
            HideDisplayText();
        }
        isSelected = true;
        if (!listenForKeyboardText)
        {
            tk2dUIManager.Instance.OnInputUpdate += ListenForKeyboardTextUpdate;
        }
        listenForKeyboardText = true;
        SetState();
        SetCursorPosition();


#if TOUCH_SCREEN_KEYBOARD
        if (Application.platform != RuntimePlatform.WindowsEditor &&
            Application.platform != RuntimePlatform.OSXEditor) {
#if UNITY_ANDROID //due to a delete key bug in Unity Android
            TouchScreenKeyboard.hideInput = false;
#else
            TouchScreenKeyboard.hideInput = true;
#endif
            keyboard = TouchScreenKeyboard.Open(text, TouchScreenKeyboardType.Default, false, false, false, false);
            StartCoroutine(TouchScreenKeyboardLoop());
        }
#endif
    }
开发者ID:shlyahovchuk,项目名称:Runner,代码行数:29,代码来源:tk2dUITextInput.cs


示例20: 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();
 }
开发者ID:Lessica,项目名称:Something-of-SHIPWAR-GAMES,代码行数:29,代码来源:UIInput.cs



注:本文中的UnityEngine.TouchScreenKeyboard类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UnityEngine.TrailRenderer类代码示例发布时间:2022-05-26
下一篇:
C# UnityEngine.Texture2D类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap