1using Unity.Mathematics;
4using UnityEngine.Serialization;
10 [DefaultExecutionOrder(-1000000)]
11 internal class CesiumGlobeAnchorBackwardCompatibility0dot2dot0 : CesiumGlobeAnchor, IBackwardCompatibilityComponent<CesiumGlobeAnchor>
13 public enum CesiumGlobeAnchorPositionAuthorityBackwardCompatibility0dot1dot2
21 [FormerlySerializedAs(
"_adjustOrientationForGlobeWhenMoving")]
22 public bool _adjustOrientationForGlobeWhenMoving0dot2dot0 =
false;
23 [FormerlySerializedAs(
"_detectTransformChanges")]
24 public bool _detectTransformChanges0dot2dot0 =
false;
25 [FormerlySerializedAs(
"_positionAuthority")]
26 public CesiumGlobeAnchorPositionAuthorityBackwardCompatibility0dot1dot2 _positionAuthority0dot2dot0 = CesiumGlobeAnchorPositionAuthorityBackwardCompatibility0dot1dot2.None;
27 [FormerlySerializedAs(
"_latitude")]
28 public double _latitude0dot2dot0 = 0.0;
29 [FormerlySerializedAs(
"_longitude")]
30 public double _longitude0dot2dot0 = 0.0;
31 [FormerlySerializedAs(
"_height")]
32 public double _height0dot2dot0 = 0.0;
33 [FormerlySerializedAs(
"_ecefX")]
34 public double _ecefX0dot2dot0 = 0.0;
35 [FormerlySerializedAs(
"_ecefY")]
36 public double _ecefY0dot2dot0 = 0.0;
37 [FormerlySerializedAs(
"_ecefZ")]
38 public double _ecefZ0dot2dot0 = 0.0;
39 [FormerlySerializedAs(
"_unityX")]
40 public double _unityX0dot2dot0 = 0.0;
41 [FormerlySerializedAs(
"_unityY")]
42 public double _unityY0dot2dot0 = 0.0;
43 [FormerlySerializedAs(
"_unityZ")]
44 public double _unityZ0dot2dot0 = 0.0;
47 [CustomEditor(typeof(CesiumGlobeAnchorBackwardCompatibility0dot2dot0))]
48 internal class CesiumGlobeAnchorBackwardCompatibility0dot2dot0Editor : Editor
50 public override void OnInspectorGUI()
52 if (GUILayout.Button(
"Upgrade"))
54 CesiumGlobeAnchorBackwardCompatibility0dot2dot0 o = (CesiumGlobeAnchorBackwardCompatibility0dot2dot0)this.target;
55 CesiumBackwardCompatibility<CesiumGlobeAnchor>.Upgrade(o);
62 CesiumBackwardCompatibility<CesiumGlobeAnchor>.Upgrade(
this);
66 public string VersionToBeUpgraded =>
"v0.2.0";
68 public void Upgrade(GameObject gameObject, CesiumGlobeAnchor upgraded)
72 upgraded.adjustOrientationForGlobeWhenMoving =
false;
73 upgraded.detectTransformChanges =
false;
75 switch (this._positionAuthority0dot2dot0)
77 case CesiumGlobeAnchorPositionAuthorityBackwardCompatibility0dot1dot2.None:
80 case CesiumGlobeAnchorPositionAuthorityBackwardCompatibility0dot1dot2.LongitudeLatitudeHeight:
81 upgraded.longitudeLatitudeHeight =
new double3(this._longitude0dot2dot0, this._latitude0dot2dot0, this._height0dot2dot0);
83 case CesiumGlobeAnchorPositionAuthorityBackwardCompatibility0dot1dot2.EarthCenteredEarthFixed:
84 upgraded.positionGlobeFixed =
new double3(this._ecefX0dot2dot0, this._ecefY0dot2dot0, this._ecefZ0dot2dot0);
86 case CesiumGlobeAnchorPositionAuthorityBackwardCompatibility0dot1dot2.UnityCoordinates:
91 CesiumGeoreference georeference = this.GetComponentInParent<CesiumGeoreference>();
92 if (georeference !=
null)
94 georeference.Initialize();
95 double3 ecef = georeference.TransformUnityPositionToEarthCenteredEarthFixed(
new double3(this._unityX0dot2dot0, this._unityY0dot2dot0, this._unityZ0dot2dot0));
96 upgraded.positionGlobeFixed = ecef;
101 upgraded.adjustOrientationForGlobeWhenMoving = this._adjustOrientationForGlobeWhenMoving0dot2dot0;
102 upgraded.detectTransformChanges = this._detectTransformChanges0dot2dot0;
@ EarthCenteredEarthFixed
The CesiumGeoreference.ecefX, CesiumGeoreference.ecefY, and CesiumGeoreference.ecefZ properties autho...
@ LongitudeLatitudeHeight
The CesiumGeoreference.longitude, CesiumGeoreference.latitude, and CesiumGeoreference....