Fur-War/Assets/Scripts/PortalBulletSpawner.cs
Gerard Gascón 3b4c6e0ec6 init
2025-04-24 17:29:51 +02:00

24 lines
591 B
C#

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);
}
}
}