コード例 #1
0
        public void Frame(IEventArgs args, int interval)
        {
            if (_entity.isFlagDestroy)
            {
                return;
            }
            args.TempUse("entity", this);
            args.TempUse(name, this);

            FreeRuleEventArgs fr = (FreeRuleEventArgs)args;

            move.Frame(fr, _entity, interval);

            xPara.SetValue(_entity.position.Value.x);
            yPara.SetValue(_entity.position.Value.y);
            zPara.SetValue(_entity.position.Value.z);

            foreach (PlayerEntity player in follows)
            {
                Vector3 v = _entity.position.Value;
                //v.y = v.y + 20;
                player.position.Value = v;
            }
            if (gameObject != null)
            {
                gameObject.transform.position = _entity.position.Value;
            }

            if (skill != null)
            {
                skill.Frame((FreeRuleEventArgs)args);
            }

            if (frameAction != null)
            {
                frameAction.Act(args);
            }

            if (effect != null && args.Rule.ServerTime - lastEffectTime > 1000L)
            {
                foreach (PlayerEntity player in args.GameContext.player.GetInitializedPlayerEntities())
                {
                    if (!effect.GetPlayerIds().Contains(player.entityKey.Value.EntityId))
                    {
                        effect.Act(args);
                        effect.AddPlayerId(player.entityKey.Value.EntityId);
                        lastEffectTime = args.Rule.ServerTime;
                        break;
                    }
                }
            }
            args.Resume(name);
            args.Resume("entity");
        }
コード例 #2
0
        public void Frame(IEventArgs args, int interval)
        {
            if (_entity.isFlagDestroy)
            {
                return;
            }
            args.TempUse("entity", this);
            args.TempUse(name, this);

            FreeRuleEventArgs fr = (FreeRuleEventArgs)args;

            move.Frame(fr, _entity, interval);

            xPara.SetValue(_entity.position.Value.x);
            yPara.SetValue(_entity.position.Value.y);
            zPara.SetValue(_entity.position.Value.z);

            foreach (PlayerEntity player in follows)
            {
                Vector3 v = _entity.position.Value;
                //v.y = v.y + 20;
                player.position.Value = v;
            }
            if (gameObject != null)
            {
                gameObject.transform.position = _entity.position.Value;
            }

            if (skill != null)
            {
                skill.Frame((FreeRuleEventArgs)args);
            }

            if (frameAction != null)
            {
                frameAction.Act(args);
            }

            args.Resume(name);
            args.Resume("entity");
        }