初始化项目
This commit is contained in:
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 生成可视化内容模块
|
||||
/// 可视化内容生成模块
|
||||
/// </summary>
|
||||
public abstract class ModuleVisual<Data> : MonoBehaviour {
|
||||
/// <summary> 必须要初始化 </summary>
|
||||
@@ -11,7 +11,7 @@ public abstract class ModuleVisual<Data> : MonoBehaviour {
|
||||
/// <summary> 核心模块 </summary>
|
||||
protected virtual ModuleCore ModuleCore => ModuleCore.I;
|
||||
|
||||
/// <summary> 更新可视化内容 </summary>
|
||||
/// <summary> 更新可视化 </summary>
|
||||
public abstract void UpdateVisual(Data data);
|
||||
/// <summary> 释放可视化内容 </summary>
|
||||
public abstract void ReleaseVisual(Data data);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32a3e92bdd9f12a4dbaeadda30a66075
|
||||
guid: 1681bcfa66dacbd4e810d15939fa7e04
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
//public class VisualBaking : ModuleVisual<DataPlate> {
|
||||
// public Transform viewSpace;
|
||||
// public Transform platePrefab;//板片
|
||||
// public Transform suturePrefab;//缝合
|
||||
// public Transform sutureSidePrefab;//缝合边
|
||||
|
||||
// protected override void Awake() => ModuleCore.VisualBaking = this;
|
||||
|
||||
// public override void UpdateVisual(DataPlate plate) {
|
||||
// //更新板片
|
||||
// Create(ref plate.baking, platePrefab, viewSpace);
|
||||
// plate.baking.UpdateVisual(plate);
|
||||
// //子数据父对象
|
||||
// Transform parent = plate.design.transform;
|
||||
// //更新线段
|
||||
// plate.sides.ForEach(obj => UpdateVisual(obj, parent));
|
||||
// }
|
||||
// public override void ReleaseVisual(DataPlate data) {
|
||||
// throw new System.NotImplementedException();
|
||||
// }
|
||||
|
||||
// private void UpdateVisual(DataSide side, Transform parent) {
|
||||
// //Create(ref side.design, sidePrefab, parent);
|
||||
// //side.design.UpdateVisual(side);
|
||||
// //更新缝合线
|
||||
// if (side.suture == null) { return; }
|
||||
// //side.suture.Update();
|
||||
// UpdateVisual(side.suture, viewSpace);
|
||||
// }
|
||||
// /// <summary> 更新缝合数据 </summary>
|
||||
// private void UpdateVisual(DataSuture suture, Transform parent) {
|
||||
// Create(ref suture.baking, suturePrefab, parent);
|
||||
// UpdateVisual(suture.a, suture.baking.transform);
|
||||
// UpdateVisual(suture.b, suture.baking.transform);
|
||||
// suture.baking.UpdateVisual(suture);
|
||||
// }
|
||||
// /// <summary> 更新缝合边 </summary>
|
||||
// private void UpdateVisual(DataSutureSide sutureSide, Transform parent) {
|
||||
// Create(ref sutureSide.baking, sutureSidePrefab, parent);
|
||||
// sutureSide.baking.UpdateVisual(sutureSide);
|
||||
// }
|
||||
//}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 545b7804867d268448f7089215e20f39
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 连接可视化模块
|
||||
/// </summary>
|
||||
public class VisualConnector : ModuleVisual<DataConnector> {
|
||||
public Transform viewSpace;
|
||||
public Transform connectorPrefab;//板片
|
||||
|
||||
protected override void Awake() => ModuleCore.VisualConnector = this;
|
||||
|
||||
public override void UpdateVisual(DataConnector data) {
|
||||
//更新板片
|
||||
Create(ref data.visual, connectorPrefab, viewSpace);
|
||||
data.visual.UpdateVisual(data);
|
||||
}
|
||||
public override void ReleaseVisual(DataConnector data) {
|
||||
if (data.visual != null) {
|
||||
Destroy(data.visual.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea4effe5ac0300348b249f05af7bf201
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,57 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 版片可视化模块
|
||||
/// </summary>
|
||||
//public class VisualDesign : ModuleVisual<DataPlate> {
|
||||
// public Transform viewSpace;
|
||||
// public Transform platePrefab;//板片
|
||||
// public Transform pointPrefab;//点
|
||||
// public Transform sidePrefab;//边
|
||||
// public Transform suturePrefab;//缝合
|
||||
// public Transform sutureSidePrefab;//缝合边
|
||||
|
||||
// protected override void Awake() => ModuleCore.VisualDesign = this;
|
||||
|
||||
// public override void UpdateVisual(DataPlate plate) {
|
||||
// //更新板片
|
||||
// Create(ref plate.design, platePrefab, viewSpace);
|
||||
// plate.design.UpdateVisual(plate);
|
||||
// //子数据父对象
|
||||
// Transform parent = plate.design.transform;
|
||||
// //更新点
|
||||
// plate.points.ForEach(obj => UpdateVisual(obj, parent));
|
||||
// //更新线段
|
||||
// plate.sides.ForEach(obj => UpdateVisual(obj, parent));
|
||||
// }
|
||||
// public override void ReleaseVisual(DataPlate data) {
|
||||
// throw new System.NotImplementedException();
|
||||
// }
|
||||
|
||||
// private void UpdateVisual(DataPoint point, Transform parent) {
|
||||
// Create(ref point.visual, pointPrefab, parent);
|
||||
// point.visual.UpdateVisual(point);
|
||||
// }
|
||||
// private void UpdateVisual(DataSide side, Transform parent) {
|
||||
// Create(ref side.design, sidePrefab, parent);
|
||||
// side.design.UpdateVisual(side);
|
||||
// //更新缝合线
|
||||
// if (side.suture == null) { return; }
|
||||
// side.suture.Update();
|
||||
// UpdateVisual(side.suture, viewSpace);
|
||||
// }
|
||||
// /// <summary> 更新缝合数据 </summary>
|
||||
// private void UpdateVisual(DataSuture suture, Transform parent) {
|
||||
// Create(ref suture.design, suturePrefab, parent);
|
||||
// UpdateVisual(suture.a, suture.design.transform);
|
||||
// UpdateVisual(suture.b, suture.design.transform);
|
||||
// suture.design.UpdateVisual(suture);
|
||||
// }
|
||||
// /// <summary> 更新缝合边 </summary>
|
||||
// private void UpdateVisual(DataSutureSide sutureSide, Transform parent) {
|
||||
// Create(ref sutureSide.design, sutureSidePrefab, parent);
|
||||
// sutureSide.design.UpdateVisual(sutureSide);
|
||||
// }
|
||||
//}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce128d679e2869147a5b5306cef090e3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,46 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class VisualPlateBaking : ModuleVisual<DataPlate> {
|
||||
public Transform viewSpace;
|
||||
public Transform platePrefab;//板片
|
||||
public Transform suturePrefab;//缝合
|
||||
public Transform sutureSidePrefab;//缝合边
|
||||
|
||||
protected override void Awake() => ModuleCore.VisualPlateBaking = this;
|
||||
|
||||
public override void UpdateVisual(DataPlate plate) {
|
||||
//更新板片
|
||||
Create(ref plate.bakingPrefab, platePrefab, viewSpace);
|
||||
plate.bakingPrefab.UpdateVisual(plate);
|
||||
//子数据父对象
|
||||
Transform parent = plate.designPrefab.transform;
|
||||
//更新线段
|
||||
plate.plateSides.ForEach(obj => UpdateVisual(obj, parent));
|
||||
}
|
||||
public override void ReleaseVisual(DataPlate data) {
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
private void UpdateVisual(DataPlateSide side, Transform parent) {
|
||||
//Create(ref side.design, sidePrefab, parent);
|
||||
//side.design.UpdateVisual(side);
|
||||
//更新缝合线
|
||||
//if (side.suture == null) { return; }
|
||||
//side.suture.Update();
|
||||
//UpdateVisual(side.suture, viewSpace);
|
||||
}
|
||||
/// <summary> 更新缝合数据 </summary>
|
||||
private void UpdateVisual(DataSuture suture, Transform parent) {
|
||||
Create(ref suture.baking, suturePrefab, parent);
|
||||
UpdateVisual(suture.a, suture.baking.transform);
|
||||
UpdateVisual(suture.b, suture.baking.transform);
|
||||
suture.baking.UpdateVisual(suture);
|
||||
}
|
||||
/// <summary> 更新缝合边 </summary>
|
||||
private void UpdateVisual(DataSutureSide sutureSide, Transform parent) {
|
||||
Create(ref sutureSide.baking, sutureSidePrefab, parent);
|
||||
sutureSide.baking.UpdateVisual(sutureSide);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef4a839345dfb344382e257d374ca3ed
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,41 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 版片可视化模块
|
||||
/// </summary>
|
||||
public class VisualPlateDesign : ModuleVisual<DataPlate> {
|
||||
public Transform viewSpace;
|
||||
public Transform platePrefab;//板片
|
||||
public Transform pointPrefab;//点
|
||||
public Transform sidePrefab;//边
|
||||
|
||||
protected override void Awake() => ModuleCore.VisualPlateDesign = this;
|
||||
|
||||
public override void UpdateVisual(DataPlate plate) {
|
||||
//更新板片
|
||||
Create(ref plate.designPrefab, platePrefab, viewSpace);
|
||||
plate.designPrefab.UpdateVisual(plate);
|
||||
//子数据父对象
|
||||
Transform parent = plate.designPrefab.transform;
|
||||
//更新点
|
||||
plate.platePoints.ForEach(obj => UpdateVisual(obj, parent));
|
||||
//更新线段
|
||||
plate.plateSides.ForEach(obj => UpdateVisual(obj, parent));
|
||||
}
|
||||
public override void ReleaseVisual(DataPlate data) {
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
private void UpdateVisual(DataPlatePoint point, Transform parent) {
|
||||
Create(ref point.visual, pointPrefab, parent);
|
||||
point.visual.UpdateVisual(point);
|
||||
}
|
||||
private void UpdateVisual(DataPlateSide side, Transform parent) {
|
||||
Create(ref side.designPrefab, sidePrefab, parent);
|
||||
side.designPrefab.UpdateVisual(side);
|
||||
//更新缝合线
|
||||
if (side.suture != null) { side.suture.UpdateVisual(); }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9827f83f79c2af42b2a06bdc3c80719
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,31 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 缝合烘焙可视化模块
|
||||
/// </summary>
|
||||
public class VisualSutureBaking : ModuleVisual<DataSuture> {
|
||||
public Transform viewSpace;
|
||||
public Transform suturePrefab;//缝合
|
||||
public Transform sutureSidePrefab;//缝合边
|
||||
|
||||
protected override void Awake() => ModuleCore.VisualSutureBaking = this;
|
||||
|
||||
public override void UpdateVisual(DataSuture suture) {
|
||||
Create(ref suture.baking, suturePrefab, viewSpace);
|
||||
suture.baking.UpdateVisual(suture);
|
||||
|
||||
UpdateVisual(suture.a, suture.baking.transform);
|
||||
UpdateVisual(suture.b, suture.baking.transform);
|
||||
}
|
||||
public override void ReleaseVisual(DataSuture data) {
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary> 更新缝合边 </summary>
|
||||
private void UpdateVisual(DataSutureSide sutureSide, Transform parent) {
|
||||
Create(ref sutureSide.baking, sutureSidePrefab, parent);
|
||||
sutureSide.baking.UpdateVisual(sutureSide);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 06ff2a0f351be2d41aa7c8dfc23798e0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,31 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 缝合设计可视化模块
|
||||
/// </summary>
|
||||
public class VisualSutureDesign : ModuleVisual<DataSuture> {
|
||||
public Transform viewSpace;
|
||||
public Transform suturePrefab;//缝合
|
||||
public Transform sutureSidePrefab;//缝合边
|
||||
|
||||
protected override void Awake() => ModuleCore.VisualSutureDesign = this;
|
||||
|
||||
public override void UpdateVisual(DataSuture suture) {
|
||||
Create(ref suture.design, suturePrefab, viewSpace);
|
||||
suture.design.UpdateVisual(suture);
|
||||
|
||||
UpdateVisual(suture.a, suture.design.transform);
|
||||
UpdateVisual(suture.b, suture.design.transform);
|
||||
}
|
||||
public override void ReleaseVisual(DataSuture data) {
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary> 更新缝合边 </summary>
|
||||
private void UpdateVisual(DataSutureSide sutureSide, Transform parent) {
|
||||
Create(ref sutureSide.design, sutureSidePrefab, parent);
|
||||
sutureSide.design.UpdateVisual(sutureSide);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a43eabbe6a52df943b5157da8933dd33
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user