public override void OnInspectorGUI() { serializedObject.Update(); //更新对象最新数据 table.FlushVariableDic(); repeatList.Clear(); //标记重复的变量 if (table.Variables != null) { for (int i = 0; i < table.Variables.Length; i++) { if (table.GetRepeatVariable().Contains(table.Variables[i].Name)) { repeatList.Add(i); } } list.drawElementBackgroundCallback = (rect, index, isActive, isFocused) => { if (repeatList.Contains(index)) { GUI.backgroundColor = Color.red; } else { GUI.backgroundColor = Color.white; } }; } list.DoLayoutList(); serializedObject.ApplyModifiedProperties(); }
static int _m_GetRepeatVariable(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); UIVariableTable gen_to_be_invoked = (UIVariableTable)translator.FastGetCSObj(L, 1); { System.Collections.Generic.List <string> gen_ret = gen_to_be_invoked.GetRepeatVariable( ); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }