Unity Stuff | C#

March 31st, 2021 05:01:46 PM

					
using System.Collections; using System.Collections.Generic; using UnityEngine; public class counter : MonoBehaviour { public float counterGoal = 10f; public float counterValue = 0f; public float timer = 30000f; public GameObject bulletPrefab; public GameObject barrel; public Collision collider; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { Debug.Log(timer); timer -= 100f; if(timer <= 0f) { Application.Quit(); Debug.Log("QUIT THIUS THANG"); } if(collider.gameObject.name == "Bullet_Prefab" && collider.OnCollisionEnter("bonk")) { this.counterValue = this.counterValue + 1; Debug.Log("COLLISISON"); } if(counterValue == counterGoal) { Debug.Log("GG"); Application.Quit(); } } }

Featured Posts