Пример #1
0
 void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.tag == "Player")
     {
         ScoreScript.AddPoint();
         sound1.Play();
     }
 }
Пример #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (!hasPoint)
     {
         hasPoint = true;
         Debug.Log("entered");
         audioSource.Play();
         ss.AddPoint();
         Destroy(gameObject);
     }
 }
Пример #3
0
 public void GetCoin()
 {
     scoreScript.AddPoint();
     coinSound.GetComponent <AudioSource>().Play();
 }
Пример #4
0
 void OnDestroy()
 {
     ScoreScript.AddPoint();
 }
 void Start()
 {
     ScoreScript.AddPoint();
     Destroy(gameObject, 2f);
 }