
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
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class MagnetPowerUpEffect : 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 newMagnetEffect = newSpecialCore.GetComponent<MagnetAttachedPowerUpEffect>();
|
|
_playerObjectShared.AttachPickUp(newMagnetEffect);
|
|
|
|
if (_currentGameEngine != null)
|
|
{
|
|
_currentGameEngine.QueueDialog(dialogIndex);
|
|
}
|
|
}
|
|
|
|
public override void ApplyEffect()
|
|
{
|
|
}
|
|
}
|