void Init() { toggle = transform.Find("InfoBtn").GetComponent <ButtonOnPress>(); tran = transform.Find("Information"); RecordToggle = tran.Find("BattleBtn").GetComponent <UIToggle>(); AttributeToggle = tran.Find("StatusBtn").GetComponent <UIToggle>(); SystemSetToggle = tran.Find("SettingBtn").GetComponent <UIToggle>(); BattleState = BattleCurrInfo.BattleRecord; Transform temp = tran.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 = tran.Find("BattleInfo/Team/RedTeam"); index = temp.childCount; for (int i = 0; i < index; i++) { AllRedTeam.Add(new BattleRealInfo(temp.Find("Player" + (i + 1)))); } PlayerSpeed = tran.Find("StatusInfo/Speed/Num").GetComponent <UILabel>(); AttackInterval = tran.Find("StatusInfo/AtkInterval/Num").GetComponent <UILabel>(); AttackRange = tran.Find("StatusInfo/AtkRange/Num").GetComponent <UILabel>(); ResurgenceTime = tran.Find("StatusInfo/ResuTime/Num").GetComponent <UILabel>(); PhysicAttack = tran.Find("StatusInfo/PhysicAtk/Num").GetComponent <UILabel>(); SpellsAttack = tran.Find("StatusInfo/SpellsAtk/Num").GetComponent <UILabel>(); PhysicDef = tran.Find("StatusInfo/PhysicDef/Num").GetComponent <UILabel>(); SpellsDef = tran.Find("StatusInfo/SpellsDef/Num").GetComponent <UILabel>(); CloseBtn = tran.Find("CloseBtn").GetComponent <ButtonOnPress>(); tran = tran.Find("SettingInfo"); SoundBtn = tran.Find("SoundSwitch").GetComponent <ButtonOnPress>(); MusicBtn = tran.Find("MusicSwitch").GetComponent <ButtonOnPress>(); EffectBtn = tran.Find("EffectSwitch").GetComponent <ButtonOnPress>(); RangeBtn = tran.Find("RangeSwitch").GetComponent <ButtonOnPress>(); 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; SoundBtn.AddListener((int)SystemSet.SoundButton, SoundButtonPress); MusicBtn.AddListener((int)SystemSet.MusicButton, SoundButtonPress); EffectBtn.AddListener((int)SystemSet.EffectButton, SoundButtonPress); RangeBtn.AddListener((int)SystemSet.RangeButton, SoundButtonPress); CloseBtn.AddListener((int)SystemSet.CloseButton, ClosePress); toggle.AddListener(OnPress); }
void BattleAttr() { BattleState = BattleCurrInfo.BattleAttribute; PlayerSpeed.text = BattleingData.Instance.PlayerSpeed.ToString(); AttackInterval.text = BattleingData.Instance.AttackInterval.ToString(); AttackRange.text = BattleingData.Instance.AttackRange.ToString(); ResurgenceTime.text = BattleingData.Instance.ResurgenceTime.ToString(); PhysicAttack.text = BattleingData.Instance.PhysicAttack.ToString(); SpellsAttack.text = BattleingData.Instance.SpellsAttack.ToString(); PhysicDef.text = BattleingData.Instance.PhysicDef.ToString(); SpellsDef.text = BattleingData.Instance.SpellsDef.ToString(); }
void ShowBattle() { if (BattleState == BattleCurrInfo.BattleRecord) { Record(); } else if (BattleState == BattleCurrInfo.BattleAttribute) { BattleAttr(); } else if (BattleState == BattleCurrInfo.BattleSystemSet) { BattleState = BattleCurrInfo.BattleSystemSet; } }