Initial commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using MuHua;
|
||||
|
||||
public class UICuttingWorkshop : ModuleUIPage {
|
||||
[SceneName] public string scene1;
|
||||
[SceneName] public string scene2;
|
||||
[SceneName] public string scene3;
|
||||
[SceneName] public string returnScene;
|
||||
private Button Button1 => root.Q<Button>("Button1");
|
||||
private Button Button2 => root.Q<Button>("Button2");
|
||||
private Button Button3 => root.Q<Button>("Button3");
|
||||
private Button Button4 => root.Q<Button>("Button4");
|
||||
private Button Button5 => root.Q<Button>("Button5");
|
||||
protected override void Awake() {
|
||||
base.Awake();
|
||||
Button1.clicked += Button1_clicked;
|
||||
Button2.clicked += Button2_clicked;
|
||||
Button3.clicked += Button3_clicked;
|
||||
Button4.clicked += Button4_clicked;
|
||||
Button5.clicked += Button5_clicked;
|
||||
}
|
||||
private void Button1_clicked() {
|
||||
ModuleCore.ModuleScene.LoadSceneAsync(scene1);
|
||||
}
|
||||
private void Button2_clicked() {
|
||||
ModuleCore.ModuleScene.LoadSceneAsync(scene2);
|
||||
}
|
||||
private void Button3_clicked() {
|
||||
ModuleCore.ModuleScene.LoadSceneAsync(scene3);
|
||||
}
|
||||
private void Button4_clicked() {
|
||||
ModuleCore.ModuleScene.LoadSceneAsync(returnScene);
|
||||
}
|
||||
private void Button5_clicked() {
|
||||
ModuleCore.LearningVideoPanel.Open(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51510177a79d2ea43b1390e794b0028f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using MuHua;
|
||||
|
||||
public class UIFactoryScenery : ModuleUIPage {
|
||||
public VisualTreeAsset NavigationUnitlAsset;
|
||||
[SceneName] public string returnScene;
|
||||
public List<NavigationData> navigationDatas = new List<NavigationData>();
|
||||
private Button Button1 => root.Q<Button>("Button1");
|
||||
private Button Button2 => root.Q<Button>("Button2");
|
||||
private Button Button3 => root.Q<Button>("Button3");
|
||||
private Button Button4 => root.Q<Button>("Button4");
|
||||
private MUFoldout Foldout => root.Q<MUFoldout>("MUFoldout");
|
||||
protected override void Awake() {
|
||||
base.Awake();
|
||||
Button1.clicked += Button1_clicked;
|
||||
Button2.clicked += Button2_clicked;
|
||||
Button3.clicked += Button3_clicked;
|
||||
Button4.clicked += Button4_clicked;
|
||||
navigationDatas.ForEach(CreateUINavigationUnit);
|
||||
}
|
||||
private void Button1_clicked() {
|
||||
Debug.Log("自动漫游");
|
||||
}
|
||||
private void Button2_clicked() {
|
||||
Debug.Log("手动漫游");
|
||||
}
|
||||
private void Button3_clicked() {
|
||||
Debug.Log("地图导航");
|
||||
}
|
||||
private void Button4_clicked() {
|
||||
ModuleCore.ModuleScene.LoadSceneAsync(returnScene);
|
||||
}
|
||||
public void CreateUINavigationUnit(NavigationData data) {
|
||||
VisualElement element = NavigationUnitlAsset.Instantiate();
|
||||
UINavigationUnit foldout = new UINavigationUnit(data, element);
|
||||
Foldout.AddContainer(foldout.element);
|
||||
}
|
||||
}
|
||||
[Serializable]
|
||||
public class NavigationData {
|
||||
public string name;
|
||||
[SceneName] public string scene;
|
||||
}
|
||||
public class UINavigationUnit {
|
||||
public readonly NavigationData value;
|
||||
public readonly VisualElement element;
|
||||
public Button Button => element.Q<Button>();
|
||||
public ModuleCore ModuleCore => ModuleCore.I;
|
||||
public UINavigationUnit(NavigationData value, VisualElement element) {
|
||||
this.value = value;
|
||||
this.element = element;
|
||||
Button.text = value.name;
|
||||
Button.clicked += Button_clicked;
|
||||
}
|
||||
private void Button_clicked() {
|
||||
ModuleCore.ModuleScene.LoadSceneAsync(value.scene);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1978c6de87b7e6c47a0c13cb49be0d4b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class UIGlobalPage : ModuleUIPage {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c68fd17af7408b48803af81cc1db5c4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class UILoginInterface : ModuleUIPage {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a567a47e28606be47bd1914fba0312e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using MuHua;
|
||||
|
||||
public class UISewingWorkshop : ModuleUIPage {
|
||||
[SceneName]public string scene1;
|
||||
[SceneName]public string scene2;
|
||||
[SceneName]public string scene3;
|
||||
[SceneName]public string returnScene;
|
||||
private Button Button1 => root.Q<Button>("Button1");
|
||||
private Button Button2 => root.Q<Button>("Button2");
|
||||
private Button Button3 => root.Q<Button>("Button3");
|
||||
private Button Button4 => root.Q<Button>("Button4");
|
||||
protected override void Awake() {
|
||||
base.Awake();
|
||||
Button1.clicked += Button1_clicked;
|
||||
Button2.clicked += Button2_clicked;
|
||||
Button3.clicked += Button3_clicked;
|
||||
Button4.clicked += Button4_clicked;
|
||||
}
|
||||
private void Button1_clicked() {
|
||||
ModuleCore.ModuleScene.LoadSceneAsync(scene1);
|
||||
}
|
||||
private void Button2_clicked() {
|
||||
ModuleCore.ModuleScene.LoadSceneAsync(scene2);
|
||||
}
|
||||
private void Button3_clicked() {
|
||||
ModuleCore.ModuleScene.LoadSceneAsync(scene3);
|
||||
}
|
||||
private void Button4_clicked() {
|
||||
ModuleCore.ModuleScene.LoadSceneAsync(returnScene);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c6570850e7442d479866de845327cab
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user