Skip to content

Editor: Skip CesiumIonSession.Tick() when Unity is offline #575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## ? - ?

##### Additions :tada:

##### Fixes :wrench:
- Fixed a bug related to using offline tilesets without internet connection.

## v1.16.0 - 2025-05-01

##### Additions :tada:
Expand Down
24 changes: 24 additions & 0 deletions Editor/CesiumEditorUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ static CesiumEditorUtility()

static void UpdateIonSession()
{
if (!IsNetworkReachable())
return;
try
{
CesiumIonServerManager.instance.currentSession.Tick();
Expand All @@ -34,6 +36,28 @@ static void UpdateIonSession()
}
}

private static bool IsNetworkReachable()
{
switch (Application.internetReachability)
{
case NetworkReachability.ReachableViaCarrierDataNetwork:
// Reachable via carrier data network
return true;

case NetworkReachability.ReachableViaLocalAreaNetwork:
// Reachable via Local Area Network.
return true;

case NetworkReachability.NotReachable:
// Not Reachable.
return false;

default:
// Not Reachable.
return false;
}
}

static void
HandleCesium3DTilesetLoadFailure(Cesium3DTilesetLoadFailureDetails details)
{
Expand Down