Exemplo n.º 1
0
    void OnUpdatedTextRectLength()
    {
        float maxWidth = 0;
        float height   = searchResults_.Count * TagTextHeight;

        foreach (TagText tagText in searchResults_)
        {
            float width = CustomInputField.CalcTextRectLength(tagText.TextComponent.cachedTextGenerator, tagText.Text.Length - 1);
            if (maxWidth < width)
            {
                maxWidth = width;
            }
        }

        foreach (UIMidairRect rect in GetComponentsInChildren <UIMidairRect>())
        {
            rect.Width  = maxWidth + 20;
            rect.Height = height + 2;
            rect.RecalculatePolygon();
        }

        SelectionImage.rectTransform.sizeDelta = new Vector2(maxWidth + 20, TagTextHeight);

        foreach (TagText tagText in searchResults_)
        {
            tagText.BG.rectTransform.sizeDelta = new Vector2(maxWidth, TagTextHeight);
        }
    }
Exemplo n.º 2
0
    public override void Awake()
    {
        base.Awake();

        userName = transform.Find("Panel/UserName").GetComponent <CustomInputField>();
        password = transform.Find("Panel/Password").GetComponent <CustomInputField>();
    }
Exemplo n.º 3
0
 public void RemoveSelecteInputField()
 {
     customInputField = selectedInputField.GetComponent <CustomInputField>();
     customInputField.FieldTrigger();
     selectedInputField.DeactivateInputField();
     selectedInputField = null;
     firstCapsPass      = true;
 }
Exemplo n.º 4
0
        private void UnAcive()
        {
            InputField?.Active(false);
            InputField = null;

            inputString     = null;
            contentValidate = null;
        }
Exemplo n.º 5
0
        private void Awake()
        {
            customInputField = GetComponent <CustomInputField>();
            inputField       = customInputField.inputText;

            defaultScale = transform.localScale;
            targetScale  = transform.localScale;
        }
Exemplo n.º 6
0
    void Start()
    {
        this.customInputField = gameObject.GetComponent <CustomInputField>();
        GameObject gameDirectorObject = GameObject.FindGameObjectWithTag("GameDirector");

        this.gameDirector = gameDirectorObject.GetComponent <GameDirector>();
        this.customInputField.ActivateInputField();

        this.inputFieldImage = this.GetComponent <Image>();
    }
 /// <summary>
 /// Constructor
 /// </summary>
 private void Awake()
 {
     _inputObject = this.GetComponent <CustomInputField> ();
     if ((object)_inputObject == null)
     {
         Debug.LogError(string.Format("No found InputField for {0} MobileInput", this.name));
         throw new MissingComponentException();
     }
     _inputObjectText = _inputObject.textComponent;
 }
Exemplo n.º 8
0
        private void Active(CustomInputField inputField)
        {
            InputField?.Active(false); // last input field

            InputField = inputField;
            InputField?.Active(true); // current input field

            inputString     = InputField?.Text;
            contentValidate = InputField?.Validator;
        }
Exemplo n.º 9
0
 protected override void Active(bool value, CustomInputField inputField)
 {
     base.Active(value, inputField);
     if (value)
     {
         touchKeyboard = TouchScreenKeyboard.Open(InputString);
     }
     else
     {
         touchKeyboard = null;
     }
 }
Exemplo n.º 10
0
    public override void Awake()
    {
        base.Awake();

        userName             = transform.Find("Panel/UserName").GetComponent <CustomInputField>();
        userName.valueChange = UserNameChange;
        password             = transform.Find("Panel/Password").GetComponent <CustomInputField>();
        password.valueChange = PasswordChange;
        for (int i = 1; i <= SPEAK_TIMES; i++)
        {
            inputHints.Add(transform.Find("Panel/Times/" + i.ToString()));
        }
    }
Exemplo n.º 11
0
        protected virtual void Active(bool value, CustomInputField inputField)
        {
            isActive = value;

            if (isActive)
            {
                Active(inputField);
            }
            else
            {
                UnAcive();
            }
        }
Exemplo n.º 12
0
    private void Enter()
    {
        UIManager <Keyboard> .Hide();

        if (input is CustomInputField)
        {
            CustomInputField customInput = (CustomInputField)input;
            if (customInput.valueSummit != null)
            {
                customInput.valueSummit();
            }
        }
    }
Exemplo n.º 13
0
    public override void Awake()
    {
        base.Awake();

        if (Role.currentRole == null)//首次登陆
        {
            userName = transform.Find("Panel/UserName").GetComponent <CustomInputField>();
            GameObject agent = Instantiate(Resources.Load("Models/Agent")) as GameObject;
            agent.name = "Agent";
        }
        else//从课程中返回
        {
            UIManager <Main> .Show(transform.gameObject, false);
        }
    }
Exemplo n.º 14
0
    void Back()
    {
        if (isShift)
        {
            Shift(false);
        }

        display.text = sb.ToString();
        input.text   = sb.ToString();
        if (input is CustomInputField)
        {
            CustomInputField customInput = (CustomInputField)input;
            if (customInput.valueChange != null)
            {
                customInput.valueChange();
            }
        }
    }
Exemplo n.º 15
0
        protected override void Active(bool value, CustomInputField inputField)
        {
            base.Active(value, inputField);

            if (value)
            {
                if (inputField.Validator.Type != CustomInputField.ContentValidate.ContentType.Interger)
                {
                    if (intergerValidator == null)
                    {
                        intergerValidator = inputField.ValidateFactory
                                            .GetValidator(ContentValidate.ContentType.Interger);
                    }
                    contentValidate = intergerValidator;
                }
            }
            RefreshNumpadDisplay();
            gameObject.SetActive(value);
        }
    public static void UpdateInputFields()
    {
        InputField[] inputfields = Resources.FindObjectsOfTypeAll(typeof(InputField)) as InputField[];

        foreach (InputField inputfield in inputfields)
        {
            InputField source = inputfield;
            GameObject go     = inputfield.gameObject;
            DestroyImmediate(inputfield);
            CustomInputField customInputField = go.AddComponent <CustomInputField>();
            UpdateForType(typeof(InputField), source, customInputField);
            customInputField.colors = inputfield.colors;
        }

        EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
        bool saveOK = EditorSceneManager.SaveScene(EditorSceneManager.GetActiveScene());

        Debug.Log("Saved Scene " + (saveOK ? "OK" : "Error!"));
    }
Exemplo n.º 17
0
 public void Open(CustomInputField inputField)
 {
     Active(true, inputField);
 }
Exemplo n.º 18
0
 private void SetFocusInputField(CustomInputField inputField)
 {
     focusInputField = inputField;
 }