コード例 #1
0
    //------------------------------
    private void PlayGrid()
    {
        GComponent obj   = _demoObjects["Grid"];
        GList      list1 = obj.GetChild("list1").asList;

        list1.RemoveChildrenToPool();
        string[] testNames = System.Enum.GetNames(typeof(RuntimePlatform));
        Color[]  testColor = new Color[] { Color.yellow, Color.red, Color.white, Color.cyan };
        int      cnt       = testNames.Length;

        for (int i = 0; i < cnt; i++)
        {
            GButton item = list1.AddItemFromPool().asButton;
            item.GetChild("t0").text = "" + (i + 1);
            item.GetChild("t1").text = testNames[i];
            item.GetChild("t2").asTextField.color  = testColor[UnityEngine.Random.Range(0, 4)];
            item.GetChild("star").asProgress.value = (int)((float)UnityEngine.Random.Range(1, 4) / 3f * 100);
        }

        GList list2 = obj.GetChild("list2").asList;

        list2.RemoveChildrenToPool();
        for (int i = 0; i < cnt; i++)
        {
            GButton item = list2.AddItemFromPool().asButton;
            item.GetChild("cb").asButton.selected = false;
            item.GetChild("t1").text = testNames[i];
            item.GetChild("mc").asMovieClip.playing = i % 2 == 0;
            item.GetChild("t3").text = "" + UnityEngine.Random.Range(0, 10000);
        }
    }
コード例 #2
0
    private void PlayPopup()
    {
        if (_pm == null)
        {
            _pm = new PopupMenu();
            _pm.AddItem("Item 1", __clickMenu);
            _pm.AddItem("Item 2", __clickMenu);
            _pm.AddItem("Item 3", __clickMenu);
            _pm.AddItem("Item 4", __clickMenu);
        }

        if (_popupCom == null)
        {
            _popupCom = UIPackage.CreateObject("Basics", "Component12").asCom;
            _popupCom.Center();
        }
        GComponent obj = _demoObjects["Popup"];

        obj.GetChild("n0").onClick.Add((EventContext context) =>
        {
            _pm.Show((GObject)context.sender, true);
        });

        obj.GetChild("n1").onClick.Add(() =>
        {
            GRoot.inst.ShowPopup(_popupCom);
        });


        obj.onRightClick.Add(() =>
        {
            _pm.Show();
        });
    }
コード例 #3
0
    void Start()
    {
        Application.targetFrameRate = 60;
        Stage.inst.onKeyDown.Add(OnKeyDown);

        _mainView = this.GetComponent <UIPanel>().ui;

        _backBtn         = _mainView.GetChild("btn_Back");
        _backBtn.visible = false;
        _backBtn.onClick.Add(onClickBack);

        _demoContainer  = _mainView.GetChild("container").asCom;
        _viewController = _mainView.GetController("c1");

        _demoObjects = new Dictionary <string, GComponent>();

        int cnt = _mainView.numChildren;

        for (int i = 0; i < cnt; i++)
        {
            GObject obj = _mainView.GetChildAt(i);
            if (obj.group != null && obj.group.name == "btns")
            {
                obj.onClick.Add(runDemo);
            }
        }
    }
コード例 #4
0
    public void Stage(GComponent stage, bool draw = false)
    {
        isDraw             = draw;
        userModel          = ModelManager.inst.userModel;
        this.stage         = stage;
        this.stage.visible = false;
//		if (Convert.ToInt32 (userModel.records ["guide"]) == 2)
//			return;
        view = Tools.GetComponent(Config.COM_GUIDE).asCom;
        this.stage.AddChild(view);

        mask = view.GetChild("n0").asGraph;
        ViewManager.SetWidthHeight(mask);
        text    = view.GetChild("n3").asTextField;
        content = view.GetChild("n1").asGroup;
        btn1    = view.GetChild("n5").asButton;
        add     = new GComponent();
        view.GetChild("n2").asGraph.ReplaceMe(add);
        btn1.onClick.Add(() =>
        {
            Clear();
            DispatchManager.inst.Dispatch(new MainEvent(MainEvent.GUIDE_UPDATE_OK, null));
//			SetGuild(4);
//			this.guide11++;
//			this.guide12 = 0;
//			this.stage.visible = false;
        });
        mask.onClick.Add(Mask_Click);
        this.guide11 = 0;
        this.guide12 = 0;
        if (isDraw)
        {
            mask.visible = false;
        }
    }
