Advertisement
Deozaan

Automatic Build Date/Time

Aug 16th, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. [ExecuteInEditMode]
  4. public class RefreshTestCS: MonoBehaviour
  5. {
  6.     public string buildName;
  7.  
  8.     public void OnGUI() {
  9.         GUILayout.Label("Build name: " + buildName);
  10.     }
  11.  
  12. #if UNITY_EDITOR
  13.     public void Awake() {
  14.         if (Application.isEditor && !Application.isPlaying) {
  15.             buildName = System.DateTime.Now.ToString() + " (" + (UnityEditor.BuildPipeline.isBuildingPlayer ? "during build)" : "during edit)");
  16.         }
  17.     }
  18. #endif
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement