Skip to content

Commit

Permalink
hotfix details at 0 delete children for all objects & prevent API cal…
Browse files Browse the repository at this point in the history
…l when selecting a tempBar
  • Loading branch information
Cedrok committed Jun 21, 2024
1 parent d2480fc commit aceadc3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Assets/Scenes/Main.unity
Original file line number Diff line number Diff line change
Expand Up @@ -9949,9 +9949,9 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Build date: 2024-06-11
m_text: 'Build date: 2024-06-21

Commit #ba5918c'
Commit #d2480fc'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: 79459efec17a4d00a321bdcc27bbc385, type: 2}
Expand Down Expand Up @@ -25344,7 +25344,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 741869393}
m_Direction: 0
m_Value: 0
m_Size: 1
m_Size: 0.99999976
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
Expand Down Expand Up @@ -28516,8 +28516,8 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1513977461}
m_HandleRect: {fileID: 1513977460}
m_Direction: 2
m_Value: 1
m_Size: 0.5657999
m_Value: 0.9999999
m_Size: 0.5658
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public async Task SetCurrentItem(GameObject _obj)
}

OgreeObject selectOgree = _obj.GetComponent<OgreeObject>();
if (!(selectOgree is Group || selectOgree is Corridor) && selectOgree.currentLod == 0)
if (!(selectOgree is Group || selectOgree is Corridor || selectOgree.category == "tempBar") && selectOgree.currentLod == 0)
await selectOgree.LoadChildren(1);
}
else // deselection => unload children if level of details is <=1
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/OgreeClasses/OgreeObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected async Task DeleteChildren(int _askedLevel)
{
List<OgreeObject> objsToDel = new();
foreach (Transform child in transform)
if (child.GetComponent<OgreeObject>() is OgreeObject obj && obj is Device dv && !dv.isComponent)
if (child.GetComponent<OgreeObject>() is OgreeObject obj && (obj is not Device || obj is Device dv && !dv.isComponent))
objsToDel.Add(obj);

if (_askedLevel == 0) // Delete all children
Expand Down

0 comments on commit aceadc3

Please sign in to comment.