| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using System.Collections; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | using KTGMGemClient; |
| | | public class TestButton : MonoBehaviour |
| | | { |
| | | //public Text t; |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | { |
| | | transform.Find("TowerBuyBtn").GetComponent<Button>().onClick.AddListener(OnClickTowerBuyBtn); |
| | | |
| | | // transform.Find("TowerBuyBtn").GetComponent<Button>().onClick.AddListener(OnClickTowerBuyBtn); |
| | | |
| | | // transform.Find("GuidePanel/Image_TowerPos2").GetComponent<Button>().onClick.AddListener(GetOneTowerPos); |
| | | |
| | | // int guide = PlayerPrefs.GetInt("GemBattleGuide"); |
| | | |
| | | // string s="<color=red>范围伤害</color>"; |
| | | // t.text=s; |
| | | // Debug.Log(s.Length); |
| | | TestFinalPanel(); |
| | | } |
| | | |
| | | private void OnClickTowerBuyBtn(){ |
| | | void TestFinalPanel() |
| | | { |
| | | GameObject go = Instantiate(Resources.Load<GameObject>("UI/Final/FinalPanel"), transform); |
| | | FinalPanel panelUI = go.GetComponent<FinalPanel>(); |
| | | panelUI.SetData("成绩 25关 3波", 789220); |
| | | panelUI.SetPlayEffectAC(null); |
| | | } |
| | | |
| | | |
| | | private void OnEnable() |
| | | { |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.AddCard, AddCard); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateFireLv2, CreateFireLv2); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateFirstWave, CreateFirstWave); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.RestartWave, RestartWave); |
| | | EventCenter.Ins.Add<int>((int)KTGMGemClient.EventType.AddGold, AddGold); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateWaterLv1, CreateWaterLv1); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateSecondWave, CreateSecondWave); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillRelease, SkillRelease); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.GuideFinish, GuideFinish); |
| | | |
| | | } |
| | | |
| | | //购买宝石 |
| | | private void OnClickTowerBuyBtn() |
| | | { |
| | | Debug.Log("点击了TowerBuyBtn"); |
| | | } |
| | | |
| | | private void AddCard() |
| | | { |
| | | Debug.Log("这里需要生成一个二级宝石"); |
| | | } |
| | | |
| | | |
| | | private void CreateFireLv2() |
| | | { |
| | | Debug.Log("生成一个2级的火焰塔"); |
| | | |
| | | } |
| | | |
| | | private void CreateFirstWave() |
| | | { |
| | | Debug.Log("第一关小怪出木元素小怪"); |
| | | StartCoroutine(CreateWave()); |
| | | } |
| | | |
| | | IEnumerator CreateWave() |
| | | { |
| | | yield return new WaitForSeconds(1f); |
| | | Debug.Log("出怪完毕,等待火元素完成第一次充能"); |
| | | yield return new WaitForSeconds(1f); |
| | | Debug.Log("火元素充能效果结束,暂停出怪"); |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.ChargingEnd); |
| | | |
| | | } |
| | | |
| | | |
| | | private void RestartWave() |
| | | { |
| | | Debug.Log("恢复出怪"); |
| | | StartCoroutine(RestartWaveCoroutine()); |
| | | } |
| | | |
| | | IEnumerator RestartWaveCoroutine() |
| | | { |
| | | yield return new WaitForSeconds(1f); |
| | | Debug.Log("出怪完毕"); |
| | | yield return new WaitForSeconds(1f); |
| | | Debug.Log("怪物被杀光,这里需要停止出下一波怪物"); |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.KillDone); |
| | | |
| | | } |
| | | |
| | | private void AddGold(int gold) |
| | | { |
| | | Debug.Log("增加金钱:" + gold); |
| | | |
| | | } |
| | | |
| | | private void GetOneTowerPos() |
| | | { |
| | | Debug.Log("解锁了第一排第二个塔位"); |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.GetOneTowerPos); |
| | | |
| | | } |
| | | |
| | | private void CreateWaterLv1() |
| | | { |
| | | Debug.Log("生成一个1级的水元素塔"); |
| | | } |
| | | |
| | | private void CreateSecondWave() |
| | | { |
| | | Debug.Log("第二关小怪出火属性小怪"); |
| | | StartCoroutine(CreateSecondWaveCoroutine()); |
| | | |
| | | } |
| | | IEnumerator CreateSecondWaveCoroutine() |
| | | { |
| | | yield return new WaitForSeconds(1f); |
| | | Debug.Log("当第二关第8波怪物生成后或玩家塔位收到第一次伤害后,这里需要暂停时间"); |
| | | |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.SkillStep); |
| | | |
| | | } |
| | | |
| | | private void SkillRelease() |
| | | { |
| | | Debug.Log("释放技能"); |
| | | |
| | | StartCoroutine(SkillReleaseDone()); |
| | | |
| | | } |
| | | |
| | | IEnumerator SkillReleaseDone() |
| | | { |
| | | yield return new WaitForSeconds(1f); |
| | | Debug.Log("技能效果播放完毕秒杀小怪后,暂停事件"); |
| | | |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.SkillReleaseDone); |
| | | |
| | | } |
| | | |
| | | private void GuideFinish() |
| | | { |
| | | |
| | | Debug.Log("新手引导流程结束"); |
| | | } |
| | | |
| | | } |