public void Create() { using (OuyaContent ouyaContent = OuyaUnityPlugin.getOuyaContent()) { if (null == ouyaContent) { Debug.LogError("OuyaContent is null"); return; } if (ouyaContent.isInitialized()) { //Debug.Log("OuyaContent is initialized"); using (OuyaMod ouyaMod = ouyaContent.create()) { //Debug.Log("Created OuyaMod"); using (OuyaMod.Editor editor = ouyaMod.edit()) { //Debug.Log("Access to Editor"); // Required fields: editor.setTitle("Custom Level"); editor.setCategory("level"); editor.setDescription("This is my custom level"); using (OutputStream os = editor.newFile("level.dat")) { os.write(System.Text.UTF8Encoding.UTF8.GetBytes("Hello World")); os.close(); } if (m_bitmapScreenshots.Length > 0) { editor.addScreenshot(m_bitmapScreenshots[0]); } // Add optional tags: editor.addTag("space"); editor.addTag("king of the hill"); // Add optional metadata for your own display: editor.setMetadata("difficulty=4;theme=space;mode=koth"); OuyaUnityPlugin.saveOuyaMod(ouyaMod, editor); } } } else { Debug.LogError("OuyaContent is not initialized"); } } }
void RunSearch() { m_status = "Refreshing list..."; CleanWidgets(); ResetFocus(); using (OuyaContent ouyaContent = OuyaUnityPlugin.getOuyaContent()) { if (null == ouyaContent) { Debug.LogError("OuyaContent is null"); return; } if (ouyaContent.isInitialized()) { OuyaUnityPlugin.getOuyaContentInstalled(); OuyaUnityPlugin.getOuyaContentPublished(m_sortMethod); } } }