Exemplo n.º 1
0
 private void RegistParamToTable(LuaTable table, int index, LuaParam param)
 {
     if (table != null && param != null)
     {
         SystemObject value = GetValueFromParam(param);
         if (value == null)
         {
             LogUtil.Error(LuaUtility.LOGGER_NAME, "");
         }
         else
         {
             table.Set(index, value);
         }
     }
 }
Exemplo n.º 2
0
 private void RegistParamToTable(LuaTable table, string name, LuaParam param)
 {
     if (table != null && !string.IsNullOrEmpty(name) && param != null)
     {
         SystemObject value = GetValueFromParam(param);
         if (value == null)
         {
             LogUtil.Error(LuaUtility.LOGGER_NAME, $"LuaBinderBehaviour:RegistParamToTable->the value of the param({name}) is null");
         }
         else
         {
             table.Set(name, value);
         }
     }
 }
Exemplo n.º 3
0
        private SystemObject GetValueFromParam(LuaParam paramValue)
        {
            if (paramValue != null)
            {
                SystemObject value = paramValue.GetValue();
                if (value != null)
                {
                    if (paramValue.paramType == LuaParamType.UObject)
                    {
                        if (value.GetType().IsSubclassOf(typeof(LuaBinderBehaviour)))
                        {
                            LuaBinderBehaviour lbBeh = value as LuaBinderBehaviour;
                            lbBeh.InitBinder();

                            value = lbBeh.Table;
                        }
                    }
                }
                return(value);
            }
            return(null);
        }