コード例 #1
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("Player"))
     {
         Debug.Log("Verso della balena");
         player = collision.gameObject.GetComponent <PlayerControllerLinear>();
         player.ObstaclesAudio.clip = audioClip;
         player.ObstaclesAudio.Play();
     }
 }
コード例 #2
0
 private void Awake()
 {
     playerController = FindObjectOfType <PlayerControllerLinear>();
     audioSource      = GetComponent <AudioSource>();
 }