private void GetUICompoent() { panelupUI = Ui.GetChild("panelup").asCom; valueMonitorPool.Clear(); panelup = Ui.GetChild("panelup").asCom; panelup.visible = false; progressBar_hp = Ui.GetChildWithPath("panelup/hpbar").asProgress; progressBar_mp = Ui.GetChildWithPath("panelup/mpbar").asProgress; progressBar_tili = Ui.GetChildWithPath("panelup/physicalbar").asProgress; damage = panelup.GetChild("damage").asTextField; defenses = panelup.GetChild("defenses").asTextField; MovingSpeed = panelup.GetChild("Moving speed").asTextField; MagicDamage = panelup.GetChild("Magic damage").asTextField; showLoader = panelup.GetChild("n76").asLoader; RenderTexture renderTexture = Resources.Load <RenderTexture>("roleinfotexture"); showLoader.texture = new NTexture(renderTexture); Crit = panelup.GetChild("crit").asTextField; CriticalDamage = panelup.GetChild("Critical damage").asTextField; choiceframe = panelup.GetChild("choiceframe").asImage; leveltext = panelup.GetChild("n78").asTextField; player1Controller = GameObject.Find("Player1").GetComponent <RoleController>(); panelDownUI = UIManager.Instance.GetUI <PanelDownUI>("paneldown"); }
public override void Init() { base.Init(); this.Create(Config.COM_GOLDCOINEXP, true); this.width = GRoot.inst.width; userModel = ModelManager.inst.userModel; exp = this.GetChild("n54").asProgress; gold = this.GetChild("n2").asCom; coin = this.GetChild("n1").asCom; name = this.GetChild("n3").asTextField; lv = this.GetChild("n12").asCom.GetChild("n2").asTextField; head = this.GetChild("n12").asCom.GetChild("n0").asButton; head.touchable = false; // bar = view.GetChild ("n54") as ComProgressBar; // exp.skin = ComProgressBar.BAR8; exp.GetChild("bar").asCom.GetChild("n0").asLoader.url = Tools.GetResourceUrl("Image2:n_icon_shengji2"); exp.value = userModel.exp; exp.max = userModel.GetExpMax(userModel.lv); name.text = userModel.uname; lv.text = userModel.lv.ToString(); Tools.SetLoaderButtonUrl(head, ModelUser.GetHeadUrl(userModel.head ["use"].ToString())); TimerManager.inst.Add(1f, 0, Over); this.AddGlobalListener(MainEvent.JUMP_COINGOLDEXPGET, Onfunction); }
public void Awake(GObject go) { if (go == null) { return; } GObject = go; if (string.IsNullOrWhiteSpace(Name)) { Name = Id.ToString(); } self = (GProgressBar)go; self.Add(this); var com = go.asCom; if (com != null) { bg = (GImage)com.GetChild("bg"); bar = (GImage)com.GetChild("bar"); } }
void xuetiao() { valueMonitorPool.Clear(); console = this.GetComponent <UIPanel>().ui; //roleController =parent.GetComponentInParent<RoleController>(); roleController = parent.GetComponent <RoleController>(); GProgressBar progressBar_hp = console.asProgress;//GetChild("ProgressBar_HP").asProgress; { valueMonitorPool.AddMonitor((System.Func <float>)(() => { return((float)roleController.RoleData.FinalHpMax); }), (System.Action <float, float>)((float from, float to) => { progressBar_hp.max = roleController.RoleData.FinalHpMax; })); valueMonitorPool.AddMonitor((System.Func <float>)(() => { return((float)roleController.RoleData.Hp); }), (System.Action <float, float>)((float from, float to) => { progressBar_hp.value = roleController.RoleData.Hp; })); } }
IEnumerator DoLoad(string sceneName) { GRoot.inst.AddChild(_cutSceneView); GProgressBar pb = _cutSceneView.GetChild("pb").asProgress; pb.value = 0; #if UNITY_5_3_OR_NEWER AsyncOperation op = SceneManager.LoadSceneAsync(sceneName); #else AsyncOperation op = Application.LoadLevelAsync(sceneName); #endif float startTime = Time.time; while (!op.isDone || pb.value != 100) { int value = (int)((Time.time - startTime) * 100f / 3f); if (value > 100) { value = 100; } pb.value = value; yield return(null); } GRoot.inst.RemoveChild(_cutSceneView); GRoot.inst.AddChild(_mainView); }
public void Awake(GObject go) { if (go == null) { return; } GObject = go; if (string.IsNullOrWhiteSpace(Name)) { Name = Id.ToString(); } self = (GComponent)go; self.Add(this); var com = go.asCom; if (com != null) { updateTxt = (GTextField)com.GetChildAt(1); updateProgress = (GProgressBar)com.GetChildAt(2); } }
protected override void InternalOnInit() { this.contentPane = UIPackage.CreateObject("global", "Connecting").asCom; this.modalType = ModalType.Modal; this._bar = this.contentPane["n3"].asProgress; }
private void _InitComponent() { if (m_loginWindow == null) { m_loginWindow = new Window(); UIPackage.AddPackage("UI/ARShooter"); m_loginWindow.contentPane = UIPackage.CreateObject("ARShooter", "Main").asCom; if (m_loginWindow.contentPane != null) { m_loginWindow.contentPane.height = GRoot.inst.height; m_loginWindow.contentPane.width = GRoot.inst.width; // m_loginWindow.Center(); // //userid // //button // //controller m_progressBar = m_loginWindow.contentPane.GetChild("n9").asProgress; // //servertext // //choosenserverbtn // //appnumtext // //resnumtext } } m_loginWindow.Show(); m_loginWindow.sortingOrder = int.MaxValue; }
//private TurnControl TurnControl.instance; //private EnemyStatus enemy; //private void Awake() //{ // hero = GameObject.Find("hero").GetComponent<HeroStatus>(); // enemy = GameObject.Find("enemy").GetComponent<EnemyStatus>(); //} void Start() { //hero = GameObject.Find("hero").GetComponent<HeroStatus>(); //enemy = GameObject.Find("enemy(Clone)").GetComponent<EnemyStatus>(); //PlayerControl.instance = GameObject.FindGameObjectWithTag("HeroUnit").GetComponent<PlayerControl>(); //EnemyControl.instance = GameObject.FindGameObjectWithTag("EnemyUnit").GetComponent<EnemyControl>(); Application.targetFrameRate = 60; //Stage.inst.onKeyDown.Add(OnKeyDown); //Transform npc1 = GameObject.Find("hero").transform; //Transform npc2 = GameObject.Find("enemy(Clone)").transform; panel1 = this.GetComponent <UIPanel>().ui; GProgressBar pb1 = panel1.GetChild("hero_headbar").asProgress; GProgressBar pb2 = panel1.GetChild("enemy_headbar").asProgress; //Debug.Log(pb1); pb1.max = HeroStatus.instance.SumStatus.HP; pb1.value = HeroStatus.instance.CurStatus.CurHP; pb2.max = EnemyStatus.instance.SumStatus.HP; pb2.value = EnemyStatus.instance.CurStatus.CurHP; }
private void InitView() { GRoot.inst.SetContentScaleFactor(1920, 1080); #if UNITY_EDITOR UIPackage.AddPackage("Load/HotFixLoading/HotFixLoading"); #endif GComponent view = UIPackage.CreateObject(_packageName, _pageName).asCom; GRoot.inst.AddChild(view); view.MakeFullScreen(); _view = view; _frame = _view.GetChild("frame").asCom; _frame.visible = false; _apkDes = _frame.GetChild("context").asCom.GetChild("text").asTextField; _confirmBtn = _frame.GetChild("confirmBtn").asButton; _loadingAni = _frame.GetTransition("loadingAni"); _progress = _view.GetChild("loading").asProgress; _progress.value = 0; _loading = _view.GetChild("loadingSpine").asGraph; Object obj = Resources.Load("Load/Prefab/LoadSpine"); GameObject spineItem = Instantiate(obj) as GameObject; float scaleX = GRoot.inst.width / DESIGN_WIDTH; float scaleY = GRoot.inst.height / DESIGN_HEIGHT; spineItem.transform.localScale = new Vector3(scaleX, scaleY, 1); GoWrapper wrapper = new GoWrapper(spineItem); SkeletonAnimation spine = spineItem.gameObject.GetComponent <SkeletonAnimation>(); spine.state.SetAnimation(0, "H5_loading", true); _loading.SetNativeObject(wrapper); _text = _view.GetChild("textInfo").asTextField; _text.text = "正在检测版本更新..."; _confirmBtn.onClick.Add(onClick); }
private void HandleEntityAttrChanged(BaseEvent e) { UIEvent uiEvent = ( UIEvent )e; VEntity target = uiEvent.entity; Attr attr = uiEvent.attr; object oldValue = uiEvent.o0; object newValue = uiEvent.o1; if (target == VPlayer.instance) { switch (attr) { case Attr.Gold: this._root["gold"].asCom["text_gold"].asTextField.text = string.Empty + ( int )newValue; break; case Attr.Exp: GProgressBar expBar = this._root["exp_bar"].asProgress; expBar.value = ( int )newValue; expBar.maxValue = VPlayer.instance.upgradeExpNeeded; break; } this._skillPanel.OnEntityAttrChanged(target, attr, oldValue, newValue); this._statesPanel.OnEntityAttrChanged(target, attr, oldValue, newValue); } this._hudManager.OnEntityAttrChanged(target, attr, oldValue, newValue); }
public override void ConstructFromXML() { this.Owner = "FUI.Login"; m_Text_ParDesc = (GTextField)this.GetChild("Text_ParDesc"); m_LoginPBar = (GProgressBar)this.GetChild("LoginPBar"); }
protected override void OnStart() { base.OnStart(); _progressBar = _mainView.GetChild("pb").asProgress; StartCoroutine(DoLoad("battle")); }
// 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); }
public override void ConstructFromXML(XML xml) { base.ConstructFromXML(xml); gTextField = this.GetChild("updateTxt") as GTextField; gProgress = this.GetChild("updateProgress") as GProgressBar; gProgress.visible = false; }
public override void ConstructFromXML(XML xml) { base.ConstructFromXML(xml); m_BarHp = (GProgressBar)this.GetChildAt(0); m_Body = (GGraph)this.GetChildAt(1); m_HurtStart = (GComponent)this.GetChildAt(2); }
public void HpChange(int max, int current) { GProgressBar pb = this.m_HP.GObject.asProgress; pb.max = max; pb.value = current; }
protected override void OnInit(object userData) { base.OnInit(userData); m_LoadingBar = UI.GetChild("prg_loding").asProgress; m_TipsText = UI.GetChild("tf_tips").asTextField; m_LoadInfoText = UI.GetChild("tf_loadInfo").asTextField; m_BgCtrl = UI.GetController("bgCtrl"); }
public UICharactor(GComponent gCharactor, AbstractCharactor charactor) { GHpBar = gCharactor.GetChild("HpBar").asProgress; buffList = gCharactor.GetChild("BuffList").asList; //ArmorController = GHpBar.GetController("BlockVisable"); this.charactor = charactor; Fresh(); }
protected override void OnInit(object userData) { base.OnInit(userData); m_HpBar = UI.GetChild("bar_Hp").asProgress; m_BarText = m_HpBar.GetChild("title").asTextField; m_Name = UI.GetChild("tf_Name").asTextField; }
// Use this for initialization void Start() { mainUI = GetComponent <UIPanel>().ui; progressBar = mainUI.GetChild("n1").asProgress; progressBar.value = 0; //SceneManager.LoadScene("MainUI"); StartCoroutine(StartLoading()); }
public override void ConstructFromXML(FairyGUI.Utils.XML xml) { base.ConstructFromXML(xml); lv = this.GetChild("n6").asTextField; cardLv = this.GetChild("n9").asTextField; icon = this.GetChild("n3").asLoader; bg = this.GetChild("n4").asLoader; cardBg = this.GetChild("n0").asLoader; bar = this.GetChild("n7").asProgress; up = this.GetChild("n10").asImage; txt = this.GetChild("n12").asTextField; n11 = this.GetChild("n11").asLoader; proBar = bar.GetChild("bar").asCom.GetChild("n0").asLoader; // bar.offsetY = 5; EffectManager.inst.AddPrefab(Config.EFFECT_DENGJI, this.GetChild("n15").asGraph).transform.localScale *= 1.1f; EffectManager.inst.AddPrefab(Config.EFFECT_K04, this.GetChild("n17").asGraph).transform.localScale *= 1.1f; this.GetChild("n15").asGraph.visible = false; this.GetChild("n17").asGraph.visible = false; cfg = DataManager.inst.systemSimple; // GGraph ggg = this.GetChild ("n18").asCom.GetChild("n3").asGraph;//new GGraph (); //// ggg.SetSize (200, 50); //// ggg.x = 300; //// ggg.y = 5; // float mm = 125f; // float cc = 5f; // float[] rgbA = new float[]{1f,0f,0f,125f,0f,0f}; // float[] rgbB = new float[]{1f,1f,0f,125f,125f,0f}; // // Color ccs = Color.white; // Color ccs2 = Color.white; // Color[] ccc = new Color[]{ ccs, ccs, ccs2, ccs2 }; // TimerManager.inst.Add (0.06f, 0, (float x) => { // rgbA = Tools.GetRGB(mm,cc,ref rgbA); // rgbB = Tools.GetRGB(mm,cc,ref rgbB); // // ccs.r = rgbA[3]/mm; // ccs.g = rgbA[4]/mm; // ccs.b = rgbA[5]/mm; // // ccs2.r = rgbB[3]/mm; // ccs2.g = rgbB[4]/mm; // ccs2.b = rgbB[5]/mm; // ccc[0] = ccs; // ccc[1] = ccs; // ccc[2] = ccs2; // ccc[3] = ccs2; // // ggg.shape.DrawRect (0, ccc); // // }); // this.AddChild (ggg); }
public override void ConstructFromXML(XML xml) { base.ConstructFromXML(xml); t0 = (GTextField)this.GetChild("t0"); t1 = (GTextField)this.GetChild("t1"); t2 = (GTextField)this.GetChild("t2"); star = (GProgressBar)this.GetChild("star"); }
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; } } }
public override void ConstructFromXML(XML xml) { base.ConstructFromXML(xml); m_p0 = (UI_Card)this.GetChildAt(1); m_p1 = (UI_Card)this.GetChildAt(2); m_p2 = (UI_Card)this.GetChildAt(3); m_time = (GProgressBar)this.GetChildAt(5); Init(); }
void Start() { _mainView = this.GetComponent <UIPanel>().ui; if (_mainView != null) { gTextField = _mainView.GetChild("updateTxt").asTextField; gProgress = _mainView.GetChild("updateProgress").asProgress; gProgress.visible = true; } }
private void Init() { HPBar = UI.asProgress; HPText = UI.GetChild("MonsterHPText").asTextField; roleController = transform.parent.transform.GetComponent <RoleController>(); valueMonitorPool.AddMonitor(() => roleController._roleData.Hp, (f, f1) => { SetHP(roleController._roleData.Hp); }, true); }
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); }
protected override void StartFUI() { this.m_bar = this.FUIComponent.Get("n3").GObject.asProgress; this.m_bar.max = 100f; this.m_bar.value = 0f; this.Lanaguage(); }
public override void ConstructFromXML(XML xml) { base.ConstructFromXML(xml); m_ChooseHero = this.GetControllerAt(0); m_Request = this.GetControllerAt(1); m_ChangeSeatController = this.GetControllerAt(2); m_PlayerInfo0 = (UI_PlayerSimpleInfo)this.GetChildAt(1); m_PlayerInfo1 = (UI_PlayerSimpleInfo)this.GetChildAt(2); m_PlayerInfo2 = (UI_PlayerSimpleInfo)this.GetChildAt(3); m_PlayerInfo3 = (UI_PlayerSimpleInfo)this.GetChildAt(4); m_PlayerInfo4 = (UI_PlayerSimpleInfo)this.GetChildAt(5); m_PlayerInfo5 = (UI_PlayerSimpleInfo)this.GetChildAt(6); m_PlayerInfo6 = (UI_PlayerSimpleInfo)this.GetChildAt(7); m_PlayerInfo7 = (UI_PlayerSimpleInfo)this.GetChildAt(8); m_EventDeckCount = (GTextField)this.GetChildAt(13); m_ActionDeckCount = (GTextField)this.GetChildAt(17); m_MainSize = (UI_MainSize)this.GetChildAt(19); m_RoundInfo = (GTextField)this.GetChildAt(20); m_TurnInfo = (GTextField)this.GetChildAt(21); m_NowEvent = (UI_Card)this.GetChildAt(26); m_DelayAction = (GList)this.GetChildAt(27); m_ActionDropDeck = (GTextField)this.GetChildAt(29); m_EventDropDeckCount = (GTextField)this.GetChildAt(32); m_PlayerHero = (UI_Card)this.GetChildAt(34); m_GameInfo = (UI_Log)this.GetChildAt(36); m_Hand = (UI_HandCards)this.GetChildAt(37); m_SetEvent = (UI_Card)this.GetChildAt(38); m_NowTheme = (GComponent)this.GetChildAt(41); m_ThemeDeckCount = (GTextField)this.GetChildAt(46); m_ActivePlayer = (GTextField)this.GetChildAt(48); m_TimeBar = (GProgressBar)this.GetChildAt(50); m_NowAction = (UI_Card)this.GetChildAt(51); m_UseTip = (GTextField)this.GetChildAt(62); m_skills = (GList)this.GetChildAt(63); m_useCard = (GButton)this.GetChildAt(65); m_Endturn = (GButton)this.GetChildAt(66); m_freeUse = (GGroup)this.GetChildAt(67); m_choose_y = (GButton)this.GetChildAt(69); m_choose_n = (GButton)this.GetChildAt(70); m_chooseCard = (GGroup)this.GetChildAt(71); m_choiceList = (GList)this.GetChildAt(73); m_takeChoice = (GGroup)this.GetChildAt(74); m_requestList = (GList)this.GetChildAt(76); m_ChooseRequest = (GGroup)this.GetChildAt(77); m_limitUse = (GButton)this.GetChildAt(78); m_limitUseCancel = (GButton)this.GetChildAt(79); m_forward = (GButton)this.GetChildAt(81); m_backward = (GButton)this.GetChildAt(82); m_setcard = (GButton)this.GetChildAt(83); m_chooseDirection = (GGroup)this.GetChildAt(84); m_HeroChooseWindow = (UI_ChooseHero)this.GetChildAt(86); m_ChangeSeatPanel = (UI_ChangeSeat)this.GetChildAt(87); Init(); }