Files
blackhole-escape/Assets/Scripts/Scripts/PlayerBlackHoleForce.cs
iDunnoDev fb3415c7b2 Added new sounds needed for game
Added blackhole swirl texture and materials
Added Magnet, Hunter and Drop core powerups and script overhaul for powerups in general
Added Scenes and Cinematic changes for the game, win and death screens
Added a score
Changed the way enemy spawns work
Removed unused scripts
2022-07-14 17:31:10 +01:00

30 lines
790 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerBlackHoleForce : BlackHoleForce
{
private PlayerColliderManager _playerColliderManager;
protected override void DoAwakeTasks()
{
_playerColliderManager = gameObject.GetComponent<PlayerColliderManager>();
base.DoAwakeTasks();
}
public override void ApplyBlackHoleForce(float appliedForce)
{
if (!blackHolePullImmunue && !GameEngine.playerPaused)
{
_objectRigidBody.AddForce(-_objectRigidBody.transform.up * appliedForce);
base.ApplyBlackHoleForce(appliedForce);
}
}
public override void HitBlackHole()
{
_playerColliderManager.PlayerHit(true);
base.HitBlackHole();
}
}