Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     box                   = GetComponent <Collider2D> ();
     tmPro                 = GetComponent <TextMeshPro> ();
     SoundClick            = GetComponent <AudioSource>();
     tmPro.maxVisibleLines = maxLine;
     CheckGlobal           = CheckPageGlobal.pGlobal;
 }
Exemplo n.º 2
0
 void Start()
 {
     pGlobal = this;
     foreach (GameObject obj in ColorObject)
     {
         if (obj != null)
         {
             SpriteRenderer renderer = obj.GetComponent <SpriteRenderer>();
             renderer.color = pageColor;
         }
     }
     xmlData.postDownloaded += FinishDownload;
 }
Exemplo n.º 3
0
    void OnGUI()
    {
        Event e = Event.current;

        if (e.keyCode == KeyCode.Return)
        {
            IsKeyboardShow = false;
            CheckPageGlobal.CheckProduct();
        }
        else if (IsKeyboardShow)
        {
            stringToEdit = GUI.TextField(new Rect(0, 0, 100, 50), stringToEdit, 25);
            setText(stringToEdit);
        }
    }
Exemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        if (box == null)
        {
            return;
        }
        bool    touchDown = TouchInterface.GetTouchDown();
        Vector2 pos       = TouchInterface.GetTouchPosition();

        if (touchDown)
        {
            if (box.OverlapPoint(pos))
            {
                if (SoundClick != null)
                {
                    SoundClick.Play();
                }
                //show keyboard
                                #if UNITY_EDITOR
                IsKeyboardShow = true;
                                #else
                                #if !UNITY_WEBGL && !DISABLE_WEBVIEW
                if (!TouchScreenKeyboard.visible)
                {
                    keyboard = TouchScreenKeyboard.Open(currentText, type, false, multiline, false, false);
                }
                                #endif
                                #endif
            }
        }
        if (keyboard == null || keyboard.wasCanceled)
        {
            return;
        }
        if (keyboard.done)
        {
//			keyboard = null;
            CheckPageGlobal.CheckProduct();
        }
//		if (keyboard.wasCanceled) {
//			keyboard = null;
//		}
        if (keyboard.active)
        {
            setText(keyboard.text);
        }
    }