private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Player") { this.pausemanager.Pause(this.timecouter, PauseManager.MONO); print("GoalHit"); goalbell = transform.GetComponentInParent <GoalBell>(); goalbell.SendGameStageGOAL(); GetComponent <Renderer>().enabled = false; particle.GetComponent <ParticleSystem>().Stop(); GameObject.Find("AudioObj").GetComponent <AudioObj>().PlayGoalBGM(); } }
private void OnTriggerEnter2D(Collider2D other) { //既に当たっていたらリターン if (hitFlag) { return; } if (other.gameObject.tag == "Player" && !other.isTrigger) { goalscript = transform.parent.GetComponent <GoalBell>(); goalscript.CountSub(); this.sourceAudio.PlaySE((int)AudioList.AUDIO_BELL); particle = Instantiate(GameObject.Find("EffectManager").GetComponent <EffectManager>().bellSparkleEffect); particle.transform.position = transform.position + Vector3.back * 3.0f + Vector3.down * 0.22f; particle.GetComponent <ParticleSystem>().Play(); particle.transform.parent = transform; hitFlag = true; } }