コード例 #5
0
ファイル: UnityEntity.cs プロジェクト: forscn/dotanet_client
    //创建获得金币
    public void ShowGetGold(int gold)
    {
        Debug.Log("------------ShowGetGold------------");
        GComponent words = UIPackage.CreateObject("GameUI", "HurtInfo").asCom;
        WordsInfo  wd    = AddWordsInfo(words);

        wd.RandomX(-30, 30);

        //words.z = 0;
        //1,直接加到GRoot显示出来
        GRoot.inst.AddChild(words);
        GRoot.inst.SetChildIndex(words, 1);
        words.GetChild("num").asTextField.text            = "" + gold;
        words.GetChild("num").asTextField.color           = new Color(245 / 255.0f, 218 / 255.0f, 0);
        words.GetChild("num").asTextField.shadowOffset    = new Vector2(1, 1);
        words.GetChild("num").asTextField.textFormat.bold = true;
        FairyGUI.Transition trans = words.GetTransition("getgold");
        trans.Play();
        trans.SetHook("over", () => {
            RemoveWordsInfo(wd);
        });

        //音效
        AudioManager.Am.Play3DSound(AudioManager.Sound_Gold, this.Mode.transform.position);
    }
コード例 #6
0
ファイル: Main.cs プロジェクト: zhutaorun/FairyGUI-unity
    void Start()
    {
        Application.targetFrameRate = 60;
        DontDestroyOnLoad(this.gameObject);

        Stage.Instantiate(5);
        Stage.inst.AddChild(new GRoot().displayObject);
        Stage.inst.camera.clearFlags = CameraClearFlags.Depth;
        Stage.inst.onKeyDown.Add(OnKeyDown);

        GRoot.inst.SetContentScaleFactor(1136, 640);

        UIPackage.AddPackage("UI/CustomMaterialDemo");

        _mainView = UIPackage.CreateObject("Demo", "Main").asCom;
        _mainView.SetSize(GRoot.inst.width, GRoot.inst.height);
        _mainView.AddRelation(GRoot.inst, RelationType.Size);
        GRoot.inst.AddChild(_mainView);

        _btn0      = _mainView.GetChild("b0").asButton;
        _btn0.icon = "k0";
        _time1     = 5;
        _mat0      = new Material(Shader.Find("Cooldown mask"));
        _mat0.SetFloat("_Progress", 0f);
        _mat0.SetTexture("_MaskTex", (Texture)Resources.Load("CooldownMask"));
        _btn0.GetChild("icon").asLoader.material = _mat0;

        _btn1      = _mainView.GetChild("b1").asButton;
        _btn1.icon = "k1";
        _time2     = 10;
        _mat1      = new Material(Shader.Find("Cooldown mask"));
        _mat1.SetFloat("_Progress", 0f);
        _mat1.SetTexture("_MaskTex", (Texture)Resources.Load("CooldownMask"));
        _btn1.GetChild("icon").asLoader.material = _mat1;
    }
コード例 #7
0
    // Use this for initialization
    void Start()
    {
        PlayerPrefs.DeleteAll();
        UIPackage.AddPackage("FairyGUI/UIMain");
        UIObjectFactory.SetPackageItemExtension("ui://UIMain/ClickShower", typeof(ShowClickMask));
        hasSave = PlayerPrefs.GetInt("hasSave", 0);

        _main_menu = GetComponent <UIPanel> ().ui;
        _main_menu.GetController("c0").SetSelectedPage("unsave");
        if (hasSave > 0)
        {
            _main_menu.GetController("c0").SetSelectedPage("save");
        }
        _main_menu.GetChild("loadGame").onClick.Add(loadGame);
        _main_menu.GetChild("newGame").onClick.Add(newGame);
        _main_menu.GetChild("options").onClick.Add(options);
        _main_menu.GetChild("quit").onClick.Add(quit);

        //_main_menu.onClick.Add (OnClick);
        _main_menu.onClick.Add(OnClickShow);
        effect = _main_menu.GetChild("effect").asMovieClip;
//		ShowClickMask _maskLayer = (ShowClickMask)UIPackage.CreateObject ("UIMain", "ClickShower").asCom;
//		_maskLayer.SetSize(GRoot.inst.width, GRoot.inst.height);
//		_maskLayer.AddRelation(GRoot.inst, RelationType.Size);
//
//
//
//		GRoot.inst.AddChild(_maskLayer);
//		_main_menu.AddChild (mask);
//		Debug.Log (_main_menu.numChildren);
//		Debug.Log (mask.position);

        _mask = _main_menu.GetChild("mask").asGraph;


        _newHeroPanel = _main_menu.GetChild("newHeroPanel").asCom;
        _info         = _newHeroPanel.GetChild("info").asTextField;
        _desp         = _newHeroPanel.GetChild("desp").asTextField;

        _start_game = _newHeroPanel.GetChild("startGame").asLoader;
        _start_game.onClick.Add(delegate(EventContext context) {
            PlayerData.getInstance().heroIdx = choosedHeroIdx;
            enterGame();
        });

        _hero_list = _newHeroPanel.GetChild("hero_list").asList;
        _hero_list.SetVirtualAndLoop();

        _hero_list.itemRenderer = RenderHeroes;
        _hero_list.numItems     = GameStaticData.getInstance().heroes.Count;
        _hero_list.scrollPane.onScroll.Add(doHeroScrollEffect);
        _hero_list.scrollPane.onScrollEnd.Add(changeHeroDetail);
        doHeroScrollEffect();
        changeHeroDetail();
        {
            _info.text = GameStaticData.getInstance().heroes[choosedHeroIdx].name;
            _desp.text = GameStaticData.getInstance().heroes [choosedHeroIdx].desp;
        }
    }
コード例 #8
0
 // Start is called before the first frame update
 void Start()
 {
     mainUI            = GetComponent <UIPanel>().ui;
     progressBar       = mainUI.GetChild("n0").asProgress;
     comboBox          = mainUI.GetChild("n1").asComboBox;
     progressBar.value = 0;
     comboBox.onChanged.Add(SetComboBoxChange);
 }
コード例 #9
0
 public UICharactor(GComponent gCharactor, AbstractCharactor charactor)
 {
     GHpBar   = gCharactor.GetChild("HpBar").asProgress;
     buffList = gCharactor.GetChild("BuffList").asList;
     //ArmorController = GHpBar.GetController("BlockVisable");
     this.charactor = charactor;
     Fresh();
 }
コード例 #10
0
    void OnClickListItem(EventContext context)
    {
        GButton item = (GButton)context.data;

        _mainView.GetChild("txt").text = "clicked " + item.title;

        holder.SetNativeObject(null);
    }
コード例 #11
0
    private void Awake()
    {
        GRoot.inst.SetContentScaleFactor(960, 540);
        UIPackage.AddPackage(path + pkgName);
        UIPackage.AddPackage(path + numsPkg);
        UIPackage.AddPackage(path + handcardAssets);
        //UIPackage.AddPackage(path + cooldowncardAssets);
        //UIPackage.AddPackage(path + cardsetsAssets);
        //UIPackage.AddPackage(path + cardBookPicAssets);
        lastClicked = null;

        // 战斗场景UI
        _mainUI = UIPackage.CreateObject(pkgName, "battleScene").asCom;
        // 卡牌书界面
        _cardBookFrame = UIPackage.CreateObject(pkgName, "cardBookFrame").asCom;

        // 卡牌描述窗口内容
        _cardDescibeFrame = UIPackage.CreateObject(pkgName, "cardDescribeFrame").asCom;

        // 添加主界面UI到游戏场景
        GRoot.inst.AddChild(_mainUI);

        #region 卡牌书相关内容初始化
        // 初始化卡牌书窗口
        _cardBookWindow = new Window();
        // 设定卡牌书窗口内容
        _cardBookWindow.contentPane = _cardBookFrame;
        // 获取卡牌书内展示区相关变量
        _cardDisplayer = _cardBookFrame.GetChild("cardDisplayer").asCom;
        _abstractText  = _cardDisplayer.GetChild("abstractText").asTextField;
        _storyText     = _cardDisplayer.GetChild("storyText").asTextField;
        _iconLoader    = _cardDisplayer.GetChild("iconLoader").asLoader;
        _picLoader     = _cardDisplayer.GetChild("cardPicLoader").asLoader;
        // 设定卡牌书窗口居中
        _cardBookWindow.CenterOn(GRoot.inst, true);
        #endregion

        // 初始化卡牌内容描述窗口
        _cardDescribeWindow = new Window();
        // 设定卡牌内容描述窗口内容
        _cardDescribeWindow.contentPane = _cardDescibeFrame;
        _title  = _cardDescibeFrame.GetChild("title").asTextField;
        _effect = _cardDescibeFrame.GetChild("effect").asTextField;
        _value  = _cardDescibeFrame.GetChild("values").asTextField;

        // 从游戏主场景获得各按钮的引用
        _endRoundButton    = _mainUI.GetChild("endRoundButton").asButton;
        _cardSetsButton    = _mainUI.GetChild("cardSetsButton").asButton;
        _closeWindowButton = _cardBookFrame.GetChild("closeButton").asButton;

        // 从游戏场景获得各list的引用
        _cooldownList  = _mainUI.GetChild("cooldownList").asList;
        _handcardList  = _mainUI.GetChild("handcardList").asList;
        _cardsSetsList = _cardBookFrame.GetChild("cardList").asList;

        // 从游戏主场景获取AP值展示的text
        _APText = _mainUI.GetChild("APDisplayer").asCom.GetChild("APText").asTextField;
    }
コード例 #12
0
 public void Init()
 {
     ui         = gameObject.GetComponent <UIPanel>().ui;
     n1         = ui.GetChild("n1").asTextField;
     n2         = ui.GetChild("n2").asTextField;
     n3         = ui.GetChild("n3").asTextField;
     choice     = ui.GetChild("choice").asImage;
     ui.visible = false;
 }
コード例 #13
0
 public MenuView(GComponent view)
 {
     View = view;
     bg   = view.GetChild("bg").asGraph;
     menu = view.GetChild("menu").asGroup;
     bg.onClick.Add(OnBgClick);
     bg.onRightClick.Add(OnBgClick);
     calls.Clear();
 }
コード例 #14
0
        public void initUI()
        {
            UIPanel    panel = gameObject.GetComponent <UIPanel>();
            GComponent view  = panel.ui; // 整个UI的集合

            m_avatar    = new GComponent[3];
            m_avatar[0] = view.GetChild("AvatarGuard").asCom;
            m_avatar[1] = view.GetChild("AvatarTaoxi").asCom;
            m_avatar[2] = view.GetChild("AvatarComp").asCom;
            // 上面的对话框
            m_dialog      = view.GetChild("Dialog").asLabel;
            m_dialog.text = "";
            m_nextButton  = view.GetChild("NextButton").asButton;
            m_nextButton.onClick.Add(nextButton_Click);

            m_clue  = view.GetChild("Clue").asGroup;
            m_clue1 = view.GetChild("Clue1").asGroup;
            initClueList();
            GButton clueOKButton = view.GetChild("ClueOKButton").asButton;

            clueOKButton.onClick.Add(clueOKButton_Click);
            m_clueName         = view.GetChild("ClueName").asLabel;
            m_clueContent      = view.GetChild("ClueContent").asLabel;
            m_cluePoint        = view.GetChild("CluePoint").asLabel;
            m_clueContent      = m_clueContent.GetChild("Label").asLabel;
            m_clueContent.text = "";
            GComponent clueCloseButton = view.GetChild("ClueCloseButton").asCom;

            clueCloseButton.onClick.Add(clueCloseButton_Click);

            m_entrance = view.GetChild("Entrance").asGroup;

            m_console = view.GetChild("Console").asGroup;
            GButton collectionButton = view.GetChild("CollectButton").asButton;

            collectionButton.onClick.Add(collectionButton_Click);
            GButton driveButton = view.GetChild("DriveButton").asButton;

            driveButton.onClick.Add(driveButton_Click);

            GComponent wallpaper = view.GetChild("Wallpaper").asCom;
            GComponent map       = wallpaper.GetChild("Map").asCom;

            map.onClick.Add(map_Click);
            GComponent brain = wallpaper.GetChild("Brain").asCom;

            brain.onClick.Add(brain_Click);
            GComponent ball = wallpaper.GetChild("Ball").asCom;

            ball.onClick.Add(ball_Click);
            GComponent desk = wallpaper.GetChild("Desk").asCom;

            desk.onClick.Add(desk_Click);
            GComponent comp = wallpaper.GetChild("Comp").asCom;

            comp.onClick.Add(comp_Click);
        }
コード例 #15
0
    // Use this for initialization
    void Start()
    {
        _mainView = this.GetComponent <UIPanel>().ui;

        //_list = _mainView.GetChild("list").asList;
        //_list.itemRenderer = RenderListItem;
        //_list.SetVirtual();
        //_list.numItems = 1000;
        //_list.onTouchBegin.Add(OnClickList);
        //_list.onClickItem.Add(OnClickListItem);

        //_mainView.GetChild("box").asCom.onDrop.Add(OnDrop);


        //LongPressGesture gesture = new LongPressGesture(_list);
        //gesture.once = true;
        //gesture.trigger = 1f;
        //gesture.onAction.Add(OnLongPress);

        //holder = _mainView.GetChild("holder").asGraph;
        //prefab = Resources.Load("Particles/Fire/Flame");

        //go = (GameObject)Object.Instantiate(prefab);
        //holder.SetNativeObject(new GoWrapper(go));


        BlurFilter blurFilter = new BlurFilter();

        blurFilter.blurSize = 15;
        _mainView.GetChild("toumingimg").filter = blurFilter;

        Debug.Log("-------------------------------");

        Debug.Log(blurFilter.target);

        BlurFilter blurFilter1 = new BlurFilter();

        blurFilter1.blurSize = 2;
        _mainView.GetChild("logo").filter = blurFilter1;

        Debug.Log(blurFilter1.target);

        BlurFilter blurFilter2 = new BlurFilter();

        blurFilter2.blurSize = 20;
        _mainView.GetChild("graph").filter = blurFilter2;

        Debug.Log(blurFilter2.target);


        BlurFilter blurFilter3 = new BlurFilter();

        blurFilter3.blurSize = 20;
        _mainView.GetChild("kongbai").filter = blurFilter3;

        Debug.Log(blurFilter3.target);
    }
コード例 #16
0
    public void ShowChatBottom(string text, bool isShowBtNext, DownLineCompleteCallback callback)
    {
        initChatBottom();
        _te.SetUp(text, _chatBottom.GetChild("next"), _chatBottom, callback, isShowBtNext);
        float posFrameLeft = (int)((_popUp.width - _chatBottom.width) / 2);
        float posFrameBot  = _popUp.height - _chatBottom.height - 10;

        _chatBottom.SetXY(posFrameLeft, posFrameBot);
    }
コード例 #17
0
 //静态加载页面
 // Use this for initialization
 void Start()
 {
     UIPanel panel = this.GetComponent<UIPanel>();
     GComponent gComponent = panel.ui;
     UI_TestCom2 uI_TestCom2 = gComponent as UI_TestCom2;
     Debug.LogError(uI_TestCom2==null);
     gComponent.GetChild("n1").onClick.Add(() => { Debug.LogError("点击了第一个按钮"); });
     gComponent.GetChild("n2").onClick.Add(() => { Debug.LogError("点击了第二个按钮"); });
 }
コード例 #18
0
 // Use this for initialization
 void Start()
 {
     mainUI   = GetComponent <UIPanel>().ui;
     abundant = mainUI.GetChild("abundant").asButton;
     rare     = mainUI.GetChild("rare").asButton;
     q1       = mainUI.GetChild("Q1").asImage;
     abundant.onClick.Add(Abundant);
     rare.onClick.Add(Rare);
 }
コード例 #19
0
 void Start()
 {
     mainUI    = GetComponent <UIPanel>().ui;
     effectwin = new effectWindow();
     effectwin.SetXY(Screen.width / 2 - 500, Screen.height / 4);
     mainUI.GetChild("backbt").onClick.Add(() => { SceneManager.LoadScene("select"); });
     mainUI.GetChild("effectbt").onClick.Add(() => { effectwin.Show(); });
     mainUI.GetChild("recordbt").onClick.Add(() => { GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CaptureFromCamera>().enabled = true; });
 }
コード例 #20
0
ファイル: Init.cs プロジェクト: ItemZheng/NetEaseMG
 // Use this for initialization
 void Start()
 {
     mainUI   = GetComponent <UIPanel>().ui;
     aboutwin = new aboutWindow();
     aboutwin.SetXY(0, Screen.height / 5);
     mainUI.GetChild("startbt").onClick.Add(() => { SceneManager.LoadScene(1); });
     mainUI.GetChild("aboutbt").onClick.Add(() => { aboutwin.Show(); });
     mainUI.GetChild("quitbt").onClick.Add(() => { Application.Quit(); });
 }
