override public void Dispose() { if (_content.texture != null) { if (_contentItem == null) { _content.texture.onSizeChanged -= _reloadDelegate; try { FreeExternal(_content.texture); } catch (Exception err) { Debug.LogWarning(err); } } } if (_errorSign != null) { _errorSign.Dispose(); } if (_content2 != null) { _content2.Dispose(); } _content.Dispose(); base.Dispose(); }
override public void Dispose() { if (_content.texture != null) { if (_contentItem == null) FreeExternal(image.texture); } if (_errorSign != null) _errorSign.Dispose(); if (_content2 != null) _content2.Dispose(); _content.Dispose(); base.Dispose(); }
public override void Dispose() { if (dropdown != null) { dropdown.Dispose(); dropdown = null; } base.Dispose(); }
void OnDestroy() { if (container != null) { if (!Application.isPlaying) { EMRenderSupport.Remove(this); } if (_ui != null) { _ui.Dispose(); _ui = null; } container.Dispose(); container = null; } }
public override void Dispose() { if (dropdown != null) { dropdown.Dispose(); dropdown = null; } _selectionController = null; base.Dispose(); }
void OnDestroy() { if (Application.isPlaying) { if (_ui != null) { _ui.Dispose(); _ui = null; } container.Dispose(); container = null; } else { EMRenderSupport.Remove(this); } DestroyTexture(); }
override public void Dispose() { if (_content.texture != null) { if (_contentItem == null) { image.texture.onSizeChanged -= _reloadDelegate; FreeExternal(image.texture); } } if (_errorSign != null) { _errorSign.Dispose(); } if (_content2 != null) { _content2.Dispose(); } _content.Dispose(); base.Dispose(); }
static public int Dispose(IntPtr l) { try { FairyGUI.GComponent self = (FairyGUI.GComponent)checkSelf(l); self.Dispose(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
void OnDestroy() { Debug.Log("UIPanel.OnDestroy"); if (container != null) { if (!Application.isPlaying) { EMRenderSupport.Remove(this); } if (_ui != null) { _ui.Dispose(); _ui = null; } container.Dispose(); container = null; } _renders = null; }
public void Dispose() { int cnt = _list.numChildren; for (int i = 0; i < cnt; i++) { GObject obj = _list.GetChildAt(i); if (obj.data is PopupMenu) { ((PopupMenu)obj.data).Dispose(); } } _contentPane.Dispose(); }
static int Dispose(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); FairyGUI.GComponent obj = (FairyGUI.GComponent)ToLua.CheckObject(L, 1, typeof(FairyGUI.GComponent)); obj.Dispose(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void CaptureInEditMode() { if (!EMRenderSupport.packageListReady || UIPackage.GetByName(packageName) == null) { return; } _captured = true; DisplayOptions.SetEditModeHideFlags(); GComponent view = (GComponent)UIPackage.CreateObject(packageName, componentName); if (view != null) { DestroyTexture(); _texture = CaptureCamera.CreateRenderTexture(Mathf.RoundToInt(view.width), Mathf.RoundToInt(view.height), false); Container root = (Container)view.displayObject; root.layer = CaptureCamera.layer; root.SetChildrenLayer(CaptureCamera.layer); root.gameObject.hideFlags = HideFlags.None; root.gameObject.SetActive(true); GameObject cameraObject = new GameObject("Temp Capture Camera"); Camera camera = cameraObject.AddComponent <Camera>(); camera.depth = 0; camera.cullingMask = 1 << CaptureCamera.layer; camera.clearFlags = CameraClearFlags.Depth; camera.orthographic = true; camera.nearClipPlane = -30; camera.farClipPlane = 30; camera.enabled = false; camera.targetTexture = _texture; float halfHeight = (float)_texture.height / 2; camera.orthographicSize = halfHeight; cameraObject.transform.localPosition = root.cachedTransform.TransformPoint(halfHeight * camera.aspect, -halfHeight, 0); UpdateContext context = new UpdateContext(); //run two times context.Begin(); view.displayObject.Update(context); context.End(); context.Begin(); view.displayObject.Update(context); context.End(); RenderTexture old = RenderTexture.active; RenderTexture.active = _texture; GL.Clear(true, true, Color.clear); camera.Render(); RenderTexture.active = old; camera.targetTexture = null; view.Dispose(); GameObject.DestroyImmediate(cameraObject); if (_renderer != null) { _renderer.sharedMaterial.mainTexture = _texture; } } }
public void Dispose() { _contentPane.Dispose(); }
void CaptureInEditMode() { if (!packageListReady || UIPackage.GetByName(packageName) == null) { return; } _captured = true; GameObject tempGo = new GameObject("Temp Object"); tempGo.layer = CaptureCamera.layer; UIObjectFactory.packageItemExtensions.Clear(); UIObjectFactory.loaderConstructor = null; DisplayOptions.SetEditModeHideFlags(); DisplayOptions.defaultRoot = new Transform[] { tempGo.transform }; GComponent view = (GComponent)UIPackage.CreateObject(packageName, componentName); DisplayOptions.defaultRoot = null; if (view != null) { if (texture != null) { DestroyTexture(); } CreateTexture(Mathf.CeilToInt(view.width), Mathf.CeilToInt(view.height)); Container root = (Container)view.displayObject; root.layer = CaptureCamera.layer; root.SetChildrenLayer(CaptureCamera.layer); root.gameObject.hideFlags = HideFlags.None; root.gameObject.SetActive(true); GameObject cameraObject = new GameObject("Temp Capture Camera"); Camera camera = cameraObject.AddComponent <Camera>(); camera.depth = 0; camera.cullingMask = 1 << CaptureCamera.layer; camera.clearFlags = CameraClearFlags.Depth; camera.orthographic = true; camera.orthographicSize = view.height / 2; camera.nearClipPlane = -30; camera.farClipPlane = 30; camera.enabled = false; camera.targetTexture = texture; Vector3 pos = root.cachedTransform.position; pos.x += camera.orthographicSize * camera.aspect; pos.y -= camera.orthographicSize; pos.z = 0; cameraObject.transform.localPosition = pos; UpdateContext context = new UpdateContext(); //run two times context.Begin(); view.displayObject.Update(context); context.End(); context.Begin(); view.displayObject.Update(context); context.End(); RenderTexture old = RenderTexture.active; RenderTexture.active = texture; GL.Clear(true, true, Color.clear); camera.Render(); RenderTexture.active = old; camera.targetTexture = null; view.Dispose(); GameObject.DestroyImmediate(cameraObject); GameObject.DestroyImmediate(tempGo); this.GetComponent <Renderer>().sharedMaterial.mainTexture = texture; } }