org.outernet.cesium-unity 1.15.3-linux.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +420 -0
- package/CHANGES.md.meta +7 -0
- package/Editor/BuildCesiumForUnity.cs +186 -0
- package/Editor/BuildCesiumForUnity.cs.meta +11 -0
- package/Editor/Cesium3DTilesetEditor.cs +542 -0
- package/Editor/Cesium3DTilesetEditor.cs.meta +11 -0
- package/Editor/CesiumBingMapsRasterOverlayEditor.cs +66 -0
- package/Editor/CesiumBingMapsRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumCameraControllerEditor.cs +174 -0
- package/Editor/CesiumCameraControllerEditor.cs.meta +11 -0
- package/Editor/CesiumCameraManagerEditor.cs +65 -0
- package/Editor/CesiumCameraManagerEditor.cs.meta +11 -0
- package/Editor/CesiumCartographicPolygonEditor.cs +23 -0
- package/Editor/CesiumCartographicPolygonEditor.cs.meta +11 -0
- package/Editor/CesiumDebugColorizeTilesRasterOverlayEditor.cs +41 -0
- package/Editor/CesiumDebugColorizeTilesRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumEditor.asmdef +26 -0
- package/Editor/CesiumEditor.asmdef.meta +7 -0
- package/Editor/CesiumEditorStyle.cs +188 -0
- package/Editor/CesiumEditorStyle.cs.meta +11 -0
- package/Editor/CesiumEditorUtility.cs +394 -0
- package/Editor/CesiumEditorUtility.cs.meta +11 -0
- package/Editor/CesiumEditorWindow.cs +447 -0
- package/Editor/CesiumEditorWindow.cs.meta +11 -0
- package/Editor/CesiumFlyToControllerEditor.cs +76 -0
- package/Editor/CesiumFlyToControllerEditor.cs.meta +11 -0
- package/Editor/CesiumGeoreferenceEditor.cs +277 -0
- package/Editor/CesiumGeoreferenceEditor.cs.meta +11 -0
- package/Editor/CesiumGlobeAnchorEditor.cs +202 -0
- package/Editor/CesiumGlobeAnchorEditor.cs.meta +11 -0
- package/Editor/CesiumInspectorGUI.cs +187 -0
- package/Editor/CesiumInspectorGUI.cs.meta +11 -0
- package/Editor/CesiumIonAsset.cs +192 -0
- package/Editor/CesiumIonAsset.cs.meta +11 -0
- package/Editor/CesiumIonAssetsWindow.cs +257 -0
- package/Editor/CesiumIonAssetsWindow.cs.meta +11 -0
- package/Editor/CesiumIonRasterOverlayEditor.cs +87 -0
- package/Editor/CesiumIonRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumIonServerManager.cs +153 -0
- package/Editor/CesiumIonServerManager.cs.meta +11 -0
- package/Editor/CesiumIonServerSelector.cs +127 -0
- package/Editor/CesiumIonServerSelector.cs.meta +11 -0
- package/Editor/CesiumIonSession.cs +102 -0
- package/Editor/CesiumIonSession.cs.meta +11 -0
- package/Editor/CesiumPolygonRasterOverlayEditor.cs +102 -0
- package/Editor/CesiumPolygonRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumRasterOverlayEditor.cs +230 -0
- package/Editor/CesiumRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumSubSceneEditor.cs +201 -0
- package/Editor/CesiumSubSceneEditor.cs.meta +11 -0
- package/Editor/CesiumTileMapServiceRasterOverlayEditor.cs +88 -0
- package/Editor/CesiumTileMapServiceRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumWebMapServiceRasterOverlayEditor.cs +111 -0
- package/Editor/CesiumWebMapServiceRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumWebMapTileServiceRasterOverlayEditor.cs +277 -0
- package/Editor/CesiumWebMapTileServiceRasterOverlayEditor.cs.meta +3 -0
- package/Editor/CompileCesiumForUnityNative.cs +581 -0
- package/Editor/CompileCesiumForUnityNative.cs.meta +11 -0
- package/Editor/ConfigureReinterop.cs +255 -0
- package/Editor/ConfigureReinterop.cs.meta +11 -0
- package/Editor/Helpers.cs +102 -0
- package/Editor/Helpers.cs.meta +11 -0
- package/Editor/IonAssetsMultiColumnHeader.cs +45 -0
- package/Editor/IonAssetsMultiColumnHeader.cs.meta +11 -0
- package/Editor/IonAssetsTreeView.cs +214 -0
- package/Editor/IonAssetsTreeView.cs.meta +11 -0
- package/Editor/IonMissingAssetWindow.cs +65 -0
- package/Editor/IonMissingAssetWindow.cs.meta +11 -0
- package/Editor/IonTokenTroubleshootingWindow.cs +615 -0
- package/Editor/IonTokenTroubleshootingWindow.cs.meta +11 -0
- package/Editor/NativeDownloadHandler.cs +35 -0
- package/Editor/NativeDownloadHandler.cs.meta +11 -0
- package/Editor/QuickAddItem.cs +43 -0
- package/Editor/QuickAddItem.cs.meta +11 -0
- package/Editor/Resources/Cesium-128x128.png +0 -0
- package/Editor/Resources/Cesium-128x128.png.meta +98 -0
- package/Editor/Resources/Cesium-24x24.png +0 -0
- package/Editor/Resources/Cesium-24x24.png.meta +123 -0
- package/Editor/Resources/Cesium-64x64.png +0 -0
- package/Editor/Resources/Cesium-64x64.png.meta +98 -0
- package/Editor/Resources/Cesium-for-Unity-dark.png +0 -0
- package/Editor/Resources/Cesium-for-Unity-dark.png.meta +123 -0
- package/Editor/Resources/Cesium-for-Unity-light.png +0 -0
- package/Editor/Resources/Cesium-for-Unity-light.png.meta +123 -0
- package/Editor/Resources/Cesium-icon-16x16.png +0 -0
- package/Editor/Resources/Cesium-icon-16x16.png.meta +98 -0
- package/Editor/Resources/FontAwesome/attribution.txt +9 -0
- package/Editor/Resources/FontAwesome/attribution.txt.meta +7 -0
- package/Editor/Resources/FontAwesome/book-reader-solid.png +0 -0
- package/Editor/Resources/FontAwesome/book-reader-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/book-reader-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/book-reader-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/check-solid.png +0 -0
- package/Editor/Resources/FontAwesome/check-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/check-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/check-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/cloud-upload-alt-solid.png +0 -0
- package/Editor/Resources/FontAwesome/cloud-upload-alt-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/cloud-upload-alt-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/cloud-upload-alt-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/folder.png +0 -0
- package/Editor/Resources/FontAwesome/folder.png.meta +147 -0
- package/Editor/Resources/FontAwesome/folder.svg +5 -0
- package/Editor/Resources/FontAwesome/folder.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/hands-helping-solid.png +0 -0
- package/Editor/Resources/FontAwesome/hands-helping-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/hands-helping-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/hands-helping-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/key-solid.png +0 -0
- package/Editor/Resources/FontAwesome/key-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/key-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/key-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/plus-solid.png +0 -0
- package/Editor/Resources/FontAwesome/plus-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/plus-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/plus-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/sign-out-alt-solid.png +0 -0
- package/Editor/Resources/FontAwesome/sign-out-alt-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/sign-out-alt-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/sign-out-alt-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/sync-alt-solid.png +0 -0
- package/Editor/Resources/FontAwesome/sync-alt-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/sync-alt-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/sync-alt-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/times-solid.png +0 -0
- package/Editor/Resources/FontAwesome/times-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/times-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/times-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome.meta +8 -0
- package/Editor/Resources.meta +8 -0
- package/Editor/SelectIonTokenWindow.cs +249 -0
- package/Editor/SelectIonTokenWindow.cs.meta +11 -0
- package/Editor/arm64.meta +8 -0
- package/Editor/csc.rsp +1 -0
- package/Editor/csc.rsp.meta +7 -0
- package/Editor/libCesiumForUnityNative-Editor.so +0 -0
- package/Editor/libCesiumForUnityNative-Editor.so.meta +2 -0
- package/Editor/libCesiumForUnityNative-Runtime.so +0 -0
- package/Editor/libCesiumForUnityNative-Runtime.so.meta +2 -0
- package/Editor/x86_64.meta +8 -0
- package/Editor.meta +8 -0
- package/LICENSE +201 -0
- package/LICENSE.meta +7 -0
- package/Plugins/Standalone/libCesiumForUnityNative-Runtime.so +0 -0
- package/Plugins/Standalone/libCesiumForUnityNative-Runtime.so.meta +2 -0
- package/Plugins/Standalone.meta +8 -0
- package/Plugins.meta +8 -0
- package/README.md +39 -0
- package/README.md.meta +7 -0
- package/Reinterop.deps.json +172 -0
- package/Reinterop.deps.json.meta +7 -0
- package/Reinterop.dll +0 -0
- package/Reinterop.dll.meta +79 -0
- package/Runtime/Cesium3DTile.cs +37 -0
- package/Runtime/Cesium3DTile.cs.meta +11 -0
- package/Runtime/Cesium3DTileset.cs +788 -0
- package/Runtime/Cesium3DTileset.cs.meta +11 -0
- package/Runtime/Cesium3DTilesetLoadFailureDetails.cs +65 -0
- package/Runtime/Cesium3DTilesetLoadFailureDetails.cs.meta +11 -0
- package/Runtime/CesiumBackwardCompatibility.cs +163 -0
- package/Runtime/CesiumBackwardCompatibility.cs.meta +11 -0
- package/Runtime/CesiumBingMapsRasterOverlay.cs +72 -0
- package/Runtime/CesiumBingMapsRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumCameraController.cs +827 -0
- package/Runtime/CesiumCameraController.cs.meta +11 -0
- package/Runtime/CesiumCameraManager.cs +105 -0
- package/Runtime/CesiumCameraManager.cs.meta +11 -0
- package/Runtime/CesiumCartographicPolygon.cs +152 -0
- package/Runtime/CesiumCartographicPolygon.cs.meta +11 -0
- package/Runtime/CesiumCreditSystem.cs +343 -0
- package/Runtime/CesiumCreditSystem.cs.meta +11 -0
- package/Runtime/CesiumCreditSystemUI.cs +402 -0
- package/Runtime/CesiumCreditSystemUI.cs.meta +11 -0
- package/Runtime/CesiumDebugColorizeTilesRasterOverlay.cs +21 -0
- package/Runtime/CesiumDebugColorizeTilesRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumEllipsoid.cs +107 -0
- package/Runtime/CesiumEllipsoid.cs.meta +11 -0
- package/Runtime/CesiumFeature.cs +279 -0
- package/Runtime/CesiumFeature.cs.meta +11 -0
- package/Runtime/CesiumFeatureIdAttribute.cs +61 -0
- package/Runtime/CesiumFeatureIdAttribute.cs.meta +11 -0
- package/Runtime/CesiumFeatureIdSet.cs +165 -0
- package/Runtime/CesiumFeatureIdSet.cs.meta +11 -0
- package/Runtime/CesiumFeatureIdTexture.cs +68 -0
- package/Runtime/CesiumFeatureIdTexture.cs.meta +11 -0
- package/Runtime/CesiumFlyToController.cs +539 -0
- package/Runtime/CesiumFlyToController.cs.meta +11 -0
- package/Runtime/CesiumGeoreference.cs +628 -0
- package/Runtime/CesiumGeoreference.cs.meta +11 -0
- package/Runtime/CesiumGlobeAnchor.cs +664 -0
- package/Runtime/CesiumGlobeAnchor.cs.meta +11 -0
- package/Runtime/CesiumGlobeAnchorBackwardCompatibility0dot2dot0.cs +105 -0
- package/Runtime/CesiumGlobeAnchorBackwardCompatibility0dot2dot0.cs.meta +11 -0
- package/Runtime/CesiumIntMatN.cs +398 -0
- package/Runtime/CesiumIntMatN.cs.meta +11 -0
- package/Runtime/CesiumIntVecN.cs +525 -0
- package/Runtime/CesiumIntVecN.cs.meta +11 -0
- package/Runtime/CesiumIonRasterOverlay.cs +110 -0
- package/Runtime/CesiumIonRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumIonServer.cs +137 -0
- package/Runtime/CesiumIonServer.cs.meta +11 -0
- package/Runtime/CesiumMetadata.cs +33 -0
- package/Runtime/CesiumMetadata.cs.meta +11 -0
- package/Runtime/CesiumMetadataValue.cs +1764 -0
- package/Runtime/CesiumMetadataValue.cs.meta +11 -0
- package/Runtime/CesiumMetadataValueType.cs +203 -0
- package/Runtime/CesiumMetadataValueType.cs.meta +11 -0
- package/Runtime/CesiumModelMetadata.cs +26 -0
- package/Runtime/CesiumModelMetadata.cs.meta +11 -0
- package/Runtime/CesiumObjectPool.cs +74 -0
- package/Runtime/CesiumObjectPool.cs.meta +11 -0
- package/Runtime/CesiumObjectPools.cs +39 -0
- package/Runtime/CesiumObjectPools.cs.meta +11 -0
- package/Runtime/CesiumOriginShift.cs +146 -0
- package/Runtime/CesiumOriginShift.cs.meta +11 -0
- package/Runtime/CesiumPointCloudRenderer.cs +246 -0
- package/Runtime/CesiumPointCloudRenderer.cs.meta +11 -0
- package/Runtime/CesiumPointCloudShading.cs +76 -0
- package/Runtime/CesiumPointCloudShading.cs.meta +11 -0
- package/Runtime/CesiumPolygonRasterOverlay.cs +109 -0
- package/Runtime/CesiumPolygonRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumPrimitiveFeatures.cs +130 -0
- package/Runtime/CesiumPrimitiveFeatures.cs.meta +11 -0
- package/Runtime/CesiumPropertyArray.cs +64 -0
- package/Runtime/CesiumPropertyArray.cs.meta +11 -0
- package/Runtime/CesiumPropertyTable.cs +126 -0
- package/Runtime/CesiumPropertyTable.cs.meta +11 -0
- package/Runtime/CesiumPropertyTableProperty.cs +1734 -0
- package/Runtime/CesiumPropertyTableProperty.cs.meta +11 -0
- package/Runtime/CesiumRasterOverlay.cs +239 -0
- package/Runtime/CesiumRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumRasterOverlayLoadFailureDetails.cs +65 -0
- package/Runtime/CesiumRasterOverlayLoadFailureDetails.cs.meta +11 -0
- package/Runtime/CesiumRuntime.asmdef +32 -0
- package/Runtime/CesiumRuntime.asmdef.meta +7 -0
- package/Runtime/CesiumRuntime.cs +3 -0
- package/Runtime/CesiumRuntime.cs.meta +11 -0
- package/Runtime/CesiumRuntimeSettings.cs +188 -0
- package/Runtime/CesiumRuntimeSettings.cs.meta +11 -0
- package/Runtime/CesiumSampleHeightResult.cs +47 -0
- package/Runtime/CesiumSampleHeightResult.cs.meta +11 -0
- package/Runtime/CesiumSimplePlanarEllipsoidCurve.cs +93 -0
- package/Runtime/CesiumSimplePlanarEllipsoidCurve.cs.meta +11 -0
- package/Runtime/CesiumSubScene.cs +473 -0
- package/Runtime/CesiumSubScene.cs.meta +11 -0
- package/Runtime/CesiumTileExcluder.cs +47 -0
- package/Runtime/CesiumTileExcluder.cs.meta +11 -0
- package/Runtime/CesiumTileMapServiceRasterOverlay.cs +93 -0
- package/Runtime/CesiumTileMapServiceRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumWebMapServiceRasterOverlay.cs +129 -0
- package/Runtime/CesiumWebMapServiceRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumWebMapTileServiceRasterOverlay.cs +414 -0
- package/Runtime/CesiumWebMapTileServiceRasterOverlay.cs.meta +3 -0
- package/Runtime/CesiumWgs84Ellipsoid.cs +75 -0
- package/Runtime/CesiumWgs84Ellipsoid.cs.meta +11 -0
- package/Runtime/ConfigureReinterop.cs +926 -0
- package/Runtime/ConfigureReinterop.cs.meta +11 -0
- package/Runtime/Helpers.cs +122 -0
- package/Runtime/Helpers.cs.meta +11 -0
- package/Runtime/ICesiumRestartable.cs +17 -0
- package/Runtime/ICesiumRestartable.cs.meta +11 -0
- package/Runtime/NativeCoroutine.cs +28 -0
- package/Runtime/NativeCoroutine.cs.meta +11 -0
- package/Runtime/NativeDownloadHandler.cs +29 -0
- package/Runtime/NativeDownloadHandler.cs.meta +11 -0
- package/Runtime/Resources/CesiumCreditSystem.prefab +78 -0
- package/Runtime/Resources/CesiumCreditSystem.prefab.meta +7 -0
- package/Runtime/Resources/CesiumCreditSystemRuntimeTheme.tss +2 -0
- package/Runtime/Resources/CesiumCreditSystemRuntimeTheme.tss.meta +11 -0
- package/Runtime/Resources/CesiumCreditSystemUI.uxml +4 -0
- package/Runtime/Resources/CesiumCreditSystemUI.uxml.meta +10 -0
- package/Runtime/Resources/CesiumCreditSystemUIPanelSettings.asset +38 -0
- package/Runtime/Resources/CesiumCreditSystemUIPanelSettings.asset.meta +8 -0
- package/Runtime/Resources/CesiumDefaultTilesetMaterial.mat +232 -0
- package/Runtime/Resources/CesiumDefaultTilesetMaterial.mat.meta +8 -0
- package/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph +14271 -0
- package/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph.meta +10 -0
- package/Runtime/Resources/CesiumPointCloudShading.hlsl +156 -0
- package/Runtime/Resources/CesiumPointCloudShading.hlsl.meta +7 -0
- package/Runtime/Resources/CesiumPointCloudShadingMaterial.mat +125 -0
- package/Runtime/Resources/CesiumPointCloudShadingMaterial.mat.meta +8 -0
- package/Runtime/Resources/CesiumPointCloudShadingShader.shader +73 -0
- package/Runtime/Resources/CesiumPointCloudShadingShader.shader.meta +10 -0
- package/Runtime/Resources/CesiumRasterOverlay.shadersubgraph +2207 -0
- package/Runtime/Resources/CesiumRasterOverlay.shadersubgraph.meta +10 -0
- package/Runtime/Resources/CesiumSelectTexCoords.shadersubgraph +722 -0
- package/Runtime/Resources/CesiumSelectTexCoords.shadersubgraph.meta +10 -0
- package/Runtime/Resources/CesiumUnlitTilesetMaterial.mat +261 -0
- package/Runtime/Resources/CesiumUnlitTilesetMaterial.mat.meta +8 -0
- package/Runtime/Resources/CesiumUnlitTilesetShader.shadergraph +5873 -0
- package/Runtime/Resources/CesiumUnlitTilesetShader.shadergraph.meta +10 -0
- package/Runtime/Resources/DynamicCamera.prefab +253 -0
- package/Runtime/Resources/DynamicCamera.prefab.meta +7 -0
- package/Runtime/Resources/TransformTextureCoordinates.shadersubgraph +2171 -0
- package/Runtime/Resources/TransformTextureCoordinates.shadersubgraph.meta +10 -0
- package/Runtime/Resources/green1x1.png +0 -0
- package/Runtime/Resources/green1x1.png.meta +123 -0
- package/Runtime/Resources.meta +8 -0
- package/Runtime/TestGltfModel.cs +56 -0
- package/Runtime/TestGltfModel.cs.meta +11 -0
- package/Runtime/TestReinterop.cs +21 -0
- package/Runtime/TestReinterop.cs.meta +11 -0
- package/Runtime/UnityLifetime.cs +27 -0
- package/Runtime/UnityLifetime.cs.meta +11 -0
- package/Runtime/WaitForTask.cs +25 -0
- package/Runtime/WaitForTask.cs.meta +11 -0
- package/Runtime/csc.rsp +1 -0
- package/Runtime/csc.rsp.meta +7 -0
- package/Runtime.meta +8 -0
- package/ThirdParty.json +27 -0
- package/ThirdParty.json.meta +7 -0
- package/WGS84.asset +18 -0
- package/WGS84.asset.meta +8 -0
- package/package.json +29 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
using Reinterop;
|
|
2
|
+
using System;
|
|
3
|
+
using System.Collections.Generic;
|
|
4
|
+
using System.Threading.Tasks;
|
|
5
|
+
using Unity.Collections;
|
|
6
|
+
using Unity.Collections.LowLevel.Unsafe;
|
|
7
|
+
using UnityEditor;
|
|
8
|
+
using UnityEditor.IMGUI.Controls;
|
|
9
|
+
using UnityEngine;
|
|
10
|
+
using UnityEngine.Networking;
|
|
11
|
+
|
|
12
|
+
namespace CesiumForUnity
|
|
13
|
+
{
|
|
14
|
+
[Reinterop]
|
|
15
|
+
internal partial class ConfigureReinterop
|
|
16
|
+
{
|
|
17
|
+
// The output path for generated C++ files.
|
|
18
|
+
// If this is relative, it is relative to the this file.
|
|
19
|
+
#if UNITY_EDITOR
|
|
20
|
+
public const string CppOutputPath = "../native~/Editor/generated-Editor";
|
|
21
|
+
#elif UNITY_ANDROID
|
|
22
|
+
public const string CppOutputPath = "../native~/Editor/generated-Android";
|
|
23
|
+
#elif UNITY_IOS
|
|
24
|
+
public const string CppOutputPath = "../native~/Editor/generated-iOS";
|
|
25
|
+
#elif UNITY_WSA
|
|
26
|
+
public const string CppOutputPath = "../native~/Runtime/generated-WSA";
|
|
27
|
+
#elif UNITY_64
|
|
28
|
+
public const string CppOutputPath = "../native~/Editor/generated-Standalone";
|
|
29
|
+
#else
|
|
30
|
+
public const string CppOutputPath = "../native~/Editor/generated-Unknown";
|
|
31
|
+
#endif
|
|
32
|
+
|
|
33
|
+
// The namespace with which to prefix all C# namespaces. For example, if this
|
|
34
|
+
// property is set to "DotNet", then anything in the "System" namespace in C#
|
|
35
|
+
// will be found in the "DotNet::System" namespace in C++.
|
|
36
|
+
public const string BaseNamespace = "DotNet";
|
|
37
|
+
|
|
38
|
+
// The name of the DLL or SO containing the C++ code.
|
|
39
|
+
public const string NativeLibraryName = "CesiumForUnityNative-Editor";
|
|
40
|
+
|
|
41
|
+
// Comma-separated types to treat as non-blittable, even if their fields would
|
|
42
|
+
// otherwise cause Reinterop to treat them as blittable.
|
|
43
|
+
public const string NonBlittableTypes = "Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle,Unity.Collections.NativeArray,UnityEngine.MeshData,UnityEngine.MeshDataArray";
|
|
44
|
+
|
|
45
|
+
public void ExposeToCPP()
|
|
46
|
+
{
|
|
47
|
+
Debug.Log("log");
|
|
48
|
+
|
|
49
|
+
UnityWebRequest request = UnityWebRequest.Get("url");
|
|
50
|
+
|
|
51
|
+
var uploadHandler = new UploadHandlerRaw(new byte[0]);
|
|
52
|
+
|
|
53
|
+
var rawBytes = new NativeArray<byte>(1, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
|
|
54
|
+
unsafe
|
|
55
|
+
{
|
|
56
|
+
NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(rawBytes);
|
|
57
|
+
}
|
|
58
|
+
uploadHandler = new UploadHandlerRaw(rawBytes, true);
|
|
59
|
+
request = new UnityWebRequest("url", "method", new NativeDownloadHandler(), uploadHandler);
|
|
60
|
+
|
|
61
|
+
bool isDone = request.isDone;
|
|
62
|
+
string e = request.error;
|
|
63
|
+
string method = request.method;
|
|
64
|
+
string url = request.url;
|
|
65
|
+
if (request.result == UnityWebRequest.Result.Success) { };
|
|
66
|
+
request.downloadHandler = new NativeDownloadHandler();
|
|
67
|
+
request.SetRequestHeader("name", "value");
|
|
68
|
+
request.GetResponseHeader("name");
|
|
69
|
+
Dictionary<string,string>.Enumerator enumerator = request.GetResponseHeaders().GetEnumerator();
|
|
70
|
+
while(enumerator.MoveNext())
|
|
71
|
+
{
|
|
72
|
+
string key = enumerator.Current.Key;
|
|
73
|
+
string value = enumerator.Current.Value;
|
|
74
|
+
}
|
|
75
|
+
request.downloadHandler.Dispose();
|
|
76
|
+
long responseCode = request.responseCode;
|
|
77
|
+
UnityWebRequestAsyncOperation op = request.SendWebRequest();
|
|
78
|
+
op.completed += o => { };
|
|
79
|
+
|
|
80
|
+
Task.Run(() => { });
|
|
81
|
+
|
|
82
|
+
CesiumIonSession session = CesiumIonServerManager.instance.GetSession(null);
|
|
83
|
+
CesiumIonServer server = CesiumIonServerManager.instance.current;
|
|
84
|
+
session = CesiumIonServerManager.instance.currentSession;
|
|
85
|
+
session.IsConnected();
|
|
86
|
+
server = session.server;
|
|
87
|
+
session.server = server;
|
|
88
|
+
|
|
89
|
+
List<QuickAddItem> items = new List<QuickAddItem>();
|
|
90
|
+
items = session.GetQuickAddItems();
|
|
91
|
+
|
|
92
|
+
QuickAddItem item = new QuickAddItem();
|
|
93
|
+
item.type = QuickAddItemType.BlankTileset;
|
|
94
|
+
item.name = "name";
|
|
95
|
+
item.tooltip = "tooltip";
|
|
96
|
+
item.tilesetName = "tilesetName";
|
|
97
|
+
item.tilesetId = 1;
|
|
98
|
+
item.overlayName = "overlayName";
|
|
99
|
+
item.overlayId = 2;
|
|
100
|
+
|
|
101
|
+
item = new QuickAddItem(QuickAddItemType.IonTileset, "name", "tooltip", "tilesetName", 1, "overlayName", 2);
|
|
102
|
+
items.Add(item);
|
|
103
|
+
|
|
104
|
+
server.defaultIonAccessToken = "";
|
|
105
|
+
server.defaultIonAccessTokenId = "";
|
|
106
|
+
server.apiUrl = "";
|
|
107
|
+
server.serverUrl = "";
|
|
108
|
+
server.oauth2ApplicationID = 1;
|
|
109
|
+
|
|
110
|
+
CesiumIonServerManager.instance.GetUserAccessToken(null);
|
|
111
|
+
CesiumIonServerManager.instance.SetUserAccessToken(null, null);
|
|
112
|
+
|
|
113
|
+
EditorPrefs.HasKey("Key");
|
|
114
|
+
EditorPrefs.GetString("Key");
|
|
115
|
+
EditorPrefs.SetString("Key", "Value");
|
|
116
|
+
EditorPrefs.DeleteKey("Key");
|
|
117
|
+
|
|
118
|
+
Application.OpenURL("URL");
|
|
119
|
+
string temporaryCachePath = Application.temporaryCachePath;
|
|
120
|
+
string applicationVersion = Application.version;
|
|
121
|
+
string unityVersion = Application.unityVersion;
|
|
122
|
+
string applicationPlatform = Helpers.ToString(Application.platform);
|
|
123
|
+
string productName = Application.productName;
|
|
124
|
+
string osVersion = System.Environment.OSVersion.VersionString;
|
|
125
|
+
|
|
126
|
+
TreeViewItem root = new TreeViewItem(0, -1, "root");
|
|
127
|
+
int id = root.id;
|
|
128
|
+
|
|
129
|
+
TreeViewState treeState = new TreeViewState();
|
|
130
|
+
IonAssetsTreeView treeView = new IonAssetsTreeView(treeState);
|
|
131
|
+
treeView.Reload();
|
|
132
|
+
|
|
133
|
+
MultiColumnHeader header = treeView.multiColumnHeader;
|
|
134
|
+
int sorted = header.sortedColumnIndex;
|
|
135
|
+
bool ascending = header.IsSortedAscending(sorted);
|
|
136
|
+
|
|
137
|
+
string searchString = treeView.searchString;
|
|
138
|
+
int length = searchString.Length;
|
|
139
|
+
searchString.Contains("string", StringComparison.CurrentCultureIgnoreCase);
|
|
140
|
+
string.Equals("stringA", "stringB");
|
|
141
|
+
string.IsNullOrEmpty("value");
|
|
142
|
+
|
|
143
|
+
Rect r = new Rect(0, 0, 50, 50);
|
|
144
|
+
GUI.Label(r, "Label");
|
|
145
|
+
|
|
146
|
+
session.BroadcastConnectionUpdate();
|
|
147
|
+
session.BroadcastAssetsUpdate();
|
|
148
|
+
session.BroadcastProfileUpdate();
|
|
149
|
+
session.BroadcastTokensUpdate();
|
|
150
|
+
session.BroadcastDefaultsUpdate();
|
|
151
|
+
|
|
152
|
+
CesiumEditorWindow editorWindow = CesiumEditorWindow.currentWindow;
|
|
153
|
+
|
|
154
|
+
IonAssetDetails.FormatType("type");
|
|
155
|
+
IonAssetDetails.FormatDate("date");
|
|
156
|
+
|
|
157
|
+
SelectIonTokenWindow.GetDefaultNewTokenName();
|
|
158
|
+
SelectIonTokenWindow.ShowWindow(null);
|
|
159
|
+
SelectIonTokenWindow tokenWindow = SelectIonTokenWindow.currentWindow;
|
|
160
|
+
tokenWindow.server = null;
|
|
161
|
+
tokenWindow.tokenSource = IonTokenSource.Create;
|
|
162
|
+
string name = tokenWindow.createdTokenName;
|
|
163
|
+
int tokenIndex = tokenWindow.selectedExistingTokenIndex;
|
|
164
|
+
tokenIndex = 0;
|
|
165
|
+
string token = tokenWindow.specifiedToken;
|
|
166
|
+
List<string> tokens = tokenWindow.GetExistingTokenList();
|
|
167
|
+
tokens.Clear();
|
|
168
|
+
tokens.Add(token);
|
|
169
|
+
tokenWindow.RefreshExistingTokenList();
|
|
170
|
+
tokenWindow.Close();
|
|
171
|
+
|
|
172
|
+
int requestsPerCachePrune = CesiumRuntimeSettings.requestsPerCachePrune;
|
|
173
|
+
ulong maxItems = CesiumRuntimeSettings.maxItems;
|
|
174
|
+
|
|
175
|
+
Cesium3DTileset[] tilesets = UnityEngine.Object.FindObjectsOfType<Cesium3DTileset>();
|
|
176
|
+
Cesium3DTileset tileset = tilesets[0];
|
|
177
|
+
for (int i = 0; i < tilesets.Length; i++)
|
|
178
|
+
{
|
|
179
|
+
tileset = tilesets[i];
|
|
180
|
+
tileset.tilesetSource = CesiumDataSource.FromCesiumIon;
|
|
181
|
+
token = tileset.ionAccessToken;
|
|
182
|
+
tileset.RecreateTileset();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
tileset = tileset.gameObject.GetComponent<Cesium3DTileset>();
|
|
186
|
+
|
|
187
|
+
CesiumIonRasterOverlay ionOverlay = tileset.gameObject.GetComponent<CesiumIonRasterOverlay>();
|
|
188
|
+
token = ionOverlay.ionAccessToken;
|
|
189
|
+
ionOverlay.Refresh();
|
|
190
|
+
GameObject gameObject = new GameObject("Name");
|
|
191
|
+
tileset = gameObject.AddComponent<Cesium3DTileset>();
|
|
192
|
+
ionOverlay = gameObject.AddComponent<CesiumIonRasterOverlay>();
|
|
193
|
+
tileset.ionAssetID = 0;
|
|
194
|
+
ionOverlay.ionAssetID = 0;
|
|
195
|
+
|
|
196
|
+
CesiumRasterOverlay[] rasterOverlays = tileset.gameObject.GetComponents<CesiumRasterOverlay>();
|
|
197
|
+
CesiumRasterOverlay overlay = rasterOverlays[0];
|
|
198
|
+
UnityEngine.Object.DestroyImmediate(overlay, true);
|
|
199
|
+
UnityEngine.Object.DestroyImmediate(overlay);
|
|
200
|
+
|
|
201
|
+
CesiumIonRasterOverlay[] ionRasterOverlays =
|
|
202
|
+
tileset.gameObject.GetComponents<CesiumIonRasterOverlay>();
|
|
203
|
+
ionOverlay = ionRasterOverlays[0];
|
|
204
|
+
|
|
205
|
+
string substring = "string";
|
|
206
|
+
substring = string.Concat(substring, new long[] { 100 });
|
|
207
|
+
string message = string.Concat(substring, "string");
|
|
208
|
+
Debug.Log(message);
|
|
209
|
+
Debug.LogWarning(message);
|
|
210
|
+
Debug.LogError(message);
|
|
211
|
+
|
|
212
|
+
Selection.activeGameObject = gameObject;
|
|
213
|
+
|
|
214
|
+
CesiumEditorUtility.FindFirstTileset();
|
|
215
|
+
CesiumEditorUtility.FindFirstTilesetWithAssetID(0);
|
|
216
|
+
CesiumEditorUtility.CreateTileset("name", 0);
|
|
217
|
+
CesiumEditorUtility.AddBaseOverlayToTileset(tileset, 0);
|
|
218
|
+
|
|
219
|
+
IonMissingAssetWindow.ShowWindow("Asset Name", 0);
|
|
220
|
+
|
|
221
|
+
IonTokenTroubleshootingWindow troubleshootingWindow = null!;
|
|
222
|
+
IonTokenTroubleshootingWindow.UseDefaultToken(troubleshootingWindow.ionAsset);
|
|
223
|
+
TokenTroubleshootingDetails tokenDetails = troubleshootingWindow.assetTokenDetails;
|
|
224
|
+
tokenDetails = troubleshootingWindow.defaultTokenDetails;
|
|
225
|
+
token = tokenDetails.token;
|
|
226
|
+
tokenDetails.isValid = true;
|
|
227
|
+
tokenDetails.allowsAccessToAsset = true;
|
|
228
|
+
tokenDetails.associatedWithUserAccount = true;
|
|
229
|
+
tokenDetails.loaded = true;
|
|
230
|
+
|
|
231
|
+
CesiumIonAsset asset = troubleshootingWindow.ionAsset;
|
|
232
|
+
name = asset.objectName;
|
|
233
|
+
string type = asset.type;
|
|
234
|
+
string componentType = asset.componentType;
|
|
235
|
+
string accessToken = asset.ionAccessToken;
|
|
236
|
+
long assetId = asset.ionAssetID;
|
|
237
|
+
bool isNull = asset.IsNull();
|
|
238
|
+
tileset = asset.tileset;
|
|
239
|
+
server = tileset.ionServer;
|
|
240
|
+
ionOverlay = asset.overlay;
|
|
241
|
+
server = ionOverlay.ionServer;
|
|
242
|
+
|
|
243
|
+
AssetTroubleshootingDetails assetDetails = troubleshootingWindow.assetDetails;
|
|
244
|
+
assetDetails.assetExistsInUserAccount = true;
|
|
245
|
+
assetDetails.loaded = true;
|
|
246
|
+
|
|
247
|
+
EditorApplication.ExecuteMenuItem("Window/General/Hierarchy");
|
|
248
|
+
|
|
249
|
+
EditorUtility.SetDirty(null);
|
|
250
|
+
|
|
251
|
+
System.Exception exception = null;
|
|
252
|
+
var exceptionMessage = exception.Message;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
|
|
3
|
+
namespace CesiumForUnity
|
|
4
|
+
{
|
|
5
|
+
internal class Helpers
|
|
6
|
+
{
|
|
7
|
+
public static string ToString<T>(T value)
|
|
8
|
+
{
|
|
9
|
+
return value.ToString();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.
|
|
14
|
+
/// </summary>
|
|
15
|
+
/// <param name="angle">The angle in radians.</param>
|
|
16
|
+
/// <returns>The angle in the range [`-Math.PI`, `Math.PI`].</returns>
|
|
17
|
+
public static double NegativePiToPi(double angle)
|
|
18
|
+
{
|
|
19
|
+
if (angle >= -Math.PI && angle <= Math.PI)
|
|
20
|
+
{
|
|
21
|
+
// Early exit if the input is already inside the range. This avoids
|
|
22
|
+
// unnecessary math which could introduce floating point error.
|
|
23
|
+
return angle;
|
|
24
|
+
}
|
|
25
|
+
return Helpers.ZeroToTwoPi(angle + Math.PI) - Math.PI;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/// <summary>
|
|
29
|
+
/// Produces an angle in the range -180 <= angle <= 180 which is equivalent to the provided angle.
|
|
30
|
+
/// </summary>
|
|
31
|
+
/// <param name="angle">The angle in degrees.</param>
|
|
32
|
+
/// <returns>The angle in the range [-180, 180].</returns>
|
|
33
|
+
public static double Negative180To180(double angle)
|
|
34
|
+
{
|
|
35
|
+
if (angle >= -180.0 && angle <= 180.0)
|
|
36
|
+
{
|
|
37
|
+
// Early exit if the input is already inside the range. This avoids
|
|
38
|
+
// unnecessary math which could introduce floating point error.
|
|
39
|
+
return angle;
|
|
40
|
+
}
|
|
41
|
+
return Helpers.ZeroTo360(angle + 180.0) - 180.0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
/// Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.
|
|
46
|
+
/// </summary>
|
|
47
|
+
/// <param name="angle">The angle in radians.</param>
|
|
48
|
+
/// <returns>The angle in the range [0, `Math::TwoPi`]</returns>
|
|
49
|
+
public static double ZeroToTwoPi(double angle)
|
|
50
|
+
{
|
|
51
|
+
if (angle >= 0 && angle <= 2.0 * Math.PI)
|
|
52
|
+
{
|
|
53
|
+
// Early exit if the input is already inside the range. This avoids
|
|
54
|
+
// unnecessary math which could introduce floating point error.
|
|
55
|
+
return angle;
|
|
56
|
+
}
|
|
57
|
+
double mod = Helpers.Mod(angle, 2.0 * Math.PI);
|
|
58
|
+
if (Math.Abs(mod) < 1.0e-14 && Math.Abs(angle) > 1.0e-14)
|
|
59
|
+
{
|
|
60
|
+
return 2.0 * Math.PI;
|
|
61
|
+
}
|
|
62
|
+
return mod;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/// <summary>
|
|
66
|
+
/// Produces an angle in the range 0 <= angle <= 360 which is equivalent to the provided angle.
|
|
67
|
+
/// </summary>
|
|
68
|
+
/// <param name="angle">The angle in degrees.</param>
|
|
69
|
+
/// <returns>The angle in the range [0, 360]</returns>
|
|
70
|
+
public static double ZeroTo360(double angle)
|
|
71
|
+
{
|
|
72
|
+
if (angle >= 0 && angle <= 360.0)
|
|
73
|
+
{
|
|
74
|
+
// Early exit if the input is already inside the range. This avoids
|
|
75
|
+
// unnecessary math which could introduce floating point error.
|
|
76
|
+
return angle;
|
|
77
|
+
}
|
|
78
|
+
double mod = Helpers.Mod(angle, 360.0);
|
|
79
|
+
if (Math.Abs(mod) < 1.0e-14 && Math.Abs(angle) > 1.0e-14)
|
|
80
|
+
{
|
|
81
|
+
return 360.0;
|
|
82
|
+
}
|
|
83
|
+
return mod;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/// <summary>
|
|
87
|
+
/// The modulo operation that also works for negative dividends.
|
|
88
|
+
/// </summary>
|
|
89
|
+
/// <param name="m">The dividend.</param>
|
|
90
|
+
/// <param name="n">The divisor.</param>
|
|
91
|
+
/// <returns>The remainder.</returns>
|
|
92
|
+
public static double Mod(double m, double n)
|
|
93
|
+
{
|
|
94
|
+
if (Math.Sign(m) == Math.Sign(n) && Math.Abs(m) < Math.Abs(n)) {
|
|
95
|
+
// Early exit if the input does not need to be modded. This avoids
|
|
96
|
+
// unnecessary math which could introduce floating point error.
|
|
97
|
+
return m;
|
|
98
|
+
}
|
|
99
|
+
return ((m % n) + n) % n;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
using UnityEditor.IMGUI.Controls;
|
|
2
|
+
|
|
3
|
+
namespace CesiumForUnity
|
|
4
|
+
{
|
|
5
|
+
public class IonAssetsMultiColumnHeader : MultiColumnHeader
|
|
6
|
+
{
|
|
7
|
+
private IonAssetsTreeView _treeView;
|
|
8
|
+
private int _lastSortedColumnIndex;
|
|
9
|
+
|
|
10
|
+
public IonAssetsMultiColumnHeader(
|
|
11
|
+
MultiColumnHeaderState state,
|
|
12
|
+
IonAssetsTreeView treeView) :
|
|
13
|
+
base(state)
|
|
14
|
+
{
|
|
15
|
+
this._treeView = treeView;
|
|
16
|
+
ResizeToFit();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
protected override void ColumnHeaderClicked(
|
|
20
|
+
MultiColumnHeaderState.Column column,
|
|
21
|
+
int columnIndex)
|
|
22
|
+
{
|
|
23
|
+
if (this.sortedColumnIndex == columnIndex)
|
|
24
|
+
{
|
|
25
|
+
if (column.sortedAscending)
|
|
26
|
+
{
|
|
27
|
+
column.sortedAscending = false;
|
|
28
|
+
}
|
|
29
|
+
else
|
|
30
|
+
{
|
|
31
|
+
// Remove the sorting entirely.
|
|
32
|
+
sortedColumnIndex = -1;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else
|
|
36
|
+
{
|
|
37
|
+
sortedColumnIndex = columnIndex;
|
|
38
|
+
column.sortedAscending = true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
this._treeView.Refresh();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
using Reinterop;
|
|
2
|
+
using System;
|
|
3
|
+
using System.Collections.Generic;
|
|
4
|
+
using UnityEditor.IMGUI.Controls;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace CesiumForUnity
|
|
8
|
+
{
|
|
9
|
+
public enum IonAssetsColumn
|
|
10
|
+
{
|
|
11
|
+
Name = 0,
|
|
12
|
+
Type = 1,
|
|
13
|
+
DateAdded = 2,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public class IonAssetDetails
|
|
17
|
+
{
|
|
18
|
+
private string _name;
|
|
19
|
+
private string _type;
|
|
20
|
+
private long _id;
|
|
21
|
+
private string _description;
|
|
22
|
+
private string _attribution;
|
|
23
|
+
|
|
24
|
+
public IonAssetDetails(string name, string type, long id, string description, string attribution)
|
|
25
|
+
{
|
|
26
|
+
this._name = name;
|
|
27
|
+
this._type = type;
|
|
28
|
+
this._id = id;
|
|
29
|
+
this._description = description;
|
|
30
|
+
this._attribution = attribution;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public string name
|
|
34
|
+
{
|
|
35
|
+
get => this._name;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public string type
|
|
39
|
+
{
|
|
40
|
+
get => this._type;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public long id
|
|
44
|
+
{
|
|
45
|
+
get => this._id;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public string description
|
|
49
|
+
{
|
|
50
|
+
get => this._description;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public string attribution
|
|
54
|
+
{
|
|
55
|
+
get => this._attribution;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private static Dictionary<string, string> typeLookup = new Dictionary<string, string>
|
|
59
|
+
{
|
|
60
|
+
{ "3DTILES", "3D Tiles" },
|
|
61
|
+
{ "GLTF", "glTF" },
|
|
62
|
+
{ "IMAGERY", "Imagery" },
|
|
63
|
+
{ "TERRAIN", "Terrain" },
|
|
64
|
+
{ "CZML", "CZML" },
|
|
65
|
+
{ "KML", "KML" },
|
|
66
|
+
{ "GEOJSON", "GeoJSON" }
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
public static string FormatType(string type)
|
|
70
|
+
{
|
|
71
|
+
string value;
|
|
72
|
+
if (typeLookup.TryGetValue(type, out value))
|
|
73
|
+
{
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
return "(Unknown)";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public static string FormatDate(string assetDate)
|
|
80
|
+
{
|
|
81
|
+
DateTime date = new DateTime();
|
|
82
|
+
bool success = DateTime.TryParse(
|
|
83
|
+
assetDate,
|
|
84
|
+
System.Globalization.CultureInfo.InvariantCulture,
|
|
85
|
+
System.Globalization.DateTimeStyles.RoundtripKind,
|
|
86
|
+
out date);
|
|
87
|
+
|
|
88
|
+
if (!success)
|
|
89
|
+
{
|
|
90
|
+
Debug.Log("Could not parse date " + assetDate);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return date.ToString("yyyy-MM-dd");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
[ReinteropNativeImplementation("CesiumForUnityNative::IonAssetsTreeViewImpl", "IonAssetsTreeViewImpl.h")]
|
|
98
|
+
public partial class IonAssetsTreeView : TreeView
|
|
99
|
+
{
|
|
100
|
+
private MultiColumnHeaderState _headerState;
|
|
101
|
+
|
|
102
|
+
public IonAssetsTreeView(TreeViewState assetsTreeState)
|
|
103
|
+
: base(assetsTreeState)
|
|
104
|
+
{
|
|
105
|
+
BuildMultiColumnHeader();
|
|
106
|
+
CreateImplementation();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
private void BuildMultiColumnHeader()
|
|
110
|
+
{
|
|
111
|
+
string[] columnNames = new string[Enum.GetNames(typeof(IonAssetsColumn)).Length];
|
|
112
|
+
columnNames[(int)IonAssetsColumn.Name] = "Name";
|
|
113
|
+
columnNames[(int)IonAssetsColumn.Type] = "Type";
|
|
114
|
+
columnNames[(int)IonAssetsColumn.DateAdded] = "Date added";
|
|
115
|
+
|
|
116
|
+
MultiColumnHeaderState.Column[] columns = new MultiColumnHeaderState.Column[columnNames.Length];
|
|
117
|
+
|
|
118
|
+
for (int i = 0; i < columns.Length; i++)
|
|
119
|
+
{
|
|
120
|
+
columns[i] = new MultiColumnHeaderState.Column()
|
|
121
|
+
{
|
|
122
|
+
allowToggleVisibility = false,
|
|
123
|
+
autoResize = true,
|
|
124
|
+
minWidth = 135.0f,
|
|
125
|
+
canSort = true,
|
|
126
|
+
sortingArrowAlignment = TextAlignment.Center,
|
|
127
|
+
headerContent = new GUIContent(columnNames[i]),
|
|
128
|
+
headerTextAlignment = TextAlignment.Left,
|
|
129
|
+
sortedAscending = true,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
this._headerState = new MultiColumnHeaderState(columns);
|
|
134
|
+
multiColumnHeader = new IonAssetsMultiColumnHeader(this._headerState, this);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
protected override TreeViewItem BuildRoot()
|
|
138
|
+
{
|
|
139
|
+
int rootId = 0;
|
|
140
|
+
int rootDepth = -1;
|
|
141
|
+
return new TreeViewItem(rootId, rootDepth, "Root");
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
public partial int GetAssetsCount();
|
|
145
|
+
|
|
146
|
+
protected override IList<TreeViewItem> BuildRows(TreeViewItem root)
|
|
147
|
+
{
|
|
148
|
+
int count = GetAssetsCount();
|
|
149
|
+
IList<TreeViewItem> rows = new List<TreeViewItem>();
|
|
150
|
+
// All items are counted as children of the root item, such that when displayed
|
|
151
|
+
// they appear in a list.
|
|
152
|
+
const int itemDepth = 0;
|
|
153
|
+
|
|
154
|
+
for (int i = 0; i < count; i++)
|
|
155
|
+
{
|
|
156
|
+
// The root of the tree is typically assigned as 0, so all of the ids
|
|
157
|
+
// have to be offset by 1. Otherwise, the selection behavior of the TreeView
|
|
158
|
+
// may be inaccurate.
|
|
159
|
+
TreeViewItem assetItem = new TreeViewItem(i + 1, itemDepth);
|
|
160
|
+
rows.Add(assetItem);
|
|
161
|
+
root.AddChild(assetItem);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return rows;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
private partial string GetAssetName(int index);
|
|
168
|
+
private partial string GetAssetType(int index);
|
|
169
|
+
private partial long GetAssetID(int index);
|
|
170
|
+
private partial string GetAssetDescription(int index);
|
|
171
|
+
private partial string GetAssetAttribution(int index);
|
|
172
|
+
|
|
173
|
+
public IonAssetDetails GetAssetDetails(int treeId)
|
|
174
|
+
{
|
|
175
|
+
int index = treeId - 1;
|
|
176
|
+
string name = GetAssetName(index);
|
|
177
|
+
string type = GetAssetType(index);
|
|
178
|
+
long id = GetAssetID(index);
|
|
179
|
+
string description = GetAssetDescription(index);
|
|
180
|
+
string attribution = GetAssetAttribution(index);
|
|
181
|
+
|
|
182
|
+
return new IonAssetDetails(name, type, id, description, attribution);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
protected override void RowGUI(RowGUIArgs args)
|
|
186
|
+
{
|
|
187
|
+
for (int index = 0; index < args.GetNumVisibleColumns(); ++index)
|
|
188
|
+
{
|
|
189
|
+
int assetIndex = args.item.id - 1;
|
|
190
|
+
CellGUI(args.GetCellRect(index), assetIndex, (IonAssetsColumn)index);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
private partial void CellGUI(Rect cellRect, int assetIndex, IonAssetsColumn column);
|
|
195
|
+
|
|
196
|
+
public partial void Refresh();
|
|
197
|
+
|
|
198
|
+
protected override void SearchChanged(string newSearch)
|
|
199
|
+
{
|
|
200
|
+
this.Refresh();
|
|
201
|
+
this.SetSelection(new List<int>());
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
protected override bool CanMultiSelect(TreeViewItem item)
|
|
205
|
+
{
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
public partial void AddAssetToLevel(int index);
|
|
210
|
+
|
|
211
|
+
public partial void AddOverlayToTerrain(int index);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|