Pracownia-Programowania-Pro.../Assets/Scripts/Others/WeaponUpgrade.cs
Polarjad 1ea616dd60 Added dungeon textures, added scenes, added UI
Enemy balance, added upgrades, added score, added menu
2021-01-25 22:40:51 +01:00

29 lines
679 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WeaponUpgrade : MonoBehaviour
{
private PlayerShooting shooting;
private GameObject player;
void Start()
{
player = GameObject.FindWithTag("Player");
shooting = player.GetComponent<PlayerShooting>();
}
void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Player"))
{
Destroy(gameObject);
Debug.Log("Player upgrade taken");
if (shooting.attackDelay > 0.2f)
{
shooting.attackDelay = shooting.attackDelay - 0.1f;
}
}
}
}