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
This commit is contained in:
39
Assets/Scripts/PowerUps/ChasePowerUpEffect.cs
Normal file
39
Assets/Scripts/PowerUps/ChasePowerUpEffect.cs
Normal file
@ -0,0 +1,39 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ChasePowerUpEffect : PowerUpEffect
|
||||
{
|
||||
private GameObject _player;
|
||||
private PlayerObjectShared _playerObjectShared;
|
||||
public GameObject coredVersionGO;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
_currentGameEngine = FindObjectOfType<GameEngine>();
|
||||
_player = GameEngine.mainPlayer;
|
||||
_playerObjectShared = _player.GetComponent<PlayerObjectShared>();
|
||||
}
|
||||
|
||||
public override void OnPickUp()
|
||||
{
|
||||
Transform coreHolder = _player.transform.Find("PlayerModel/CoreHolder");
|
||||
for (int i = 0; i < coreHolder.transform.childCount; i++)
|
||||
{
|
||||
Destroy(coreHolder.GetChild(i).gameObject);
|
||||
}
|
||||
GameObject newSpecialCore = Instantiate(coredVersionGO, coreHolder);
|
||||
AttachablePowerUpEffect newDropEffect = newSpecialCore.GetComponent<ChaseAttachedPowerUpEffect>();
|
||||
_playerObjectShared.AttachPickUp(newDropEffect);
|
||||
|
||||
if (_currentGameEngine != null)
|
||||
{
|
||||
_currentGameEngine.QueueDialog(dialogIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ApplyEffect()
|
||||
{
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user