static public int SetCustomInput(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (matchType(l, argc, 2, typeof(UnityEngine.RaycastHit), typeof(bool))) { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); UnityEngine.RaycastHit a1; checkValueType(l, 2, out a1); System.Boolean a2; checkType(l, 3, out a2); self.SetCustomInput(ref a1, a2); pushValue(l, true); pushValue(l, a1); return(2); } else if (matchType(l, argc, 2, typeof(UnityEngine.Vector2), typeof(bool))) { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); UnityEngine.Vector2 a1; checkType(l, 2, out a1); System.Boolean a2; checkType(l, 3, out a2); self.SetCustomInput(a1, a2); pushValue(l, true); return(1); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function to call"); return(2); } catch (Exception e) { return(error(l, e)); } }
static int SetCustomInput(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.Stage), typeof(UnityEngine.RaycastHit), typeof(bool))) { FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.ToObject(L, 1); UnityEngine.RaycastHit arg0 = (UnityEngine.RaycastHit)ToLua.ToObject(L, 2); bool arg1 = LuaDLL.lua_toboolean(L, 3); obj.SetCustomInput(ref arg0, arg1); ToLua.Push(L, arg0); return(1); } else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.Stage), typeof(UnityEngine.Vector2), typeof(bool))) { FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.ToObject(L, 1); UnityEngine.Vector2 arg0 = ToLua.ToVector2(L, 2); bool arg1 = LuaDLL.lua_toboolean(L, 3); obj.SetCustomInput(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.Stage.SetCustomInput")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_afterUpdate(IntPtr L) { try { FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject(L, 1, typeof(FairyGUI.Stage)); EventObject arg0 = null; if (LuaDLL.lua_isuserdata(L, 2) != 0) { arg0 = (EventObject)ToLua.ToObject(L, 2); } else { return(LuaDLL.luaL_throw(L, "The event 'FairyGUI.Stage.afterUpdate' can only appear on the left hand side of += or -= when used outside of the type 'FairyGUI.Stage'")); } if (arg0.op == EventOp.Add) { System.Action ev = (System.Action)arg0.func; obj.afterUpdate += ev; } else if (arg0.op == EventOp.Sub) { System.Action ev = (System.Action)arg0.func; obj.afterUpdate -= ev; } return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int PlayOneShotSound(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); UnityEngine.AudioClip arg0 = (UnityEngine.AudioClip)ToLua.CheckObject(L, 2, typeof(UnityEngine.AudioClip)); obj.PlayOneShotSound(arg0); return(0); } else if (count == 3) { FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); UnityEngine.AudioClip arg0 = (UnityEngine.AudioClip)ToLua.CheckObject(L, 2, typeof(UnityEngine.AudioClip)); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); obj.PlayOneShotSound(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.Stage.PlayOneShotSound")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SetFous(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); FairyGUI.DisplayObject arg0 = (FairyGUI.DisplayObject)ToLua.CheckObject <FairyGUI.DisplayObject>(L, 2); obj.SetFous(arg0); return(0); } else if (count == 3) { FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); FairyGUI.DisplayObject arg0 = (FairyGUI.DisplayObject)ToLua.CheckObject <FairyGUI.DisplayObject>(L, 2); bool arg1 = LuaDLL.luaL_checkboolean(L, 3); obj.SetFous(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.Stage.SetFous")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int PlayOneShotSound(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (argc == 2) { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); UnityEngine.AudioClip a1; checkType(l, 2, out a1); self.PlayOneShotSound(a1); pushValue(l, true); return(1); } else if (argc == 3) { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); UnityEngine.AudioClip a1; checkType(l, 2, out a1); System.Single a2; checkType(l, 3, out a2); self.PlayOneShotSound(a1, a2); pushValue(l, true); return(1); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function to call"); return(2); } catch (Exception e) { return(error(l, e)); } }
public Stage() : base() { _inst = this; soundVolume = 1; _updateContext = new UpdateContext(); stageWidth = Screen.width; stageHeight = Screen.height; _frameGotHitTarget = -1; touchScreen = Input.touchSupported; _touches = new TouchInfo[5]; for (int i = 0; i < _touches.Length; i++) _touches[i] = new TouchInfo(); if (!touchScreen) _touches[0].touchId = 0; _rollOutChain = new List<DisplayObject>(); _rollOverChain = new List<DisplayObject>(); onStageResized = new EventListener(this, "onStageResized"); onTouchMove = new EventListener(this, "onTouchMove"); onCopy = new EventListener(this, "onCopy"); onPaste = new EventListener(this, "onPaste"); StageEngine engine = GameObject.FindObjectOfType<StageEngine>(); if (engine != null) this.gameObject = engine.gameObject; else { int layer = LayerMask.NameToLayer(StageCamera.LayerName); this.gameObject = new GameObject("Stage"); this.gameObject.hideFlags = HideFlags.None; this.gameObject.layer = layer; this.gameObject.AddComponent<StageEngine>(); this.gameObject.AddComponent<UIContentScaler>(); } this.cachedTransform = gameObject.transform; this.cachedTransform.localScale = new Vector3(StageCamera.UnitsPerPixel, StageCamera.UnitsPerPixel, StageCamera.UnitsPerPixel); this.gameObject.SetActive(true); UnityEngine.Object.DontDestroyOnLoad(this.gameObject); EnableSound(); inputCaret = new InputCaret(); highlighter = new Highlighter(); Timers.inst.Add(5, 0, RunTextureCollector); #if UNITY_WEBPLAYER || UNITY_WEBGL || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR CopyPastePatch.Apply(); #endif }
static int SetCustomInput(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 3 && TypeChecker.CheckTypes <UnityEngine.RaycastHit, bool>(L, 2)) { FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); UnityEngine.RaycastHit arg0 = StackTraits <UnityEngine.RaycastHit> .To(L, 2); bool arg1 = LuaDLL.lua_toboolean(L, 3); obj.SetCustomInput(ref arg0, arg1); ToLua.Push(L, arg0); return(1); } else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.Vector2, bool>(L, 2)) { FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); UnityEngine.Vector2 arg0 = ToLua.ToVector2(L, 2); bool arg1 = LuaDLL.lua_toboolean(L, 3); obj.SetCustomInput(arg0, arg1); return(0); } else if (count == 4 && TypeChecker.CheckTypes <UnityEngine.RaycastHit, bool, bool>(L, 2)) { FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); UnityEngine.RaycastHit arg0 = StackTraits <UnityEngine.RaycastHit> .To(L, 2); bool arg1 = LuaDLL.lua_toboolean(L, 3); bool arg2 = LuaDLL.lua_toboolean(L, 4); obj.SetCustomInput(ref arg0, arg1, arg2); ToLua.Push(L, arg0); return(1); } else if (count == 4 && TypeChecker.CheckTypes <UnityEngine.Vector2, bool, bool>(L, 2)) { FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); UnityEngine.Vector2 arg0 = ToLua.ToVector2(L, 2); bool arg1 = LuaDLL.lua_toboolean(L, 3); bool arg2 = LuaDLL.lua_toboolean(L, 4); obj.SetCustomInput(arg0, arg1, arg2); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.Stage.SetCustomInput")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int ResetInputState(IntPtr l) { try { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); self.ResetInputState(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int get_onStageResized(IntPtr l) { try { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); pushValue(l, true); pushValue(l, self.onStageResized); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int EnableSound(IntPtr l) { try { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); self.EnableSound(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int get_touchCount(IntPtr l) { try { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); pushValue(l, true); pushValue(l, self.touchCount); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int constructor(IntPtr l) { try { FairyGUI.Stage o; o = new FairyGUI.Stage(); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } }
static int DisableSound(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject(L, 1, typeof(FairyGUI.Stage)); obj.DisableSound(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int set_focus(IntPtr l) { try { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); FairyGUI.DisplayObject v; checkType(l, 2, out v); self.focus = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int CancelClick(IntPtr l) { try { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); System.Int32 a1; checkType(l, 2, out a1); self.CancelClick(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int ResetInputState(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); obj.ResetInputState(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int CloseKeyboard(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); obj.CloseKeyboard(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int set_soundVolume(IntPtr l) { try { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); float v; checkType(l, 2, out v); self.soundVolume = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int SortWorldSpacePanelsByZOrder(IntPtr l) { try { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); System.Int32 a1; checkType(l, 2, out a1); self.SortWorldSpacePanelsByZOrder(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int MonitorTexture(IntPtr l) { try { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); FairyGUI.NTexture a1; checkType(l, 2, out a1); self.MonitorTexture(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int GetAllTouch(IntPtr l) { try { FairyGUI.Stage self = (FairyGUI.Stage)checkSelf(l); System.Int32[] a1; checkArray(l, 2, out a1); var ret = self.GetAllTouch(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static int DoKeyNavigate(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.DoKeyNavigate(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int RemoveTouchMonitor(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); FairyGUI.EventDispatcher arg0 = (FairyGUI.EventDispatcher)ToLua.CheckObject <FairyGUI.EventDispatcher>(L, 2); obj.RemoveTouchMonitor(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int CancelClick(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.CancelClick(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int InputString(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); string arg0 = ToLua.CheckString(L, 2); obj.InputString(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int MonitorTexture(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); FairyGUI.NTexture arg0 = (FairyGUI.NTexture)ToLua.CheckObject <FairyGUI.NTexture>(L, 2); obj.MonitorTexture(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SortWorldSpacePanelsByZOrder(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.SortWorldSpacePanelsByZOrder(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int ApplyPanelOrder(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); FairyGUI.Container arg0 = (FairyGUI.Container)ToLua.CheckObject <FairyGUI.Container>(L, 2); obj.ApplyPanelOrder(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetAllTouch(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); int[] arg0 = ToLua.CheckNumberArray <int>(L, 2); int[] o = obj.GetAllTouch(arg0); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetTouchPosition(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.Stage obj = (FairyGUI.Stage)ToLua.CheckObject <FairyGUI.Stage>(L, 1); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); UnityEngine.Vector2 o = obj.GetTouchPosition(arg0); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// /// </summary> public Stage() : base() { _inst = this; soundVolume = 1; _updateContext = new UpdateContext(); stageWidth = Screen.width; stageHeight = Screen.height; _frameGotHitTarget = -1; if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.OSXEditor) touchScreen = false; else touchScreen = Input.touchSupported; _touches = new TouchInfo[5]; for (int i = 0; i < _touches.Length; i++) _touches[i] = new TouchInfo(); if (!touchScreen) _touches[0].touchId = 0; _rollOutChain = new List<DisplayObject>(); _rollOverChain = new List<DisplayObject>(); onStageResized = new EventListener(this, "onStageResized"); onTouchMove = new EventListener(this, "onTouchMove"); StageEngine engine = GameObject.FindObjectOfType<StageEngine>(); if (engine != null) Object.Destroy(engine.gameObject); this.gameObject.name = "Stage"; this.gameObject.layer = LayerMask.NameToLayer(StageCamera.LayerName); this.gameObject.AddComponent<StageEngine>(); this.gameObject.AddComponent<UIContentScaler>(); this.gameObject.SetActive(true); Object.DontDestroyOnLoad(this.gameObject); this.cachedTransform.localScale = new Vector3(StageCamera.UnitsPerPixel, StageCamera.UnitsPerPixel, StageCamera.UnitsPerPixel); EnableSound(); if (touchScreen) { #if !(UNITY_WEBPLAYER || UNITY_WEBGL || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR) _keyboard = new FairyGUI.TouchScreenKeyboard(); keyboardInput = true; #endif } Timers.inst.Add(5, 0, RunTextureCollector); #if UNITY_5_4_OR_NEWER SceneManager.sceneLoaded += SceneManager_sceneLoaded; #endif _focusRemovedDelegate = OnFocusRemoved; }
void Awake() { _stage = Stage.inst; }
/// <summary> /// /// </summary> public static void Instantiate() { if (_inst == null) { _inst = new Stage(); GRoot._inst = new GRoot(); _inst.AddChild(GRoot._inst.displayObject); StageCamera.CheckMainCamera(); } }