Example #1
0
 public void Begin()
 {
     if (effect != null)
     {
         effect.Begin();
     }
 }
Example #2
0
    /// <summary>
    /// 生成行为节点
    /// </summary>
    /// <param name="paramsPacker">数据包装类</param>
    /// <returns>行为节点</returns>
    public override IFormula GetFormula(FormulaParamsPacker paramsPacker)
    {
        if (paramsPacker == null)
        {
            return(null);
        }

        // 替换替换符数据
        ReplaceData(paramsPacker);
        // 数据本地化

        var      myFormulaType = FormulaType;
        var      myReleasePos  = ReleasePos;
        var      myReceivePos  = ReceivePos;
        IFormula result        = null;

        result = new Formula((callback, scope) =>
        {
            // 获取目标位置
            var sourcePos = GetPosByType(myReleasePos, paramsPacker, scope);
            var targetPos = GetPosByType(myReceivePos, paramsPacker, scope);

            EffectBehaviorAbstract effect = null;
            if (ReceivePos == 3)
            {
                effect = EffectsFactory.Single.CreateLinerEffect(EffectKey,
                                                                 // TODO 应该使用挂点
                                                                 paramsPacker.ReleaseMember.ClusterData.transform
                                                                 , paramsPacker.ReceiverMenber.ClusterData.gameObject
                                                                 , DurTime, callback, Utils.EffectLayer);
            }
            else
            {
                effect = EffectsFactory.Single.CreateLinerEffect(EffectKey,
                                                                 ParentManager.Instance().GetParent(ParentManager.BallisticParent).transform,
                                                                 sourcePos, targetPos, DurTime, callback, Utils.EffectLayer);
            }

            effect.Begin();
        }, myFormulaType);



        return(result);
    }
 public void Begin()
 {
     effect.Begin();
 }