| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using DCL.Helpers; |
| | 4 | | using DCL.Models; |
| | 5 | | using UnityEngine; |
| | 6 | | using Ray = UnityEngine.Ray; |
| | 7 | |
|
| | 8 | | #if UNITY_WEBGL && !UNITY_EDITOR |
| | 9 | | using System.Runtime.InteropServices; |
| | 10 | | #endif |
| | 11 | |
|
| | 12 | | namespace DCL.Interface |
| | 13 | | { |
| | 14 | | /** |
| | 15 | | * This class contains the outgoing interface of Decentraland. |
| | 16 | | * You must call those functions to interact with the WebInterface. |
| | 17 | | * |
| | 18 | | * The messages comming from the WebInterface instead, are reported directly to |
| | 19 | | * the handler GameObject by name. |
| | 20 | | */ |
| | 21 | | public static class WebInterface |
| | 22 | | { |
| | 23 | | public static bool VERBOSE = false; |
| | 24 | |
|
| | 25 | | [System.Serializable] |
| | 26 | | public class ReportPositionPayload |
| | 27 | | { |
| | 28 | | /** Camera position, world space */ |
| | 29 | | public Vector3 position; |
| | 30 | |
|
| | 31 | | /** Character rotation */ |
| | 32 | | public Quaternion rotation; |
| | 33 | |
|
| | 34 | | /** Camera rotation */ |
| | 35 | | public Quaternion cameraRotation; |
| | 36 | |
|
| | 37 | | /** Camera height, relative to the feet of the avatar or ground */ |
| | 38 | | public float playerHeight; |
| | 39 | |
|
| | 40 | | public Vector3 mousePosition; |
| | 41 | |
|
| | 42 | | public string id; |
| | 43 | | } |
| | 44 | |
|
| | 45 | | [System.Serializable] |
| | 46 | | public abstract class ControlEvent |
| | 47 | | { |
| | 48 | | public string eventType; |
| | 49 | | } |
| | 50 | |
|
| | 51 | | public abstract class ControlEvent<T> : ControlEvent |
| | 52 | | { |
| | 53 | | public T payload; |
| | 54 | |
|
| | 55 | | protected ControlEvent(string eventType, T payload) |
| | 56 | | { |
| | 57 | | this.eventType = eventType; |
| | 58 | | this.payload = payload; |
| | 59 | | } |
| | 60 | | } |
| | 61 | |
|
| | 62 | | [System.Serializable] |
| | 63 | | public class StartStatefulMode : ControlEvent<StartStatefulMode.Payload> |
| | 64 | | { |
| | 65 | | [System.Serializable] |
| | 66 | | public class Payload |
| | 67 | | { |
| | 68 | | public string sceneId; |
| | 69 | | } |
| | 70 | |
|
| | 71 | | public StartStatefulMode(string sceneId) : base("StartStatefulMode", new Payload() { sceneId = sceneId }) { |
| | 72 | | } |
| | 73 | |
|
| | 74 | | [System.Serializable] |
| | 75 | | public class StopStatefulMode : ControlEvent<StopStatefulMode.Payload> |
| | 76 | | { |
| | 77 | | [System.Serializable] |
| | 78 | | public class Payload |
| | 79 | | { |
| | 80 | | public string sceneId; |
| | 81 | | } |
| | 82 | |
|
| | 83 | | public StopStatefulMode(string sceneId) : base("StopStatefulMode", new Payload() { sceneId = sceneId }) { } |
| | 84 | | } |
| | 85 | |
|
| | 86 | | [System.Serializable] |
| | 87 | | public class SceneReady : ControlEvent<SceneReady.Payload> |
| | 88 | | { |
| | 89 | | [System.Serializable] |
| | 90 | | public class Payload |
| | 91 | | { |
| | 92 | | public string sceneId; |
| | 93 | | } |
| | 94 | |
|
| | 95 | | public SceneReady(string sceneId) : base("SceneReady", new Payload() { sceneId = sceneId }) { } |
| | 96 | | } |
| | 97 | |
|
| | 98 | | [System.Serializable] |
| | 99 | | public class ActivateRenderingACK : ControlEvent<object> |
| | 100 | | { |
| | 101 | | public ActivateRenderingACK() : base("ActivateRenderingACK", null) { } |
| | 102 | | } |
| | 103 | |
|
| | 104 | | [System.Serializable] |
| | 105 | | public class DeactivateRenderingACK : ControlEvent<object> |
| | 106 | | { |
| | 107 | | public DeactivateRenderingACK() : base("DeactivateRenderingACK", null) { } |
| | 108 | | } |
| | 109 | |
|
| | 110 | | [System.Serializable] |
| | 111 | | public class SceneEvent<T> |
| | 112 | | { |
| | 113 | | public string sceneId; |
| | 114 | | public string eventType; |
| | 115 | | public T payload; |
| | 116 | | } |
| | 117 | |
|
| | 118 | | [System.Serializable] |
| | 119 | | public class AllScenesEvent<T> |
| | 120 | | { |
| | 121 | | public string eventType; |
| | 122 | | public T payload; |
| | 123 | | } |
| | 124 | |
|
| | 125 | | [System.Serializable] |
| | 126 | | public class UUIDEvent<TPayload> |
| | 127 | | where TPayload : class, new() |
| | 128 | | { |
| | 129 | | public string uuid; |
| 101 | 130 | | public TPayload payload = new TPayload(); |
| | 131 | | } |
| | 132 | |
|
| | 133 | | public enum ACTION_BUTTON |
| | 134 | | { |
| | 135 | | POINTER, |
| | 136 | | PRIMARY, |
| | 137 | | SECONDARY, |
| | 138 | | ANY, |
| | 139 | | FORWARD, |
| | 140 | | BACKWARD, |
| | 141 | | RIGHT, |
| | 142 | | LEFT, |
| | 143 | | JUMP, |
| | 144 | | WALK, |
| | 145 | | ACTION_3, |
| | 146 | | ACTION_4, |
| | 147 | | ACTION_5, |
| | 148 | | ACTION_6 |
| | 149 | | } |
| | 150 | |
|
| | 151 | | [System.Serializable] |
| | 152 | | public class OnClickEvent : UUIDEvent<OnClickEventPayload> { }; |
| | 153 | |
|
| | 154 | | [System.Serializable] |
| | 155 | | public class CameraModePayload |
| | 156 | | { |
| | 157 | | public CameraMode.ModeId cameraMode; |
| | 158 | | }; |
| | 159 | |
|
| | 160 | | [System.Serializable] |
| | 161 | | public class Web3UseResponsePayload |
| | 162 | | { |
| | 163 | | public string id; |
| | 164 | | public bool result; |
| | 165 | | }; |
| | 166 | |
|
| | 167 | | [System.Serializable] |
| | 168 | | public class IdleStateChangedPayload |
| | 169 | | { |
| | 170 | | public bool isIdle; |
| | 171 | | }; |
| | 172 | |
|
| | 173 | | [System.Serializable] |
| | 174 | | public class OnPointerDownEvent : UUIDEvent<OnPointerEventPayload> { }; |
| | 175 | |
|
| | 176 | | [System.Serializable] |
| | 177 | | public class OnGlobalPointerEvent |
| | 178 | | { |
| | 179 | | public OnGlobalPointerEventPayload payload = new OnGlobalPointerEventPayload(); |
| | 180 | | }; |
| | 181 | |
|
| | 182 | | [System.Serializable] |
| | 183 | | public class OnPointerUpEvent : UUIDEvent<OnPointerEventPayload> { }; |
| | 184 | |
|
| | 185 | | [System.Serializable] |
| | 186 | | private class OnTextSubmitEvent : UUIDEvent<OnTextSubmitEventPayload> { }; |
| | 187 | |
|
| | 188 | | [System.Serializable] |
| | 189 | | private class OnTextInputChangeEvent : UUIDEvent<OnTextInputChangeEventPayload> { }; |
| | 190 | |
|
| | 191 | | [System.Serializable] |
| | 192 | | private class OnTextInputChangeTextEvent : UUIDEvent<OnTextInputChangeTextEventPayload> { }; |
| | 193 | |
|
| | 194 | | [System.Serializable] |
| | 195 | | private class OnScrollChangeEvent : UUIDEvent<OnScrollChangeEventPayload> { }; |
| | 196 | |
|
| | 197 | | [System.Serializable] |
| | 198 | | private class OnFocusEvent : UUIDEvent<EmptyPayload> { }; |
| | 199 | |
|
| | 200 | | [System.Serializable] |
| | 201 | | private class OnBlurEvent : UUIDEvent<EmptyPayload> { }; |
| | 202 | |
|
| | 203 | | [System.Serializable] |
| | 204 | | public class OnEnterEvent : UUIDEvent<OnEnterEventPayload> { }; |
| | 205 | |
|
| | 206 | | [System.Serializable] |
| | 207 | | public class OnClickEventPayload |
| | 208 | | { |
| | 209 | | public ACTION_BUTTON buttonId = ACTION_BUTTON.POINTER; |
| | 210 | | } |
| | 211 | |
|
| | 212 | | [System.Serializable] |
| | 213 | | public class SendChatMessageEvent |
| | 214 | | { |
| | 215 | | public ChatMessage message; |
| | 216 | | } |
| | 217 | |
|
| | 218 | | [System.Serializable] |
| | 219 | | public class RemoveEntityComponentsPayLoad |
| | 220 | | { |
| | 221 | | public string entityId; |
| | 222 | | public string componentId; |
| | 223 | | }; |
| | 224 | |
|
| | 225 | | [System.Serializable] |
| | 226 | | public class StoreSceneStateEvent |
| | 227 | | { |
| | 228 | | public string type = "StoreSceneState"; |
| | 229 | | public string payload = ""; |
| | 230 | | }; |
| | 231 | |
|
| | 232 | | [System.Serializable] |
| | 233 | | public class OnPointerEventPayload |
| | 234 | | { |
| | 235 | | [System.Serializable] |
| | 236 | | public class Hit |
| | 237 | | { |
| | 238 | | public Vector3 origin; |
| | 239 | | public float length; |
| | 240 | | public Vector3 hitPoint; |
| | 241 | | public Vector3 normal; |
| | 242 | | public Vector3 worldNormal; |
| | 243 | | public string meshName; |
| | 244 | | public string entityId; |
| | 245 | | } |
| | 246 | |
|
| | 247 | | public ACTION_BUTTON buttonId; |
| | 248 | | public Vector3 origin; |
| | 249 | | public Vector3 direction; |
| | 250 | | public Hit hit; |
| | 251 | | } |
| | 252 | |
|
| | 253 | | [System.Serializable] |
| | 254 | | public class OnGlobalPointerEventPayload : OnPointerEventPayload |
| | 255 | | { |
| | 256 | | public enum InputEventType |
| | 257 | | { |
| | 258 | | DOWN, |
| | 259 | | UP |
| | 260 | | } |
| | 261 | |
|
| | 262 | | public InputEventType type; |
| | 263 | | } |
| | 264 | |
|
| | 265 | | [System.Serializable] |
| | 266 | | public class OnTextSubmitEventPayload |
| | 267 | | { |
| | 268 | | public string id; |
| | 269 | | public string text; |
| | 270 | | } |
| | 271 | |
|
| | 272 | | [System.Serializable] |
| | 273 | | public class OnTextInputChangeEventPayload |
| | 274 | | { |
| | 275 | | public string value; |
| | 276 | | } |
| | 277 | |
|
| | 278 | | [System.Serializable] |
| | 279 | | public class OnTextInputChangeTextEventPayload |
| | 280 | | { |
| | 281 | | [System.Serializable] |
| | 282 | | public class Payload |
| | 283 | | { |
| | 284 | | public string value; |
| | 285 | | public bool isSubmit; |
| | 286 | | } |
| | 287 | |
|
| | 288 | | public Payload value = new Payload(); |
| | 289 | | } |
| | 290 | |
|
| | 291 | | [System.Serializable] |
| | 292 | | public class OnScrollChangeEventPayload |
| | 293 | | { |
| | 294 | | public Vector2 value; |
| | 295 | | public int pointerId; |
| | 296 | | } |
| | 297 | |
|
| | 298 | | [System.Serializable] |
| | 299 | | public class EmptyPayload { } |
| | 300 | |
|
| | 301 | | [System.Serializable] |
| | 302 | | public class MetricsModel |
| | 303 | | { |
| | 304 | | public int meshes; |
| | 305 | | public int bodies; |
| | 306 | | public int materials; |
| | 307 | | public int textures; |
| | 308 | | public int triangles; |
| | 309 | | public int entities; |
| | 310 | |
|
| | 311 | | public static MetricsModel operator +(MetricsModel lhs, MetricsModel rhs) |
| | 312 | | { |
| | 313 | | return new MetricsModel() |
| | 314 | | { |
| | 315 | | meshes = lhs.meshes + rhs.meshes, |
| | 316 | | bodies = lhs.bodies + rhs.bodies, |
| | 317 | | materials = lhs.materials + rhs.materials, |
| | 318 | | textures = lhs.textures + rhs.textures, |
| | 319 | | triangles = lhs.triangles + rhs.triangles, |
| | 320 | | entities = lhs.entities + rhs.entities |
| | 321 | | }; |
| | 322 | | } |
| | 323 | | } |
| | 324 | |
|
| | 325 | | [System.Serializable] |
| | 326 | | private class OnMetricsUpdate |
| | 327 | | { |
| | 328 | | public MetricsModel given = new MetricsModel(); |
| | 329 | | public MetricsModel limit = new MetricsModel(); |
| | 330 | | } |
| | 331 | |
|
| | 332 | | [System.Serializable] |
| | 333 | | public class OnEnterEventPayload { } |
| | 334 | |
|
| | 335 | | [System.Serializable] |
| | 336 | | public class TransformPayload |
| | 337 | | { |
| | 338 | | public Vector3 position = Vector3.zero; |
| | 339 | | public Quaternion rotation = Quaternion.identity; |
| | 340 | | public Vector3 scale = Vector3.one; |
| | 341 | | } |
| | 342 | |
|
| | 343 | | public class OnSendScreenshot |
| | 344 | | { |
| | 345 | | public string id; |
| | 346 | | public string encodedTexture; |
| | 347 | | }; |
| | 348 | |
|
| | 349 | | [System.Serializable] |
| | 350 | | public class GotoEvent |
| | 351 | | { |
| | 352 | | public int x; |
| | 353 | | public int y; |
| | 354 | | }; |
| | 355 | |
|
| | 356 | | [System.Serializable] |
| | 357 | | public class BaseResolution |
| | 358 | | { |
| | 359 | | public int baseResolution; |
| | 360 | | }; |
| | 361 | |
|
| | 362 | | //----------------------------------------------------- |
| | 363 | | // Raycast |
| | 364 | | [System.Serializable] |
| | 365 | | public class RayInfo |
| | 366 | | { |
| | 367 | | public Vector3 origin; |
| | 368 | | public Vector3 direction; |
| | 369 | | public float distance; |
| | 370 | | } |
| | 371 | |
|
| | 372 | | [System.Serializable] |
| | 373 | | public class RaycastHitInfo |
| | 374 | | { |
| | 375 | | public bool didHit; |
| | 376 | | public RayInfo ray; |
| | 377 | |
|
| | 378 | | public Vector3 hitPoint; |
| | 379 | | public Vector3 hitNormal; |
| | 380 | | } |
| | 381 | |
|
| | 382 | | [System.Serializable] |
| | 383 | | public class HitEntityInfo |
| | 384 | | { |
| | 385 | | public string entityId; |
| | 386 | | public string meshName; |
| | 387 | | } |
| | 388 | |
|
| | 389 | | [System.Serializable] |
| | 390 | | public class RaycastHitEntity : RaycastHitInfo |
| | 391 | | { |
| | 392 | | public HitEntityInfo entity; |
| | 393 | | } |
| | 394 | |
|
| | 395 | | [System.Serializable] |
| | 396 | | public class RaycastHitEntities : RaycastHitInfo |
| | 397 | | { |
| | 398 | | public RaycastHitEntity[] entities; |
| | 399 | | } |
| | 400 | |
|
| | 401 | | [System.Serializable] |
| | 402 | | public class RaycastResponse<T> where T : RaycastHitInfo |
| | 403 | | { |
| | 404 | | public string queryId; |
| | 405 | | public string queryType; |
| | 406 | | public T payload; |
| | 407 | | } |
| | 408 | |
|
| | 409 | | // Note (Zak): We need to explicitly define this classes for the JsonUtility to |
| | 410 | | // be able to serialize them |
| | 411 | | [System.Serializable] |
| | 412 | | public class RaycastHitFirstResponse : RaycastResponse<RaycastHitEntity> { } |
| | 413 | |
|
| | 414 | | [System.Serializable] |
| | 415 | | public class RaycastHitAllResponse : RaycastResponse<RaycastHitEntities> { } |
| | 416 | |
|
| | 417 | | [System.Serializable] |
| | 418 | | public class SendExpressionPayload |
| | 419 | | { |
| | 420 | | public string id; |
| | 421 | | public long timestamp; |
| | 422 | | } |
| | 423 | |
|
| | 424 | | [System.Serializable] |
| | 425 | | public class UserAcceptedCollectiblesPayload |
| | 426 | | { |
| | 427 | | public string id; |
| | 428 | | } |
| | 429 | |
|
| | 430 | | [System.Serializable] |
| | 431 | | public class SendBlockPlayerPayload |
| | 432 | | { |
| | 433 | | public string userId; |
| | 434 | | } |
| | 435 | |
|
| | 436 | | [System.Serializable] |
| | 437 | | public class SendUnblockPlayerPayload |
| | 438 | | { |
| | 439 | | public string userId; |
| | 440 | | } |
| | 441 | |
|
| | 442 | | [System.Serializable] |
| | 443 | | public class TutorialStepPayload |
| | 444 | | { |
| | 445 | | public int tutorialStep; |
| | 446 | | } |
| | 447 | |
|
| | 448 | | [System.Serializable] |
| | 449 | | public class PerformanceReportPayload |
| | 450 | | { |
| | 451 | | public string samples; |
| | 452 | | public bool fpsIsCapped; |
| | 453 | | public int hiccupsInThousandFrames; |
| | 454 | | public float hiccupsTime; |
| | 455 | | public float totalTime; |
| | 456 | | } |
| | 457 | |
|
| | 458 | | [System.Serializable] |
| | 459 | | public class SystemInfoReportPayload |
| | 460 | | { |
| | 461 | | public string graphicsDeviceName = SystemInfo.graphicsDeviceName; |
| | 462 | | public string graphicsDeviceVersion = SystemInfo.graphicsDeviceVersion; |
| | 463 | | public int graphicsMemorySize = SystemInfo.graphicsMemorySize; |
| | 464 | | public string processorType = SystemInfo.processorType; |
| | 465 | | public int processorCount = SystemInfo.processorCount; |
| | 466 | | public int systemMemorySize = SystemInfo.systemMemorySize; |
| | 467 | | } |
| | 468 | |
|
| | 469 | | [System.Serializable] |
| | 470 | | public class GenericAnalyticPayload |
| | 471 | | { |
| | 472 | | public string eventName; |
| | 473 | | public Dictionary<object, object> data; |
| | 474 | | } |
| | 475 | |
|
| | 476 | | [System.Serializable] |
| | 477 | | public class PerformanceHiccupPayload |
| | 478 | | { |
| | 479 | | public int hiccupsInThousandFrames; |
| | 480 | | public float hiccupsTime; |
| | 481 | | public float totalTime; |
| | 482 | | } |
| | 483 | |
|
| | 484 | | [System.Serializable] |
| | 485 | | public class TermsOfServiceResponsePayload |
| | 486 | | { |
| | 487 | | public string sceneId; |
| | 488 | | public bool dontShowAgain; |
| | 489 | | public bool accepted; |
| | 490 | | } |
| | 491 | |
|
| | 492 | | [System.Serializable] |
| | 493 | | public class OpenURLPayload |
| | 494 | | { |
| | 495 | | public string url; |
| | 496 | | } |
| | 497 | |
|
| | 498 | | [System.Serializable] |
| | 499 | | public class GIFSetupPayload |
| | 500 | | { |
| | 501 | | public string imageSource; |
| | 502 | | public string id; |
| | 503 | | public bool isWebGL1; |
| | 504 | | } |
| | 505 | |
|
| | 506 | | [System.Serializable] |
| | 507 | | public class RequestScenesInfoAroundParcelPayload |
| | 508 | | { |
| | 509 | | public Vector2 parcel; |
| | 510 | | public int scenesAround; |
| | 511 | | } |
| | 512 | |
|
| | 513 | | [System.Serializable] |
| | 514 | | public class AudioStreamingPayload |
| | 515 | | { |
| | 516 | | public string url; |
| | 517 | | public bool play; |
| | 518 | | public float volume; |
| | 519 | | } |
| | 520 | |
|
| | 521 | | [System.Serializable] |
| | 522 | | public class SetScenesLoadRadiusPayload |
| | 523 | | { |
| | 524 | | public float newRadius; |
| | 525 | | } |
| | 526 | |
|
| | 527 | | [System.Serializable] |
| | 528 | | public class SetVoiceChatRecordingPayload |
| | 529 | | { |
| | 530 | | public bool recording; |
| | 531 | | } |
| | 532 | |
|
| | 533 | | [System.Serializable] |
| | 534 | | public class ApplySettingsPayload |
| | 535 | | { |
| | 536 | | public float voiceChatVolume; |
| | 537 | | public int voiceChatAllowCategory; |
| | 538 | | } |
| | 539 | |
|
| | 540 | | [System.Serializable] |
| | 541 | | public class JumpInPayload |
| | 542 | | { |
| | 543 | | public FriendsController.UserStatus.Realm realm = new FriendsController.UserStatus.Realm(); |
| | 544 | | public Vector2 gridPosition; |
| | 545 | | } |
| | 546 | |
|
| | 547 | | [System.Serializable] |
| | 548 | | public class LoadingFeedbackMessage |
| | 549 | | { |
| | 550 | | public string message; |
| | 551 | | public int loadPercentage; |
| | 552 | | } |
| | 553 | |
|
| | 554 | | [System.Serializable] |
| | 555 | | public class AnalyticsPayload |
| | 556 | | { |
| | 557 | | [System.Serializable] |
| | 558 | | public class Property |
| | 559 | | { |
| | 560 | | public string key; |
| | 561 | | public string value; |
| | 562 | |
|
| | 563 | | public Property(string key, string value) |
| | 564 | | { |
| | 565 | | this.key = key; |
| | 566 | | this.value = value; |
| | 567 | | } |
| | 568 | | } |
| | 569 | |
|
| | 570 | | public string name; |
| | 571 | | public Property[] properties; |
| | 572 | | } |
| | 573 | |
|
| | 574 | | [System.Serializable] |
| | 575 | | public class DelightedSurveyEnabledPayload |
| | 576 | | { |
| | 577 | | public bool enabled; |
| | 578 | | } |
| | 579 | |
|
| | 580 | | [System.Serializable] |
| | 581 | | public class ExternalActionSceneEventPayload |
| | 582 | | { |
| | 583 | | public string type; |
| | 584 | | public string payload; |
| | 585 | | } |
| | 586 | |
|
| | 587 | | [System.Serializable] |
| | 588 | | public class MuteUserPayload |
| | 589 | | { |
| | 590 | | public string[] usersId; |
| | 591 | | public bool mute; |
| | 592 | | } |
| | 593 | |
|
| | 594 | | [System.Serializable] |
| | 595 | | public class CloseUserAvatarPayload |
| | 596 | | { |
| | 597 | | public bool isSignUpFlow; |
| | 598 | | } |
| | 599 | |
|
| | 600 | | [System.Serializable] |
| | 601 | | public class StringPayload |
| | 602 | | { |
| | 603 | | public string value; |
| | 604 | | } |
| | 605 | |
|
| | 606 | | [System.Serializable] |
| | 607 | | public class KillPortableExperiencePayload |
| | 608 | | { |
| | 609 | | public string portableExperienceId; |
| | 610 | | } |
| | 611 | |
|
| | 612 | | [System.Serializable] |
| | 613 | | public class SetDisabledPortableExperiencesPayload |
| | 614 | | { |
| | 615 | | public string[] idsToDisable; |
| | 616 | | } |
| | 617 | |
|
| | 618 | | [System.Serializable] |
| | 619 | | public class WearablesRequestFiltersPayload |
| | 620 | | { |
| | 621 | | public string ownedByUser; |
| | 622 | | public string[] wearableIds; |
| | 623 | | public string[] collectionIds; |
| | 624 | | } |
| | 625 | |
|
| | 626 | | [System.Serializable] |
| | 627 | | public class RequestWearablesPayload |
| | 628 | | { |
| | 629 | | public WearablesRequestFiltersPayload filters; |
| | 630 | | public string context; |
| | 631 | | } |
| | 632 | |
|
| | 633 | | [System.Serializable] |
| | 634 | | public class HeadersPayload |
| | 635 | | { |
| | 636 | | public string method; |
| | 637 | | public string url; |
| | 638 | | public Dictionary<string, object> metadata = new Dictionary<string, object>(); |
| | 639 | | } |
| | 640 | |
|
| | 641 | | [System.Serializable] |
| | 642 | | public class SearchENSOwnerPayload |
| | 643 | | { |
| | 644 | | public string name; |
| | 645 | | public int maxResults; |
| | 646 | | } |
| | 647 | |
|
| | 648 | | [System.Serializable] |
| | 649 | | public class UnpublishScenePayload |
| | 650 | | { |
| | 651 | | public string coordinates; |
| | 652 | | } |
| | 653 | |
|
| | 654 | | [System.Serializable] |
| | 655 | | public class AvatarStateBase |
| | 656 | | { |
| | 657 | | public string type; |
| | 658 | | public string entityId; |
| | 659 | | public string avatarShapeId; |
| | 660 | | } |
| | 661 | |
|
| | 662 | | [System.Serializable] |
| | 663 | | public class AvatarStateSceneChanged : AvatarStateBase |
| | 664 | | { |
| | 665 | | public string sceneId; |
| | 666 | | } |
| | 667 | |
|
| | 668 | | [System.Serializable] |
| | 669 | | public class AvatarOnClickPayload |
| | 670 | | { |
| | 671 | | public string userId; |
| | 672 | | public RayInfo ray = new RayInfo(); |
| | 673 | | } |
| | 674 | |
|
| | 675 | | [System.Serializable] |
| | 676 | | public class TimeReportPayload |
| | 677 | | { |
| | 678 | | public float timeNormalizationFactor; |
| | 679 | | public float cycleTime; |
| | 680 | | public bool isPaused; |
| | 681 | | public float time; |
| | 682 | | } |
| | 683 | |
|
| | 684 | | #if UNITY_WEBGL && !UNITY_EDITOR |
| | 685 | | /** |
| | 686 | | * This method is called after the first render. It marks the loading of the |
| | 687 | | * rest of the JS client. |
| | 688 | | */ |
| | 689 | | [DllImport("__Internal")] public static extern void StartDecentraland(); |
| | 690 | | [DllImport("__Internal")] public static extern void MessageFromEngine(string type, string message); |
| | 691 | | [DllImport("__Internal")] public static extern string GetGraphicCard(); |
| | 692 | | [DllImport("__Internal")] public static extern bool CheckURLParam(string targetParam); |
| | 693 | |
|
| | 694 | | public static System.Action<string, string> OnMessageFromEngine; |
| | 695 | | #else |
| | 696 | | public static Action<string, string> OnMessageFromEngine |
| | 697 | | { |
| | 698 | | set |
| | 699 | | { |
| | 700 | | OnMessage = value; |
| | 701 | | if (OnMessage != null) |
| | 702 | | { |
| | 703 | | ProcessQueuedMessages(); |
| | 704 | | } |
| | 705 | | } |
| | 706 | | get => OnMessage; |
| | 707 | | } |
| | 708 | | private static Action<string, string> OnMessage; |
| | 709 | |
|
| | 710 | | private static bool hasQueuedMessages = false; |
| | 711 | | private static List<(string, string)> queuedMessages = new List<(string, string)>(); |
| | 712 | | public static void StartDecentraland() { } |
| | 713 | | public static bool CheckURLParam(string targetParam) |
| | 714 | | { |
| | 715 | | return false; |
| | 716 | | } |
| | 717 | |
|
| | 718 | | public static void MessageFromEngine(string type, string message) |
| | 719 | | { |
| | 720 | | if (OnMessageFromEngine != null) |
| | 721 | | { |
| | 722 | | if (hasQueuedMessages) |
| | 723 | | { |
| | 724 | | ProcessQueuedMessages(); |
| | 725 | | } |
| | 726 | |
|
| | 727 | | OnMessageFromEngine.Invoke(type, message); |
| | 728 | | if (VERBOSE) |
| | 729 | | { |
| | 730 | | Debug.Log("MessageFromEngine called with: " + type + ", " + message); |
| | 731 | | } |
| | 732 | | } |
| | 733 | | else |
| | 734 | | { |
| | 735 | | lock (queuedMessages) |
| | 736 | | { |
| | 737 | | queuedMessages.Add((type, message)); |
| | 738 | | } |
| | 739 | |
|
| | 740 | | hasQueuedMessages = true; |
| | 741 | | } |
| | 742 | | } |
| | 743 | |
|
| | 744 | | private static void ProcessQueuedMessages() |
| | 745 | | { |
| | 746 | | hasQueuedMessages = false; |
| | 747 | | lock (queuedMessages) |
| | 748 | | { |
| | 749 | | foreach ((string type, string payload) in queuedMessages) |
| | 750 | | { |
| | 751 | | MessageFromEngine(type, payload); |
| | 752 | | } |
| | 753 | |
|
| | 754 | | queuedMessages.Clear(); |
| | 755 | | } |
| | 756 | | } |
| | 757 | |
|
| | 758 | | public static string GetGraphicCard() => "In Editor Graphic Card"; |
| | 759 | | #endif |
| | 760 | |
|
| | 761 | | public static void SendMessage(string type) |
| | 762 | | { |
| | 763 | | // sending an empty JSON object to be compatible with other messages |
| | 764 | | MessageFromEngine(type, "{}"); |
| | 765 | | } |
| | 766 | |
|
| | 767 | | public static void SendMessage<T>(string type, T message) |
| | 768 | | { |
| | 769 | | string messageJson = JsonUtility.ToJson(message); |
| | 770 | |
|
| | 771 | | if (VERBOSE) |
| | 772 | | { |
| | 773 | | Debug.Log($"Sending message: " + messageJson); |
| | 774 | | } |
| | 775 | |
|
| | 776 | | MessageFromEngine(type, messageJson); |
| | 777 | | } |
| | 778 | |
|
| | 779 | | private static ReportPositionPayload positionPayload = new ReportPositionPayload(); |
| | 780 | | private static CameraModePayload cameraModePayload = new CameraModePayload(); |
| | 781 | | private static Web3UseResponsePayload web3UseResponsePayload = new Web3UseResponsePayload(); |
| | 782 | | private static IdleStateChangedPayload idleStateChangedPayload = new IdleStateChangedPayload(); |
| | 783 | | private static OnMetricsUpdate onMetricsUpdate = new OnMetricsUpdate(); |
| | 784 | | private static OnClickEvent onClickEvent = new OnClickEvent(); |
| | 785 | | private static OnPointerDownEvent onPointerDownEvent = new OnPointerDownEvent(); |
| | 786 | | private static OnPointerUpEvent onPointerUpEvent = new OnPointerUpEvent(); |
| | 787 | | private static OnTextSubmitEvent onTextSubmitEvent = new OnTextSubmitEvent(); |
| | 788 | | private static OnTextInputChangeEvent onTextInputChangeEvent = new OnTextInputChangeEvent(); |
| | 789 | | private static OnTextInputChangeTextEvent onTextInputChangeTextEvent = new OnTextInputChangeTextEvent(); |
| | 790 | | private static OnScrollChangeEvent onScrollChangeEvent = new OnScrollChangeEvent(); |
| | 791 | | private static OnFocusEvent onFocusEvent = new OnFocusEvent(); |
| | 792 | | private static OnBlurEvent onBlurEvent = new OnBlurEvent(); |
| | 793 | | private static OnEnterEvent onEnterEvent = new OnEnterEvent(); |
| | 794 | | private static OnSendScreenshot onSendScreenshot = new OnSendScreenshot(); |
| | 795 | | private static OnPointerEventPayload onPointerEventPayload = new OnPointerEventPayload(); |
| | 796 | | private static OnGlobalPointerEventPayload onGlobalPointerEventPayload = new OnGlobalPointerEventPayload(); |
| | 797 | | private static OnGlobalPointerEvent onGlobalPointerEvent = new OnGlobalPointerEvent(); |
| | 798 | | private static AudioStreamingPayload onAudioStreamingEvent = new AudioStreamingPayload(); |
| | 799 | | private static SetVoiceChatRecordingPayload setVoiceChatRecordingPayload = new SetVoiceChatRecordingPayload(); |
| | 800 | | private static SetScenesLoadRadiusPayload setScenesLoadRadiusPayload = new SetScenesLoadRadiusPayload(); |
| | 801 | | private static ApplySettingsPayload applySettingsPayload = new ApplySettingsPayload(); |
| | 802 | | private static GIFSetupPayload gifSetupPayload = new GIFSetupPayload(); |
| | 803 | | private static JumpInPayload jumpInPayload = new JumpInPayload(); |
| | 804 | | private static GotoEvent gotoEvent = new GotoEvent(); |
| | 805 | | private static SendChatMessageEvent sendChatMessageEvent = new SendChatMessageEvent(); |
| | 806 | | private static BaseResolution baseResEvent = new BaseResolution(); |
| | 807 | | private static AnalyticsPayload analyticsEvent = new AnalyticsPayload(); |
| | 808 | | private static DelightedSurveyEnabledPayload delightedSurveyEnabled = new DelightedSurveyEnabledPayload(); |
| | 809 | | private static ExternalActionSceneEventPayload sceneExternalActionEvent = new ExternalActionSceneEventPayload(); |
| | 810 | | private static MuteUserPayload muteUserEvent = new MuteUserPayload(); |
| | 811 | | private static StoreSceneStateEvent storeSceneState = new StoreSceneStateEvent(); |
| | 812 | | private static CloseUserAvatarPayload closeUserAvatarPayload = new CloseUserAvatarPayload(); |
| | 813 | | private static StringPayload stringPayload = new StringPayload(); |
| | 814 | | private static KillPortableExperiencePayload killPortableExperiencePayload = new KillPortableExperiencePayload() |
| | 815 | | private static SetDisabledPortableExperiencesPayload setDisabledPortableExperiencesPayload = new SetDisabledPort |
| | 816 | | private static RequestWearablesPayload requestWearablesPayload = new RequestWearablesPayload(); |
| | 817 | | private static SearchENSOwnerPayload searchEnsOwnerPayload = new SearchENSOwnerPayload(); |
| | 818 | | private static HeadersPayload headersPayload = new HeadersPayload(); |
| | 819 | | private static AvatarStateBase avatarStatePayload = new AvatarStateBase(); |
| | 820 | | private static AvatarStateSceneChanged avatarSceneChangedPayload = new AvatarStateSceneChanged(); |
| | 821 | | public static AvatarOnClickPayload avatarOnClickPayload = new AvatarOnClickPayload(); |
| | 822 | | private static UUIDEvent<EmptyPayload> onPointerHoverEnterEvent = new UUIDEvent<EmptyPayload>(); |
| | 823 | | private static UUIDEvent<EmptyPayload> onPointerHoverExitEvent = new UUIDEvent<EmptyPayload>(); |
| | 824 | | private static TimeReportPayload timeReportPayload = new TimeReportPayload(); |
| | 825 | |
|
| | 826 | | public static void SendSceneEvent<T>(string sceneId, string eventType, T payload) |
| | 827 | | { |
| | 828 | | SceneEvent<T> sceneEvent = new SceneEvent<T>(); |
| | 829 | | sceneEvent.sceneId = sceneId; |
| | 830 | | sceneEvent.eventType = eventType; |
| | 831 | | sceneEvent.payload = payload; |
| | 832 | |
|
| | 833 | | SendMessage("SceneEvent", sceneEvent); |
| | 834 | | } |
| | 835 | |
|
| | 836 | | private static void SendAllScenesEvent<T>(string eventType, T payload) |
| | 837 | | { |
| | 838 | | AllScenesEvent<T> allScenesEvent = new AllScenesEvent<T>(); |
| | 839 | | allScenesEvent.eventType = eventType; |
| | 840 | | allScenesEvent.payload = payload; |
| | 841 | |
|
| | 842 | | SendMessage("AllScenesEvent", allScenesEvent); |
| | 843 | | } |
| | 844 | |
|
| | 845 | | public static void ReportPosition(Vector3 position, Quaternion rotation, float playerHeight, Quaternion cameraRo |
| | 846 | | { |
| | 847 | | positionPayload.position = position; |
| | 848 | | positionPayload.rotation = rotation; |
| | 849 | | positionPayload.playerHeight = playerHeight; |
| | 850 | | positionPayload.cameraRotation = cameraRotation; |
| | 851 | |
|
| | 852 | | SendMessage("ReportPosition", positionPayload); |
| | 853 | | } |
| | 854 | |
|
| | 855 | | public static void ReportCameraChanged(CameraMode.ModeId cameraMode) |
| | 856 | | { |
| | 857 | | ReportCameraChanged(cameraMode, null); |
| | 858 | | } |
| | 859 | |
|
| | 860 | | public static void ReportCameraChanged(CameraMode.ModeId cameraMode, string targetSceneId) |
| | 861 | | { |
| | 862 | | cameraModePayload.cameraMode = cameraMode; |
| | 863 | | if (!string.IsNullOrEmpty(targetSceneId)) |
| | 864 | | { |
| | 865 | | SendSceneEvent(targetSceneId, "cameraModeChanged", cameraModePayload); |
| | 866 | | } |
| | 867 | | else |
| | 868 | | { |
| | 869 | | SendAllScenesEvent("cameraModeChanged", cameraModePayload); |
| | 870 | | } |
| | 871 | | } |
| | 872 | |
|
| | 873 | | public static void Web3UseResponse(string id, bool result) |
| | 874 | | { |
| | 875 | | web3UseResponsePayload.id = id; |
| | 876 | | web3UseResponsePayload.result = result; |
| | 877 | | SendMessage("Web3UseResponse", web3UseResponsePayload); |
| | 878 | | } |
| | 879 | |
|
| | 880 | | public static void ReportIdleStateChanged(bool isIdle) |
| | 881 | | { |
| | 882 | | idleStateChangedPayload.isIdle = isIdle; |
| | 883 | | SendAllScenesEvent("idleStateChanged", idleStateChangedPayload); |
| | 884 | | } |
| | 885 | |
|
| | 886 | | public static void ReportControlEvent<T>(T controlEvent) where T : ControlEvent |
| | 887 | | { |
| | 888 | | SendMessage("ControlEvent", controlEvent); |
| | 889 | | } |
| | 890 | |
|
| | 891 | | public static void SendRequestHeadersForUrl(string eventName, string method, string url, Dictionary<string, obje |
| | 892 | | { |
| | 893 | | headersPayload.method = method; |
| | 894 | | headersPayload.url = url; |
| | 895 | | if (metadata != null) |
| | 896 | | headersPayload.metadata = metadata; |
| | 897 | | SendMessage(eventName, headersPayload); |
| | 898 | | } |
| | 899 | |
|
| | 900 | | public static void BuilderInWorldMessage(string type, string message) |
| | 901 | | { |
| | 902 | | MessageFromEngine(type, message); |
| | 903 | | } |
| | 904 | |
|
| | 905 | | public static void ReportOnClickEvent(string sceneId, string uuid) |
| | 906 | | { |
| | 907 | | if (string.IsNullOrEmpty(uuid)) |
| | 908 | | { |
| | 909 | | return; |
| | 910 | | } |
| | 911 | |
|
| | 912 | | onClickEvent.uuid = uuid; |
| | 913 | |
|
| | 914 | | SendSceneEvent(sceneId, "uuidEvent", onClickEvent); |
| | 915 | | } |
| | 916 | |
|
| | 917 | | private static void ReportRaycastResult<T, P>(string sceneId, string queryId, string queryType, P payload) where |
| | 918 | | { |
| | 919 | | T response = new T(); |
| | 920 | | response.queryId = queryId; |
| | 921 | | response.queryType = queryType; |
| | 922 | | response.payload = payload; |
| | 923 | |
|
| | 924 | | SendSceneEvent<T>(sceneId, "raycastResponse", response); |
| | 925 | | } |
| | 926 | |
|
| | 927 | | public static void ReportRaycastHitFirstResult(string sceneId, string queryId, RaycastType raycastType, RaycastH |
| | 928 | | { |
| | 929 | | ReportRaycastResult<RaycastHitFirstResponse, RaycastHitEntity>(sceneId, queryId, Protocol.RaycastTypeToLiter |
| | 930 | | } |
| | 931 | |
|
| | 932 | | public static void ReportRaycastHitAllResult(string sceneId, string queryId, RaycastType raycastType, RaycastHit |
| | 933 | | { |
| | 934 | | ReportRaycastResult<RaycastHitAllResponse, RaycastHitEntities>(sceneId, queryId, Protocol.RaycastTypeToLiter |
| | 935 | | } |
| | 936 | |
|
| | 937 | | private static OnPointerEventPayload.Hit CreateHitObject(string entityId, string meshName, Vector3 point, Vector |
| | 938 | | { |
| | 939 | | OnPointerEventPayload.Hit hit = new OnPointerEventPayload.Hit(); |
| | 940 | |
|
| | 941 | | hit.hitPoint = point; |
| | 942 | | hit.length = distance; |
| | 943 | | hit.normal = normal; |
| | 944 | | hit.worldNormal = normal; |
| | 945 | | hit.meshName = meshName; |
| | 946 | | hit.entityId = entityId; |
| | 947 | |
|
| | 948 | | return hit; |
| | 949 | | } |
| | 950 | |
|
| | 951 | | private static void SetPointerEventPayload(OnPointerEventPayload pointerEventPayload, ACTION_BUTTON buttonId, st |
| | 952 | | { |
| | 953 | | pointerEventPayload.origin = ray.origin; |
| | 954 | | pointerEventPayload.direction = ray.direction; |
| | 955 | | pointerEventPayload.buttonId = buttonId; |
| | 956 | |
|
| | 957 | | if (isHitInfoValid) |
| | 958 | | pointerEventPayload.hit = CreateHitObject(entityId, meshName, point, normal, distance); |
| | 959 | | else |
| | 960 | | pointerEventPayload.hit = null; |
| | 961 | | } |
| | 962 | |
|
| | 963 | | public static void ReportGlobalPointerDownEvent(ACTION_BUTTON buttonId, Ray ray, Vector3 point, Vector3 normal, |
| | 964 | | { |
| | 965 | | SetPointerEventPayload((OnPointerEventPayload)onGlobalPointerEventPayload, buttonId, entityId, meshName, ray |
| | 966 | | onGlobalPointerEventPayload.type = OnGlobalPointerEventPayload.InputEventType.DOWN; |
| | 967 | |
|
| | 968 | | onGlobalPointerEvent.payload = onGlobalPointerEventPayload; |
| | 969 | |
|
| | 970 | | SendSceneEvent(sceneId, "actionButtonEvent", onGlobalPointerEvent); |
| | 971 | | } |
| | 972 | |
|
| | 973 | | public static void ReportGlobalPointerUpEvent(ACTION_BUTTON buttonId, Ray ray, Vector3 point, Vector3 normal, fl |
| | 974 | | { |
| | 975 | | SetPointerEventPayload((OnPointerEventPayload)onGlobalPointerEventPayload, buttonId, entityId, meshName, ray |
| | 976 | | onGlobalPointerEventPayload.type = OnGlobalPointerEventPayload.InputEventType.UP; |
| | 977 | |
|
| | 978 | | onGlobalPointerEvent.payload = onGlobalPointerEventPayload; |
| | 979 | |
|
| | 980 | | SendSceneEvent(sceneId, "actionButtonEvent", onGlobalPointerEvent); |
| | 981 | | } |
| | 982 | |
|
| | 983 | | public static void ReportOnPointerDownEvent(ACTION_BUTTON buttonId, string sceneId, string uuid, string entityId |
| | 984 | | { |
| | 985 | | if (string.IsNullOrEmpty(uuid)) |
| | 986 | | { |
| | 987 | | return; |
| | 988 | | } |
| | 989 | |
|
| | 990 | | onPointerDownEvent.uuid = uuid; |
| | 991 | | SetPointerEventPayload(onPointerEventPayload, buttonId, entityId, meshName, ray, point, normal, distance, is |
| | 992 | | onPointerDownEvent.payload = onPointerEventPayload; |
| | 993 | |
|
| | 994 | | SendSceneEvent(sceneId, "uuidEvent", onPointerDownEvent); |
| | 995 | | } |
| | 996 | |
|
| | 997 | | public static void ReportOnPointerUpEvent(ACTION_BUTTON buttonId, string sceneId, string uuid, string entityId, |
| | 998 | | { |
| | 999 | | if (string.IsNullOrEmpty(uuid)) |
| | 1000 | | { |
| | 1001 | | return; |
| | 1002 | | } |
| | 1003 | |
|
| | 1004 | | onPointerUpEvent.uuid = uuid; |
| | 1005 | | SetPointerEventPayload(onPointerEventPayload, buttonId, entityId, meshName, ray, point, normal, distance, is |
| | 1006 | | onPointerUpEvent.payload = onPointerEventPayload; |
| | 1007 | |
|
| | 1008 | | SendSceneEvent(sceneId, "uuidEvent", onPointerUpEvent); |
| | 1009 | | } |
| | 1010 | |
|
| | 1011 | | public static void ReportOnTextSubmitEvent(string sceneId, string uuid, string text) |
| | 1012 | | { |
| | 1013 | | if (string.IsNullOrEmpty(uuid)) |
| | 1014 | | { |
| | 1015 | | return; |
| | 1016 | | } |
| | 1017 | |
|
| | 1018 | | onTextSubmitEvent.uuid = uuid; |
| | 1019 | | onTextSubmitEvent.payload.text = text; |
| | 1020 | |
|
| | 1021 | | SendSceneEvent(sceneId, "uuidEvent", onTextSubmitEvent); |
| | 1022 | | } |
| | 1023 | |
|
| | 1024 | | public static void ReportOnTextInputChangedEvent(string sceneId, string uuid, string text) |
| | 1025 | | { |
| | 1026 | | if (string.IsNullOrEmpty(uuid)) |
| | 1027 | | { |
| | 1028 | | return; |
| | 1029 | | } |
| | 1030 | |
|
| | 1031 | | onTextInputChangeEvent.uuid = uuid; |
| | 1032 | | onTextInputChangeEvent.payload.value = text; |
| | 1033 | |
|
| | 1034 | | SendSceneEvent(sceneId, "uuidEvent", onTextInputChangeEvent); |
| | 1035 | | } |
| | 1036 | |
|
| | 1037 | | public static void ReportOnTextInputChangedTextEvent(string sceneId, string uuid, string text, bool isSubmit) |
| | 1038 | | { |
| | 1039 | | if (string.IsNullOrEmpty(uuid)) |
| | 1040 | | { |
| | 1041 | | return; |
| | 1042 | | } |
| | 1043 | |
|
| | 1044 | | onTextInputChangeTextEvent.uuid = uuid; |
| | 1045 | | onTextInputChangeTextEvent.payload.value.value = text; |
| | 1046 | | onTextInputChangeTextEvent.payload.value.isSubmit = isSubmit; |
| | 1047 | |
|
| | 1048 | | SendSceneEvent(sceneId, "uuidEvent", onTextInputChangeTextEvent); |
| | 1049 | | } |
| | 1050 | |
|
| | 1051 | | public static void ReportOnFocusEvent(string sceneId, string uuid) |
| | 1052 | | { |
| | 1053 | | if (string.IsNullOrEmpty(uuid)) |
| | 1054 | | { |
| | 1055 | | return; |
| | 1056 | | } |
| | 1057 | |
|
| | 1058 | | onFocusEvent.uuid = uuid; |
| | 1059 | | SendSceneEvent(sceneId, "uuidEvent", onFocusEvent); |
| | 1060 | | } |
| | 1061 | |
|
| | 1062 | | public static void ReportOnBlurEvent(string sceneId, string uuid) |
| | 1063 | | { |
| | 1064 | | if (string.IsNullOrEmpty(uuid)) |
| | 1065 | | { |
| | 1066 | | return; |
| | 1067 | | } |
| | 1068 | |
|
| | 1069 | | onBlurEvent.uuid = uuid; |
| | 1070 | | SendSceneEvent(sceneId, "uuidEvent", onBlurEvent); |
| | 1071 | | } |
| | 1072 | |
|
| | 1073 | | public static void ReportOnScrollChange(string sceneId, string uuid, Vector2 value, int pointerId) |
| | 1074 | | { |
| | 1075 | | if (string.IsNullOrEmpty(uuid)) |
| | 1076 | | { |
| | 1077 | | return; |
| | 1078 | | } |
| | 1079 | |
|
| | 1080 | | onScrollChangeEvent.uuid = uuid; |
| | 1081 | | onScrollChangeEvent.payload.value = value; |
| | 1082 | | onScrollChangeEvent.payload.pointerId = pointerId; |
| | 1083 | |
|
| | 1084 | | SendSceneEvent(sceneId, "uuidEvent", onScrollChangeEvent); |
| | 1085 | | } |
| | 1086 | |
|
| | 1087 | | public static void ReportEvent<T>(string sceneId, T @event) |
| | 1088 | | { |
| | 1089 | | SendSceneEvent(sceneId, "uuidEvent", @event); |
| | 1090 | | } |
| | 1091 | |
|
| | 1092 | | public static void ReportOnMetricsUpdate(string sceneId, MetricsModel current, |
| | 1093 | | MetricsModel limit) |
| | 1094 | | { |
| | 1095 | | onMetricsUpdate.given = current; |
| | 1096 | | onMetricsUpdate.limit = limit; |
| | 1097 | |
|
| | 1098 | | SendSceneEvent(sceneId, "metricsUpdate", onMetricsUpdate); |
| | 1099 | | } |
| | 1100 | |
|
| | 1101 | | public static void ReportOnEnterEvent(string sceneId, string uuid) |
| | 1102 | | { |
| | 1103 | | if (string.IsNullOrEmpty(uuid)) |
| | 1104 | | return; |
| | 1105 | |
|
| | 1106 | | onEnterEvent.uuid = uuid; |
| | 1107 | |
|
| | 1108 | | SendSceneEvent(sceneId, "uuidEvent", onEnterEvent); |
| | 1109 | | } |
| | 1110 | |
|
| | 1111 | | public static void LogOut() |
| | 1112 | | { |
| | 1113 | | SendMessage("LogOut"); |
| | 1114 | | } |
| | 1115 | |
|
| | 1116 | | public static void RedirectToSignUp() |
| | 1117 | | { |
| | 1118 | | SendMessage("RedirectToSignUp"); |
| | 1119 | | } |
| | 1120 | |
|
| | 1121 | | public static void PreloadFinished(string sceneId) |
| | 1122 | | { |
| | 1123 | | SendMessage("PreloadFinished", sceneId); |
| | 1124 | | } |
| | 1125 | |
|
| | 1126 | | public static void ReportMousePosition(Vector3 mousePosition, string id) |
| | 1127 | | { |
| | 1128 | | positionPayload.mousePosition = mousePosition; |
| | 1129 | | positionPayload.id = id; |
| | 1130 | | SendMessage("ReportMousePosition", positionPayload); |
| | 1131 | | } |
| | 1132 | |
|
| | 1133 | | public static void SendScreenshot(string encodedTexture, string id) |
| | 1134 | | { |
| | 1135 | | onSendScreenshot.encodedTexture = encodedTexture; |
| | 1136 | | onSendScreenshot.id = id; |
| | 1137 | | SendMessage("SendScreenshot", onSendScreenshot); |
| | 1138 | | } |
| | 1139 | |
|
| | 1140 | | public static void SetDelightedSurveyEnabled(bool enabled) |
| | 1141 | | { |
| | 1142 | | delightedSurveyEnabled.enabled = enabled; |
| | 1143 | | SendMessage("SetDelightedSurveyEnabled", delightedSurveyEnabled); |
| | 1144 | | } |
| | 1145 | |
|
| | 1146 | | public static void SetScenesLoadRadius(float newRadius) |
| | 1147 | | { |
| | 1148 | | setScenesLoadRadiusPayload.newRadius = newRadius; |
| | 1149 | | SendMessage("SetScenesLoadRadius", setScenesLoadRadiusPayload); |
| | 1150 | | } |
| | 1151 | |
|
| | 1152 | | [System.Serializable] |
| | 1153 | | public class SaveAvatarPayload |
| | 1154 | | { |
| | 1155 | | public string face256; |
| | 1156 | | public string body; |
| | 1157 | | public bool isSignUpFlow; |
| | 1158 | | public AvatarModel avatar; |
| | 1159 | | } |
| | 1160 | |
|
| | 1161 | | public static class RendererAuthenticationType |
| | 1162 | | { |
| | 1163 | | public static string Guest => "guest"; |
| | 1164 | | public static string WalletConnect => "wallet_connect"; |
| | 1165 | | } |
| | 1166 | |
|
| | 1167 | | [System.Serializable] |
| | 1168 | | public class SendAuthenticationPayload |
| | 1169 | | { |
| | 1170 | | public string rendererAuthenticationType; |
| | 1171 | | } |
| | 1172 | |
|
| | 1173 | | [System.Serializable] |
| | 1174 | | public class SendPassportPayload |
| | 1175 | | { |
| | 1176 | | public string name; |
| | 1177 | | public string email; |
| | 1178 | | } |
| | 1179 | |
|
| | 1180 | | [System.Serializable] |
| | 1181 | | public class SendSaveUserUnverifiedNamePayload |
| | 1182 | | { |
| | 1183 | | public string newUnverifiedName; |
| | 1184 | | } |
| | 1185 | |
|
| | 1186 | | [System.Serializable] |
| | 1187 | | public class SendSaveUserDescriptionPayload |
| | 1188 | | { |
| | 1189 | | public string description; |
| | 1190 | |
|
| | 1191 | | public SendSaveUserDescriptionPayload(string description) |
| | 1192 | | { |
| | 1193 | | this.description = description; |
| | 1194 | | } |
| | 1195 | | } |
| | 1196 | |
|
| | 1197 | | [Serializable] |
| | 1198 | | public class SendVideoProgressEvent |
| | 1199 | | { |
| | 1200 | | public string componentId; |
| | 1201 | | public string sceneId; |
| | 1202 | | public string videoTextureId; |
| | 1203 | | public int status; |
| | 1204 | | public float currentOffset; |
| | 1205 | | public float videoLength; |
| | 1206 | | } |
| | 1207 | |
|
| | 1208 | | public static void RequestOwnProfileUpdate() |
| | 1209 | | { |
| | 1210 | | SendMessage("RequestOwnProfileUpdate"); |
| | 1211 | | } |
| | 1212 | |
|
| | 1213 | | public static void SendSaveAvatar(AvatarModel avatar, Texture2D face256Snapshot, Texture2D bodySnapshot, bool is |
| | 1214 | | { |
| | 1215 | | var payload = new SaveAvatarPayload() |
| | 1216 | | { |
| | 1217 | | avatar = avatar, |
| | 1218 | | face256 = System.Convert.ToBase64String(face256Snapshot.EncodeToPNG()), |
| | 1219 | | body = System.Convert.ToBase64String(bodySnapshot.EncodeToPNG()), |
| | 1220 | | isSignUpFlow = isSignUpFlow |
| | 1221 | | }; |
| | 1222 | | SendMessage("SaveUserAvatar", payload); |
| | 1223 | | } |
| | 1224 | |
|
| | 1225 | | public static void SendAuthentication(string rendererAuthenticationType) |
| | 1226 | | { |
| | 1227 | | SendMessage("SendAuthentication", new SendAuthenticationPayload { rendererAuthenticationType = rendererAuthe |
| | 1228 | | } |
| | 1229 | |
|
| | 1230 | | public static void SendPassport(string name, string email) |
| | 1231 | | { |
| | 1232 | | SendMessage("SendPassport", new SendPassportPayload { name = name, email = email }); |
| | 1233 | | } |
| | 1234 | |
|
| | 1235 | | public static void SendSaveUserUnverifiedName(string newName) |
| | 1236 | | { |
| | 1237 | | var payload = new SendSaveUserUnverifiedNamePayload() |
| | 1238 | | { |
| | 1239 | | newUnverifiedName = newName |
| | 1240 | | }; |
| | 1241 | |
|
| | 1242 | | SendMessage("SaveUserUnverifiedName", payload); |
| | 1243 | | } |
| | 1244 | |
|
| | 1245 | | public static void SendSaveUserDescription(string about) |
| | 1246 | | { |
| | 1247 | | SendMessage("SaveUserDescription", new SendSaveUserDescriptionPayload(about)); |
| | 1248 | | } |
| | 1249 | |
|
| | 1250 | | public static void SendUserAcceptedCollectibles(string airdropId) |
| | 1251 | | { |
| | 1252 | | SendMessage("UserAcceptedCollectibles", new UserAcceptedCollectiblesPayload { id = airdropId }); |
| | 1253 | | } |
| | 1254 | |
|
| | 1255 | | public static void SaveUserTutorialStep(int newTutorialStep) |
| | 1256 | | { |
| | 1257 | | SendMessage("SaveUserTutorialStep", new TutorialStepPayload() { tutorialStep = newTutorialStep }); |
| | 1258 | | } |
| | 1259 | |
|
| | 1260 | | public static void SendPerformanceReport(string encodedFrameTimesInMS, bool usingFPSCap, int hiccupsInThousandFr |
| | 1261 | | { |
| | 1262 | | SendMessage("PerformanceReport", new PerformanceReportPayload() |
| | 1263 | | { |
| | 1264 | | samples = encodedFrameTimesInMS, |
| | 1265 | | fpsIsCapped = usingFPSCap, |
| | 1266 | | hiccupsInThousandFrames = hiccupsInThousandFrames, |
| | 1267 | | hiccupsTime = hiccupsTime, |
| | 1268 | | totalTime = totalTime |
| | 1269 | | }); |
| | 1270 | | } |
| | 1271 | |
|
| | 1272 | | public static void SendSystemInfoReport() |
| | 1273 | | { |
| | 1274 | | SendMessage("SystemInfoReport", new SystemInfoReportPayload()); |
| | 1275 | | } |
| | 1276 | |
|
| | 1277 | | public static void SendTermsOfServiceResponse(string sceneId, bool accepted, bool dontShowAgain) |
| | 1278 | | { |
| | 1279 | | var payload = new TermsOfServiceResponsePayload() |
| | 1280 | | { |
| | 1281 | | sceneId = sceneId, |
| | 1282 | | accepted = accepted, |
| | 1283 | | dontShowAgain = dontShowAgain |
| | 1284 | | }; |
| | 1285 | | SendMessage("TermsOfServiceResponse", payload); |
| | 1286 | | } |
| | 1287 | |
|
| | 1288 | | public static void SendExpression(string expressionID, long timestamp) |
| | 1289 | | { |
| | 1290 | | SendMessage("TriggerExpression", new SendExpressionPayload() |
| | 1291 | | { |
| | 1292 | | id = expressionID, |
| | 1293 | | timestamp = timestamp |
| | 1294 | | }); |
| | 1295 | | } |
| | 1296 | |
|
| | 1297 | | public static void OpenURL(string url) |
| | 1298 | | { |
| | 1299 | | #if UNITY_WEBGL |
| | 1300 | | SendMessage("OpenWebURL", new OpenURLPayload { url = url }); |
| | 1301 | | #else |
| | 1302 | | Application.OpenURL(url); |
| | 1303 | | #endif |
| | 1304 | | } |
| | 1305 | |
|
| | 1306 | | public static void SendReportScene(string sceneID) |
| | 1307 | | { |
| | 1308 | | SendMessage("ReportScene", sceneID); |
| | 1309 | | } |
| | 1310 | |
|
| | 1311 | | public static void SendReportPlayer(string playerName) |
| | 1312 | | { |
| | 1313 | | SendMessage("ReportPlayer", playerName); |
| | 1314 | | } |
| | 1315 | |
|
| | 1316 | | public static void SendBlockPlayer(string userId) |
| | 1317 | | { |
| | 1318 | | SendMessage("BlockPlayer", new SendBlockPlayerPayload() |
| | 1319 | | { |
| | 1320 | | userId = userId |
| | 1321 | | }); |
| | 1322 | | } |
| | 1323 | |
|
| | 1324 | | public static void SendUnblockPlayer(string userId) |
| | 1325 | | { |
| | 1326 | | SendMessage("UnblockPlayer", new SendUnblockPlayerPayload() |
| | 1327 | | { |
| | 1328 | | userId = userId |
| | 1329 | | }); |
| | 1330 | | } |
| | 1331 | |
|
| | 1332 | | public static void RequestScenesInfoAroundParcel(Vector2 parcel, int maxScenesArea) |
| | 1333 | | { |
| | 1334 | | SendMessage("RequestScenesInfoInArea", new RequestScenesInfoAroundParcelPayload() |
| | 1335 | | { |
| | 1336 | | parcel = parcel, |
| | 1337 | | scenesAround = maxScenesArea |
| | 1338 | | }); |
| | 1339 | | } |
| | 1340 | |
|
| | 1341 | | public static void SendAudioStreamEvent(string url, bool play, float volume) |
| | 1342 | | { |
| | 1343 | | onAudioStreamingEvent.url = url; |
| | 1344 | | onAudioStreamingEvent.play = play; |
| | 1345 | | onAudioStreamingEvent.volume = volume; |
| | 1346 | | SendMessage("SetAudioStream", onAudioStreamingEvent); |
| | 1347 | | } |
| | 1348 | |
|
| | 1349 | | public static void SendSetVoiceChatRecording(bool recording) |
| | 1350 | | { |
| | 1351 | | setVoiceChatRecordingPayload.recording = recording; |
| | 1352 | | SendMessage("SetVoiceChatRecording", setVoiceChatRecordingPayload); |
| | 1353 | | } |
| | 1354 | |
|
| | 1355 | | public static void ToggleVoiceChatRecording() |
| | 1356 | | { |
| | 1357 | | SendMessage("ToggleVoiceChatRecording"); |
| | 1358 | | } |
| | 1359 | |
|
| | 1360 | | public static void ApplySettings(float voiceChatVolume, int voiceChatAllowCategory) |
| | 1361 | | { |
| | 1362 | | applySettingsPayload.voiceChatVolume = voiceChatVolume; |
| | 1363 | | applySettingsPayload.voiceChatAllowCategory = voiceChatAllowCategory; |
| | 1364 | | SendMessage("ApplySettings", applySettingsPayload); |
| | 1365 | | } |
| | 1366 | |
|
| | 1367 | | public static void RequestGIFProcessor(string gifURL, string gifId, bool isWebGL1) |
| | 1368 | | { |
| | 1369 | | gifSetupPayload.imageSource = gifURL; |
| | 1370 | | gifSetupPayload.id = gifId; |
| | 1371 | | gifSetupPayload.isWebGL1 = isWebGL1; |
| | 1372 | |
|
| | 1373 | | SendMessage("RequestGIFProcessor", gifSetupPayload); |
| | 1374 | | } |
| | 1375 | |
|
| | 1376 | | public static void DeleteGIF(string id) |
| | 1377 | | { |
| | 1378 | | stringPayload.value = id; |
| | 1379 | | SendMessage("DeleteGIF", stringPayload); |
| | 1380 | | } |
| | 1381 | |
|
| | 1382 | | public static void GoTo(int x, int y) |
| | 1383 | | { |
| | 1384 | | gotoEvent.x = x; |
| | 1385 | | gotoEvent.y = y; |
| | 1386 | | SendMessage("GoTo", gotoEvent); |
| | 1387 | | } |
| | 1388 | |
|
| | 1389 | | public static void GoToCrowd() |
| | 1390 | | { |
| | 1391 | | SendMessage("GoToCrowd"); |
| | 1392 | | } |
| | 1393 | |
|
| | 1394 | | public static void GoToMagic() |
| | 1395 | | { |
| | 1396 | | SendMessage("GoToMagic"); |
| | 1397 | | } |
| | 1398 | |
|
| | 1399 | | public static void JumpIn(int x, int y, string serverName, string layerName) |
| | 1400 | | { |
| | 1401 | | jumpInPayload.realm.serverName = serverName; |
| | 1402 | | jumpInPayload.realm.layer = layerName; |
| | 1403 | |
|
| | 1404 | | jumpInPayload.gridPosition.x = x; |
| | 1405 | | jumpInPayload.gridPosition.y = y; |
| | 1406 | |
|
| | 1407 | | SendMessage("JumpIn", jumpInPayload); |
| | 1408 | | } |
| | 1409 | |
|
| | 1410 | | public static void SendChatMessage(ChatMessage message) |
| | 1411 | | { |
| | 1412 | | sendChatMessageEvent.message = message; |
| | 1413 | | SendMessage("SendChatMessage", sendChatMessageEvent); |
| | 1414 | | } |
| | 1415 | |
|
| | 1416 | | public static void UpdateFriendshipStatus(FriendsController.FriendshipUpdateStatusMessage message) |
| | 1417 | | { |
| | 1418 | | SendMessage("UpdateFriendshipStatus", message); |
| | 1419 | | } |
| | 1420 | |
|
| | 1421 | | public static void ScenesLoadingFeedback(LoadingFeedbackMessage message) |
| | 1422 | | { |
| | 1423 | | SendMessage("ScenesLoadingFeedback", message); |
| | 1424 | | } |
| | 1425 | |
|
| | 1426 | | public static void FetchHotScenes() |
| | 1427 | | { |
| | 1428 | | SendMessage("FetchHotScenes"); |
| | 1429 | | } |
| | 1430 | |
|
| | 1431 | | public static void SetBaseResolution(int resolution) |
| | 1432 | | { |
| | 1433 | | baseResEvent.baseResolution = resolution; |
| | 1434 | | SendMessage("SetBaseResolution", baseResEvent); |
| | 1435 | | } |
| | 1436 | |
|
| | 1437 | | public static void ReportAnalyticsEvent(string eventName) |
| | 1438 | | { |
| | 1439 | | ReportAnalyticsEvent(eventName, null); |
| | 1440 | | } |
| | 1441 | |
|
| | 1442 | | public static void ReportAnalyticsEvent(string eventName, AnalyticsPayload.Property[] eventProperties) |
| | 1443 | | { |
| | 1444 | | analyticsEvent.name = eventName; |
| | 1445 | | analyticsEvent.properties = eventProperties; |
| | 1446 | | SendMessage("Track", analyticsEvent); |
| | 1447 | | } |
| | 1448 | |
|
| | 1449 | | public static void FetchBalanceOfMANA() |
| | 1450 | | { |
| | 1451 | | SendMessage("FetchBalanceOfMANA"); |
| | 1452 | | } |
| | 1453 | |
|
| | 1454 | | public static void SendSceneExternalActionEvent(string sceneId, string type, string payload) |
| | 1455 | | { |
| | 1456 | | sceneExternalActionEvent.type = type; |
| | 1457 | | sceneExternalActionEvent.payload = payload; |
| | 1458 | | SendSceneEvent(sceneId, "externalAction", sceneExternalActionEvent); |
| | 1459 | | } |
| | 1460 | |
|
| | 1461 | | public static void SetMuteUsers(string[] usersId, bool mute) |
| | 1462 | | { |
| | 1463 | | muteUserEvent.usersId = usersId; |
| | 1464 | | muteUserEvent.mute = mute; |
| | 1465 | | SendMessage("SetMuteUsers", muteUserEvent); |
| | 1466 | | } |
| | 1467 | |
|
| | 1468 | | public static void SendCloseUserAvatar(bool isSignUpFlow) |
| | 1469 | | { |
| | 1470 | | closeUserAvatarPayload.isSignUpFlow = isSignUpFlow; |
| | 1471 | | SendMessage("CloseUserAvatar", closeUserAvatarPayload); |
| | 1472 | | } |
| | 1473 | |
|
| | 1474 | | // Warning: Use this method only for PEXs non-associated to smart wearables. |
| | 1475 | | // For PEX associated to smart wearables use 'SetDisabledPortableExperiences'. |
| | 1476 | | public static void KillPortableExperience(string portableExperienceId) |
| | 1477 | | { |
| | 1478 | | killPortableExperiencePayload.portableExperienceId = portableExperienceId; |
| | 1479 | | SendMessage("KillPortableExperience", killPortableExperiencePayload); |
| | 1480 | | } |
| | 1481 | |
|
| | 1482 | | public static void SetDisabledPortableExperiences(string[] idsToDisable) |
| | 1483 | | { |
| | 1484 | | setDisabledPortableExperiencesPayload.idsToDisable = idsToDisable; |
| | 1485 | | SendMessage("SetDisabledPortableExperiences", setDisabledPortableExperiencesPayload); |
| | 1486 | | } |
| | 1487 | |
|
| | 1488 | | public static void RequestWearables( |
| | 1489 | | string ownedByUser, |
| | 1490 | | string[] wearableIds, |
| | 1491 | | string[] collectionIds, |
| | 1492 | | string context) |
| | 1493 | | { |
| | 1494 | | requestWearablesPayload.filters = new WearablesRequestFiltersPayload |
| | 1495 | | { |
| | 1496 | | ownedByUser = ownedByUser, |
| | 1497 | | wearableIds = wearableIds, |
| | 1498 | | collectionIds = collectionIds |
| | 1499 | | }; |
| | 1500 | |
|
| | 1501 | | requestWearablesPayload.context = context; |
| | 1502 | |
|
| | 1503 | | SendMessage("RequestWearables", requestWearablesPayload); |
| | 1504 | | } |
| | 1505 | |
|
| | 1506 | | public static void SearchENSOwner(string name, int maxResults) |
| | 1507 | | { |
| | 1508 | | searchEnsOwnerPayload.name = name; |
| | 1509 | | searchEnsOwnerPayload.maxResults = maxResults; |
| | 1510 | |
|
| | 1511 | | SendMessage("SearchENSOwner", searchEnsOwnerPayload); |
| | 1512 | | } |
| | 1513 | |
|
| | 1514 | | public static void RequestUserProfile(string userId) |
| | 1515 | | { |
| | 1516 | | stringPayload.value = userId; |
| | 1517 | | SendMessage("RequestUserProfile", stringPayload); |
| | 1518 | | } |
| | 1519 | |
|
| | 1520 | | public static void ReportAvatarFatalError() |
| | 1521 | | { |
| | 1522 | | SendMessage("ReportAvatarFatalError"); |
| | 1523 | | } |
| | 1524 | |
|
| | 1525 | | public static void UnpublishScene(Vector2Int sceneCoordinates) |
| | 1526 | | { |
| | 1527 | | var payload = new UnpublishScenePayload() { coordinates = $"{sceneCoordinates.x},{sceneCoordinates.y}" }; |
| | 1528 | | SendMessage("UnpublishScene", payload); |
| | 1529 | | } |
| | 1530 | |
|
| | 1531 | | public static void NotifyStatusThroughChat(string message) |
| | 1532 | | { |
| | 1533 | | stringPayload.value = message; |
| | 1534 | | SendMessage("NotifyStatusThroughChat", stringPayload); |
| | 1535 | | } |
| | 1536 | |
|
| | 1537 | | public static void ReportVideoProgressEvent( |
| | 1538 | | string componentId, |
| | 1539 | | string sceneId, |
| | 1540 | | string videoClipId, |
| | 1541 | | int videoStatus, |
| | 1542 | | float currentOffset, |
| | 1543 | | float length) |
| | 1544 | | { |
| | 1545 | | SendVideoProgressEvent progressEvent = new SendVideoProgressEvent() |
| | 1546 | | { |
| | 1547 | | componentId = componentId, |
| | 1548 | | sceneId = sceneId, |
| | 1549 | | videoTextureId = videoClipId, |
| | 1550 | | status = videoStatus, |
| | 1551 | | currentOffset = currentOffset, |
| | 1552 | | videoLength = length |
| | 1553 | | }; |
| | 1554 | |
|
| | 1555 | | SendMessage("VideoProgressEvent", progressEvent); |
| | 1556 | | } |
| | 1557 | |
|
| | 1558 | | public static void ReportAvatarRemoved(string entityId, string avatarId) |
| | 1559 | | { |
| | 1560 | | avatarStatePayload.type = "Removed"; |
| | 1561 | | avatarStatePayload.entityId = entityId; |
| | 1562 | | avatarStatePayload.avatarShapeId = avatarId; |
| | 1563 | | SendMessage("ReportAvatarState", avatarStatePayload); |
| | 1564 | | } |
| | 1565 | |
|
| | 1566 | | public static void ReportAvatarSceneChanged(string entityId, string avatarId, string sceneId) |
| | 1567 | | { |
| | 1568 | | avatarSceneChangedPayload.type = "SceneChanged"; |
| | 1569 | | avatarSceneChangedPayload.entityId = entityId; |
| | 1570 | | avatarSceneChangedPayload.avatarShapeId = avatarId; |
| | 1571 | | avatarSceneChangedPayload.sceneId = sceneId; |
| | 1572 | | SendMessage("ReportAvatarState", avatarSceneChangedPayload); |
| | 1573 | | } |
| | 1574 | |
|
| | 1575 | | public static void ReportAvatarClick(string sceneId, string userId, Vector3 rayOrigin, Vector3 rayDirection, flo |
| | 1576 | | { |
| | 1577 | | avatarOnClickPayload.userId = userId; |
| | 1578 | | avatarOnClickPayload.ray.origin = rayOrigin; |
| | 1579 | | avatarOnClickPayload.ray.direction = rayDirection; |
| | 1580 | | avatarOnClickPayload.ray.distance = distance; |
| | 1581 | |
|
| | 1582 | | SendSceneEvent(sceneId, "playerClicked", avatarOnClickPayload); |
| | 1583 | | } |
| | 1584 | |
|
| | 1585 | | public static void ReportOnPointerHoverEnterEvent(string sceneId, string uuid) |
| | 1586 | | { |
| | 1587 | | onPointerHoverEnterEvent.uuid = uuid; |
| | 1588 | | SendSceneEvent(sceneId, "uuidEvent", onPointerHoverEnterEvent); |
| | 1589 | | } |
| | 1590 | |
|
| | 1591 | | public static void ReportOnPointerHoverExitEvent(string sceneId, string uuid) |
| | 1592 | | { |
| | 1593 | | onPointerHoverExitEvent.uuid = uuid; |
| | 1594 | | SendSceneEvent(sceneId, "uuidEvent", onPointerHoverExitEvent); |
| | 1595 | | } |
| | 1596 | |
|
| | 1597 | | public static void ReportTime(float time, bool isPaused, float timeNormalizationFactor, float cycleTime) |
| | 1598 | | { |
| | 1599 | | timeReportPayload.time = time; |
| | 1600 | | timeReportPayload.isPaused = isPaused; |
| | 1601 | | timeReportPayload.timeNormalizationFactor = timeNormalizationFactor; |
| | 1602 | | timeReportPayload.cycleTime = cycleTime; |
| | 1603 | | SendMessage("ReportDecentralandTime", timeReportPayload); |
| | 1604 | | } |
| | 1605 | | } |
| | 1606 | | } |