Browse Source

添加战报

DESKTOP-FB72PO8\Administrator 3 tuần trước cách đây
mục cha
commit
a6a6fa5883

+ 24 - 1
Assets/Editor/CombatEditor/CombaReportEnditorManager.cs

@@ -2,9 +2,32 @@ using System.Collections;
 using System.Collections.Generic;
 using UnityEditor;
 using UnityEngine;
+using UnityEngine.UIElements;
 
 public class CombaReportEnditorManager : EditorWindow
 {
-    
+    [SerializeField]
+    private VisualTreeAsset m_VisualTreeAsset = default;
+
+    [MenuItem("Window/UI Toolkit/CombatR")]
+    public static void ShowExample()
+    {
+        CombaReportEnditorManager wnd = GetWindow<CombaReportEnditorManager>();
+        wnd.titleContent = new GUIContent("CombatR");
+    }
+
+    public void CreateGUI()
+    {
+        // Each editor window contains a root VisualElement object
+        VisualElement root = rootVisualElement;
+
+        // VisualElements objects can contain other VisualElement following a tree hierarchy.
+        VisualElement label = new Label("Hello World! From C#");
+        root.Add(label);
+
+        // Instantiate UXML
+        VisualElement labelFromUXML = m_VisualTreeAsset.Instantiate();
+        root.Add(labelFromUXML);
+    }
     
 }

+ 23 - 23
Assets/Editor/UIAsset/CombatR.cs

@@ -4,27 +4,27 @@ using UnityEngine.UIElements;
 
 public class CombatR : EditorWindow
 {
-    [SerializeField]
-    private VisualTreeAsset m_VisualTreeAsset = default;
-
-    [MenuItem("Window/UI Toolkit/CombatR")]
-    public static void ShowExample()
-    {
-        CombatR wnd = GetWindow<CombatR>();
-        wnd.titleContent = new GUIContent("CombatR");
-    }
-
-    public void CreateGUI()
-    {
-        // Each editor window contains a root VisualElement object
-        VisualElement root = rootVisualElement;
-
-        // VisualElements objects can contain other VisualElement following a tree hierarchy.
-        VisualElement label = new Label("Hello World! From C#");
-        root.Add(label);
-
-        // Instantiate UXML
-        VisualElement labelFromUXML = m_VisualTreeAsset.Instantiate();
-        root.Add(labelFromUXML);
-    }
+    // [SerializeField]
+    // private VisualTreeAsset m_VisualTreeAsset = default;
+    //
+    // [MenuItem("Window/UI Toolkit/CombatR")]
+    // public static void ShowExample()
+    // {
+    //     CombatR wnd = GetWindow<CombatR>();
+    //     wnd.titleContent = new GUIContent("CombatR");
+    // }
+    //
+    // public void CreateGUI()
+    // {
+    //     // Each editor window contains a root VisualElement object
+    //     VisualElement root = rootVisualElement;
+    //
+    //     // VisualElements objects can contain other VisualElement following a tree hierarchy.
+    //     VisualElement label = new Label("Hello World! From C#");
+    //     root.Add(label);
+    //
+    //     // Instantiate UXML
+    //     VisualElement labelFromUXML = m_VisualTreeAsset.Instantiate();
+    //     root.Add(labelFromUXML);
+    // }
 }

+ 47 - 1
Assets/Editor/UIAsset/CombatR.uss

@@ -2,4 +2,50 @@
     font-size: 20px;
     -unity-font-style: bold;
     color: rgb(68, 138, 255);
