示例#1
0
    private void CreateModel(Dictionary <int, int> equipList)
    {
        var player         = ObjManager.Instance.MyPlayer;
        var controllerBase = UIManager.Instance.GetController(UIConfig.NewStrongUI);

        if (controllerBase == null)
        {
            return;
        }
        var ctrl = controllerBase;

        if (ctrl == null)
        {
            return;
        }

        ModelRoot.Create(player.GetDataId(), equipList, (character) =>
        {
            DragRotate.Target = character.transform;
            var roleId        = PlayerDataManager.Instance.GetRoleId();
            int effectId      = 0;
            if ((int)ctrl.CallFromOtherClass("mChange", null) == 1)
            {
                if (roleId == 0)
                {
                    effectId = 404;
                }
                else if (roleId == 1)
                {
                    effectId = 402;
                }
                else
                {
                    effectId = 403;
                }
            }
            else
            {
                if (roleId == 0)
                {
                    effectId = 405;
                }
                else if (roleId == 1)
                {
                    effectId = 405;
                }
                else
                {
                    effectId = 405;
                }
            }

            var tableEffct      = Table.GetEffect(effectId);
            EffectRef effectRef = new EffectRef();
            effectRef.TypeId    = tableEffct.Id;
            effectRef.RefCount++;
            EffectManager.Instance.CreateEffect(tableEffct, character, null, (e, id) =>
            {
                var avatar = character.GetComponent <ActorAvatar>();
                e.gameObject.SetLayerRecursive(avatar.Layer);
                e.gameObject.SetRenderQueue(avatar.RenderQueue);
            });
        }, -1, true, 5, true, -1, -1);
    }
示例#2
0
    //update
    public void Update()
    {
#if !UNITY_EDITOR
        try
        {
#endif

        if (null == mCharacter)
        {
            return;
        }
        {
            var __list3      = LoadQueue;
            var __listCount3 = __list3.Count;
            for (var __i3 = 0; __i3 < __listCount3; ++__i3)
            {
                var buffRef = __list3[__i3];
                {
                    var buffId = buffRef.BuffId;
                    var buff   = GetBuff(buffId);
                    if (null == buff)
                    {
                        continue;
                    }

                    if (buff.State == BuffState.Deleted)
                    {
                        continue;
                    }

                    var tableEffct = Table.GetEffect(buffRef.EffectTypeId);
                    var playerId   = ObjManager.Instance.MyPlayer.GetObjId();
                    if (tableEffct.MaxOwnNum != -1)
                    {
                        EffectRef effectRef;
                        if (mEffectRefCount.TryGetValue(tableEffct.Id, out effectRef))
                        {
                            var tempBuff = GetBuff(buffId);
                            tempBuff.EffectRef.Add(effectRef);
                            effectRef.RefCount++;
                        }
                        else
                        {
                            effectRef        = new EffectRef();
                            effectRef.TypeId = tableEffct.Id;
                            effectRef.RefCount++;

                            EffectManager.Instance.CreateEffect(tableEffct, mCharacter, null, (e, id) =>
                            {
                                if (Math.Abs(tableEffct.Duration) < 0.001f)
                                {
                                    var tempBuff = GetBuff(buffId);
                                    if (null == tempBuff)
                                    {
                                        EffectManager.Instance.StopLoop(id);
                                    }
                                    else
                                    {
                                        effectRef.Uuid = id;
                                        tempBuff.EffectRef.Add(effectRef);
                                        mEffectRefCount[effectRef.TypeId] = effectRef;
                                        tempBuff.State = BuffState.LoadingCompleted;
                                    }
                                }
                            }, null,
                                                                (tableEffct.BroadcastType == 0 && buff.CasterId == playerId || buff.TargetId == playerId) ||
                                                                tableEffct.BroadcastType == 1);
                        }
                    }
                    else
                    {
                        EffectManager.Instance.CreateEffect(tableEffct, mCharacter, null, (e, id) =>
                        {
                            if (Math.Abs(tableEffct.Duration) < 0.001f)
                            {
                                var tempBuff = GetBuff(buffId);
                                if (null == tempBuff)
                                {
                                    EffectManager.Instance.StopLoop(id);
                                }
                                else
                                {
                                    tempBuff.EffectId.Add(id);
                                    tempBuff.State = BuffState.LoadingCompleted;
                                }
                            }
                        }, null,
                                                            (tableEffct.BroadcastType == 0 && buff.CasterId == playerId || buff.TargetId == playerId) ||
                                                            tableEffct.BroadcastType == 1);
                    }
                }
            }
        }
        LoadQueue.Clear();

#if !UNITY_EDITOR
    }

    catch (Exception ex)
    {
        Logger.Error(ex.ToString());
    }
#endif
    }