コード例 #21
0
ファイル: Bag.cs プロジェクト: dada0101/FairyGUI
    private BagWindow2 bagWindow;                                                   //背包窗口

    // Start is called before the first frame update
    void Start()
    {
        mainUI       = GetComponent <UIPanel>().ui;
        playerViewer = mainUI.GetChild("playerView").asButton;
        playerViewer.onClick.Add(UseItem);                                          //为物品显示按钮添加监听事件
        bagWindow = new BagWindow2(playerViewer);
        bagWindow.SetXY(121, 63);
        mainUI.GetChild("bagButton").onClick.Add(() => { bagWindow.Show(); });      //为背包按钮添加监听事件,使背包窗口显示出来
    }
コード例 #22
0
 // Use this for initialization
 void Start()
 {
     mainUI     = GetComponent <UIPanel>().ui;
     playerView = mainUI.GetChild("playerView").asButton;
     playerView.onClick.Add(UseItem);
     bagWindow = new BagWindow(playerView);
     bagWindow.SetXY(121, 63);
     mainUI.GetChild("BagButton").onClick.Add(() => { bagWindow.Show(); });
 }
コード例 #23
0
        public void Init()
        {
            inited = true;

            valueMonitorPool.Clear();

            // player1
            {
                // 血条 and 蓝条 add by TangJian 2017/11/14 22:35:21
                {
                    progressBar_hp   = Ui.GetChildWithPath("Player1_State/ProgressBar_HP").asProgress;
                    progressBar_mp   = Ui.GetChildWithPath("Player1_State/ProgressBar_MP").asProgress;
                    progressBar_tili = Ui.GetChildWithPath("Player1_State/ProgressBar_TiLi").asProgress;
                }

                //金钱数量和魂数量
                {
                    GComponent MoneyData = Ui.GetChild("MoneyData").asCom;
                    GLoader    momeyimg  = MoneyData.GetChild("moneyimg").asLoader;
                    GLoader    soulimg   = MoneyData.GetChild("Soulimg").asLoader;
                    money = MoneyData.GetChild("money").asTextField;
                    soul  = MoneyData.GetChild("Soul").asTextField;
                }

                // 魂 add by TangJian 2017/11/14 22:35:33
                {
                    image_soul = Ui.GetChild("Player1_Soul").asImage;
                }

                //消耗品循环列表add by tianjinpeng 2018/02/05 16:12:58
                {
                    _mainView = Ui.GetChild("scrollpane").asCom;
                    _list     = _mainView.GetChild("list").asList;
                }

                {
                    functionlist = Ui.GetChild("functionlist").asCom;
                    GComponent roleinfobc = functionlist.GetChild("n1").asCom;
                    GComponent mapbut     = functionlist.GetChild("n2").asCom;
                    roleinfobc.onClick.Add(() => { GameManager.Instance.RoleinfoButton(); });
                }
                {
                    comboComponent         = Ui.GetChild("comboShu").asCom;
                    comboNumber            = comboComponent.GetChild("n0").asTextField;
                    comboComponent.visible = false;
                }

                {
                    GComponent listtips = Ui.GetChild("n27").asCom;
                    listtips.container.gameObject.layer = LayerMask.NameToLayer("UI");
                    GList slist = listtips.GetChild("n7").asList;
                    slist.container.gameObject.layer = LayerMask.NameToLayer("UI");
                    tipsDatalist.gList = slist;
                }
            }
        }
