1
This commit is contained in:
@@ -12,10 +12,10 @@ public class PrefabPlateBaking : ModulePrefab<DataPlate> {
|
||||
|
||||
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;
|
||||
DataPlateBaking baking = plate.dataBaking;
|
||||
//transform.localPosition = baking.position;
|
||||
//transform.localEulerAngles = baking.eulerAngles;
|
||||
meshFilter.mesh = baking.mesh;
|
||||
meshCollider.sharedMesh = baking.mesh;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,10 @@ public class PrefabPlateDesign : ModulePrefab<DataPlate> {
|
||||
|
||||
public override void UpdateVisual(DataPlate plate) {
|
||||
this.plate = plate;
|
||||
transform.localPosition = plate.designPosition;
|
||||
meshFilter.mesh = plate.designMesh;
|
||||
meshCollider.sharedMesh = plate.designMesh;
|
||||
DataPlateDesign design = plate.dataDesign;
|
||||
transform.localPosition = design.position;
|
||||
meshFilter.mesh = design.mesh;
|
||||
meshCollider.sharedMesh = design.mesh;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PrefabPoint : ModulePrefab<DataPoint> {
|
||||
private DataPoint point;
|
||||
public class PrefabPoint : ModulePrefab<DataPlatePoint> {
|
||||
private DataPlatePoint point;
|
||||
|
||||
public override DataPoint Value => point;
|
||||
public override DataPlatePoint Value => point;
|
||||
|
||||
public override void UpdateVisual(DataPoint point) {
|
||||
public override void UpdateVisual(DataPlatePoint point) {
|
||||
this.point = point;
|
||||
transform.localPosition = point.position;
|
||||
}
|
||||
|
||||
@@ -3,20 +3,20 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PrefabSide : ModulePrefab<DataSide> {
|
||||
public class PrefabSide : ModulePrefab<DataPlateSide> {
|
||||
public Transform aPoint;
|
||||
public Transform bPoint;
|
||||
public LineRenderer lineRenderer;
|
||||
public LineRenderer aBezier;
|
||||
public LineRenderer bBezier;
|
||||
private DataSide side;
|
||||
private DataPlateSide side;
|
||||
|
||||
#region 引用模块
|
||||
/// <summary> 设计UI输入模块 </summary>
|
||||
public ModuleUIInput<UnitMouseInput> UIInputDesign => ModuleCore.I.UIInputDesign;
|
||||
#endregion
|
||||
|
||||
public override DataSide Value => side;
|
||||
public override DataPlateSide Value => side;
|
||||
|
||||
private void Awake() {
|
||||
UIInputDesign.OnChangeInput += UIInputDesign_OnChangeInput;
|
||||
@@ -34,11 +34,12 @@ public class PrefabSide : ModulePrefab<DataSide> {
|
||||
aBezier.gameObject.SetActive(false);
|
||||
bBezier.gameObject.SetActive(false);
|
||||
}
|
||||
public override void UpdateVisual(DataSide side) {
|
||||
public override void UpdateVisual(DataPlateSide side) {
|
||||
this.side = side;
|
||||
|
||||
lineRenderer.positionCount = side.positions.Length;
|
||||
lineRenderer.SetPositions(side.positions);
|
||||
DataPlateSideDesign design = side.dataDesign;
|
||||
lineRenderer.positionCount = design.positions.Length;
|
||||
lineRenderer.SetPositions(design.positions);
|
||||
|
||||
Type type = UIInputDesign.Current.GetType();
|
||||
if (type != typeof(DesignBezier)) { ActiveGameObject(false); return; }
|
||||
|
||||
@@ -14,10 +14,12 @@ public class PrefabSutureBaking : ModulePrefab<DataSuture> {
|
||||
public override void UpdateVisual(DataSuture suture) {
|
||||
this.suture = suture;
|
||||
|
||||
aLineRenderer.SetPosition(0, suture.a.BakingPosintA);
|
||||
aLineRenderer.SetPosition(1, suture.b.BakingPosintA);
|
||||
DataSutureSideBaking aBaking = suture.a.dataBaking;
|
||||
DataSutureSideBaking bBaking = suture.b.dataBaking;
|
||||
aLineRenderer.SetPosition(0, aBaking.PointA);
|
||||
aLineRenderer.SetPosition(1, bBaking.PointA);
|
||||
|
||||
bLineRenderer.SetPosition(0, suture.a.BakingPosintB);
|
||||
bLineRenderer.SetPosition(1, suture.b.BakingPosintB);
|
||||
bLineRenderer.SetPosition(0, aBaking.PointB);
|
||||
bLineRenderer.SetPosition(1, bBaking.PointB);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,10 +14,12 @@ public class PrefabSutureDesign : ModulePrefab<DataSuture> {
|
||||
public override void UpdateVisual(DataSuture suture) {
|
||||
this.suture = suture;
|
||||
|
||||
aLineRenderer.SetPosition(0, suture.a.DesignPosintA);
|
||||
aLineRenderer.SetPosition(1, suture.b.DesignPosintA);
|
||||
DataSutureSideDesign aDesign = suture.a.dataDesign;
|
||||
DataSutureSideDesign bDesign = suture.b.dataDesign;
|
||||
aLineRenderer.SetPosition(0, aDesign.PointA);
|
||||
aLineRenderer.SetPosition(1, bDesign.PointA);
|
||||
|
||||
bLineRenderer.SetPosition(0, suture.a.DesignPosintB);
|
||||
bLineRenderer.SetPosition(1, suture.b.DesignPosintB);
|
||||
bLineRenderer.SetPosition(0, aDesign.PointB);
|
||||
bLineRenderer.SetPosition(1, bDesign.PointB);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ public class PrefabSutureSideBaking : ModulePrefab<DataSutureSide> {
|
||||
public override void UpdateVisual(DataSutureSide sutureSide) {
|
||||
this.sutureSide = sutureSide;
|
||||
|
||||
lineRenderer.positionCount = sutureSide.bakingPositions.Length;
|
||||
lineRenderer.SetPositions(sutureSide.bakingPositions);
|
||||
DataSutureSideBaking baking = sutureSide.dataBaking;
|
||||
lineRenderer.positionCount = baking.positions.Length;
|
||||
lineRenderer.SetPositions(baking.positions);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ public class PrefabSutureSideDesign : ModulePrefab<DataSutureSide> {
|
||||
public override void UpdateVisual(DataSutureSide sutureSide) {
|
||||
this.sutureSide = sutureSide;
|
||||
|
||||
lineRenderer.positionCount = sutureSide.designPositions.Length;
|
||||
lineRenderer.SetPositions(sutureSide.designPositions);
|
||||
DataSutureSideDesign design = sutureSide.dataDesign;
|
||||
lineRenderer.positionCount = design.positions.Length;
|
||||
lineRenderer.SetPositions(design.positions);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user