代码合并
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
public class TopMenu {
|
||||
public Action ClickTopMenu1;
|
||||
public Action ClickTopMenu2;
|
||||
public readonly VisualElement element;
|
||||
public VisualElement TopMenu1 => element.Q<VisualElement>("TopMenu1");
|
||||
public VisualElement TopMenu2 => element.Q<VisualElement>("TopMenu2");
|
||||
public TopMenu(VisualElement element) {
|
||||
this.element = element;
|
||||
TopMenu1.RegisterCallback<ClickEvent>(TopMenu1_ClickEvent);
|
||||
TopMenu2.RegisterCallback<ClickEvent>(TopMenu2_ClickEvent);
|
||||
}
|
||||
private void TopMenu1_ClickEvent(ClickEvent evt) {
|
||||
ClickTopMenu1?.Invoke();
|
||||
}
|
||||
private void TopMenu2_ClickEvent(ClickEvent evt) {
|
||||
ClickTopMenu2?.Invoke();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 925cd7c3a7a4d624fb742687191f086f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,66 @@
|
||||
.top-menu {
|
||||
background-image: url("project://database/Assets/UI%20Toolkit/Assets/%E6%8C%89%E9%92%AE%E9%98%B4%E5%BD%B1.png?fileID=2800000&guid=9ce769a9c36db7048b884f400edd2560&type=3#按钮阴影");
|
||||
width: 130px;
|
||||
height: 90px;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.top-menu-bg {
|
||||
width: 110px;
|
||||
height: 70px;
|
||||
background-color: rgb(255, 255, 255);
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-left-color: rgb(0, 0, 0);
|
||||
border-right-color: rgb(0, 0, 0);
|
||||
border-top-color: rgb(0, 0, 0);
|
||||
border-bottom-color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.top-menu-mask {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
transition-duration: 0.3s;
|
||||
justify-content: flex-end;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.top-menu-mask:hover {
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.top-menu-label {
|
||||
margin-top: 0;
|
||||
margin-right: 0;
|
||||
margin-bottom: 0;
|
||||
margin-left: 0;
|
||||
padding-top: 0;
|
||||
padding-right: 0;
|
||||
padding-bottom: 0;
|
||||
padding-left: 0;
|
||||
border-top-width: 0;
|
||||
border-right-width: 0;
|
||||
border-bottom-width: 0;
|
||||
border-left-width: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 9px;
|
||||
border-bottom-left-radius: 9px;
|
||||
-unity-text-align: middle-center;
|
||||
width: 100%;
|
||||
height: 40%;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
font-size: 18px;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b7925943dcb7d374181a9db9c7af7481
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
|
||||
disableValidation: 0
|
||||
@@ -0,0 +1,40 @@
|
||||
<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/UI%20Toolkit/UIComponent/TopMenu/TopMenu.uss?fileID=7433441132597879392&guid=b7925943dcb7d374181a9db9c7af7481&type=3#TopMenu" />
|
||||
<ui:VisualElement name="VisualElement" style="flex-direction: row; flex-grow: 1; align-items: center; padding-left: 8px;">
|
||||
<ui:VisualElement name="TopMenu1" class="top-menu">
|
||||
<ui:VisualElement name="Top-Menu-BG" class="top-menu-bg">
|
||||
<ui:VisualElement name="Top-Menu-Mask" class="top-menu-mask">
|
||||
<ui:Label tabindex="-1" text="工程文件" parse-escape-sequences="true" display-tooltip-when-elided="true" class="top-menu-label" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="TopMenu2" class="top-menu">
|
||||
<ui:VisualElement name="Top-Menu-BG" class="top-menu-bg">
|
||||
<ui:VisualElement name="Top-Menu-Mask" class="top-menu-mask">
|
||||
<ui:Label tabindex="-1" text="预设模板" parse-escape-sequences="true" display-tooltip-when-elided="true" class="top-menu-label" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="TopMenu3" class="top-menu" style="display: none;">
|
||||
<ui:VisualElement name="Top-Menu-BG" class="top-menu-bg">
|
||||
<ui:VisualElement name="Top-Menu-Mask" class="top-menu-mask">
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" class="top-menu-label" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="TopMenu4" class="top-menu" style="display: none;">
|
||||
<ui:VisualElement name="Top-Menu-BG" class="top-menu-bg">
|
||||
<ui:VisualElement name="Top-Menu-Mask" class="top-menu-mask">
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" class="top-menu-label" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="TopMenu5" class="top-menu" style="display: none;">
|
||||
<ui:VisualElement name="Top-Menu-BG" class="top-menu-bg">
|
||||
<ui:VisualElement name="Top-Menu-Mask" class="top-menu-mask">
|
||||
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" class="top-menu-label" />
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:VisualElement>
|
||||
</ui:UXML>
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1740e867b76e16f41ac6871d25bf6317
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
|
||||
Reference in New Issue
Block a user