public void UpdateTexture() { if (Initialized) { UpdateInitialized(); //execute run-once functions if (_needToRunOnce) { SendExecuteJSEvent(_runOnceJS); _needToRunOnce = false; } } else { if (_connected) { try { //init memory file _mainTexArray = new SharedTextureBuffer(_sharedFileName); Initialized = true; } catch (Exception ex) { Debug.Log("Exception on init:" + ex.Message + ".Waiting for plugin server"); } } } }
public void Dispose() { if (_buffer != null) { _buffer.Close(); _buffer = null; } }
private void Resize(int newSize) { if (_buffer.Length != newSize) { var name = _buffer.Name; _buffer.Close(); _buffer = new SharedTextureBuffer(name, newSize); } }
public SharedTextureWriter(string name, int length) { _buffer = new SharedTextureBuffer(name, length); }