From adb0dae8a82a7eabb4e686bc0e83c8859bf6445f Mon Sep 17 00:00:00 2001 From: chenxin <chenxin6991@163.com> Date: Fri, 25 Dec 2020 10:48:53 +0800 Subject: [PATCH] Merge branch 'master' of http://47.95.218.140:8090/r/GemBattle into master --- Assets/Scripts/TowerDefense/UI/EndlessScoreManager.cs | 38 +++++--------------------------------- 1 files changed, 5 insertions(+), 33 deletions(-) diff --git a/Assets/Scripts/TowerDefense/UI/EndlessScoreManager.cs b/Assets/Scripts/TowerDefense/UI/EndlessScoreManager.cs index f8b98e3..b494e57 100644 --- a/Assets/Scripts/TowerDefense/UI/EndlessScoreManager.cs +++ b/Assets/Scripts/TowerDefense/UI/EndlessScoreManager.cs @@ -30,8 +30,7 @@ public Text DoubleHitText; - public Image OneTimeKillObj; - private bool isShowing; + public DoubleHitImg OneTimeKillObj; public Text OneTimeKillText; @@ -67,7 +66,6 @@ // Start is called before the first frame update private void Start() { - isShowing = false; Init(); EventCenter.Ins.Add<int>((int)KTGMGemClient.EventType.EndlessAgentDead, AgentDead); EventCenter.Ins.Add((int)KTGMGemClient.EventType.EndlessOneHit, OnHit); @@ -84,17 +82,7 @@ if (count >= 10) { AddScore(0); - ShowOneTimeKill(10, 500); - } - else if (count >= 8) - { - AddScore(0); - ShowOneTimeKill(8, 200); - } - else if (count >= 5) - { - AddScore(0); - ShowOneTimeKill(5, 100); + ShowOneTimeKill(); } } @@ -118,6 +106,7 @@ else remainTime -= Time.deltaTime; } + } /// <summary> @@ -180,28 +169,11 @@ /// 显示一次性击杀飘字 /// </summary> /// <param name="count"></param> - /// <param name="score"></param> - private void ShowOneTimeKill(int count, int score) + private void ShowOneTimeKill() { - if (!isShowing) - { - isShowing = true; - Image obj = Instantiate(OneTimeKillObj); - obj.transform.SetParent(GameObject.Find("Panel").transform, false); - obj.sprite = Resources.Load<Sprite>($"UI/DoubleHit/hit_{count}"); - StartCoroutine(KillImage(obj.gameObject)); - } - - //Destroy(obj.gameObject, 2.05f); + OneTimeKillObj.SetkillCount(); } - IEnumerator KillImage(GameObject obj) - { - yield return new WaitForSeconds(2.05f); - Destroy(obj); - - isShowing = false; - } /// <summary> /// 飘连击奖励分数 -- Gitblit v1.9.1