void HitMengZong(object sender, HItEventArgs e) { if (Time.time > silence) { int index = e.index; countHitMengZong++; ExplosionFX fx = poolFXExplosion.Reuse(holes[index].nowLeave.position, Quaternion.identity).GetComponent <ExplosionFX>(); StartCoroutine(fx.Audio(11)); Home(index); tipBoom.SetActive(true); tipBoom.GetComponent <RectTransform>().localScale = Vector3.zero; tipBoom.transform.DOScale(new Vector3(1, 1, 1), 0.73f).SetEase(Ease.OutElastic).OnComplete(() => StartCoroutine(TipsBack(tipBoom))); int tempScore = 200; for (int i = 0; i < 9; i++) { if (holes[i].nowLeave != null) { holes[i].nowLeave.GetComponentInChildren <Character>().Boom(); tempScore += 100; } } message[index].SetActive(true); message[index].transform.DOKill(true); message[index].transform.position = textIn[index].position; message[index].transform.DOMove(textOut[index].position, 0.37f).OnComplete(() => MsgBack(index)); textMessage[index].text = "+" + tempScore; score += tempScore; textScore.text = "" + (int)score; } }
void HitHuaJi(object sender, HItEventArgs e) { if (Time.time > silence) { int index = e.index; //countHitMengZong++; ExplosionFX fx = poolFXHit.Reuse(holes[index].nowLeave.position, Quaternion.identity).GetComponent <ExplosionFX>(); StartCoroutine(fx.Audio(0)); Home(index); message[index].SetActive(true); message[index].transform.DOKill(true); message[index].transform.position = textIn[index].position; message[index].transform.DOMove(textOut[index].position, 0.37f).OnComplete(() => MsgBack(index)); } }
void HitMinion(object sender, HItEventArgs e) { if (Time.time > silence) { int index = e.index; capture++; textCapture.text = "" + capture; ExplosionFX fx = poolFXHit.Reuse(holes[index].nowLeave.position, Quaternion.identity).GetComponent <ExplosionFX>(); StartCoroutine(fx.Audio(Random.Range(2, 9))); Home(index); message[index].SetActive(true); message[index].transform.DOKill(true); message[index].transform.position = textIn[index].position; message[index].transform.DOMove(textOut[index].position, 0.37f).OnComplete(() => MsgBack(index)); textMessage[index].text = "+100"; score += 100; textScore.text = "" + (int)score; } }
void HitMole(object sender, HItEventArgs e) { if (Time.time > silence) { int index = e.index; countHitMole++; ExplosionFX fx = poolFXExplosion.Reuse(holes[index].nowLeave.position, Quaternion.identity).GetComponent <ExplosionFX>(); StartCoroutine(fx.Audio(1)); Home(index); tipCross.SetActive(true); tipCross.GetComponent <RectTransform>().localScale = Vector3.zero; tipCross.transform.DOScale(new Vector3(1, 1, 1), 1.0f).SetEase(Ease.OutExpo).OnComplete(() => StartCoroutine(TipsBack(tipCross))); int tempScore = 50; int indexN = index - 3; int indexS = index + 3; int indexW = index - 1; int indexE = index + 1; if (indexN > 0) { if (holes[indexN].nowLeave != null) { holes[indexN].nowLeave.GetComponentInChildren <Character>().Boom(); tempScore += 50; } } if (indexS < countCharacter) { if (holes[indexS].nowLeave != null) { holes[indexS].nowLeave.GetComponentInChildren <Character>().Boom(); tempScore += 50; } } if (indexW > 0) { if (holes[indexW].nowLeave != null) { holes[indexW].nowLeave.GetComponentInChildren <Character>().Boom(); tempScore += 50; } } if (indexE < countCharacter) { if (holes[indexE].nowLeave != null) { holes[indexE].nowLeave.GetComponentInChildren <Character>().Boom(); tempScore += 50; } } message[index].SetActive(true); message[index].transform.DOKill(true); message[index].transform.position = textIn[index].position; message[index].transform.DOMove(textOut[index].position, 0.37f).OnComplete(() => MsgBack(index)); textMessage[index].text = "+" + tempScore; score += tempScore; textScore.text = "" + (int)score; } }