Ejemplo n.º 1
0
        private void _LuaScriptParmsCall(AbstractParams ScriptParms)
        {
            if (ScriptParms != null)
            {
                ScriptParms.ResetReadIndex();

                for (int i = 0; i < ScriptParms.ArgCount; ++i)
                {
                    int tp = ScriptParms.GetArgIndexType(i);
                    if (tp == (int)ParamType.INT)
                    {
                        this.luafunc.Push(ScriptParms.ReadInt());
                    }
                    else if (tp == (int)ParamType.BOOL)
                    {
                        this.luafunc.Push(ScriptParms.ReadBool());
                    }
                    else if (tp == (int)ParamType.SHORT)
                    {
                        this.luafunc.Push(ScriptParms.ReadShort());
                    }
                    else if (tp == (int)ParamType.FLOAT)
                    {
                        this.luafunc.Push(ScriptParms.ReadFloat());
                    }
                    else if (tp == (int)ParamType.DOUBLE)
                    {
                        this.luafunc.Push(ScriptParms.ReadDouble());
                    }
                    else if (tp == (int)ParamType.STRING)
                    {
                        this.luafunc.Push(ScriptParms.ReadString());
                    }
                    else if (tp == (int)ParamType.OBJECT)
                    {
                        this.luafunc.Push(ScriptParms.ReadObject());
                    }
                    else if (tp == (int)ParamType.UNITYOBJECT)
                    {
                        this.luafunc.Push(ScriptParms.ReadUnityObject());
                    }
                    else if (tp == (int)ParamType.LONG)
                    {
                        this.luafunc.Push(ScriptParms.ReadLong());
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void Push(AbstractParams args)
        {
            if (args != null)
            {
                if (args == this)
                {
                    LogMgr.Log("参数对象相同 无法添加");
                    return;
                }

                int cnt = args.ArgCount;
                if (this._LimitMax != -1 && cnt + ArgCount > this._LimitMax)
                {
                    this.throwUseGener();
                    return;
                }

                if (this._OriginArgCount > 0)
                {
                    this._OriginArgCount += cnt;
                }

                for (int i = 0; i < cnt; ++i)
                {
                    int tp = args.GetArgIndexType(i);
                    if (tp == (int)ParamType.INT)
                    {
                        this.WriteInt(args.ReadInt());
                    }
                    else if (tp == (int)ParamType.SHORT)
                    {
                        this.WriteShort(args.ReadShort());
                    }
                    else if (tp == (int)ParamType.BOOL)
                    {
                        this.WriteBool(args.ReadBool());
                    }
                    else if (tp == (int)ParamType.FLOAT)
                    {
                        this.WriteFloat(args.ReadFloat());
                    }
                    else if (tp == (int)ParamType.DOUBLE)
                    {
                        this.WriteDouble(args.ReadDouble());
                    }
                    else if (tp == (int)ParamType.LONG)
                    {
                        this.WriteLong(args.ReadLong());
                    }
                    else if (tp == (int)ParamType.STRING)
                    {
                        this.WriteString(args.ReadString());
                    }
                    else if (tp == (int)ParamType.VETOR3)
                    {
                        this.WriteVector3(args.ReadVector3());
                    }
                    else if (tp == (int)ParamType.OBJECT)
                    {
                        this.WriteObject(args.ReadObject());
                    }
                    else if (tp == (int)ParamType.UNITYOBJECT)
                    {
                        this.WriteUnityObject(args.ReadUnityObject());
                    }
                }
            }
        }