Skip to content

Commit

Permalink
fix for the modelid not changing
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbusysky committed Dec 23, 2023
1 parent db06d11 commit 2f897d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Scenario/Editor/Models/ModelsUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,13 @@ private void DrawTextureBox(float boxWidth, float boxHeight, float rowPadding, L
};

if (texture != null)
{
{
if (GUI.Button(boxRect, texture))
{
if (i >= 0 && i < models.Count)
int globalIndex = firstImageIndex + i;
if (globalIndex >= 0 && globalIndex < models.Count)
{
DataCache.instance.SelectedModelId = models[i].id;
DataCache.instance.SelectedModelId = models[globalIndex].id;
EditorPrefs.SetString("SelectedModelName", name);
}

Expand Down

0 comments on commit 2f897d2

Please sign in to comment.