Skip to content

Commit

Permalink
Basic server selector.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Nov 29, 2023
1 parent 9f2971d commit 0afa08a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Editor/CesiumIonServerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public CesiumIonServer Current
}
return this._currentCesiumIonServer;
}
set
{
this._currentCesiumIonServer = value;
}
}

public CesiumIonSession CurrentSession
Expand Down
7 changes: 6 additions & 1 deletion Editor/CesiumIonServerUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ public class CesiumIonServerUI
{
public static void Selector()
{

CesiumIonServer server = CesiumIonServerManager.instance.Current;
CesiumIonServer newServer = (CesiumIonServer)EditorGUILayout.ObjectField(server, typeof(CesiumIonServer), false);
if (server != newServer)
{
CesiumIonServerManager.instance.Current = newServer;
}
}
}
}
2 changes: 2 additions & 0 deletions Runtime/CesiumIonServer.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.ComponentModel;
using UnityEditor;
using UnityEngine;

Expand All @@ -8,6 +9,7 @@ namespace CesiumForUnity
/// ion.cesium.com, or it may be a self-hosted instance.
/// </summary>
[CreateAssetMenu(fileName = "CesiumIonServer", menuName = "Cesium/Cesium ion Server")]
[AddComponentMenu("Cesium/Cesium ion Server")]
public class CesiumIonServer : ScriptableObject
{
/// <summary>
Expand Down

0 comments on commit 0afa08a

Please sign in to comment.