Beispiel #1
0
    /// <summary>
    /// 创建特效
    /// </summary>
    /// <param name="effectId">特效id</param>
    /// <param name="parent">特效的父节点</param>
    public void CreateEffects(string effectId, Transform parent)
    {
        if (string.IsNullOrEmpty(effectId))
        {
            return;
        }
        LYXSkillEntity entity = LYXSkillConfig.GetSkillEntity(effectId);

        if (entity == null)
        {
            Debug.LogError("你创建的特效不存在!!!");
            return;
        }
        LYXSkillEffects effects = LYXSkillEffects.CreateEffects(entity.SkillPath, parent);

        if (mHeroEnity.FriendAndFoe == 2)
        {
            effects.SetEffectRotation(new Vector3(0, -180, 0));
        }
        effects.mSkillEntity = entity;
        // 得到播放特效的函数
        LYXSkillEffects.SkillFun fun = LYXSkillEffects.GetSkillFun("Effect" + effectId);
        if (fun != null)
        {
            // 特效对象,当前播放特效的侠客,目标侠客,
            fun(effects, this, mTargetHero);
        }
        // 增加到特效管理
        mSkillEffes.Add(effects);
    }
Beispiel #2
0
    /// <summary>
    /// 放大结束
    /// </summary>
    public void OnTweenFinished()
    {
        mAnima.enabled = true;
        // 播放大招动画
        PlayAnimation("anger");
        PlayAnimation("idle1", false);
        // 停止暂停
        mHeroEnity.CurrentAnger = 0;
        mBatManage.OnBattlePause(false);
        if (!string.IsNullOrEmpty(mHeroEnity.AngerSkillId))
        {
            LYXSkillEntity  entity  = LYXSkillConfig.GetSkillEntity(mHeroEnity.AngerSkillId);
            LYXSkillEffects effects = LYXSkillEffects.CreateEffects(entity.SkillPath, transform);
            effects.SetEffectOffset(new Vector3(0, 15, 0));
            //  播放特效
            LYXSkillEffects.SkillFun fun = LYXSkillEffects.GetSkillFun("Effect" + mHeroEnity.AngerSkillId);
            if (fun != null)
            {
                fun(effects, this, mTargetHero, new Vector3(0, 15, 0));
            }
        }
        TweenScale scale = TweenScale.Begin(gameObject, 1f, new Vector3(1f * GetHeroMirror(), 1f, 1f));

        scale.method = UITweener.Method.EaseInOut;
        scale.style  = UITweener.Style.Once;
        // 移出完成事件
        EventDelegate evt = new EventDelegate(OnTweenFinished);

        scale.RemoveOnFinished(evt);
        scale.Play();
    }
Beispiel #3
0
 /// <summary>
 /// 清理特效
 /// </summary>
 public void ClearEffect()
 {
     mHeroObj.RemoveEffect(this);
     mHeroObj     = null;
     mTargetObj   = null;
     mOffset      = Vector3.zero;
     mTweenPos    = null;
     mSkillEntity = null;
     mDestroy     = null;
     GameObject.DestroyObject(gameObject);
 }
 /// <summary>
 /// 清理特效
 /// </summary>
 public void ClearEffect()
 {
     mHeroObj.RemoveEffect(this);
     mHeroObj = null;
     mTargetObj = null;
     mOffset = Vector3.zero;
     mTweenPos = null;
     mSkillEntity = null;
     mDestroy = null;
     GameObject.DestroyObject(gameObject);
 }