| | |
| | | private void Start() |
| | | { |
| | | Init(); |
| | | EventCenter.Ins.Add<Agent>((int)KTGMGemClient.EventType.EndlessAgentDead, AgentDead); |
| | | EventCenter.Ins.Add<int>((int)KTGMGemClient.EventType.EndlessAgentDead, AgentDead); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.EndlessOneHit, OnHit); |
| | | EventCenter.Ins.Add<int>((int)KTGMGemClient.EventType.EndlessOneTimeKillCount, OnTimeKill); |
| | | canvasGroup = DoubleHit.GetComponent<CanvasGroup>(); |
| | |
| | | } |
| | | } |
| | | |
| | | private void AgentDead(Agent agent) |
| | | private void AgentDead(int point) |
| | | { |
| | | if (EndlessGameUI.instance.state == EndlessGameUI.State.GameOver) return; |
| | | AddScore(agent.EnemyData.point); |
| | | AddScore(point); |
| | | } |
| | | |
| | | // Update is called once per frame |
| | |
| | | Image obj = Instantiate(OneTimeKillObj); |
| | | obj.transform.SetParent(GameObject.Find("Panel").transform, false); |
| | | obj.sprite = Resources.Load<Sprite>($"UI/DoubleHit/hit_{count}"); |
| | | Animator animator = obj.GetComponent<Animator>(); |
| | | AnimatorClipInfo[] animatorClipInfos = animator.GetCurrentAnimatorClipInfo(0); |
| | | Destroy(obj.gameObject, animatorClipInfos[0].clip.length); |
| | | Destroy(obj.gameObject, 0.59f); |
| | | } |
| | | |
| | | private void OnShowOneTimeKillComplete() |