62 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using RebootKit.Engine.UI;
 | |
| using UnityEngine;
 | |
| using UnityEngine.UIElements;
 | |
| 
 | |
| namespace RebootKitEditor.RebootWindow {
 | |
|     public class HomeView : IView {
 | |
|         public void Dispose() {
 | |
|         }
 | |
| 
 | |
|         public VisualElement Build() {
 | |
|             VisualElement rootContainer = new() {
 | |
|                 style = {
 | |
|                     flexGrow = 1,
 | |
|                     fontSize = 14
 | |
|                 }
 | |
|             };
 | |
| 
 | |
|             Label label = new($"{Application.productName} {Application.version}") {
 | |
|                 style = {
 | |
|                     fontSize = 18,
 | |
|                     unityFontStyleAndWeight = FontStyle.Bold
 | |
|                 }
 | |
|             };
 | |
|             rootContainer.Add(label);
 | |
| 
 | |
|             VisualElement persistentPathContainer = new() {
 | |
|                 style = {
 | |
|                     marginTop = 8,
 | |
|                     marginBottom = 8,
 | |
|                     paddingLeft = 4,
 | |
|                     paddingRight = 4,
 | |
|                     paddingTop = 4,
 | |
|                     paddingBottom = 4,
 | |
|                     borderLeftWidth = 1,
 | |
|                     borderLeftColor = new Color(0.3f, 0.3f, 0.3f),
 | |
|                     flexDirection = FlexDirection.Row,
 | |
|                 }
 | |
|             };
 | |
| 
 | |
|             Label persistentPathLabel = new($"Persistent Path: {Application.persistentDataPath}") {
 | |
|                 style = {
 | |
|                     fontSize = 12,
 | |
|                     color = new Color(0.7f, 0.9f, 0.9f)
 | |
|                 }
 | |
|             };
 | |
|             persistentPathContainer.Add(persistentPathLabel);
 | |
| 
 | |
|             Button openPersistentPathButton = new(() => { Application.OpenURL(Application.persistentDataPath); }) {
 | |
|                 style = {
 | |
|                     fontSize = 12,
 | |
|                     width = 48
 | |
|                 },
 | |
|                 text = "Open"
 | |
|             };
 | |
|             persistentPathContainer.Add(openPersistentPathButton);
 | |
| 
 | |
|             rootContainer.Add(persistentPathContainer);
 | |
| 
 | |
|             return rootContainer;
 | |
|         }
 | |
|     }
 | |
| } |