Inheritance: MonoBehaviour
Ejemplo n.º 1
0
	void Awake(){
		_instance = this;
		headSprite = transform.Find ("HeadSprite").GetComponent<UISprite> ();
		levelLabel = transform.Find ("LevelLabel").GetComponent<UILabel> ();
		nameLabel = transform.Find ("NameLabel").GetComponent<UILabel> ();
		diamondLabel = transform.Find ("DiamondLabel/DiamondNumLabel").GetComponent<UILabel> ();
		coinLabel = transform.Find ("CoinLabel/CoinNumLabel").GetComponent<UILabel> ();

		tween = this.GetComponent<TweenPosition> ();
		closeButton = transform.Find ("CancelButton").GetComponent<UIButton> ();

		changeNameButton = transform.Find ("ChangeNameButton").GetComponent<UIButton> ();
		changeNameGo = transform.Find ("ChangeNameBg").gameObject;
		nameInput = transform.Find ("ChangeNameBg/NameInput").GetComponent<UIInput> ();
		sureButton = transform.Find ("ChangeNameBg/SureButton").GetComponent<UIButton> ();
		cancelButton = transform.Find ("ChangeNameBg/CancelButton").GetComponent<UIButton> ();
		changeNameGo.SetActive (false);

		EventDelegate ed = new EventDelegate(this,"OnButtonCloseClick");
		closeButton.onClick.Add (ed);

		EventDelegate ed2 = new EventDelegate (this, "OnButtonChangeNameClick");
		changeNameButton.onClick.Add (ed2);

		EventDelegate ed3 = new EventDelegate (this, "OnButtonSureClick");
		sureButton.onClick.Add (ed3);

		EventDelegate ed4 = new EventDelegate (this, "OnButtonCancelClick");
		cancelButton.onClick.Add (ed4);


		PlayerInfo._instance.OnPlayerInfoChanged += this.OnPlayerInfoChanged;
	}
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        user = GameObject.Find("UI Root/account").GetComponent<UIInput>();
        passwd = GameObject.Find("UI Root/passwd").GetComponent<UIInput>();
        tip = GameObject.Find("UI Root/lanuch/Tip_Label").GetComponent<UILabel>();

    }
Ejemplo n.º 3
0
	public void FindItem() {
		labelText = transform.Find("name").GetComponent<UILabel>();
		select = transform.Find("xuanzhong").gameObject;
		addStatue = transform.Find("addstatue").gameObject;
		sendGroup = transform.Find("send_group").gameObject;
		inputSend = sendGroup.GetComponent<UIInput>();
	}
 void Start()
 {
     if (this.GetComponent<UIInput>())
     {
         uiInput = this.GetComponent<UIInput>();
     }
 }
Ejemplo n.º 5
0
 void InitGame()
 {
     mName = skinTransform.Find("name").GetComponent<UILabel>();
     mInputNum = skinTransform.Find("inputNum").GetComponent<UIInput>();
     mInputNum.value = mNowSelectNums.ToString();
     mInputNum.onChange.Add(new EventDelegate(ChangeInput));
 }
Ejemplo n.º 6
0
 public MarketBuyView(Transform transform)
 {
     panel = transform.gameObject;
     name = transform.FindChild("name").GetComponent<UILabel>();
     total = transform.FindChild("total").GetComponent<UILabel>();
     num = transform.FindChild("num").GetComponent<UIInput>();
     minus = transform.FindChild("minus").GetComponent<MogoButton>();
     minusminus = transform.FindChild("minusminus").GetComponent<MogoButton>();
     plus = transform.FindChild("plus").GetComponent<MogoButton>();
     plusplus = transform.FindChild("plusplus").GetComponent<MogoButton>();
     close = transform.FindChild("close").GetComponent<MogoButton>();
     commit = transform.FindChild("commit").GetComponent<MogoButton>();
     UILabel c = transform.FindChild("close/Label").GetComponent<UILabel>();
     UILabel cm = transform.FindChild("commit/Label").GetComponent<UILabel>();
     c.text = Mogo.GameData.LanguageData.GetContent(716); // "取消";
     cm.text = Mogo.GameData.LanguageData.GetContent(717); // "确定";
     
     minus.clickHandler = Minus;
     minusminus.clickHandler = MinusMinus;
     plus.clickHandler = Plus;
     plusplus.clickHandler = PlusPlus;
     close.clickHandler = Close;
     commit.clickHandler = Commit;
     num.validator = Validator;
     num.onSubmit = OnInputSubmit;
 }
Ejemplo n.º 7
0
	protected override void OnDestroyEnd ()
	{
		base.OnDestroyEnd ();

		inputAcc = null;
		inputPassword = null;
	}
Ejemplo n.º 8
0
	public override void Awake()
	{
		base.Awake();
		
		_UiInputReceiver = gameObject.GetComponent<UIInput>();
		_UiLabelReceiver = gameObject.GetComponent<UILabel>();
	}
Ejemplo n.º 9
0
 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();
 }
Ejemplo n.º 10
0
	public override void Awake()
	{
		base.Awake();
		_nvc.Awake(gameObject);
		_input = GetComponent<UIInput> ();
		_uiInputField = GetComponent<UnityEngine.UI.InputField>();
	}
Ejemplo n.º 11
0
    public override void OnInit()
    {
        base.OnInit();

        m_InputName = FindChildComponent<UIInput>("Input_NickName");

        AddChildElementClickEvent(OnClickCreate, "UIButton_Create");
    }
		public void OnChange (UIInput input) {
			string text = "";
			for (int i=0; i<=input.value.Length; i++) {
				text += "  ";
			}
			text += postfix;
			postfixLabel.text = text;
		}
Ejemplo n.º 13
0
	void Start()
	{
        // 获得各种控件
        lbAccount = transform.FindChild("lbAccount").GetComponent<UIInput>();
        lbPassword = transform.FindChild("lbPassword").GetComponent<UIInput>();
        btnLogin = transform.FindChild("btnLogin").GetComponent<UIButton>();
        EventDelegate.Add(btnLogin.onClick, OnClickLogin);
	}
Ejemplo n.º 14
0
	// Use this for initialization
	void Awake() {
		_instance = this;
		tween = this.GetComponent<TweenPosition> ();
		NumDialog = this.transform.Find ("NumDilag").gameObject;

		inputxu=transform.Find("NumDilag/NumInput").GetComponent<UIInput>();
		NumDialog.SetActive (false);
	}
Ejemplo n.º 15
0
 void OnEngineSlotXInput(UIInput sender)
 {
     float result = 0;
     if (CheckFloatInput (sender, ref result)) {
         currentShip.engineSlots [int.Parse (poplst_engineSlots.selection)] = new Vector2 (
             result,
             currentShip.engineSlots [int.Parse (poplst_engineSlots.selection)].y);
     }
 }
Ejemplo n.º 16
0
 protected void ExecuteOnChange()
 {
     if (EventDelegate.IsValid(this.onChange))
     {
         current = this;
         EventDelegate.Execute(this.onChange);
         current = null;
     }
 }
 public IObservable<string> OnChangeAsObservable(UIInput input)
 {
     this.input = input;
     if(input != null) {
         input.onChange.Add(new EventDelegate(Change));
         return onChange ?? (onChange = new Subject<string>());
     } else {
         return Observable.Empty<string>();
     }
 }
Ejemplo n.º 18
0
	void Start () {
		if (!GameManager.Instance.GameLogin) {
			SceneManager.LoadScene (0, LoadSceneMode.Single);
			return;
		}
		GameData.SetBtn (this.transform, "BtnOk", "Press", this);
		m_ipNickName = this.transform.FindChild ("Input").GetComponent<UIInput> ();
		UILabel tGuide = this.transform.FindChild ("tGuide").GetComponent<UILabel> ();
		tGuide.text = "닉네임은 2~10글자 까지 영문과 숫자만 가능합니다.";
	}
Ejemplo n.º 19
0
 void Awake ()
 {
     Object.DontDestroyOnLoad (GameObject.Find ("PC Packet"));
     PC = GameObject.Find ("PC Packet").GetComponent<Character> ();
     UI = GetComponent<UIController> ();
     ClassSelectList = GameObject.Find ("Class Select: List")
         .GetComponent<UIPopupList> ();
     NameInput = GameObject.Find ("Name: Input")
         .GetComponent<UIInput> ();
 }
Ejemplo n.º 20
0
    public override void OnInit()
    {
        base.OnInit();

        m_InputUserName = FindChildComponent<UIInput>("Input_UserName");
        m_InputPassword = FindChildComponent<UIInput>("Input_Password");

        AddChildElementClickEvent(OnClickLogin, "UIButton_Login");
        AddChildElementClickEvent(OnClickRegister, "UIButton_Register");
    }
 public IObservable<string> OnSubmitAsObservable(UIInput input)
 {
     this.input = input;
     if(input != null) {
         input.onSubmit.Add(new EventDelegate(Submit));
         return onSubmit ?? (onSubmit = new Subject<string>());
     } else {
         return Observable.Empty<string>();
     }
 }
Ejemplo n.º 22
0
 private void CreateObjects()
 {
     Transform transform = base.transform.Find("winBG");
     GameObject gameObject = transform.Find("titleBg/CloseBtn").gameObject;
     UIEventListener expr_28 = UIEventListener.Get(gameObject);
     expr_28.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_28.onClick, new UIEventListener.VoidDelegate(this.OnCloseClick));
     Transform transform2 = transform.Find("panel");
     gameObject = transform2.Find("codeBtn").gameObject;
     UIEventListener expr_6C = UIEventListener.Get(gameObject);
     expr_6C.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_6C.onClick, new UIEventListener.VoidDelegate(this.OnCodeBtnClick));
     gameObject = transform2.Find("bindBtn").gameObject;
     UIEventListener expr_A4 = UIEventListener.Get(gameObject);
     expr_A4.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_A4.onClick, new UIEventListener.VoidDelegate(this.OnBindBtnClick));
     this.inputCode = transform2.Find("codeInput").GetComponent<UIInput>();
     this.inputCode.defaultText = Singleton<StringManager>.Instance.GetString("phoneBindTxt1");
     this.inputCode.characterLimit = 11;
     this.inputCode.validation = UIInput.Validation.Integer;
     this.inputCode.keyboardType = UIInput.KeyboardType.NumberPad;
     this.inputBind = transform2.Find("bindInput").GetComponent<UIInput>();
     this.inputBind.defaultText = Singleton<StringManager>.Instance.GetString("phoneBindTxt2");
     this.inputBind.characterLimit = 4;
     this.inputBind.validation = UIInput.Validation.Integer;
     this.inputBind.keyboardType = UIInput.KeyboardType.NumberPad;
     MiscInfo info = Globals.Instance.AttDB.MiscDict.GetInfo(16);
     int num = 0;
     int num2 = 0;
     while (num < info.Day7RewardType.Count && num < 3)
     {
         if (info.Day7RewardType[num] != 0 && info.Day7RewardType[num] != 20)
         {
             int num3 = info.Day7RewardType[num];
             int num4 = info.Day7RewardValue1[num];
             int num5 = info.Day7RewardValue2[num];
             Transform parent = transform.Find(string.Format("RewardItem{0}", num));
             if (num3 == 3)
             {
                 this.itemInfo = Globals.Instance.AttDB.ItemDict.GetInfo(num4);
                 GameObject go = GameUITools.CreateReward(num3, num4, num5, parent, true, false, 0f, 0f, 0f, 255f, 255f, 255f, 0);
                 UIEventListener expr_25C = UIEventListener.Get(go);
                 expr_25C.onPress = (UIEventListener.BoolDelegate)Delegate.Combine(expr_25C.onPress, new UIEventListener.BoolDelegate(this.OnRewardPress));
             }
             else
             {
                 GameUITools.CreateReward(num3, num4, num5, parent, true, true, 0f, 0f, 0f, 255f, 255f, 255f, 0);
             }
             this.rewardType[num2] = num3;
             this.rewardValue1[num2] = num4;
             this.rewardValue2[num2] = num5;
             num2++;
         }
         num++;
     }
     Globals.Instance.CliSession.Register(395, new ClientSession.MsgHandler(this.OnMsgRequestSMSCode));
     Globals.Instance.CliSession.Register(397, new ClientSession.MsgHandler(this.OnMsgVerifySMSCode));
 }
Ejemplo n.º 23
0
	void Awake () {

        mInput = GetComponent<UIInput>();
		if (mInput != null)
		{
			EventDelegate.Add(mInput.onSubmit, OnSubmit);
			EventDelegate.Add(mInput.onChange, OnChange);
		}

		UIToggle Toggle = GetComponent<UIToggle>();
		if (Toggle != null)
		{
			EventDelegate.Add(Toggle.onChange, OnToggle);
		}

		UIToggleEx ToggleEx = GetComponent<UIToggleEx>();
		if (ToggleEx != null)
		{
			EventDelegate.Add(ToggleEx.onChange, OnToggleEx);
		}

		UIProgressBar ProgressBar = GetComponent<UIProgressBar>();
		if (ProgressBar != null)
		{
			EventDelegate.Add(ProgressBar.onChange, OnProgressBar);
		}

		UIPopupList PopupList = GetComponent<UIPopupList>();
		if (PopupList != null)
		{
			EventDelegate.Add(PopupList.onChange, OnPopupList);
		}

		SpringPanel SpringPanel = GetComponent<SpringPanel>();
		if (SpringPanel != null)
		{
			SpringPanel.onFinishedEx = OnSpringPanel;
		}

		UITweener oneTweener = GetComponent<UITweener>();
		if (oneTweener != null)
		{
			UITweener[] tweenerArr = GetComponents<UITweener>();
			foreach (var tweener in tweenerArr)
			{
				EventDelegate.Add(tweener.onFinished, OnTweenerFinish);
			}
		}

		UIPlayTween playTweener = GetComponent<UIPlayTween>();
		if (playTweener != null)
		{
			EventDelegate.Add(playTweener.onFinished, OnPlayTweenFinish);
		}
	}
Ejemplo n.º 24
0
    public override void Awake()
    {
        base.Awake();

        for (var i = 0; i < Paths.Count; ++i)
        {
            _propertyGroups.Add(new Dictionary<Type, EZData.Property>());
        }
        _UiInputReceiver = gameObject.GetComponent<UIInput>();
        _UiLabelReceiver = gameObject.GetComponent<UILabel>();
    }
Ejemplo n.º 25
0
 private void CreateObjects()
 {
     Transform transform = base.transform.Find("bg");
     this.mInputNum = transform.Find("nameInput").GetComponent<UIInput>();
     GameObject gameObject = transform.Find("okBtn").gameObject;
     UIEventListener expr_3E = UIEventListener.Get(gameObject);
     expr_3E.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_3E.onClick, new UIEventListener.VoidDelegate(this.OnOkBtnClick));
     GameObject gameObject2 = transform.Find("cancelBtn").gameObject;
     UIEventListener expr_76 = UIEventListener.Get(gameObject2);
     expr_76.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_76.onClick, new UIEventListener.VoidDelegate(this.OnCancelClick));
 }
Ejemplo n.º 26
0
		public void Submit (UIInput input) {
			string value;
			if (_storage.TryGetValue(key, out value)) {
				_storage[key] = input.value;
			}
			else {
				_storage.Add(key, input.value);
			}

			Debug.Log(_storage[key]);
		}
Ejemplo n.º 27
0
	void Awake()
	{
        instance = this;
        mParent = gameObject.transform.FindChild(ParentPath).gameObject;
        mScrollView = gameObject.transform.FindChild(mScrollViewPath).GetComponent<UIScrollView>();
        mGo_Input = gameObject.transform.FindChild(mGo_Input_Path).GetComponent<UIInput>();
		mInputLabel = mGo_Input.transform.FindChild ("Label").transform.GetComponent<UILabel>();
        mGo_Send = gameObject.transform.FindChild(mBt_Send_Path).gameObject;
        UIEventListener.Get(mGo_Send).onClick += OnSubmit;

	}
Ejemplo n.º 28
0
 private void CreateObjects()
 {
     this.mGuildName = base.transform.Find("nameInput").GetComponent<UIInput>();
     UIInput expr_21 = this.mGuildName;
     expr_21.onValidate = (UIInput.OnValidate)Delegate.Combine(expr_21.onValidate, new UIInput.OnValidate(this.OnInputGuildName));
     this.mGuildAnnounce = base.transform.Find("announceInput").GetComponent<UIInput>();
     this.mCostNum = base.transform.Find("costNum").GetComponent<UILabel>();
     GameObject gameObject = base.transform.Find("createBtn").gameObject;
     UIEventListener expr_94 = UIEventListener.Get(gameObject);
     expr_94.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_94.onClick, new UIEventListener.VoidDelegate(this.OnCreateBtnClick));
 }
Ejemplo n.º 29
0
    protected override void OnInitDone()
    {
        base.OnInitDone();
        mInputAcc = skinTransform.Find("InputAcc").GetComponent<UIInput>();
        mInputPass = skinTransform.Find("InputPass").GetComponent<UIInput>();

        string str = (string)sceneArgs[0];
        int i = (int)sceneArgs[1];
        bool bo = (bool)sceneArgs[2];
        Debug.Log(str + "---" + i + "---" + bo);
    }
Ejemplo n.º 30
0
    public override void OnInit()
    {
        base.OnInit();
        
        m_Input = FindChildComponent<UIInput>("Input_GM");
        AddChildElementClickEvent(OnClickOpenLog, "Button_OpenLog");
        AddChildElementClickEvent(OnClickChangeToGM, "Button_ChangeToGM");
        AddChildElementClickEvent(OnClickOK, "Button_OK"); 
        AddChildElementClickEvent(OnClickExit, "Button_Exit"); 

    }
Ejemplo n.º 31
0
    protected override void OnStart()
    {
        ShopBtn    = this.GetChild("ShopBtn").GetComponent <UIButton>();
        ensureBtn  = this.GetChild("quit").GetComponent <UIButton>();
        noNameBtn  = this.GetChild("ensure").GetComponent <UIButton>();
        succeseBtn = this.GetChild("succese").GetComponent <UIButton>();

        input = this.GetChild("Input").GetComponent <UIInput>();

        succeseSprite = this.GetChild("SucceseBg").gameObject;
        errorSprite   = this.GetChild("ErrorBg").gameObject;
        noNameSprite  = this.GetChild("noName").gameObject;

        input.onSubmit.Add(new EventDelegate(OnSubmit));
        input.onChange.Add(new EventDelegate(OnChange));

        AddGOInList();
        AddEventDelete();
    }
Ejemplo n.º 32
0
    /// <summary>
    /// Notification of the input field losing selection.
    /// </summary>

    protected void OnDeselectEvent()
    {
        if (mDoInit)
        {
            Init();
        }

        if (label != null && NGUITools.GetActive(this))
        {
            mValue = value;

            if (current == null)
            {
                current = this;
                EventDelegate.Execute(onDeSelected);
                current = null;
            }

#if MOBILE
            if (mKeyboard != null)
            {
                mWaitForKeyboard = false;
                mKeyboard.active = false;
                mKeyboard        = null;
            }
#endif
            if (string.IsNullOrEmpty(mValue))
            {
                label.text  = mDefaultText;
                label.color = mDefaultColor;
            }
            else
            {
                label.text = mValue;
            }

            Input.imeCompositionMode = IMECompositionMode.Auto;
            RestoreLabelPivot();
        }

        selection = null;
        UpdateLabel();
    }
Ejemplo n.º 33
0
    private static int get_selectionColor(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput uIInput        = (UIInput)obj;
            Color   selectionColor = uIInput.selectionColor;
            ToLua.Push(L, selectionColor);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index selectionColor on a nil value");
        }
        return(result);
    }
Ejemplo n.º 34
0
    private static int get_savedAs(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput uIInput = (UIInput)obj;
            string  savedAs = uIInput.savedAs;
            LuaDLL.lua_pushstring(L, savedAs);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index savedAs on a nil value");
        }
        return(result);
    }
Ejemplo n.º 35
0
    private static int get_characterLimit(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput uIInput        = (UIInput)obj;
            int     characterLimit = uIInput.characterLimit;
            LuaDLL.lua_pushinteger(L, characterLimit);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index characterLimit on a nil value");
        }
        return(result);
    }
Ejemplo n.º 36
0
    public void send()
    {
        UIInput input = inputs["account"];

        if (MyUtilTools.stringIsNull(input.value))
        {
            DialogUtil.tip("请输入手机号码");
            return;
        }
        if (startTime == 0)
        {
            ByteBuffer buffer = ByteBuffer.Allocate(1024);
            buffer.skip(4);
            buffer.WriteString("Token");
            buffer.WriteString(input.value);
            buffer.WriteString("1");
            NetUtil.getInstance.SendMessage(buffer);
        }
    }
Ejemplo n.º 37
0
    private string GetValueFromEditBox()
    {
        InputField inputField = GetInputField();

        if (inputField != null)
        {
            return(inputField.text);
        }

#if ACCESS_NGUI
        UIInput element = GetNGUIInputField();
        if (element != null)
        {
            return(element.value);
        }
#endif

        return("");
    }
Ejemplo n.º 38
0
    void Awake()
    {
        accountView = transform.Find("Account").gameObject;
        Common.AddClickListener(transform.Find("BG/WX").gameObject,
                                () => EventManage.Instance.Broadcast <string>(EventEnum.login, "wx"));
        Common.AddClickListener(transform.Find("BG/Test").gameObject,
                                () => EventManage.Instance.Broadcast <string>(EventEnum.login, "user"));

        NGUITools.AddWidgetCollider(transform.Find("Account/Mask").gameObject);
        Common.AddClickListener(transform.Find("Account/BG/Close").gameObject,
                                () => accountView.SetActive(false));
        Common.AddClickListener(transform.Find("Account/BG/RegisterBtn").gameObject,
                                () => EventManage.Instance.Broadcast <string>(EventEnum.login, "register"));
        Common.AddClickListener(transform.Find("Account/BG/LoginBtn").gameObject,
                                () => EventManage.Instance.Broadcast <string>(EventEnum.login, "login"));

        accountInput  = transform.Find("Account/BG/AccountInput/Text").GetComponent <UIInput>();
        passwordInput = transform.Find("Account/BG/PasswordInput/Text").GetComponent <UIInput>();
    }
Ejemplo n.º 39
0
    private static int get_keyboardType(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput uIInput = (UIInput)obj;
            UIInput.KeyboardType keyboardType = uIInput.keyboardType;
            ToLua.Push(L, keyboardType);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index keyboardType on a nil value");
        }
        return(result);
    }
Ejemplo n.º 40
0
    private static int get_onReturnKey(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput             uIInput     = (UIInput)obj;
            UIInput.OnReturnKey onReturnKey = uIInput.onReturnKey;
            ToLua.Push(L, onReturnKey);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index onReturnKey on a nil value");
        }
        return(result);
    }
Ejemplo n.º 41
0
    /// <summary>
    /// Notification of the input field gaining selection.
    /// </summary>

    protected void OnSelectEvent()
    {
        selection = this;

        if (mDoInit)
        {
            Init();
        }

        if (label != null && NGUITools.GetActive(this))
        {
            label.color = activeTextColor;
#if MOBILE
            if (Application.platform == RuntimePlatform.IPhonePlayer ||
                Application.platform == RuntimePlatform.Android
#if UNITY_WP8
                || Application.platform == RuntimePlatform.WP8Player
#endif
#if UNITY_BLACKBERRY
                || Application.platform == RuntimePlatform.BB10Player
#endif
                )
            {
                mKeyboard = (inputType == InputType.Password) ?
                            TouchScreenKeyboard.Open(mValue, TouchScreenKeyboardType.Default, false, false, true) :
                            TouchScreenKeyboard.Open(mValue, (TouchScreenKeyboardType)((int)keyboardType), inputType == InputType.AutoCorrect, label.multiLine, false, false, defaultText);
            }
            else
#endif
            {
                Input.imeCompositionMode   = IMECompositionMode.On;
                Input.compositionCursorPos = (UICamera.current != null && UICamera.current.cachedCamera != null) ?
                                             UICamera.current.cachedCamera.WorldToScreenPoint(label.worldCorners[0]) :
                                             label.worldCorners[0];
#if !MOBILE
                mSelectionStart = 0;
                mSelectionEnd   = string.IsNullOrEmpty(mValue) ? 0 : mValue.Length;
#endif
                mDrawStart = 0;
            }
            UpdateLabel();
        }
    }
Ejemplo n.º 42
0
    private static int set_selectionEnd(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput uIInput      = (UIInput)obj;
            int     selectionEnd = (int)LuaDLL.luaL_checknumber(L, 2);
            uIInput.selectionEnd = selectionEnd;
            result = 0;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index selectionEnd on a nil value");
        }
        return(result);
    }
Ejemplo n.º 43
0
    private static int set_isSelected(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput uIInput    = (UIInput)obj;
            bool    isSelected = LuaDLL.luaL_checkboolean(L, 2);
            uIInput.isSelected = isSelected;
            result             = 0;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index isSelected on a nil value");
        }
        return(result);
    }
Ejemplo n.º 44
0
    private static int set_value(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput uIInput = (UIInput)obj;
            string  value   = ToLua.CheckString(L, 2);
            uIInput.value = value;
            result        = 0;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index value on a nil value");
        }
        return(result);
    }
Ejemplo n.º 45
0
    //////////////////////////////////////////////////////////////////////////

    public override string GetCurrentValueAsText()
    {
        InputField inputField = GetInputField();

        if (inputField != null)
        {
            return(inputField.text);
        }

#if ACCESS_NGUI
        UIInput element = GetNGUIInputField();
        if (element != null)
        {
            return(element.value);
        }
#endif

        return("");
    }
Ejemplo n.º 46
0
    private static int get_hideInput(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput uIInput   = (UIInput)obj;
            bool    hideInput = uIInput.hideInput;
            LuaDLL.lua_pushboolean(L, hideInput);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index hideInput on a nil value");
        }
        return(result);
    }
Ejemplo n.º 47
0
    //////////////////////////////////////////////////////////////////////////

    public override void InteractEnd()
    {
        InputField inputField = GetInputField();

        if (inputField != null)
        {
            inputField.onValueChanged.RemoveListener(delegate { ValueChangeCheck(); });
        }

#if ACCESS_NGUI
        UIInput element = GetNGUIInputField();
        if (element != null)
        {
            element.onChange.Remove(m_Callback);
            element.RemoveFocus();
            //element.isSelected = false;
        }
#endif
    }
Ejemplo n.º 48
0
    private static int get_selectAllTextOnFocus(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput uIInput = (UIInput)obj;
            bool    selectAllTextOnFocus = uIInput.selectAllTextOnFocus;
            LuaDLL.lua_pushboolean(L, selectAllTextOnFocus);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index selectAllTextOnFocus on a nil value");
        }
        return(result);
    }
Ejemplo n.º 49
0
    private static int get_validation(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput            uIInput    = (UIInput)obj;
            UIInput.Validation validation = uIInput.validation;
            ToLua.Push(L, validation);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index validation on a nil value");
        }
        return(result);
    }
Ejemplo n.º 50
0
    private static int get_label(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput uIInput = (UIInput)obj;
            UILabel label   = uIInput.label;
            ToLua.Push(L, label);
            result = 1;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index label on a nil value");
        }
        return(result);
    }
Ejemplo n.º 51
0
    public void showAccountPanel(string phone)
    {
        this.archLogin.SetActive(true);
        UIInput accountInput = transform.FindChild("AnchorLogin/account").GetComponent <UIInput> ();

        accountInput.value = phone;

        GameObject loginBtn    = transform.FindChild("AnchorLogin/LoginBtn").gameObject;
        GameObject registerBtn = transform.FindChild("AnchorLogin/RegisterBtn").gameObject;

        UIEventListener.Get(loginBtn).onClick = delegate {
            GameObject account = transform.FindChild("AnchorLogin/account").gameObject;
            string     a       = account.GetComponent <UIInput>().value;

                        #if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
            this.reqAccountLogin(a, Helper.getPassword(a));
                        #else
            if (PlayerPrefs.HasKey("Account") && PlayerPrefs.GetString("Account").Equals(a))
            {
                this.reqAccountLogin(a, Helper.getPassword(a));
            }
            else
            {
                PlayerPrefs.SetString("Account", "");
                Invoke("willSmsSendLogin", 0f);
            }
                        #endif
        };
        UIEventListener.Get(registerBtn).onClick = delegate {
                        #if UNITY_ANDROID
            SmsSend.instance.Type = SmsSend.TYPE_register;
            SmsSend.instance.showRegisterPage();
                        #endif
                        #if UNITY_IPHONE
            SmsSend.instance.Type = SmsSend.TYPE_register;
            SmsSend.instance.showRegisterPage();
                        #endif
                        #if UNITY_EDITOR_OSX
            string testPhone = "1122334455662";
            this.regiseterAccount(testPhone, Helper.getPassword(testPhone));
                        #endif
        };
    }
Ejemplo n.º 52
0
    private static int set_onChange(IntPtr L)
    {
        object obj = null;
        int    result;

        try
        {
            obj = ToLua.ToObject(L, 1);
            UIInput uIInput = (UIInput)obj;
            List <EventDelegate> onChange = (List <EventDelegate>)ToLua.CheckObject(L, 2, typeof(List <EventDelegate>));
            uIInput.onChange = onChange;
            result           = 0;
        }
        catch (Exception ex)
        {
            result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index onChange on a nil value");
        }
        return(result);
    }
Ejemplo n.º 53
0
    static int set_onValidate(IntPtr L)
    {
        object  o   = LuaScriptMgr.GetLuaObject(L, 1);
        UIInput obj = (UIInput)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name onValidate");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index onValidate on a nil value");
            }
        }

        LuaTypes funcType = LuaDLL.lua_type(L, 3);

        if (funcType != LuaTypes.LUA_TFUNCTION)
        {
            obj.onValidate = (UIInput.OnValidate)LuaScriptMgr.GetNetObject(L, 3, typeof(UIInput.OnValidate));
        }
        else
        {
            LuaFunction func = LuaScriptMgr.ToLuaFunction(L, 3);
            obj.onValidate = (param0, param1, param2) =>
            {
                int top = func.BeginPCall();
                LuaScriptMgr.Push(L, param0);
                LuaScriptMgr.Push(L, param1);
                LuaScriptMgr.Push(L, param2);
                func.PCall(top, 3);
                object[] objs = func.PopValues(top);
                func.EndPCall(top);
                return((char)objs[0]);
            };
        }
        return(0);
    }
Ejemplo n.º 54
0
    void Awake()
    {
        _instance                  = this;
        headSprite                 = transform.Find("HeadSprite").GetComponent <UISprite>();
        levelLabel                 = transform.Find("LevelLabel").GetComponent <UILabel>();
        nameLabel                  = transform.Find("NameLabel").GetComponent <UILabel>();
        powerLabel                 = transform.Find("PowerLabel/PowerNumber").GetComponent <UILabel>();
        expLabel                   = transform.Find("EXP_BG/NumberLabel").GetComponent <UILabel>();
        expSlider                  = transform.Find("EXP_BG/EXP_bar").GetComponent <UISlider>();
        diamondLabel               = transform.Find("Diiamond/NumberLabel").GetComponent <UILabel>();
        coinLabel                  = transform.Find("Coin/NumberLabel").GetComponent <UILabel>();
        energyLabel                = transform.Find("EnegyLabel/NumberLabel").GetComponent <UILabel>();
        energyRecoverTimeLabel     = transform.Find("EnegyLabel/EnegyBackLabel/TimeLabel").GetComponent <UILabel>();
        energyAllRecoverTimerLabel = transform.Find("EnegyLabel/EnegyBackLabel2/TimeLabel").GetComponent <UILabel>();
        liLianLabel                = transform.Find("LiLianLabel/NumberLabel").GetComponent <UILabel>();
        lilianRecoverTimeLabel     = transform.Find("LiLianLabel/EnegyBackLabel/TimeLabel").GetComponent <UILabel>();
        liLianAllRecoverTimeLabel  = transform.Find("LiLianLabel/EnegyBackLabel2/TimeLabel").GetComponent <UILabel>();
        changeNameButton           = transform.Find("ChangeNameButton").GetComponent <UIButton>();
        closedButton               = transform.Find("CloseButton").GetComponent <UIButton>();

        //注册事件,绑定按键
        tween         = this.GetComponent <TweenPosition>();
        changeNameUI  = transform.Find("ChangeNameUI").gameObject;
        confirmButton = transform.Find("ChangeNameUI/ConfirmButton").GetComponent <UIButton>();
        cancelButton  = transform.Find("ChangeNameUI/CancelButton").GetComponent <UIButton>();
        nameInput     = transform.Find("ChangeNameUI/NameInput").GetComponent <UIInput>();
        EventDelegate ed = new EventDelegate(this, "ClosedButtonClick");

        closedButton.onClick.Add(ed);
        EventDelegate ed2 = new EventDelegate(this, "OnChangeNameButtonClick");

        changeNameButton.onClick.Add(ed2);
        EventDelegate ed3 = new EventDelegate(this, "OnConfirmButtonClick");

        confirmButton.onClick.Add(ed3);
        EventDelegate ed4 = new EventDelegate(this, "OnCancelButtonClick");

        cancelButton.onClick.Add(ed4);
        closedButton.onClick.Add(ed4);
        changeNameUI.SetActive(false);
        PlayerInfo.GetInstance.OnPlayerInfoChangedEvent += OnPlayerInfoChanged;
    }
Ejemplo n.º 55
0
    public override void OnInit()
    {
        base.OnInit();

        m_website = FindChildComponent <UIInput>("WebSiteInput");
//        m_downLoad      = FindChildComponent<UIButton>("DownLoad");
//        m_enter         = FindChildComponent<UIButton>("Enter");
//        m_offLineEnter  = FindChildComponent<UIButton>("OfflineEnter");
        m_ip          = FindChildComponent <UIInput>("IPInput");
        m_onlineEnter = FindChildComponent <UIButton>("EnterOnLine");

        m_website.defaultText = "请输入下载地址网址";

        if (PlayerPrefs.HasKey("DownloadWebSite"))
        {
            m_website.value = PlayerPrefs.GetString("DownloadWebSite");
        }
        else
        {
            m_website.value = "http://115.28.220.134:8083/xproject/Publish/";
        }

        if (PlayerPrefs.HasKey("OnLineIP"))
        {
            m_ip.value = PlayerPrefs.GetString("OnLineIP");
        }
        else
        {
            m_ip.value = "192.168.11.143";
        }

        bool bSingle = GameSettings.Singleton.m_isSingle;


        //m_ip.gameObject.SetActive(!bSingle);

        //m_onlineEnter.gameObject.SetActive(!bSingle);

        m_popupListSelect = FindChild("Popup List").GetComponent <UIPopupList>();

        EventDelegate.Add(m_popupListSelect.onChange, OnPopupListChanged);
    }
Ejemplo n.º 56
0
    public override void OnInit()
    {
        base.OnInit();
        AddPropChangedNotify((int)MVCPropertyID.enGameSeting, OnPropertyChanged);

        m_gridList          = new Dictionary <int, UIDragScrollView>();
        m_soundSlider       = FindChildComponent <UISlider>("SoundSlider");
        m_soundEffectSlider = FindChildComponent <UISlider>("SoundEffectSlider");
        m_doubleClickSlider = FindChildComponent <UISlider>("DoubleClickSlider");
        m_settingPanel      = FindChildComponent <UIPanel>("SettingPanel");
        m_illustratedPanel  = FindChildComponent <UIPanel>("IllustratedPanel");
        m_soundIcon         = FindChildComponent <UISprite>("SoundIcon");
        m_girdPanel         = FindChildComponent <UIGrid>("ImageGridList");
        m_item          = FindChildComponent <UIDragScrollView>("ImageGird");
        m_sortCardPanel = FindChildComponent <UIPanel>("SortCardPanel");
        m_occToggles    = FindChildComponent <UITable>("Occupation").gameObject;
        m_raceToggles   = FindChildComponent <UITable>("Race").gameObject;

        m_OKButton = FindChildComponent <UIButton>("OK").gameObject;

        m_selectedPanel   = FindChild("SelectedPanel");
        m_selectedContion = FindChild("SelectedCondition", m_selectedPanel);
        m_cancelSelect    = FindChild("cancel", m_selectedPanel);
        m_backgroundGrid  = FindChild("Grid", m_selectedPanel);
        m_bg = FindChild("bg", m_selectedPanel);


        m_changeNamePanel = FindChildComponent <UIPanel>("ChangeNamePanel");
        m_userName        = FindChildComponent <UIInput>("ChangeNameInput");
        m_okChangeButton  = FindChildComponent <UIButton>("OKChangeNameButton");


        WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enUnlockHeadImgIconId);
        IconInfomation iconInfo  = GameTable.IconInfoTableAsset.Lookup(worldInfo.IntTypeValue);

        m_unopen = PoolManager.Singleton.LoadIcon <Texture2D>(iconInfo.dirName);
        InitIllustratedList();
        UpdateIllustratedPanel();
        RefreshOccAndRace();
        RefreshSelectedCondition();
        InitPanelSetting();
    }
Ejemplo n.º 57
0
        static int _m_LoadValue(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UIInput __cl_gen_to_be_invoked = (UIInput)translator.FastGetCSObj(L, 1);


            try {
                {
                    __cl_gen_to_be_invoked.LoadValue(  );



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Ejemplo n.º 58
0
        private IUIControl CreateRangeSliderControl()
        {
            UIInput input = new UIInput();

            input.AddInput("id", "testRangeSliderControl");
            input.AddInput("Description", "Range slider control");
            input.AddInput("allowTextBox", true);
            input.AddInput("min", 500);
            input.AddInput("max", 900);
            input.AddInput("Value", new Dictionary <string, float> {
                { "min", 546 }, { "max", 823 }
            });
            input.AddInput("sliderType", "int");
            input.AddInput("adjustMinMax", false);
            input.AddInput("showAbsolute", false);
            IUIControl panel = this.UnityContainer.Resolve <IUIControl>("RangeSlider");

            panel.SetInput(input);
            return(panel);
        }
Ejemplo n.º 59
0
 protected override void OnAwakeInitUI()
 {
     if (mUIMainModel == null)
     {
         mUIMainModel = UIModelMgr.Instance.GetModel <UIMainModel>();
     }
     mUIInput             = CacheTrans.FindComponent <UIInput>("Root/ContainerBottom/Input");
     mLabel               = CacheTrans.FindComponent <UILabel>("Root/ContainerBottom/LoginGroup/CheckAgreement/Label");
     mAppVersion          = CacheTrans.FindComponent <UILabel>("Root/ContainerBottom/AppVersion");
     mSwitchAccount       = CacheTrans.FindComponent <UIToggle>("Root/ContainerBottom/LoginGroup/SwitchAccount");
     mCheckAgreement      = CacheTrans.FindComponent <UIToggle>("Root/ContainerBottom/LoginGroup/CheckAgreement");
     mLoginGroup          = CacheTrans.FindComponent <Transform>("Root/ContainerBottom/LoginGroup");
     mAgreementGroup      = CacheTrans.FindComponent <Transform>("Root/ContainerCenter/AgreementGroup");
     mOperationEffectItem = CacheTrans.FindComponent <OperationEffectItem>("Root/Sprite");
     CacheTrans.GetUIEventListener <UIButton>("Root/ContainerBottom/LoginGroup/BtnLogin").onClick       += LoginClick;
     CacheTrans.GetUIEventListener <UIButton>("Root/ContainerCenter/AgreementGroup/BtnCanel").onClick   += AgreementButtonClick;
     CacheTrans.GetUIEventListener <UIButton>("Root/ContainerCenter/AgreementGroup/BtnConfirm").onClick += AgreementButtonClick;
     ApplicationMgr.Instance.ShareSDK.authHandler     += OnAuthResultHandler;
     ApplicationMgr.Instance.ShareSDK.showUserHandler += OnGetUserInfoResultHandler;
 }
Ejemplo n.º 60
0
    public static int Validate(IntPtr l)
    {
        int result;

        try
        {
            UIInput uIInput = (UIInput)LuaObject.checkSelf(l);
            string  val;
            LuaObject.checkType(l, 2, out val);
            string s = uIInput.Validate(val);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, s);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }