This commit is contained in:
MuHua-123
2024-11-25 18:32:05 +08:00
parent 72d1f89b54
commit 84243e75a8
353 changed files with 17666 additions and 3206 deletions
+16
View File
@@ -0,0 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 预制件模块
/// </summary>
public abstract class ModulePrefab<Data> : MonoBehaviour {
/// <summary> 核心模块 </summary>
protected virtual ModuleCore ModuleCore => ModuleCore.I;
/// <summary> 关联的数据 </summary>
public abstract Data Value { get; }
/// <summary> 更新可视化内容 </summary>
public abstract void UpdateVisual(Data data);
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f29e3f72f567ffc4f97bdc9129f2fe1b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+22
View File
@@ -0,0 +1,22 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PrefabConnector : ModulePrefab<DataConnector> {
public Transform aPonit;
public Transform bPoint;
public LineRenderer lineRenderer;
private DataConnector connector;
public override DataConnector Value => connector;
public override void UpdateVisual(DataConnector connector) {
this.connector = connector;
aPonit.localPosition = connector.aPoint;
bPoint.localPosition = connector.bPoint;
lineRenderer.SetPosition(0, connector.aPoint);
lineRenderer.SetPosition(1, connector.bPoint);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 139466628cb8f5d4882b2c4d84899b57
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+21
View File
@@ -0,0 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PrefabPlateBaking : ModulePrefab<DataPlate> {
private DataPlate plate;
private MeshFilter meshFilter => GetComponent<MeshFilter>();
private MeshCollider meshCollider => GetComponent<MeshCollider>();
public override DataPlate Value => plate;
public override void UpdateVisual(DataPlate plate) {
this.plate = plate;
transform.localPosition = plate.bakingPosition;
transform.localEulerAngles = plate.bakingEulerAngles;
meshFilter.mesh = plate.designMesh;
meshCollider.sharedMesh = plate.designMesh;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 78d649ecc86d78140a6fc3668cfd51d1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+20
View File
@@ -0,0 +1,20 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PrefabPlateDesign : ModulePrefab<DataPlate> {
private DataPlate plate;
private MeshFilter meshFilter => GetComponent<MeshFilter>();
private MeshCollider meshCollider => GetComponent<MeshCollider>();
public override DataPlate Value => plate;
public override void UpdateVisual(DataPlate plate) {
this.plate = plate;
transform.localPosition = plate.designPosition;
meshFilter.mesh = plate.designMesh;
meshCollider.sharedMesh = plate.designMesh;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 96e2853481aa5c647a532a352a3c33d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+14
View File
@@ -0,0 +1,14 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PrefabPoint : ModulePrefab<DataPoint> {
private DataPoint point;
public override DataPoint Value => point;
public override void UpdateVisual(DataPoint point) {
this.point = point;
transform.localPosition = point.position;
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4746c152c7202c84f974eeab499c1e8c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+63
View File
@@ -0,0 +1,63 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PrefabSide : ModulePrefab<DataSide> {
public Transform aPoint;
public Transform bPoint;
public LineRenderer lineRenderer;
public LineRenderer aBezier;
public LineRenderer bBezier;
private DataSide side;
#region
/// <summary> 设计UI输入模块 </summary>
public ModuleUIInput<UnitMouseInput> UIInputDesign => ModuleCore.I.UIInputDesign;
#endregion
public override DataSide Value => side;
private void Awake() {
UIInputDesign.OnChangeInput += UIInputDesign_OnChangeInput;
}
private void OnDestroy() {
if (UIInputDesign == null) { return; }
UIInputDesign.OnChangeInput -= UIInputDesign_OnChangeInput;
}
private void UIInputDesign_OnChangeInput(UnitMouseInput obj) {
Type type = UIInputDesign.Current.GetType();
if (type == typeof(DesignBezier)) { UpdateVisual(side); return; }
aPoint.gameObject.SetActive(false);
bPoint.gameObject.SetActive(false);
aBezier.gameObject.SetActive(false);
bBezier.gameObject.SetActive(false);
}
public override void UpdateVisual(DataSide side) {
this.side = side;
lineRenderer.positionCount = side.positions.Length;
lineRenderer.SetPositions(side.positions);
Type type = UIInputDesign.Current.GetType();
if (type != typeof(DesignBezier)) { ActiveGameObject(false); return; }
if (side.bezier == Bezier.) { ActiveGameObject(false); return; }
if (side.bezier == Bezier.) { ActiveGameObject(true); }
if (side.bezier == Bezier.) { ActiveGameObject(true); }
aPoint.localPosition = side.aBezier;
bPoint.localPosition = side.bBezier;
aBezier.SetPosition(0, side.aPoint.position);
aBezier.SetPosition(1, side.aBezier);
bBezier.SetPosition(0, side.bPoint.position);
bBezier.SetPosition(1, side.bBezier);
}
private void ActiveGameObject(bool isActive) {
aPoint.gameObject.SetActive(isActive);
bPoint.gameObject.SetActive(isActive);
aBezier.gameObject.SetActive(isActive);
bBezier.gameObject.SetActive(isActive);
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b75d83af36741c649b1caa22b1bd103c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+23
View File
@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PrefabSutureBaking : ModulePrefab<DataSuture> {
public LineRenderer aLineRenderer;
public LineRenderer bLineRenderer;
private DataSuture suture;
public override DataSuture Value => suture;
public override void UpdateVisual(DataSuture suture) {
this.suture = suture;
aLineRenderer.SetPosition(0, suture.a.BakingPosintA);
aLineRenderer.SetPosition(1, suture.b.BakingPosintA);
bLineRenderer.SetPosition(0, suture.a.BakingPosintB);
bLineRenderer.SetPosition(1, suture.b.BakingPosintB);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 75e541a37f3fd844bbf81bc250bd1a23
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+23
View File
@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PrefabSutureDesign : ModulePrefab<DataSuture> {
public LineRenderer aLineRenderer;
public LineRenderer bLineRenderer;
private DataSuture suture;
public override DataSuture Value => suture;
public override void UpdateVisual(DataSuture suture) {
this.suture = suture;
aLineRenderer.SetPosition(0, suture.a.DesignPosintA);
aLineRenderer.SetPosition(1, suture.b.DesignPosintA);
bLineRenderer.SetPosition(0, suture.a.DesignPosintB);
bLineRenderer.SetPosition(1, suture.b.DesignPosintB);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1eb2df51fd021c64ba16fd7aea74de71
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PrefabSutureSideBaking : ModulePrefab<DataSutureSide> {
private DataSutureSide sutureSide;
public override DataSutureSide Value => sutureSide;
public LineRenderer lineRenderer => GetComponent<LineRenderer>();
public override void UpdateVisual(DataSutureSide sutureSide) {
this.sutureSide = sutureSide;
lineRenderer.positionCount = sutureSide.bakingPositions.Length;
lineRenderer.SetPositions(sutureSide.bakingPositions);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f3f822abebf5e5c4a9d564052bddb818
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PrefabSutureSideDesign : ModulePrefab<DataSutureSide> {
private DataSutureSide sutureSide;
public override DataSutureSide Value => sutureSide;
public LineRenderer lineRenderer => GetComponent<LineRenderer>();
public override void UpdateVisual(DataSutureSide sutureSide) {
this.sutureSide = sutureSide;
lineRenderer.positionCount = sutureSide.designPositions.Length;
lineRenderer.SetPositions(sutureSide.designPositions);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4f5c45672bf96354da7017651e332f58
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: