//窗口控件初始化 protected override void InitWidget() { RecordToggle = mRoot.Find("BattleBtn").GetComponent <UIToggle>(); AttributeToggle = mRoot.Find("StatusBtn").GetComponent <UIToggle>(); SystemSetToggle = mRoot.Find("SettingBtn").GetComponent <UIToggle>(); BattleState = BattleCurrInfo.BattleRecord; Transform temp = mRoot.Find("BattleInfo/Team/BlueTeam"); int index = temp.childCount; for (int i = 0; i < index; i++) { AllBlueTeam.Add(new BattleRealInfo(temp.Find("Player" + (i + 1)))); } temp = mRoot.Find("BattleInfo/Team/RedTeam"); index = temp.childCount; for (int i = 0; i < index; i++) { AllRedTeam.Add(new BattleRealInfo(temp.Find("Player" + (i + 1)))); } PlayerSpeed = mRoot.Find("StatusInfo/Speed/Num").GetComponent <UILabel>(); AttackInterval = mRoot.Find("StatusInfo/AtkInterval/Num").GetComponent <UILabel>(); AttackRange = mRoot.Find("StatusInfo/AtkRange/Num").GetComponent <UILabel>(); ResurgenceTime = mRoot.Find("StatusInfo/ResuTime/Num").GetComponent <UILabel>(); PhysicAttack = mRoot.Find("StatusInfo/PhysicAtk/Num").GetComponent <UILabel>(); SpellsAttack = mRoot.Find("StatusInfo/SpellsAtk/Num").GetComponent <UILabel>(); PhysicDef = mRoot.Find("StatusInfo/PhysicDef/Num").GetComponent <UILabel>(); SpellsDef = mRoot.Find("StatusInfo/SpellsDef/Num").GetComponent <UILabel>(); CloseBtn = mRoot.Find("CloseBtn").gameObject; tran = mRoot.Find("SettingInfo"); PlayerSpeed.text = ""; AttackInterval.text = ""; AttackRange.text = ""; ResurgenceTime.text = ""; PhysicAttack.text = ""; SpellsAttack.text = ""; PhysicDef.text = ""; SpellsDef.text = ""; SoundBtn = tran.Find("SoundSwitch").gameObject; MusicBtn = tran.Find("MusicSwitch").gameObject; EffectBtn = tran.Find("EffectSwitch").gameObject; RangeBtn = tran.Find("RangeSwitch").gameObject; objOn[0] = SoundBtn.transform.Find("On").gameObject; ojbOff[0] = SoundBtn.transform.Find("Off").gameObject; objOn[1] = MusicBtn.transform.Find("On").gameObject; ojbOff[1] = MusicBtn.transform.Find("Off").gameObject; objOn[2] = EffectBtn.transform.Find("On").gameObject; ojbOff[2] = EffectBtn.transform.Find("Off").gameObject; objOn[3] = RangeBtn.transform.Find("On").gameObject; ojbOff[3] = RangeBtn.transform.Find("Off").gameObject; UIEventListener.Get(CloseBtn).onClick += ClosePress; UIEventListener.Get(SoundBtn).onClick += SoundPress; UIEventListener.Get(MusicBtn).onClick += MusicPress; UIEventListener.Get(EffectBtn).onClick += EffectPress; UIEventListener.Get(RangeBtn).onClick += RangePress; EventDelegate.Add(RecordToggle.onChange, ShowRecordAttrSet); EventDelegate.Add(AttributeToggle.onChange, ShowRecordAttrSet); EventDelegate.Add(SystemSetToggle.onChange, ShowRecordAttrSet); SetSave(ref SoundOpenState, UIGameSetting.soundKey, SystemSet.SoundButton); SetSave(ref MusicOpenState, UIGameSetting.voiceKey, SystemSet.MusicButton); SetSave(ref EffectOpenState, GameMethod.EffectVoc, SystemSet.EffectButton); SetSave(ref RangeOpenState, GameMethod.RangeVoc, SystemSet.RangeButton); }
//隐藏 public override void OnDisable() { AllBlueTeam.Clear(); AllRedTeam.Clear(); }