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

38 lines
915 B
C#
Raw Normal View History

2021-02-15 19:09:32 +01:00
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;
2021-03-08 15:16:20 +01:00
[SerializeField]
private bool _cheatFreeze;
2021-02-15 19:09:32 +01:00
[Header( "References" )]
[SerializeField]
private PlayerPower _blink;
[SerializeField]
private PlayerPower _boost;
2021-03-08 15:16:20 +01:00
[SerializeField]
private PlayerPower _freeze;
2021-02-15 19:09:32 +01:00
public PlayerPower Blink => _blink;
public PlayerPower Boost => _boost;
2021-03-08 15:16:20 +01:00
public PlayerPower Freeze => _freeze;
2021-02-15 19:09:32 +01:00
public void UpdatePowers( float dt, bool grounded )
{
_blink.UpdatePower( dt, _cheatBlink, grounded );
_boost.UpdatePower( dt, _cheatBoost, grounded );
2021-03-08 15:16:20 +01:00
_boost.UpdatePower(dt, _cheatFreeze, grounded);
2021-02-15 19:09:32 +01:00
}
}