private void Awake() { if (Instance == null) { Instance = this; Initialize(); } else { Destroy(gameObject); } }
public void CopyTo(Stream stream) { var fragment = FragmentPool.Get(); try { int read; while ((read = m_Reader.Read(fragment.Data, 0, fragment.Data.Length)) > 0) { stream.Write(fragment.Data, 0, read); } } finally { fragment.TryReturn(); } }
private void Awake() { Instance = this; }