コード例 #24
0
    //private void InitAge()
    //{

    //    for (int i = 1; i <= 100; i++)
    //    {
    //        list_age.Add(i + "");
    //    }

    //    list_age = new List<string>();
    //    for (int i = 1; i <= 100; i++)
    //    {
    //        list_age.Add(i + "");
    //    }
    //    comboxAge.items = list_age.ToArray();
    //    if (userModel.age != 1)
    //    {
    //        comboxAge.text = userModel.age.ToString();
    //    }
    //    age = comboxAge.text;
    //    ageTemp = comboxAge.text;
    //    comboxAge.onChanged.Add(() =>
    //    {
    //        ageTemp = comboxAge.text;
    //    });
    //}

    private void InitSex(int type)
    {
        if (type == 1)
        {
            to_man      = child2.GetChild("n5").asButton;
            to_man.text = Tools.GetMessageById("13070");
            to_man.changeStateOnClick = true;
            to_wman      = child2.GetChild("n44").asButton;
            to_wman.text = Tools.GetMessageById("13071");
            to_wman.changeStateOnClick = true;
        }
        else
        {
            to_man      = child1.GetChild("n15").asButton;
            to_man.text = Tools.GetMessageById("13070");
            to_man.changeStateOnClick = true;
            to_wman      = child1.GetChild("n56").asButton;
            to_wman.text = Tools.GetMessageById("13071");
            to_wman.changeStateOnClick = true;
        }

        sex              = userModel.sex;
        to_man.selected  = (userModel.GetSex == 0);
        to_wman.selected = (userModel.GetSex == 1);
        sexTemp          = userModel.sex;

        //        if (Tools.IsNullEmpty(userModel.sex))
        //        {
        //            sexTemp = "m";
        //            sex = "";
        //            //comboxSex.text = listSex[1];
        //            to_man.selected = true;
        //            to_wman.selected = false;
        //        }
        //        else
        //        {
        //            sex = userModel.sex.ToString();
        //            if (userModel.sex.ToString().Equals("f"))
        //            {
        //                //comboxSex.text = listSex[0];
        //
        //                to_man.selected = true;
        //                to_wman.selected = false;
        //                sexTemp = "f";
        //                sex = "f";
        //            }
        //            if (userModel.sex.ToString().Equals("m"))
        //            {
        //                to_wman.selected = true;
        //                to_man.selected = false;
        //                sex = "m";
        //            }
        //        }
        to_man.onChanged.Add(OnManChanged);
        to_wman.onChanged.Add(OnWmanChanged);
    }
コード例 #25
0
    //MsgManager.Instance.AddListener("SC_NeedLineUp", new HandleMsg(this.SC_NeedLineUp));
    //    MsgManager.Instance.AddListener("SC_GetLineUpFrontCount", new HandleMsg(this.SC_GetLineUpFrontCount));
    public bool SC_NeedLineUp(Protomsg.MsgBase d1)
    {
        Google.Protobuf.IMessage IMperson = new Protomsg.SC_NeedLineUp();
        Protomsg.SC_NeedLineUp   p1       = (Protomsg.SC_NeedLineUp)IMperson.Descriptor.Parser.ParseFrom(d1.Datas);

        mLineUp.visible = true;
        mLineUp.GetChild("playercount").asTextField.text = p1.FrontCount + "";

        return(true);
    }
コード例 #26
0
 void Start()
 {
     _mainView = this.GetComponent <UIPanel>().ui;
     if (_mainView != null)
     {
         gTextField        = _mainView.GetChild("updateTxt").asTextField;
         gProgress         = _mainView.GetChild("updateProgress").asProgress;
         gProgress.visible = true;
     }
 }
コード例 #27
0
ファイル: CardManager.cs プロジェクト: flyarong/qipai_client
 private void Awake()
 {
     ui   = GetComponent <UIPanel>().ui;
     tPut = ui.GetTransition("t1");
     ui.GetChild("cardImg").sortingOrder = 1000;
     for (var i = 1; i < 11; i++)
     {
         cardPlaces.Add(ui.GetChild("card" + i).asCom);
     }
 }
コード例 #28
0
    private void P7()
    {
        rare2 = mainUI.GetChild("rare2").asButton;
        rare2.onClick.Add(() => P7Fade());
        abundant2 = mainUI.GetChild("abundant2").asButton;
        abundant2.onClick.Add(() => P7Fade());
        Transition p7 = mainUI.GetTransition("P7");

        p7.Play();
    }
コード例 #29
0
    private GComboBox comboBox;                                 //可选下拉框

    // Start is called before the first frame update
    void Start()
    {
        mainUI      = GetComponent <UIPanel>().ui;
        progressBar = mainUI.GetChild("n0").asProgress;
        //设置进度条在5s内到达100
        progressBar.TweenValue(100, 5);
        comboBox = mainUI.GetChild("n7").asComboBox;
        //设置可选下拉框的改变的监听事件
        comboBox.onChanged.Add(SetCompleteTime);
    }
コード例 #30
0
    void Start()
    {
        mainUI     = GetComponent <UIPanel>().ui;
        quitwindow = new quitWindow();
        quitwindow.SetXY(Screen.width / 2 - 305, Screen.height / 3);

        mainUI.GetChild("startbt").onClick.Add(() => { SceneManager.LoadScene("select"); });
        mainUI.GetChild("quitbt").onClick.Add(() => { quitwindow.Show(); });
        mainUI.GetChild("aboutbt").onClick.Add(() => { SceneManager.LoadScene("about"); });
    }