代码合并

This commit is contained in:
MuHua-123
2024-11-08 18:15:06 +08:00
parent 5f169b90bb
commit 497b43a446
146 changed files with 2858 additions and 110 deletions
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6d6bffb6d06d8af47a714ca6aca9a0a6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,127 @@
fileFormatVersion: 2
guid: 9ce769a9c36db7048b884f400edd2560
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 20, y: 20, z: 20, w: 20}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 1537655665
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -13,8 +13,8 @@ public class MediaPlayer {
private Action fullAction;
private ModuleCore Core => ModuleCore.I;
private ModuleVideo ModuleVideo => Core.ModuleVideo;
private RenderTexture RenderTexture => ModuleVideo.renderTexture;
//private ModuleVideo ModuleVideo => Core.ModuleVideo;
//private RenderTexture RenderTexture => ModuleVideo.renderTexture;
private VisualElement VideoView => element.Q<VisualElement>("VideoView");
private VisualElement VideoController => element.Q<VisualElement>("VideoController");
private MUSliderHorizontal Slider => element.Q<MUSliderHorizontal>("Slider");
@@ -40,27 +40,27 @@ public class MediaPlayer {
Slider.SlidingValueChanged += Slider_SlidingValueChanged;
}
private void Play_clicked() {
ModuleVideo.Play(); showTime = 5;
Play.style.display = DisplayStyle.None;
Pause.style.display = DisplayStyle.Flex;
Slider.MaxValue = ModuleVideo.frameCount;
//ModuleVideo.Play(); showTime = 5;
//Play.style.display = DisplayStyle.None;
//Pause.style.display = DisplayStyle.Flex;
//Slider.MaxValue = ModuleVideo.frameCount;
}
private void Pause_clicked() {
ModuleVideo.Pause();
Play.style.display = DisplayStyle.Flex;
Pause.style.display = DisplayStyle.None;
//ModuleVideo.Pause();
//Play.style.display = DisplayStyle.Flex;
//Pause.style.display = DisplayStyle.None;
}
private void FullScreen_clicked() {
fullAction?.Invoke();
}
private void Slider_SlidingValueChanged(float obj) {
ModuleVideo.frame = (long)obj;
//ModuleVideo.frame = (long)obj;
}
public void Open() {
element.style.visibility = Visibility.Visible;
//设置渲染纹理
Background background = Background.FromRenderTexture(RenderTexture);
VideoView.style.backgroundImage = new StyleBackground(background);
//Background background = Background.FromRenderTexture(RenderTexture);
//VideoView.style.backgroundImage = new StyleBackground(background);
//播放视频
Play_clicked();
}
@@ -73,10 +73,10 @@ public class MediaPlayer {
Visibility visibility = showTime > 0 ? Visibility.Visible : Visibility.Hidden;
VideoController.style.visibility = visibility;
if (!isDownSlider) { Slider.Value = ModuleVideo.frame; }
//if (!isDownSlider) { Slider.Value = ModuleVideo.frame; }
string clockTime = TimeSpan.FromSeconds(ModuleVideo.time).ToString(@"mm\:ss");
string length = TimeSpan.FromSeconds(ModuleVideo.maxTime).ToString(@"mm\:ss");
Time.text = clockTime + "/" + length;
//string clockTime = TimeSpan.FromSeconds(ModuleVideo.time).ToString(@"mm\:ss");
//string length = TimeSpan.FromSeconds(ModuleVideo.maxTime).ToString(@"mm\:ss");
//Time.text = clockTime + "/" + length;
}
}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 669f2b93f810a404ba0447b36869b3f7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
.pb-button {
height: 30px;
background-color: rgb(204, 204, 204);
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
margin-top: 2px;
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b7cc9cc589f43df40b63ccfcb30fdbb7
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -0,0 +1,13 @@
<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/PlateBaking/PlateBaking.uss?fileID=7433441132597879392&amp;guid=b7cc9cc589f43df40b63ccfcb30fdbb7&amp;type=3#PlateBaking" />
<ui:VisualElement style="flex-grow: 1; overflow: hidden; width: 100%; height: 100%;">
<ui:VisualElement name="Rendering" style="flex-grow: 1;" />
<ui:VisualElement style="position: absolute; height: 162px; width: 40px; left: 10px; top: 10px; background-color: rgb(51, 51, 51); border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px;">
<ui:VisualElement name="Button1" class="pb-button" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; border-top-left-radius: 4px; border-top-right-radius: 4px;" />
<ui:VisualElement name="Button2" class="pb-button" />
<ui:VisualElement name="Button3" class="pb-button" />
<ui:VisualElement name="Button4" class="pb-button" />
<ui:VisualElement name="Button5" class="pb-button" style="border-bottom-right-radius: 4px; border-bottom-left-radius: 4px;" />
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 12f5fe5a3d1c9d84593d412f3c44f9e5
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
@@ -0,0 +1,72 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
public class UIPlateBaking {
public readonly VisualElement element;
public ModuleViewInput viewInput => ModuleCore.I.PlateBakingViewInput;
public ModuleViewCamera viewCamera => ModuleCore.I.PlateBakingViewCamera;
public VisualElement Rendering => element.Q<VisualElement>("Rendering");
public Button Button1 => element.Q<Button>("Button1");
public Button Button2 => element.Q<Button>("Button2");
public Button Button3 => element.Q<Button>("Button3");
public Button Button4 => element.Q<Button>("Button4");
public Button Button5 => element.Q<Button>("Button5");
public UIPlateBaking(VisualElement element) {
this.element = element;
element.generateVisualContent += Element_GenerateVisualContent;
Rendering.RegisterCallback<MouseDownEvent>(DownMouse);
Rendering.RegisterCallback<MouseMoveEvent>(DragMouse);
Rendering.RegisterCallback<MouseUpEvent>(ReleaseMouse);
Rendering.RegisterCallback<MouseOutEvent>(ReleaseMouse);
Rendering.RegisterCallback<WheelEvent>(ScrollWheel);
}
private void Element_GenerateVisualContent(MeshGenerationContext context) {
ModuleCore.I.ModuleAgent.StartCoroutine(UpdateRenderTexture());
}
private IEnumerator UpdateRenderTexture() {
yield return null;
int width = (int)element.resolvedStyle.width;
int height = (int)element.resolvedStyle.height;
viewCamera.UpdateRenderTexture(width, height);
Background background = Background.FromRenderTexture(viewCamera.RenderTexture);
StyleBackground style = new StyleBackground(background);
Rendering.style.backgroundImage = style;
}
private bool isDownLeftMouse;
private bool isDownRightMouse;
private bool isDownMiddleMouse;
public void DownMouse(MouseDownEvent evt) {
DataMouseInput mouseInput = new DataMouseInput(evt);
if (evt.button == 0) { viewInput.DownLeftMouse(mouseInput); isDownLeftMouse = true; }
if (evt.button == 1) { viewInput.DownRightMouse(mouseInput); isDownRightMouse = true; }
if (evt.button == 2) { viewInput.DownMiddleMouse(mouseInput); isDownMiddleMouse = true; }
}
public void DragMouse(MouseMoveEvent evt) {
DataMouseInput mouseInput = new DataMouseInput(evt);
if (isDownLeftMouse) { viewInput.DragLeftMouse(mouseInput); }
if (isDownRightMouse) { viewInput.DragRightMouse(mouseInput); }
if (isDownMiddleMouse) { viewInput.DragMiddleMouse(mouseInput); }
if (evt.button == 0) { viewInput.MoveLeftMouse(mouseInput); }
if (evt.button == 1) { viewInput.MoveRightMouse(mouseInput); }
if (evt.button == 2) { viewInput.MoveMiddleMouse(mouseInput); }
}
public void ReleaseMouse(MouseUpEvent evt) {
DataMouseInput mouseInput = new DataMouseInput(evt);
viewInput.ReleaseLeftMouse(mouseInput); isDownLeftMouse = false;
viewInput.ReleaseRightMouse(mouseInput); isDownRightMouse = false;
viewInput.ReleaseMiddleMouse(mouseInput); isDownMiddleMouse = false;
}
public void ReleaseMouse(MouseOutEvent evt) {
DataMouseInput mouseInput = new DataMouseInput(evt);
viewInput.ReleaseLeftMouse(mouseInput); isDownLeftMouse = false;
viewInput.ReleaseRightMouse(mouseInput); isDownRightMouse = false;
viewInput.ReleaseMiddleMouse(mouseInput); isDownMiddleMouse = false;
}
public void ScrollWheel(WheelEvent evt) {
DataMouseInput mouseInput = new DataMouseInput(evt);
viewInput.ScrollWheel(mouseInput);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bcbd4071f1020ce4da59f6aa6aee51ad
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 131e42b2deb90c44faf40f1d99810957
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,17 @@
.pd-button {
height: 30px;
background-color: rgb(204, 204, 204);
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
margin-top: 2px;
border-top-width: 0;
border-right-width: 0;
border-bottom-width: 0;
border-left-width: 0;
}
.pd-button-s {
background-color: rgb(0, 235, 255);
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 61655961f50792845ab24ff6cded58d9
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -0,0 +1,13 @@
<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/PlateDesign/PlateDesign.uss?fileID=7433441132597879392&amp;guid=61655961f50792845ab24ff6cded58d9&amp;type=3#PlateDesign" />
<ui:VisualElement style="flex-grow: 1; width: 100%; height: 100%; overflow: hidden;">
<ui:VisualElement name="Rendering" style="flex-grow: 1;" />
<ui:VisualElement style="position: absolute; height: 162px; width: 40px; left: 10px; top: 10px; background-color: rgb(51, 51, 51); border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px;">
<ui:Button parse-escape-sequences="true" display-tooltip-when-elided="true" name="Button1" class="pd-button" style="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-left-radius: 4px; border-top-right-radius: 4px; border-left-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); border-top-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0);" />
<ui:Button parse-escape-sequences="true" display-tooltip-when-elided="true" name="Button2" class="pd-button" style="padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-left-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); border-top-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); margin-top: 2px; margin-right: 0; margin-bottom: 0; margin-left: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0;" />
<ui:Button parse-escape-sequences="true" display-tooltip-when-elided="true" name="Button3" class="pd-button" style="padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-left-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); border-top-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); margin-top: 2px; margin-right: 0; margin-bottom: 0; margin-left: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0;" />
<ui:Button parse-escape-sequences="true" display-tooltip-when-elided="true" name="Button4" class="pd-button" style="padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-left-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); border-top-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); margin-top: 2px; margin-right: 0; margin-bottom: 0; margin-left: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0;" />
<ui:Button parse-escape-sequences="true" display-tooltip-when-elided="true" name="Button5" class="pd-button" style="padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-left-color: rgba(0, 0, 0, 0); border-right-color: rgba(0, 0, 0, 0); border-top-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0); margin-top: 2px; margin-right: 0; margin-bottom: 0; margin-left: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px;" />
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: ba059349af6076b40b0e35856489786c
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
@@ -0,0 +1,96 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
public class UIPlateDesign {
public readonly VisualElement element;
public ModuleViewInput viewInput => ModuleCore.I.PlateDesignViewInput;
public ModuleViewCamera viewCamera => ModuleCore.I.PlateDesignViewCamera;
public VisualElement Rendering => element.Q<VisualElement>("Rendering");
public Button Button1 => element.Q<Button>("Button1");
public Button Button2 => element.Q<Button>("Button2");
public Button Button3 => element.Q<Button>("Button3");
public Button Button4 => element.Q<Button>("Button4");
public Button Button5 => element.Q<Button>("Button5");
public UIPlateDesign(VisualElement element) {
this.element = element;
viewInput.OnInputType += ViewInput_OnInputType;
element.generateVisualContent += Element_GenerateVisualContent;
Rendering.RegisterCallback<MouseDownEvent>(DownMouse);
Rendering.RegisterCallback<MouseMoveEvent>(DragMouse);
Rendering.RegisterCallback<MouseUpEvent>(ReleaseMouse);
Rendering.RegisterCallback<MouseOutEvent>(ReleaseMouse);
Rendering.RegisterCallback<WheelEvent>(ScrollWheel);
//边缘点操作
//Button1.clicked += () => { viewInput.SetPrimaryKeyInput(new VIUEdgePointMobile(viewCamera)); };
//Button2.clicked += () => { viewInput.SetPrimaryKeyInput(new VIUEdgePointAdd(viewCamera)); };
//设计点操作
Button1.clicked += () => { viewInput.SetPrimaryKeyInput(new VIUDesignPointMobile(viewCamera)); };
Button2.clicked += () => { viewInput.SetPrimaryKeyInput(new VIUDesignPointInsert(viewCamera)); };
Button3.clicked += () => { viewInput.SetPrimaryKeyInput(new VIUBezierMobile(viewCamera)); };
viewInput.SetPrimaryKeyInput(new VIUDesignPointMobile(viewCamera));
}
private void ViewInput_OnInputType(Type obj) {
//边缘点操作
//ChangeStyle(obj, typeof(VIUEdgePointMobile), Button1);
//ChangeStyle(obj, typeof(VIUEdgePointAdd), Button2);
//设计点操作
ChangeStyle(obj, typeof(VIUDesignPointMobile), Button1);
ChangeStyle(obj, typeof(VIUDesignPointInsert), Button2);
ChangeStyle(obj, typeof(VIUBezierMobile), Button3);
}
private void ChangeStyle(Type obj, Type compare, VisualElement visualElement) {
if (obj == compare) { visualElement.AddToClassList("pd-button-s"); }
else { visualElement.RemoveFromClassList("pd-button-s"); }
}
private void Element_GenerateVisualContent(MeshGenerationContext context) {
ModuleCore.I.ModuleAgent.StartCoroutine(UpdateRenderTexture());
}
private IEnumerator UpdateRenderTexture() {
yield return null;
int width = (int)element.resolvedStyle.width;
int height = (int)element.resolvedStyle.height;
viewCamera.UpdateRenderTexture(width, height);
Background background = Background.FromRenderTexture(viewCamera.RenderTexture);
StyleBackground style = new StyleBackground(background);
Rendering.style.backgroundImage = style;
}
private bool isDownLeftMouse;
private bool isDownRightMouse;
private bool isDownMiddleMouse;
public void DownMouse(MouseDownEvent evt) {
DataMouseInput mouseInput = new DataMouseInput(evt);
if (evt.button == 0) { viewInput.DownLeftMouse(mouseInput); isDownLeftMouse = true; }
if (evt.button == 1) { viewInput.DownRightMouse(mouseInput); isDownRightMouse = true; }
if (evt.button == 2) { viewInput.DownMiddleMouse(mouseInput); isDownMiddleMouse = true; }
}
public void DragMouse(MouseMoveEvent evt) {
DataMouseInput mouseInput = new DataMouseInput(evt);
if (isDownLeftMouse) { viewInput.DragLeftMouse(mouseInput); }
if (isDownRightMouse) { viewInput.DragRightMouse(mouseInput); }
if (isDownMiddleMouse) { viewInput.DragMiddleMouse(mouseInput); }
if (evt.button == 0) { viewInput.MoveLeftMouse(mouseInput); }
if (evt.button == 1) { viewInput.MoveRightMouse(mouseInput); }
if (evt.button == 2) { viewInput.MoveMiddleMouse(mouseInput); }
}
public void ReleaseMouse(MouseUpEvent evt) {
DataMouseInput mouseInput = new DataMouseInput(evt);
viewInput.ReleaseLeftMouse(mouseInput); isDownLeftMouse = false;
viewInput.ReleaseRightMouse(mouseInput); isDownRightMouse = false;
viewInput.ReleaseMiddleMouse(mouseInput); isDownMiddleMouse = false;
}
public void ReleaseMouse(MouseOutEvent evt) {
DataMouseInput mouseInput = new DataMouseInput(evt);
viewInput.ReleaseLeftMouse(mouseInput); isDownLeftMouse = false;
viewInput.ReleaseRightMouse(mouseInput); isDownRightMouse = false;
viewInput.ReleaseMiddleMouse(mouseInput); isDownMiddleMouse = false;
}
public void ScrollWheel(WheelEvent evt) {
DataMouseInput mouseInput = new DataMouseInput(evt);
viewInput.ScrollWheel(mouseInput);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c0ce22839c16abf4e8397a948f702523
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5c63c5be481bbfc408f27d84f6ad0fc4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -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&amp;guid=b7925943dcb7d374181a9db9c7af7481&amp;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}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2040d20cfab7df54f98017095d713005
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 329e098da89084a45998198367945516
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,14 @@
.dp-component {
margin-top: 2px;
margin-right: 2px;
margin-bottom: 2px;
margin-left: 2px;
border-top-width: 2px;
border-right-width: 2px;
border-bottom-width: 2px;
border-left-width: 2px;
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);
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c3e08d3b22612584caef632ea8f1c182
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -0,0 +1,17 @@
<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">
<ui:Template name="TopMenu" src="project://database/Assets/UI%20Toolkit/UIComponent/TopMenu/TopMenu.uxml?fileID=9197481963319205126&amp;guid=1740e867b76e16f41ac6871d25bf6317&amp;type=3#TopMenu" />
<ui:Template name="DesignView" src="project://database/Assets/UI%20Toolkit/UIComponent/PlateDesign/PlateDesign.uxml?fileID=9197481963319205126&amp;guid=ba059349af6076b40b0e35856489786c&amp;type=3#PlateDesign" />
<ui:Template name="PlateBaking" src="project://database/Assets/UI%20Toolkit/UIComponent/PlateBaking/PlateBaking.uxml?fileID=9197481963319205126&amp;guid=12f5fe5a3d1c9d84593d412f3c44f9e5&amp;type=3#PlateBaking" />
<ui:Template name="PresetsPlate" src="project://database/Assets/UI%20Toolkit/UIWindow/PresetsPlate/PresetsPlate.uxml?fileID=9197481963319205126&amp;guid=5c36844e01281c24c8eee91af6feee87&amp;type=3#PresetsPlate" />
<Style src="project://database/Assets/UI%20Toolkit/UIDocument/DesignPage/DesignPage.uss?fileID=7433441132597879392&amp;guid=c3e08d3b22612584caef632ea8f1c182&amp;type=3#DesignPage" />
<ui:VisualElement style="flex-grow: 1; background-color: rgb(204, 204, 204); padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px;">
<ui:Instance template="TopMenu" name="TopMenu" class="dp-component" style="height: 96px;" />
<ui:VisualElement style="flex-direction: row; width: 100%; height: 100%;">
<ui:VisualElement class="dp-component" style="width: 240px; min-width: 240px;" />
<ui:Instance template="DesignView" name="PlateDesign" class="dp-component" style="width: 100%;" />
<ui:Instance template="PlateBaking" name="PlateBaking" class="dp-component" style="width: 600px; min-width: 600px;" />
</ui:VisualElement>
<ui:VisualElement class="design-bottom dp-component" style="height: 40px;" />
</ui:VisualElement>
<ui:Instance template="PresetsPlate" name="PresetsPlate" style="position: absolute; width: 544px; height: 400px; top: 324px; left: 560px; display: none;" />
</ui:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f176a30c50ceffe41958f4fc4b69fc1a
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 084186be84d61d44da10ee78c0cf0b10
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 480fd755dcfed1b4180c5a7743753277
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,32 @@
.pp-unit {
width: 100px;
height: 60px;
}
.pp-button {
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
background-color: rgb(188, 188, 188);
border-left-color: rgb(149, 149, 149);
border-right-color: rgb(149, 149, 149);
border-top-color: rgb(149, 149, 149);
border-bottom-color: rgb(149, 149, 149);
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
margin-left: 5px;
padding-top: 0;
padding-right: 0;
padding-bottom: 0;
padding-left: 0;
flex-grow: 1;
}
.pp-button:hover {
border-left-color: rgb(255, 255, 255);
border-right-color: rgb(255, 255, 255);
border-top-color: rgb(255, 255, 255);
border-bottom-color: rgb(255, 255, 255);
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 56954ee7ad04e0544988b1d2b52f7a77
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -0,0 +1,12 @@
<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/UIWindow/PresetsPlate/PresetsPlate.uss?fileID=7433441132597879392&amp;guid=56954ee7ad04e0544988b1d2b52f7a77&amp;type=3#PresetsPlate" />
<ui:VisualElement style="flex-grow: 1; background-image: url(&quot;project://database/Assets/UI%20Toolkit/Assets/%E6%8C%89%E9%92%AE%E9%98%B4%E5%BD%B1.png?fileID=21300000&amp;guid=9ce769a9c36db7048b884f400edd2560&amp;type=3#按钮阴影&quot;);">
<ui:VisualElement style="flex-grow: 1; background-color: rgb(204, 204, 204); margin-top: 15px; margin-right: 15px; margin-bottom: 15px; margin-left: 15px; border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; 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);">
<ui:VisualElement style="width: 100%; height: 35px; background-color: rgb(128, 128, 128); flex-direction: row;">
<ui:Label tabindex="-1" text="预制模板" parse-escape-sequences="true" display-tooltip-when-elided="true" style="-unity-text-align: middle-center; background-color: rgb(204, 204, 204); margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 10px; padding-bottom: 0; padding-left: 10px; border-top-left-radius: 5px; border-top-right-radius: 5px; font-size: 18px;" />
<ui:Button text="关闭" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Close" style="position: absolute; top: 0; right: 0; background-color: rgba(0, 0, 0, 0); border-top-width: 0; border-right-width: 0; border-bottom-width: 0; border-left-width: 0; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; height: 100%; width: 80px; color: rgb(255, 255, 255); font-size: 18px;" />
</ui:VisualElement>
<ui:VisualElement name="Container" style="flex-grow: 1; width: 100%; height: 100%; flex-direction: row; align-items: flex-start; flex-wrap: wrap; justify-content: flex-start; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px;" />
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 5c36844e01281c24c8eee91af6feee87
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
@@ -0,0 +1,4 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
<Style src="project://database/Assets/UI%20Toolkit/UIWindow/PresetsPlate/PresetsPlate.uss?fileID=7433441132597879392&amp;guid=56954ee7ad04e0544988b1d2b52f7a77&amp;type=3#PresetsPlate" />
<ui:Button text="Button" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Button" class="pp-button" />
</ui:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 6c07881a6c4179a4dbd89b86689b3837
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
@@ -0,0 +1,30 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
public class UIPresetsPlate {
public Action ClickClose;
public readonly VisualElement element;
public Button Close => element.Q<Button>("Close");
public VisualElement Container => element.Q<VisualElement>("Container");
public UIPresetsPlate(VisualElement element) {
this.element = element;
Container.Clear();
Close.clicked += Close_Clicked;
}
public void Add(UIPresetsPlateUnit unit) {
Container.Add(unit.element);
unit.element.AddToClassList("pp-unit");
}
public void Add(VisualElement visualElement) {
Container.Add(visualElement);
}
public void Clear() {
Container.Clear();
}
private void Close_Clicked() {
ClickClose?.Invoke();
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 31b12dad4121ac74f8072b56fccff8e6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,21 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
public class UIPresetsPlateUnit {
public Action Click;
public readonly VisualElement element;
public readonly DataPresetsPlate data;
public Button Button => element.Q<Button>("Button");
public UIPresetsPlateUnit(VisualElement element, DataPresetsPlate data) {
this.data = data;
this.element = element;
Button.text = data.name;
Button.clicked += Button_Clicked;
}
private void Button_Clicked() {
Click?.Invoke();
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1b2a4d8284ea1bb4dbf0f18daed5ecef
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: