コード例 #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());
                    }
                }
            }
        }