private void DropPrincess()
    {
        m_Scream.Play();
        m_FireBallTimer = 2f;
        Princess princess    = GameManager.m_Instance.GetObjectPool.GetPrincess();
        Vector2  dropPosHigh = new Vector2(Random.Range(-2f, 2f), transform.position.y);
        Vector2  dropPos     = new Vector2(dropPosHigh.x, dropPosHigh.y - 5f);

        GameManager.m_Instance.PrincessFalling(dropPosHigh);
        princess.Activate(dropPosHigh, GameManager.m_Instance.GetBulletDirection(dropPosHigh, dropPos));

        for (int i = 0; i < 12; i++)
        {
            Fireball fireBall = GameManager.m_Instance.GetObjectPool.GetFireBall();
            if (i < 6)
            {
                Vector2 startpos = dropPosHigh;
                startpos.x -= 1.5f;
                Vector2 pos = new Vector2(startpos.x - (1.2f * i), princess.transform.position.y);
                fireBall.Activate(pos, GameManager.m_Instance.GetBulletDirection(pos, new Vector2(pos.x, pos.y - 1)));
            }
            else
            {
                Vector2 startpos = dropPosHigh;
                startpos.x -= 5.5f;
                Vector2 pos = new Vector2(startpos.x + (1.2f * i), princess.transform.position.y);
                fireBall.Activate(pos, GameManager.m_Instance.GetBulletDirection(pos, new Vector2(pos.x, pos.y - 1)));
            }
        }
    }
    private void ShootFireBall()
    {
        Fireball fireBall  = GameManager.m_Instance.GetObjectPool.GetFireBall();
        Vector2  playerPos = m_Player.transform.position;

        fireBall.Activate(m_FireBallStartPosition.transform.position, GameManager.m_Instance.GetBulletDirection(transform.position, playerPos));
    }
            // c'tor
            public FireballParticle(Color color, ParticleSystemManager manager)
            {
                this.age   = 0.0f;
                this.color = color;

                smokeEmitter        = new SmokeEmitter(manager);
                smokeEmitter.Active = true;

                fireball = new Fireball(Classification.Colors.Red);
                InGame.inGame.gameThingList.Add(fireball);
                fireball.Activate();
            } // end of c'tor
Exemple #4
0
    void UtilizeAbility(int slot)
    {
        bool cooldownActive = pinfo.abilities[slot].coolDown.GetActivity();
        int  mpCost         = pinfo.abilities[slot].GetCostMP();

        if (!cooldownActive && pinfo.stats.mpCur > mpCost)
        {
            cooldownImg[slot].gameObject.SetActive(true);
            int id = pinfo.abilities[slot].GetID();
            switch (id)
            {
            case 1:
                Frenzy frenzy = (Frenzy)pinfo.abilities[slot];
                frenzy.Activate();
                break;

            case 2:
                Rage rage = (Rage)pinfo.abilities[slot];
                rage.Activate();
                break;

            case 3:
                Mine mine = (Mine)pinfo.abilities[slot];
                mine.Activate();
                break;

            case 4:
                Fireball   fireball = (Fireball)pinfo.abilities[slot];
                PlayerInfo target   = Target.GetTargetUnit();
                if (target != null)
                {
                    fireball.Activate();
                }
                break;
            }
        }
    }