init
This commit is contained in:
commit
862afc9b7a
478 changed files with 197737 additions and 0 deletions
29
Assets/Scripts/PlayerKill.cs
Normal file
29
Assets/Scripts/PlayerKill.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerKill : MonoBehaviour{
|
||||
|
||||
public GameObject player;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start(){
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update(){
|
||||
|
||||
}
|
||||
|
||||
public void Die(){
|
||||
StartCoroutine(Respawn());
|
||||
FindObjectOfType<PlayerWeaponController>().currentBullets += 3f;
|
||||
player.SetActive(false);
|
||||
}
|
||||
|
||||
IEnumerator Respawn(){
|
||||
yield return new WaitForSeconds(1.5f);
|
||||
player.SetActive(true);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue