void Start() { #if !UNITY_EDITOR try { #endif Binding = gameObject.GetComponent <BindDataRoot>(); if (Binding == null) { return; } var controllerBase = UIManager.Instance.GetController(UIConfig.MessageBoxEx); if (controllerBase == null) { return; } Binding.SetBindDataSource(controllerBase.GetDataModel("")); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
public static void BindDataSource(BindDataRoot dataRoot, int controllerId, string dataName) { var ctrller = UIManager.Instance.GetControllerById(controllerId); if (null == ctrller) { Logger.Error("null==UIManager.Instance.GetControllerById({0})", controllerId); return; } dataRoot.SetBindDataSource(ctrller.GetDataModel(dataName)); }
static int BindDataSourcePlayerData(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); BindDataRoot arg0 = (BindDataRoot)ToLua.CheckUnityObject(L, 1, typeof(BindDataRoot)); LuaGameHelper.BindDataSourcePlayerData(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int RemoveBinding(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); BindDataRoot obj = (BindDataRoot)ToLua.CheckObject(L, 1, typeof(BindDataRoot)); obj.RemoveBinding(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void Start() { Binding = gameObject.GetComponent <BindDataRoot>(); if (Binding == null) { return; } var controllerBase = UIManager.Instance.GetController(UIConfig.MessageBoxEx); if (controllerBase == null) { return; } Binding.SetBindDataSource(controllerBase.GetDataModel("")); }
static int SetBindDataSource(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); BindDataRoot obj = (BindDataRoot)ToLua.CheckObject(L, 1, typeof(BindDataRoot)); object arg0 = ToLua.ToVarObject(L, 2); obj.SetBindDataSource(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int BindDataSource(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); BindDataRoot arg0 = (BindDataRoot)ToLua.CheckUnityObject(L, 1, typeof(BindDataRoot)); int arg1 = (int)LuaDLL.luaL_checknumber(L, 2); string arg2 = ToLua.CheckString(L, 3); LuaGameHelper.BindDataSource(arg0, arg1, arg2); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_IsBind(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); BindDataRoot obj = (BindDataRoot)o; bool ret = obj.IsBind; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index IsBind on a nil value" : e.Message)); } }
static int set_Source(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); BindDataRoot obj = (BindDataRoot)o; object arg0 = ToLua.ToVarObject(L, 2); obj.Source = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Source on a nil value" : e.Message)); } }
static int set_IsBind(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); BindDataRoot obj = (BindDataRoot)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.IsBind = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index IsBind on a nil value" : e.Message)); } }
static int set_BindingNamelList(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); BindDataRoot obj = (BindDataRoot)o; System.Collections.Generic.List <BindingClassName> arg0 = (System.Collections.Generic.List <BindingClassName>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <BindingClassName>)); obj.BindingNamelList = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index BindingNamelList on a nil value" : e.Message)); } }
static int get_Source(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); BindDataRoot obj = (BindDataRoot)o; object ret = obj.Source; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Source on a nil value" : e.Message)); } }
static int get_BindingNamelList(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); BindDataRoot obj = (BindDataRoot)o; System.Collections.Generic.List <BindingClassName> ret = obj.BindingNamelList; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index BindingNamelList on a nil value" : e.Message)); } }
void Awake() { #if !UNITY_EDITOR try { #endif root = GetComponent <BindDataRoot>(); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
public static void BindDataSourcePlayerData(BindDataRoot dataRoot) { dataRoot.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel); }
public override void OnGUI(Rect rect, SerializedProperty prop, GUIContent label) { SerializedProperty target = prop.FindPropertyRelative("ClassName"); string curSel = target.stringValue; List <string> strList = new List <string>(); //List<string> strListOrder = new List<string>(); SerializedObject serObj = target.serializedObject; //strListOrder.Add(curSel == "" ? "none" : curSel); int index = 0; if (serObj.targetObject is BindDataRoot) { var path = Application.dataPath + "/Plugins/DataModel/"; Assembly ass = Assembly.LoadFile(Path.Combine(path, "GameDataDefine.dll")); Type[] types = ass.GetTypes(); int tempIndex = 0; { var __array1 = types; var __arrayLength1 = __array1.Length; for (int __i1 = 0; __i1 < __arrayLength1; ++__i1) { var t = (Type)__array1[__i1]; { if (CheckClassProperChanged(t, 0)) { strList.Add(t.Name); } } } } } else { Transform tf = null; BindDataRoot root = null; if (serObj.targetObject is InverseBinding) { InverseBinding tarObj = serObj.targetObject as InverseBinding; //tf = tarObj.gameObject.transform.parent; tf = tarObj.gameObject.transform; } else if (serObj.targetObject is UIClassBinding) { UIClassBinding tarObj = serObj.targetObject as UIClassBinding; //tf = tarObj.gameObject.transform.parent; tf = tarObj.gameObject.transform; } while (tf != null) { root = tf.gameObject.GetComponent <BindDataRoot>(); if (root != null) { { var __list2 = root.BindingNamelList; var __listCount2 = __list2.Count; for (int __i2 = 0; __i2 < __listCount2; ++__i2) { var name = __list2[__i2]; { strList.Add(name.ClassName); } } } } tf = tf.parent; } } if (strList.Count == 0) { return; } strList.Sort(); { var __list3 = strList; var __listCount3 = __list3.Count; for (int __i3 = 0; __i3 < __listCount3; ++__i3) { var s = __list3[__i3]; { if (curSel == s) { break; } index++; } } } GUI.changed = false; EditorGUI.BeginDisabledGroup(target.hasMultipleDifferentValues); int choice = EditorGUI.Popup(rect, "", index, strList.ToArray()); if (GUI.changed && choice >= 0) { string str = strList[choice]; target.stringValue = str; } EditorGUI.EndDisabledGroup(); }
public static void BindDataSourceNoticeData(BindDataRoot dataRoot) { dataRoot.SetBindDataSource(PlayerDataManager.Instance.NoticeData); }