修复放置位置的问题

This commit is contained in:
YangHua 2023-09-16 00:46:21 +08:00
parent 9e8ed5e170
commit 617c373158
4 changed files with 8 additions and 14 deletions

View File

@ -185,9 +185,9 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler,
/// <param name="isOnUPos"></param> /// <param name="isOnUPos"></param>
public void SetUPosHighLight(bool isOnUPos) public void SetUPosHighLight(bool isOnUPos)
{ {
Debug.Log(isOnUPos + "++++++isOnUPos");
if (isOnUPos) if (isOnUPos)
{ {
int index = uPosManger.CountUPos(targetObject.volume, currentUPosItem.ID); int index = uPosManger.CountUPos(targetObject.volume, currentUPosItem.ID);
uPosManger.SetUPosInstruct(index, targetObject.volume, isOnUPos); uPosManger.SetUPosInstruct(index, targetObject.volume, isOnUPos);
} }
@ -216,8 +216,8 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler,
if (!currentUPosItem.isOccupied) if (!currentUPosItem.isOccupied)
{ {
target.transform.position = hitInfo.point; target.transform.position = hitInfo.point;
} }
} }
else else
{ {

View File

@ -104,26 +104,19 @@ public class UPosManger : MonoBehaviour
/// <param name="isEnabel"></param> /// <param name="isEnabel"></param>
public void SetUPosInstruct(int startIndex, int count, bool isOnUPos) public void SetUPosInstruct(int startIndex, int count, bool isOnUPos)
{ {
for (int i = 0; i < uPosItems.Length; i++) for (int i = 0; i < uPosItems.Length; i++)
{ {
if (!uPosItems[i].isOccupied) if (!uPosItems[i].isOccupied)
uPosItems[i].SetInstructColor(Color.green); uPosItems[i].SetInstructColor(Color.green);
} }
if (startIndex == -1) return;
if (isOnUPos) if (isOnUPos)
{ {
for (int i = startIndex; i < startIndex + count; i++) for (int i = startIndex; i < startIndex + count; i++)
{
try
{ {
uPosItems[i].SetInstructColor(Color.yellow); uPosItems[i].SetInstructColor(Color.yellow);
} }
catch
{
}
}
} }
} }

View File

@ -116749,6 +116749,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_SendPointerHoverToParent: 1
m_HorizontalAxis: Horizontal m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical m_VerticalAxis: Vertical
m_SubmitButton: Submit m_SubmitButton: Submit
@ -195017,7 +195018,7 @@ MonoBehaviour:
xlz_sc: xlz_sc:
xllx_sc: xllx_sc:
arguments: arguments:
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2OTQ4NTAyODksInVzZXJuYW1lIjoiMTgzMTIzNDU2NzgifQ.j0JKoTpsQ3upAbreBLVTMZEsYMfN5WtEI810C7TCjLg token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2OTQ4Nzg2NTUsInVzZXJuYW1lIjoiMTgzMTIzNDU2NzgifQ.zwIb__dy-Twp7UM9simdt2stqMLtl303EruHFTS5uq8 '
heatThresholdValueMax: heatThresholdValueMax:
heatThresholdValueMin: heatThresholdValueMin:
humidityThresholdValueMax: humidityThresholdValueMax:

View File

@ -1 +1 @@
https://37g271144o.imdo.co/ https://y1770r6292.goho.co/