Skip to content

Commit

Permalink
Show loading spinner while cities are drawn
Browse files Browse the repository at this point in the history
  • Loading branch information
falko17 committed Dec 18, 2023
1 parent 9743e72 commit 10730fd
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Assets/SEE/Game/City/SEECity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -391,16 +391,19 @@ public virtual void DrawGraph()
}
else
{
graphRenderer = new GraphRenderer(this, theVisualizedSubGraph);
// We assume here that this SEECity instance was added to a game object as
// a component. The inherited attribute gameObject identifies this game object.
graphRenderer.DrawGraph(theVisualizedSubGraph, gameObject);

// If we're in editmode, InitializeAfterDrawn() will be called by Start() once the
// game starts. Otherwise, in playmode, we have to call it ourselves.
if (Application.isPlaying)
using (LoadingSpinner.Show($"Drawing city \"{gameObject.name}\""))
{
InitializeAfterDrawn();
graphRenderer = new GraphRenderer(this, theVisualizedSubGraph);
// We assume here that this SEECity instance was added to a game object as
// a component. The inherited attribute gameObject identifies this game object.
graphRenderer.DrawGraph(theVisualizedSubGraph, gameObject);

// If we're in editmode, InitializeAfterDrawn() will be called by Start() once the
// game starts. Otherwise, in playmode, we have to call it ourselves.
if (Application.isPlaying)
{
InitializeAfterDrawn();
}
}
}
}
Expand Down

0 comments on commit 10730fd

Please sign in to comment.