Created
July 6, 2016 06:39
-
-
Save mattiaswargren-zz/e50ba1b8a9c2b5449da3143f0d1b2816 to your computer and use it in GitHub Desktop.
Unity Cloud Build Manifest Info Display
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
public class ManifestInfoText : MonoBehaviour | |
{ | |
[System.Serializable] | |
public class UnityCloudBuildManifestData | |
{ | |
public string scmCommitId; | |
public string scmBranch; | |
public string buildNumber; | |
public string buildStartTime; | |
public string projectId; | |
public string bundleId; | |
public string unityVersion; | |
public string xcodeVersion; | |
public string cloudBuildTargetName; | |
} | |
void Start() | |
{ | |
var manifest = (TextAsset)Resources.Load("UnityCloudBuildManifest.json"); | |
if (manifest != null) | |
{ | |
var data = JsonUtility.FromJson<UnityCloudBuildManifestData>(manifest.text); | |
GetComponent<Text>().text = string.Format("{0} ({1})", data.buildNumber, data.scmCommitId); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment