protected virtual void OnStateWaitRebornEnter()
    {
        _waitRebornTime  = 0;
        _stateUpdateFunc = StateWaitRebornUpdate;
        // 创建死亡特效
        STGPlayerDeadEffect effect = EffectsManager.GetInstance().CreateEffectByType(EffectType.PlayerDeadEffect) as STGPlayerDeadEffect;

        effect.SetPosition(_curPos.x, _curPos.y);
    }
Exemple #2
0
    /// <summary>
    /// 创建boss死亡特效(暂用
    /// <para>posX</para>
    /// <para>posY</para>
    /// </summary>
    /// <param name="luaState"></param>
    /// <returns></returns>
    public static int CreateBossDeadEffect(ILuaState luaState)
    {
        STGPlayerDeadEffect effect = EffectsManager.GetInstance().CreateEffectByType(EffectType.PlayerDeadEffect) as STGPlayerDeadEffect;
        float posX = (float)luaState.ToNumber(-2);
        float posY = (float)luaState.ToNumber(-1);

        effect.SetPosition(posX, posY);
        luaState.PushLightUserData(effect);
        return(1);
    }
Exemple #3
0
    public STGEffectBase CreateEffectByType(EffectType type)
    {
        STGEffectBase effect = GetEffectFromPool(type);

        if (effect == null)
        {
            switch (type)
            {
            case EffectType.SpriteEffect:
                effect = new STGSpriteEffect();
                break;

            case EffectType.ShakeEffect:
                effect = new ShakeEffect();
                break;

            case EffectType.BreakScreenEffect:
                effect = new STGBreakScreenEffect();
                break;

            case EffectType.BurstEffect:
                effect = new STGBurstEffect();
                break;

            case EffectType.ChargeEffect:
                effect = new STGChargeEffect();
                break;

            case EffectType.BulletEliminate:
                effect = new STGBulletEliminateEffect();
                break;

            case EffectType.EnemyEliminated:
                effect = new STGEnemyEliminatedEffect();
                break;

            case EffectType.PlayerDeadEffect:
                effect = new STGPlayerDeadEffect();
                break;
            }
        }
        if (effect != null)
        {
            effect.Init();
            _effectList.Add(effect);
            _effectsCount++;
        }
        return(effect);
    }