コード例 #1
0
 public void PlayPacManEffect()
 {
     if (PacManEffectPrefab != null)
     {
         XEffectManager.GenerateAsync(PacManEffectPrefab, 0, delegate(XEffectComponent obj)
         {
             if (obj != null && flyEffect_ != null)
             {
                 obj.transform.position = flyEffect_.transform.position;
             }
         });
     }
 }
コード例 #2
0
    protected void HandleAnimationEffect(AnimationEvent e)
    {
        XEffectConfigObject config = e.objectReferenceParameter as XEffectConfigObject;

        if (config == null)
        {
            return;
        }

        float  time = e.floatParameter;
        string res  = config.getRes(GetEffectIndexByHeroStar(config));

        if (!string.IsNullOrEmpty(res))
        {
            int animatorState = e.animatorStateInfo.fullPathHash;
            if (config.follow == XEffectComponent.EffectFollowType.Both)
            {
                XEffectManager.GenerateAsync(GetBoneNogPoint(config.linkBone).gameObject, res, time,
                                             delegate(XEffectComponent xeffect)
                {
                    if (xeffect != null)
                    {
                        if (IsPvp() == false)
                        {
                            MakeOffsetScale(xeffect, e);
                        }

                        if (gameObject != null)
                        {
                            AddFrameEffect(animatorState, config, xeffect);
                        }
                        else
                        {
                            xeffect.Stop();
                        }
                    }
                });
            }
            else
            {
                Transform  bone = GetBoneNogPoint(config.linkBone);
                Quaternion rot  = _nogPoint.center.rotation;
                if (bone.transform.lossyScale.x < 0 && config.isIgnoreMorror)
                {
                    rot.eulerAngles += new Vector3(0f, -180f, 0f);
                }

                XEffectManager.GenerateAsync(bone.gameObject, bone.position, rot, res, time,
                                             delegate(XEffectComponent xeffect)
                {
                    if (xeffect == null)
                    {
                        return;
                    }
                    if (gameObject != null)
                    {
                        if (!IsPvp())
                        {
                            MakeOffsetScale(xeffect, e);
                        }

                        if (config.follow == XEffectComponent.EffectFollowType.Position || config.follow == XEffectComponent.EffectFollowType.PositionButY)
                        {
                            xeffect.onlyFollowPosition = true;
                            if (config.follow == XEffectComponent.EffectFollowType.PositionButY)
                            {
                                xeffect.ignoreFollowHeight = true;
                                xeffect.followStayHeight   = bone.position.y;
                            }
                            AddFrameEffect(animatorState, config, xeffect);
                            xeffect.Mirror(bone.transform.lossyScale.x < 0);
                        }
                        else
                        {
                            xeffect.onlyFollowPosition = false;
                        }
                    }
                    else
                    {
                        xeffect.Stop();
                    }
                });
            }
        }
    }
コード例 #3
0
ファイル: XEffectManager.cs プロジェクト: oathx/myactx
 static XEffectManager()
 {
     Instance = new XEffectManager();
     Instance.InitialCacheStrategy();
 }