1 (edited by roswell108 2015-04-20 13:56:15)

Topic: Record matches and share them online (iOS / Android)

Some of you may have played games like Dead or Alive 5 that allow sharing a fight to YouTube.

The same can be done on iOS and Android using the service Kamcord (http://kamcord.com) and it is completely free as long as the game is published on Google Play or the App Store.

Head over to the site and get the Unity SDK, import it, and open up the ExampleScripts/RecordingGUI.cs

Comment out the entire OnGUI section and replace it with

void OnGameBegins(CharacterInfo player1, CharacterInfo player2, StageOptions stage) {
            Kamcord.StartRecording ();
        
            recordingStartedAt = System.DateTime.Now;
    }

    void OnGameEnds(CharacterInfo winner, CharacterInfo loser) {
            Kamcord.StopRecording ();
        
            // It is very important to set a descriptive video title for each video.
            // In addition to the video title, setting the level and score also makes
            // the watch experience significantly better.
            double gameplayDuration = (System.DateTime.Now - recordingStartedAt).TotalSeconds;
            Kamcord.SetVideoTitle (winner.name + " vs " + loser.name + " [" + gameplayDuration.ToString ("F2") + " sec]");
        
            // Change this to whatever you want for level, score, or any other key and value pair
//         Kamcord.SetDeveloperMetadata (Kamcord.MetadataType.level, "Level", "1");
//         Kamcord.SetDeveloperMetadata (Kamcord.MetadataType.score, "Score", "1000");
            Kamcord.SetDeveloperMetadata (Kamcord.MetadataType.other, "Winner", winner.name);
            Kamcord.SetDeveloperMetadata (Kamcord.MetadataType.other, "Loser", loser.name);
            Kamcord.SetDeveloperMetadataWithNumericValue (Kamcord.MetadataType.other, "Length", "Seconds", gameplayDuration);
        
            firstVideoRecorded = true;

            Kamcord.ShowView ();
    }

Set up the keys on the prefab and drag it to the main UFE scene, then attach the RecordingGUI to that GameObject

That's it. Now when you complete a match, the share option will appear over the end-game menu and allow you to save or share the video before continuing with the game.

Share

Thumbs up +2 Thumbs down