-}
+}
+
+.foldout_style {
+}
+
+.value_data_style {
+    flex-grow: 1;
+    flex-direction: row;
+    flex-wrap: wrap;
+}
+
+.value_data_entity_style {
+    flex-grow: 1;
+    flex-wrap: wrap;
+    flex-direction: row;
+}
+
+.value_scrollview {
+    margin-left: 0;
+    min-width: 70%;
+}
+
+.value_list_style {
+}
+
+.visualElement_h {
+    flex-grow: 1;
+    align-self: flex-start;
+    align-items: flex-start;
+    justify-content: space-around;
+    width: 100%;
+    flex-direction: row;
+}
+
+.visualElement_v {
+    flex-grow: 1;
+    width: auto;
+    max-width: none;
+    align-items: flex-start;
+    align-self: auto;
+    min-width: 30%;
+    flex-basis: auto;
+    flex-shrink: 1;
+    flex-wrap: nowrap;
+    opacity: 1;
+    margin-left: 0;
+}

+ 20 - 11
Assets/Editor/UIAsset/CombatR.uxml

@@ -1,12 +1,21 @@
-<?xml version="1.0" encoding="utf-8"?>
-<engine:UXML
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:engine="UnityEngine.UIElements"
-    xmlns:editor="UnityEditor.UIElements"
-    xsi:noNamespaceSchemaLocation="../../../UIElementsSchema/UIElements.xsd"
->
+<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
     <Style src="project://database/Assets/Editor/UIAsset/CombatR.uss?fileID=7433441132597879392&amp;guid=834f076e9de78254a915d3bcc179e7c8&amp;type=3#CombatR" />
-	<engine:Label text="Hello World! From UXML" />
-	<engine:Label class="custom-label" text="Hello World! With Style" />
-
-</engine:UXML>
+    <ui:Foldout text="Foldout" name="Foldout" view-data-key="foldout_" class="foldout_style">
+        <ui:VisualElement class="visualElement_h">
+            <ui:VisualElement name="VisualElement" class="visualElement_v">
+                <ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Label" view-data-key="heroname" style="width: 30%;" />
+                <ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Label" view-data-key="herolevel" style="width: 30%;" />
+            </ui:VisualElement>
+            <ui:ScrollView class="value_scrollview">
+                <ui:Foldout text="Foldout">
+                    <ui:VisualElement name="VisualElement" class="value_data_style">
+                        <ui:VisualElement class="value_data_entity_style">
+                            <ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" />
+                            <ui:ProgressBar value="73.8" title="my-progress" name="ProgressBar" style="max-width: 100px; flex-direction: column; flex-wrap: wrap;" />
+                        </ui:VisualElement>
+                    </ui:VisualElement>
+                </ui:Foldout>
+            </ui:ScrollView>
+        </ui:VisualElement>
+    </ui:Foldout>
+</ui:UXML>

+ 4 - 4
Assets/Res/Config/HeroModelConfig.json

@@ -3,7 +3,7 @@
     {
       "ID": 101,
       "nickName": -1,
-      "name": 5,
+      "name": 1,
       "headicon": "icon_tx101",
       "model": "Nanzhu",
       "isUseGpu": false,
@@ -30,7 +30,7 @@
     {
       "ID": 9101,
       "nickName": -1,
-      "name": 5,
+      "name": 2,
       "headicon": "icon_tx9101",
       "model": "Guixiu01",
       "isUseGpu": false,
@@ -59,7 +59,7 @@
     {
       "ID": 9102,
       "nickName": -1,
-      "name": 5,
+      "name": 3,
       "headicon": "icon_tx9102",
       "model": "Nanzhu",
       "isUseGpu": false,
@@ -86,7 +86,7 @@
     {
       "ID": 9103,
       "nickName": -1,
-      "name": 5,
+      "name": 4,
       "headicon": "icon_tx9103",
       "model": "Guixiu01",
       "isUseGpu": false,

+ 1 - 1
Assets/Scenes/testCombat.scene

@@ -11917,9 +11917,9 @@ SceneRoots:
   - {fileID: 613972499}
   - {fileID: 321407578}
   - {fileID: 1856735312}
-  - {fileID: 7971796013686853673}
   - {fileID: 1584646302}
   - {fileID: 2622624}
   - {fileID: 144571669}
   - {fileID: 1089162872}
   - {fileID: 1557285921}
+  - {fileID: 7971796013686853673}

BIN
Excel2Json/Excel/HeroModel.xlsx