public override void OnInspectorGUI() { btn = target as UIButton; int controlID = EditorGUILayout.IntField("ControlID", btn.controlID); if (btn.controlID != controlID) { btn.controlID = controlID; } int clickInterval = EditorGUILayout.IntField("ClickInterval", btn.clickInterval); if (btn.clickInterval != clickInterval) { btn.clickInterval = clickInterval; } int audioID = EditorGUILayout.IntField("AudioID", btn.audioID); if (audioID != btn.audioID) { btn.audioID = audioID; } UIMod uis = EditorGUILayout.ObjectField("UIMod", btn.uiMod, typeof(UIMod), true) as UIMod; if (btn.uiMod != uis) { btn.uiMod = uis; } base.OnInspectorGUI(); }
public override void OnInspectorGUI() { base.DrawDefaultInspector(); uimod = target as UIMod; if (GUILayout.Button("自动输出Lua变量")) { string str = string.Empty; str = "--------------------------------------------------------------\n"; foreach (GameObject obj in uimod.relatedGameObject) { string localstr = string.Empty; localstr = string.Format("local m_ui{0} = nil; --{1}\n", obj.name, obj.GetType()); str += localstr; } Debug.LogError(str); int index = 0; str = string.Empty; foreach (GameObject obj in uimod.relatedGameObject) { string localstr = string.Empty; localstr = string.Format("m_ui{0} = objs[{1}];\n", obj.name, index); str += localstr; index += 1; } Debug.LogError(str); } }
static int GetTexture(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { UIMod obj = (UIMod)ToLua.CheckObject <UIMod>(L, 1); string arg0 = ToLua.CheckString(L, 2); UnityEngine.Texture o = obj.GetTexture(arg0); ToLua.Push(L, o); return(1); } else if (count == 3) { UIMod obj = (UIMod)ToLua.CheckObject <UIMod>(L, 1); string arg0 = ToLua.CheckString(L, 2); bool arg1 = LuaDLL.luaL_checkboolean(L, 3); UnityEngine.Texture o = obj.GetTexture(arg0, arg1); ToLua.Push(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: UIMod.GetTexture")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
protected override void Awake() { base.Awake(); //设置材质球 string uiResMoudle = ""; UIMod uiSystem = GetComponentInParent <UIMod>(); if (uiSystem) { uiResMoudle = uiSystem.resUtility.moduleName; } #if UNITY_EDITOR if (Application.isPlaying) { base.graphic.material = ResMgr.Inst.LoadAsset <Material>("UI_OutlineEx", 3, uiResMoudle); } else { base.graphic.material = new Material(Shader.Find("UI/OutlineEx")); } #else base.graphic.material = ResMgr.Inst.LoadAsset <Material>("UI_OutlineEx", 3, uiResMoudle); #endif }
void Start() { // 挂载uiMod if (uiMod == null) { uiMod = gameObject.GetComponentInParent <UIMod>(); } }
protected override void Start() { base.Start(); if (uiMod == null) { uiMod = gameObject.GetComponentInParent <UIMod>(); } }
// Use this for initialization void Start() { // 挂载uiMod if (uiMod == null) { uiMod = gameObject.GetComponentInParent <UIMod>(); } rectTransform = transform as RectTransform; canvas = GameObject.Find("UIRoot").GetComponent <Canvas>(); }
protected override void Start() { base.Start(); #if UNITY_EDITOR // 挂载uiMod if (uiMod == null) { uiMod = gameObject.GetComponentInParent <UIMod>(); } #endif }
private GameObject NewObjectInstance() { GameObject obj = GameObject.Instantiate(poolObjectPrefab) as GameObject; UIMod uimod = obj.transform.GetComponent <UIMod> (); if (uimod != null) { uimod.id = autoNumber++; } return(obj); }
// Use this for initialization protected override void Start() { base.Start(); // 挂载uiMod if (uiMod == null) { uiMod = gameObject.GetComponentInParent <UIMod>(); } this.onValueChanged.AddListener(ValueChanged); }
protected override void Start() { if (playOnEable) { InvokeRepeating("CountDown", 0, Interval); } // 挂载uiMod if (uiMod == null) { uiMod = gameObject.GetComponentInParent <UIMod>(); } }
// Use this for initialization protected override void Start() { // 挂载uiMod if (uiMod == null) { uiMod = gameObject.GetComponentInParent <UIMod>(); if (uiMod == null) { Debug.LogError("Can't Find UIMod:" + gameObject.name); Destroy(gameObject); return; } } }
static int Close(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); UIMod obj = (UIMod)ToLua.CheckObject <UIMod>(L, 1); obj.Close(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
protected override void Start() { base.Start(); #if UNITY_EDITOR // 挂载uiMod if (uiMod == null) { uiMod = gameObject.GetComponentInParent <UIMod>(); } #endif _contentLayout = content.GetComponent <LayoutGroup>(); InitLayoutData(); }
static int PushEvent(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UIMod obj = (UIMod)ToLua.CheckObject(L, 1, typeof(UIMod)); object arg0 = ToLua.ToVarObject(L, 2); obj.PushEvent(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
protected override void Start() { base.Start(); #if UNITY_EDITOR // 挂载uiMod if (uiMod == null) { uiMod = gameObject.GetComponentInParent <UIMod>(); } #endif if (enableValueChangeEvent) { onValueChanged.AddListener(OnValueChange); } }
public override void OnInspectorGUI() { UITextTimeCountup txt = target as UITextTimeCountup; int controlID = EditorGUILayout.IntField("ControlID", txt.controlID); if (txt.controlID != controlID) { txt.controlID = controlID; } UIMod uis = EditorGUILayout.ObjectField("UIMod", txt.uiMod, typeof(UIMod), true) as UIMod; if (txt.uiMod != uis) { txt.uiMod = uis; } base.OnInspectorGUI(); }
static int get_id(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIMod obj = (UIMod)o; int ret = obj.id; LuaDLL.lua_pushinteger(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index id on a nil value" : e.Message)); } }
public override void OnInspectorGUI() { slider = target as UISlider; int controlID = EditorGUILayout.IntField("ControlID", slider.controlID); if (slider.controlID != controlID) { slider.controlID = controlID; } UIMod uis = EditorGUILayout.ObjectField("UIMod", slider.uiMod, typeof(UIMod), true) as UIMod; if (slider.uiMod != uis) { slider.uiMod = uis; } base.OnInspectorGUI(); }
static int get_uiMod(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UITween obj = (UITween)o; UIMod ret = obj.uiMod; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index uiMod on a nil value" : e.Message)); } }
static int set_uiMod(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UITween obj = (UITween)o; UIMod arg0 = (UIMod)ToLua.CheckUnityObject(L, 2, typeof(UIMod)); obj.uiMod = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index uiMod on a nil value" : e.Message)); } }
static int get_uiName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIMod obj = (UIMod)o; string ret = obj.uiName; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index uiName on a nil value" : e.Message)); } }
static int set_enableUpdate(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIMod obj = (UIMod)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.enableUpdate = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index enableUpdate on a nil value" : e.Message)); } }
static int set_relatedGameObject(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIMod obj = (UIMod)o; UnityEngine.GameObject[] arg0 = ToLua.CheckObjectArray <UnityEngine.GameObject>(L, 2); obj.relatedGameObject = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index relatedGameObject on a nil value" : e.Message)); } }
static int set_uiName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIMod obj = (UIMod)o; string arg0 = ToLua.CheckString(L, 2); obj.uiName = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index uiName on a nil value" : e.Message)); } }
static int get_uiMod(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIInputField obj = (UIInputField)o; UIMod ret = obj.uiMod; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index uiMod on a nil value")); } }
static int set_uiMod(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIInputField obj = (UIInputField)o; UIMod arg0 = (UIMod)ToLua.CheckObject <UIMod>(L, 2); obj.uiMod = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index uiMod on a nil value")); } }
static int get_enableUpdate(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIMod obj = (UIMod)o; bool ret = obj.enableUpdate; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index enableUpdate on a nil value" : e.Message)); } }
protected override void Start() { base.Start(); if (scrollRect != null) { OnScrollRectValueChange(scrollRect.normalizedPosition); } #if UNITY_EDITOR // 挂载uiMod if (uiMod == null) { uiMod = gameObject.GetComponentInParent <UIMod>(); } #endif }
static int get_relatedGameObject(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIMod obj = (UIMod)o; UnityEngine.GameObject[] ret = obj.relatedGameObject; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index relatedGameObject on a nil value" : e.Message)); } }