init
This commit is contained in:
commit
3b4c6e0ec6
506 changed files with 434142 additions and 0 deletions
24
Assets/Scripts/PortalBulletSpawner.cs
Normal file
24
Assets/Scripts/PortalBulletSpawner.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PortalBulletSpawner : MonoBehaviour{
|
||||
|
||||
PlayerController player;
|
||||
MapCellCalculator map;
|
||||
|
||||
void Awake(){
|
||||
player = FindObjectOfType<PlayerController>();
|
||||
map = FindObjectOfType<MapCellCalculator>();
|
||||
}
|
||||
|
||||
|
||||
void OnTriggerEnter(Collider col){
|
||||
if (col.CompareTag("Player")){
|
||||
AudioManager.instance.PlayOneShot("Powerup");
|
||||
player.numberOfCharge++;
|
||||
map.CanSpawnEnergy();
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue