public void Dispose() { if (mesh != null) { if (Application.isPlaying) Mesh.Destroy(mesh); else Mesh.DestroyImmediate(mesh); mesh = null; } if (_manager != null) { _manager.Release(); _manager = null; } if (_customMatarial && _material != null) { if (Application.isPlaying) Material.Destroy(_material); else Material.DestroyImmediate(_material); } _material = null; meshRenderer = null; meshFilter = null; _stencilEraser = null; meshModifier = null; }
static public int Dispose(IntPtr l) { try { FairyGUI.NGraphics self = (FairyGUI.NGraphics)checkSelf(l); self.Dispose(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }