revival/game/Assets/Scripts/Player/PlayerPowers.cs

38 lines
916 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerPowers : MonoBehaviour
{
[Header( "Cheats" )]
[SerializeField]
private bool _cheatBlink;
[SerializeField]
private bool _cheatBoost;
[SerializeField]
private bool _cheatFreeze;
[Header( "References" )]
[SerializeField]
private PlayerPower _blink;
[SerializeField]
private PlayerPower _boost;
[SerializeField]
private PlayerPower _freeze;
public PlayerPower Blink => _blink;
public PlayerPower Boost => _boost;
public PlayerPower Freeze => _freeze;
public void UpdatePowers( float dt, bool grounded )
{
_blink.UpdatePower( dt, _cheatBlink, grounded );
_boost.UpdatePower( dt, _cheatBoost, grounded );
_freeze.UpdatePower(dt, _cheatFreeze, grounded);
}
}