init
This commit is contained in:
commit
16da8e4dde
333 changed files with 109229 additions and 0 deletions
21
Assets/Scripts/Level/Guns/GunController.cs
Normal file
21
Assets/Scripts/Level/Guns/GunController.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class GunController : MonoBehaviour, IPooledObject{
|
||||
// Start is called before the first frame update
|
||||
public void OnObjectSpawn(){
|
||||
StartCoroutine(Remove());
|
||||
}
|
||||
|
||||
IEnumerator Remove(){
|
||||
yield return new WaitForSeconds(12f);
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D col){
|
||||
if(col.gameObject.tag == "Player"){
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue