Advertisement
8ydilnik

bonus

Sep 18th, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class bonusi : MonoBehaviour
  6. {
  7.     public GameObject FuckingCar;
  8.     // Start is called before the first frame update
  9.     void Start()
  10.     {
  11.        
  12.     }
  13.  
  14.     // Update is called once per frame
  15.     void Update()
  16.     {
  17.        
  18.     }
  19.  
  20.     public void OnTriggerEnter(Collider other)
  21.     {
  22.         if(other.tag == "Bonus")
  23.         {
  24.             Debug.Log("Bonus");
  25.             Destroy(other.gameObject);
  26.             sccorre.instacne.score += 1;
  27.             FuckingCar.GetComponent<Renderer>().material.color = Color.blue;
  28.             movew.instance.bonus += 2;
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement