public void init() { ///这个要替换其他的btn。 bool visible = Utils.equal(DataManager.inst.systemSimple, "testBtn", 1); this.voiceBtn.gameObject.SetActive(visible); ClientRunTime clientRunTime = FightMain.instance.selection; clientRunTime.registerClientView(this); this.rank.init(Tools.FindChild2("topRightLayer/scoreRankLayer", this.gameObject)); //TODO:断网重连 这个不知道会不会有问题。 可能有坑。 先留着。 this.initCards(); GameObject scoreGame = Tools.FindChild2("topRightLayer/teamBallsLayer", this.gameObject); if (clientRunTime.mapData.isTeam) { this.scoreView = scoreGame.GetComponent <RadishScoreView>(); if (null == this.scoreView) { this.scoreView = scoreGame.AddComponent <RadishScoreView>(); } scoreView.init(clientRunTime); scoreGame.SetActive(true); } else { scoreGame.SetActive(false); } clientRunTime.addListener(EventConstant.END, (e) => { GameObject finish = ResFactory.createObject <GameObject>(ResFactory.getOther("finish")); finish.transform.SetParent(this.transform, false); TimerManager.inst.Add(2, 1, (t) => { Destroy(finish); }); }); this.videoChange(); clientRunTime.addListener(EventConstant.LOGIC_COMPLETE, (e) => { if (null != clientRunTime.localPlayer.reviveAction) { this.playerReliveText.enabled = true; //TODO:改成语言配置 string str = string.Format("复活中...{0:F1}", clientRunTime.localPlayer.reviveAction.time / 1000f); this.playerReliveText.text = str; } else { this.playerReliveText.enabled = false; } }); }
protected virtual TeamBall createBall() { return(ResFactory.createObject <GameObject>(ResFactory.getOther("teamBall")).GetComponent <TeamBall>()); }