Exemplo n.º 1
0
    private void Awake()
    {
        Instance = this;

        cancerRoot = transform;
        cancerMap  = new bool[_size.x, _size.y];
        _idleTiles = new List <Vector2Int>(cancerMap.Length);
        _busyTiles = new List <Vector2Int>(cancerMap.Length);

        prototypes.Add("Cancer 0", Resources.Load <GameObject>("Prefabs/Cancer 0"));
        prototypes.Add("Cancer 1", Resources.Load <GameObject>("Prefabs/Cancer 1"));
        prototypes.Add("Cancer 2", Resources.Load <GameObject>("Prefabs/Cancer 2"));
    }
Exemplo n.º 2
0
    private void Die()
    {
        _isAlive = false;
        ExplosionController explosion = ExplosionManager.Get(explodeEffect);

        explosion.transform.position = transform.position;
        explosion.Explode();
        if (explodeSound)
        {
            AudioManager.PlayAtPoint(explodeSound, transform.position);
        }
        CancerManager.Recycle(this);
        GameSceneController.OnCancerDeath(identifierName);
    }
Exemplo n.º 3
0
    public void Replay()
    {
        EnemyManager.Reset();
        ParticleDecalManager.Reset();
        ExplosionManager.Reset();
        BulletController[] bullets = FindObjectsOfType <BulletController>();
        foreach (var bullet in bullets)
        {
            bullet.Recycle();
        }
        ParticleController[] particles = FindObjectsOfType <ParticleController>();
        foreach (var particle in particles)
        {
            ParticleManager.Recycle(particle);
        }
        CancerController[] cancers = FindObjectsOfType <CancerController>();
        foreach (var cancer in cancers)
        {
            CancerManager.Recycle(cancer);
        }
        CancerManager.Instance.Deactivate();

        Play();
    }