//private constructor private DataSource4DS(string serverip, int serverport, ref bool success) { this.FDVUUID = 0; success = true; //Create network client with native plugin this.FDVUUID = Bridge4DS.CreateConnection(serverip, serverport); if (this.FDVUUID == 0) { success = false; } //Get sequence info if (success) { this.TextureSize = Bridge4DS.GetTextureSize(this.FDVUUID); if (this.TextureSize == 0) { this.TextureSize = 1024; //put 1024 by default => will crash if we have 2048 texture and it's not written in xml fi } int textureEncoding = Bridge4DS.GetTextureEncoding(this.FDVUUID); switch (textureEncoding) { case 5: this.TextureFormat = TextureFormat.ETC_RGB4; break; case 6: this.TextureFormat = TextureFormat.PVRTC_RGB4; break; case 4: this.TextureFormat = TextureFormat.PVRTC_RGB2; break; case 1: this.TextureFormat = TextureFormat.DXT1; break; case 8: this.TextureFormat = TextureFormat.ASTC_RGBA_8x8; break; default: #if UNITY_IPHONE this.TextureFormat = TextureFormat.PVRTC_RGB4; #elif UNITY_ANDROID this.TextureFormat = TextureFormat.ETC_RGB4; #else this.TextureFormat = TextureFormat.DXT1; #endif break; } this.MaxVertices = Bridge4DS.GetSequenceMaxVertices(this.FDVUUID); if (this.MaxVertices == 0) { this.MaxVertices = 65535; } this.MaxTriangles = Bridge4DS.GetSequenceMaxTriangles(this.FDVUUID); if (this.MaxTriangles == 0) { this.MaxTriangles = 65535; } this.FrameRate = (float)Bridge4DS.GetSequenceFramerate(this.FDVUUID); } }