1
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user