Added NoTrail, Slowmotion and BulletFreezeRemove Pickups
Also refactored Extinguisher to remove particles from the end (still wonky though)
This commit is contained in:
35
Assets/Scripts/Game/Pickups/NoTrail.cs
Normal file
35
Assets/Scripts/Game/Pickups/NoTrail.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class NoTrail : Pickup
|
||||
{
|
||||
private Player player;
|
||||
public float noTrailDuration = 5f;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
player = GameObject.Find("Player").GetComponent<Player>();
|
||||
}
|
||||
|
||||
public override void OnPickup()
|
||||
{
|
||||
player.trail.SetActive(false);
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (pickedUp)
|
||||
{
|
||||
noTrailDuration -= Time.deltaTime;
|
||||
if (noTrailDuration <= 0)
|
||||
{
|
||||
player.trail.SetActive(true);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user