VRC SDK
This project aims to completely document the VRChat Unity SDK
Loading...
Searching...
No Matches
VRCSDK3.cs
Go to the documentation of this file.
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Diagnostics;
5using System.Globalization;
6using System.IO;
7using System.Linq;
8using System.Reflection;
9using System.Runtime.CompilerServices;
10using System.Runtime.InteropServices;
11using System.Runtime.Serialization;
12using System.Runtime.Versioning;
13using System.Security;
14using System.Security.Permissions;
15using System.Text;
16using System.Threading;
17using Cysharp.Threading.Tasks;
18using Cysharp.Threading.Tasks.CompilerServices;
19using JetBrains.Annotations;
20using Midi;
21using TMPro;
22using Unity.Collections;
23using Unity.Collections.LowLevel.Unsafe;
24using UnityEngine;
25using UnityEngine.Events;
26using UnityEngine.EventSystems;
27using UnityEngine.Networking;
28using UnityEngine.Rendering;
29using UnityEngine.SceneManagement;
30using UnityEngine.Serialization;
31using UnityEngine.UI;
32using UnityEngine.Video;
35using VRC.SDK3.Midi;
40using VRC.SDKBase;
44using VRC.Udon.Common;
45using VRC.Udon.Common.Attributes;
46using VRC.Udon.Common.Enums;
47using VRC.Udon.Common.Interfaces;
48
49[assembly: CompilationRelaxations(8)]
50[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
51[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
52[assembly: UnityAPICompatibilityVersion("2022.3.22f1", true)]
53[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
54[assembly: AssemblyCompany("VRCSDK3")]
55[assembly: AssemblyConfiguration("Release")]
56[assembly: AssemblyFileVersion("1.0.0.0")]
57[assembly: AssemblyInformationalVersion("1.0.0+77370df7b4055abf7cc0fb1da3c3d290108e9941")]
58[assembly: AssemblyProduct("VRCSDK3")]
59[assembly: AssemblyTitle("VRCSDK3")]
60[assembly: SecurityPermission(8, SkipVerification = true)]
61[assembly: AssemblyVersion("1.0.0.0")]
62[module: UnverifiableCode]
63public class EnumFlagAttribute : PropertyAttribute
64{
65}
66namespace Midi
67{
68 public class ParsedMidiFile : Object
69 {
70 private static class Reader : Object
71 {
72 public static int Read16(byte[] data, ref int i)
73 {
74 return (data[i++] << 8) | data[i++];
75 }
76
77 public static int Read32(byte[] data, ref int i)
78 {
79 return (data[i++] << 24) | (data[i++] << 16) | (data[i++] << 8) | data[i++];
80 }
81
82 public static byte Read8(byte[] data, ref int i)
83 {
84 return data[i++];
85 }
86
87 public static byte[] ReadAllBytesFromStream(Stream input)
88 {
89 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
90 //IL_0011: Expected O, but got Unknown
91 byte[] array = (byte[])(object)new Byte[16384];
92 MemoryStream val = new MemoryStream();
93 try
94 {
95 int num;
96 while ((num = input.Read(array, 0, array.Length)) > 0)
97 {
98 ((Stream)val).Write(array, 0, num);
99 }
100 return val.ToArray();
101 }
102 finally
103 {
104 if (val != null)
105 {
106 ((IDisposable)val).Dispose();
107 }
108 }
109 }
110
111 public static string ReadString(byte[] data, ref int i, int length)
112 {
113 string @string = Encoding.ASCII.GetString(data, i, length);
114 i += length;
115 return @string;
116 }
117
118 public static int ReadVarInt(byte[] data, ref int i)
119 {
120 int num = data[i++];
121 if ((num & 0x80) == 0)
122 {
123 return num;
124 }
125 num &= 0x7F;
126 for (int j = 0; j < 3; j++)
127 {
128 int num2 = data[i++];
129 num = (num << 7) | (num2 & 0x7F);
130 if ((num2 & 0x80) == 0)
131 {
132 break;
133 }
134 }
135 return num;
136 }
137 }
138
139 public readonly int Format;
140
141 public readonly int TicksPerQuarterNote;
142
143 public readonly MidiRawData.MidiRawTrack[] Tracks;
144
145 public readonly int TracksCount;
146
147 public ParsedMidiFile(Stream stream)
148 : this(Reader.ReadAllBytesFromStream(stream))
149 {
150 }
151
152 public ParsedMidiFile(string path)
153 : this(File.ReadAllBytes(path))
154 {
155 }
156
157 public ParsedMidiFile(byte[] data)
158 {
159 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
160 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
161 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
162 int i = 0;
163 if (Reader.ReadString(data, ref i, 4) != "MThd")
164 {
165 throw new FormatException("Invalid file header (expected MThd)");
166 }
167 if (Reader.Read32(data, ref i) != 6)
168 {
169 throw new FormatException("Invalid header length (expected 6)");
170 }
171 Format = Reader.Read16(data, ref i);
172 TracksCount = Reader.Read16(data, ref i);
173 TicksPerQuarterNote = Reader.Read16(data, ref i);
174 if (((uint)TicksPerQuarterNote & 0x8000u) != 0)
175 {
176 throw new FormatException("Invalid timing mode (SMPTE timecode not supported)");
177 }
179 for (int j = 0; j < TracksCount; j++)
180 {
181 Tracks[j] = ParseTrack(j, data, ref i);
182 }
183 }
184
185 private static bool ParseMetaEvent(byte[] data, ref int position, byte metaEventType, ref byte data1, ref byte data2)
186 {
187 switch (metaEventType)
188 {
189 case 81:
190 {
191 int num2 = (data[position + 1] << 16) | (data[position + 2] << 8) | data[position + 3];
192 data1 = (byte)(60000000.0 / (double)num2);
193 position += 4;
194 return true;
195 }
196 case 88:
197 data1 = data[position + 1];
198 data2 = (byte)Math.Pow(2.0, (double)(int)data[position + 2]);
199 position += 5;
200 return true;
201 case 89:
202 data1 = data[position + 1];
203 data2 = data[position + 2];
204 position += 3;
205 return true;
206 default:
207 {
208 int num = Reader.ReadVarInt(data, ref position);
209 position += num;
210 return false;
211 }
212 }
213 }
214
215 private static MidiRawData.MidiRawTrack ParseTrack(int index, byte[] data, ref int position)
216 {
217 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
218 if (Reader.ReadString(data, ref position, 4) != "MTrk")
219 {
220 throw new FormatException("Invalid track header (expected MTrk)");
221 }
222 int num = Reader.Read32(data, ref position);
223 int num2 = position + num;
225 {
226 Index = index
227 };
228 int num3 = 0;
229 byte b = 0;
230 while (position < num2)
231 {
232 num3 += Reader.ReadVarInt(data, ref position);
233 byte b2 = data[position];
234 if ((b2 & 0x80u) != 0)
235 {
236 b = b2;
237 position++;
238 }
239 if ((b & 0xF0) != 240)
240 {
241 byte b3 = (byte)(b & 0xF0u);
242 byte arg = (byte)((b & 0xF) + 1);
243 byte arg2 = data[position++];
244 byte arg3 = (byte)(((b3 & 0xE0) != 192) ? data[position++] : 0);
245 midiRawTrack.MidiEvents.Add(new MidiRawData.MidiEvent
246 {
247 Time = num3,
248 Type = b3,
249 Arg1 = arg,
250 Arg2 = arg2,
251 Arg3 = arg3
252 });
253 continue;
254 }
255 switch (b)
256 {
257 case 255:
258 {
259 byte b4 = Reader.Read8(data, ref position);
260 if (b4 >= 1 && b4 <= 15)
261 {
262 int length = Reader.ReadVarInt(data, ref position);
263 string value = Reader.ReadString(data, ref position, length);
264 MidiRawData.TextEvent textEvent = default(MidiRawData.TextEvent);
265 textEvent.Time = num3;
266 textEvent.Type = b4;
267 textEvent.Value = value;
268 MidiRawData.TextEvent textEvent2 = textEvent;
269 midiRawTrack.TextEvents.Add(textEvent2);
270 break;
271 }
272 byte data2 = 0;
273 byte data3 = 0;
274 if (ParseMetaEvent(data, ref position, b4, ref data2, ref data3))
275 {
276 midiRawTrack.MidiEvents.Add(new MidiRawData.MidiEvent
277 {
278 Time = num3,
279 Type = b,
280 Arg1 = b4,
281 Arg2 = data2,
282 Arg3 = data3
283 });
284 }
285 break;
286 }
287 case 240:
288 case 247:
289 {
290 int num4 = Reader.ReadVarInt(data, ref position);
291 position += num4;
292 break;
293 }
294 default:
295 position++;
296 break;
297 }
298 }
299 return midiRawTrack;
300 }
301 }
302}
303namespace VRC.SDK3
304{
305 public interface IVRCNetworkId : INetworkID
306 {
307 }
308 public class ControllerColliderPlayerHit : Object
309 {
311
312 public Vector3 moveDirection;
313
314 public float moveLength;
315
316 public Vector3 normal;
317
318 public Vector3 point;
319 }
320}
322{
323 public interface IVRCVideoPlayer
324 {
325 [PublicAPI]
326 bool Loop { get; set; }
327
328 [PublicAPI]
329 bool IsPlaying { get; }
330
331 [PublicAPI]
332 bool IsReady { get; }
333
334 [PublicAPI]
335 int VideoWidth { get; }
336
337 [PublicAPI]
338 int VideoHeight { get; }
339
340 [PublicAPI]
341 void LoadURL(VRCUrl url);
342
343 [PublicAPI]
344 void PlayURL(VRCUrl url);
345
346 [PublicAPI]
347 void Play();
348
349 [PublicAPI]
350 void Pause();
351
352 [PublicAPI]
353 void Stop();
354
355 [PublicAPI]
356 void SetTime(float value);
357
358 [PublicAPI]
359 float GetTime();
360
361 [PublicAPI]
362 float GetDuration();
363
364 [PublicAPI]
365 [ExcludeFromUdonWrapper]
367
368 [PublicAPI]
369 [ExcludeFromUdonWrapper]
370 void OnVideoError(VideoError videoError);
371
372 [PublicAPI]
373 [ExcludeFromUdonWrapper]
375
376 [PublicAPI]
377 [ExcludeFromUdonWrapper]
379
380 [PublicAPI]
381 [ExcludeFromUdonWrapper]
383 }
384}
386{
388 {
389 [PublicAPI]
390 bool Loop { get; set; }
391
392 [PublicAPI]
393 bool IsPlaying { get; }
394
395 [PublicAPI]
396 bool IsReady { get; }
397
398 [PublicAPI]
399 bool UseLowLatency { get; }
400
401 [PublicAPI]
402 int VideoWidth { get; }
403
404 [PublicAPI]
405 int VideoHeight { get; }
406
407 [PublicAPI]
408 void LoadURL(VRCUrl url);
409
410 [PublicAPI]
411 void PlayURL(VRCUrl url);
412
413 [PublicAPI]
414 void Play();
415
416 [PublicAPI]
417 void Pause();
418
419 [PublicAPI]
420 void Stop();
421
422 [PublicAPI]
423 void SetTime(float value);
424
425 [PublicAPI]
426 float GetTime();
427
428 [PublicAPI]
429 float GetDuration();
430 }
431}
433{
434 [AddComponentMenu("VRChat/Video/VRC Unity Video Player")]
436 {
437 private enum VideoRenderMode : Enum
438 {
439 RenderTexture,
440 MaterialOverride
441 }
442
443 [SerializeField]
445
446 [SerializeField]
447 private bool autoPlay = true;
448
449 [SerializeField]
450 private bool loop = true;
451
452 [SerializeField]
454
455 [SerializeField]
456 private RenderTexture targetTexture;
457
458 [SerializeField]
459 private Renderer targetMaterialRenderer;
460
461 [SerializeField]
463
464 [SerializeField]
465 private VideoAspectRatio aspectRatio = (VideoAspectRatio)2;
466
467 [SerializeField]
468 private AudioSource[] targetAudioSources = Array.Empty<AudioSource>();
469
470 [SerializeField]
471 [Tooltip("The maximum virtual resolution to retrieve from sites that support multiple resolutions.")]
472 private int maximumResolution = 720;
473
474 private VideoPlayer _unityPlayer;
475
476 private bool _pauseOnStart;
477
478 private Coroutine _playDelayedCoroutine;
479
480 private Coroutine _onVideoReadyDelayedCoroutine;
481
482 [PublicAPI]
483 [ExcludeFromUdonWrapper]
484 [field: CompilerGenerated]
485 public static Action<VRCUrl, int, Object, Action<string>, Action<VideoError>> StartResolveURLCoroutine
486 {
487 [CompilerGenerated]
488 get;
489 [CompilerGenerated]
490 set;
491 }
492
493 [PublicAPI]
494 public VideoPlayer UnityPlayer
495 {
496 get
497 {
498 if ((Object)(object)_unityPlayer == (Object)null)
499 {
501 }
502 return _unityPlayer;
503 }
504 }
505
506 public override bool IsPlaying => UnityPlayer.isPlaying;
507
508 public override bool IsReady => UnityPlayer.isPrepared;
509
510 public override bool Loop
511 {
512 get
513 {
514 return loop;
515 }
516 set
517 {
518 loop = value;
519 }
520 }
521
522 [PublicAPI]
523 public override int VideoWidth => (int)UnityPlayer.width;
524
525 [PublicAPI]
526 public override int VideoHeight => (int)UnityPlayer.height;
527
528 protected override void Start()
529 {
530 base.Start();
533 }
534
535 private void PlayDefaultVideo()
536 {
537 if (autoPlay && videoURL != null)
538 {
539 if (StartResolveURLCoroutine != null)
540 {
541 StartResolveURLCoroutine.Invoke(videoURL, maximumResolution, (Object)(object)this, (Action<string>)PlayVideo, (Action<VideoError>)OnVideoError);
542 }
543 else
544 {
545 PlayVideo(videoURL.Get());
546 }
547 }
548 [CompilerGenerated]
549 void PlayVideo(string resolvedURL)
550 {
551 UnityPlayer.url = resolvedURL;
552 }
553 }
554
555 private void SetupVideoPlayer()
556 {
557 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
558 //IL_0028: Expected O, but got Unknown
559 //IL_0035: Unknown result type (might be due to invalid IL or missing references)
560 //IL_003f: Expected O, but got Unknown
561 //IL_004c: Unknown result type (might be due to invalid IL or missing references)
562 //IL_0056: Expected O, but got Unknown
563 //IL_0063: Unknown result type (might be due to invalid IL or missing references)
564 //IL_006d: Expected O, but got Unknown
565 //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
566 //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
567 _unityPlayer = ((Component)this).gameObject.AddComponent<VideoPlayer>();
568 _unityPlayer.prepareCompleted += new EventHandler(OnPrepared);
569 _unityPlayer.started += new EventHandler(OnStarted);
570 _unityPlayer.loopPointReached += new EventHandler(OnLoopPointReached);
571 _unityPlayer.errorReceived += new ErrorEventHandler(OnError);
572 _unityPlayer.isLooping = false;
573 switch (renderMode)
574 {
575 case VideoRenderMode.RenderTexture:
576 _unityPlayer.renderMode = (VideoRenderMode)2;
577 _unityPlayer.targetTexture = targetTexture;
578 break;
579 case VideoRenderMode.MaterialOverride:
580 _unityPlayer.renderMode = (VideoRenderMode)3;
581 _unityPlayer.targetMaterialRenderer = targetMaterialRenderer;
582 _unityPlayer.targetMaterialProperty = targetMaterialProperty;
583 break;
584 default:
585 throw new ArgumentOutOfRangeException();
586 }
587 _unityPlayer.source = (VideoSource)1;
588 _unityPlayer.aspectRatio = aspectRatio;
589 _unityPlayer.audioOutputMode = (VideoAudioOutputMode)1;
590 _unityPlayer.controlledAudioTrackCount = (ushort)targetAudioSources.Length;
591 for (ushort num = 0; num < targetAudioSources.Length; num++)
592 {
593 _unityPlayer.SetTargetAudioSource(num, targetAudioSources[num]);
594 }
596 }
597
598 public override void LoadURL(VRCUrl url)
599 {
600 if (StartResolveURLCoroutine != null)
601 {
602 StartResolveURLCoroutine.Invoke(url, maximumResolution, (Object)(object)this, (Action<string>)PlayVideo, (Action<VideoError>)OnVideoError);
603 }
604 else
605 {
606 PlayVideo(url.Get());
607 }
608 [CompilerGenerated]
609 void PlayVideo(string resolvedURL)
610 {
611 UnityPlayer.url = resolvedURL;
612 _pauseOnStart = true;
613 }
614 }
615
616 public override void PlayURL(VRCUrl url)
617 {
618 if (StartResolveURLCoroutine != null)
619 {
620 StartResolveURLCoroutine.Invoke(url, maximumResolution, (Object)(object)this, (Action<string>)PlayVideo, (Action<VideoError>)OnVideoError);
621 }
622 else
623 {
624 PlayVideo(url.Get());
625 }
626 base.PlayURL(url);
627 [CompilerGenerated]
628 void PlayVideo(string resolvedURL)
629 {
630 UnityPlayer.url = resolvedURL;
631 _pauseOnStart = false;
632 }
633 }
634
635 public override void Pause()
636 {
637 UnityPlayer.Pause();
638 }
639
640 public override void Play()
641 {
642 if (_playDelayedCoroutine != null)
643 {
644 ((MonoBehaviour)this).StopCoroutine(_playDelayedCoroutine);
645 _playDelayedCoroutine = null;
646 }
647 _playDelayedCoroutine = ((MonoBehaviour)this).StartCoroutine(PlayDelayCoroutine());
648 }
649
650 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
651 private IEnumerator PlayDelayCoroutine()
652 {
653 for (int attempts = 0; attempts < 5; attempts++)
654 {
655 if (!UnityPlayer.isPrepared)
656 {
657 break;
658 }
659 if (UnityPlayer.isPlaying)
660 {
661 break;
662 }
663 UnityPlayer.Play();
664 base.Play();
665 yield return null;
666 }
667 _playDelayedCoroutine = null;
668 }
669
670 public override float GetDuration()
671 {
672 return (float)UnityPlayer.length;
673 }
674
675 public override float GetTime()
676 {
677 return (float)UnityPlayer.time;
678 }
679
680 public override void SetTime(float value)
681 {
682 UnityPlayer.time = value;
683 base.SetTime(value);
684 }
685
686 public override void Stop()
687 {
688 UnityPlayer.Stop();
689 }
690
691 private void OnPrepared(VideoPlayer source)
692 {
693 if (source.canSetSkipOnDrop)
694 {
695 source.skipOnDrop = true;
696 }
697 if (_onVideoReadyDelayedCoroutine != null)
698 {
699 ((MonoBehaviour)this).StopCoroutine(_onVideoReadyDelayedCoroutine);
700 _onVideoReadyDelayedCoroutine = null;
701 }
702 _onVideoReadyDelayedCoroutine = ((MonoBehaviour)this).StartCoroutine(OnVideoReadyDelayCoroutine());
703 }
704
705 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
706 private IEnumerator OnVideoReadyDelayCoroutine()
707 {
708 yield return new WaitForSecondsRealtime(0.25f);
709 OnVideoReady();
710 _onVideoReadyDelayedCoroutine = null;
711 }
712
713 private void OnError(VideoPlayer source, string message)
714 {
715 Object.Destroy((Object)(object)UnityPlayer);
716 OnVideoError(VideoError.PlayerError);
717 }
718
719 private void OnStarted(VideoPlayer source)
720 {
721 if (!_pauseOnStart)
722 {
723 OnVideoStart();
724 return;
725 }
726 UnityPlayer.Pause();
727 _pauseOnStart = false;
728 }
729
730 private void OnLoopPointReached(VideoPlayer source)
731 {
732 if (loop)
733 {
734 UnityPlayer.Play();
735 OnVideoLoop();
736 }
737 else
738 {
739 OnVideoEnd();
740 }
741 }
742 }
743}
745{
746 [AddComponentMenu("VRChat/Video/VRC AVPro Video Player")]
748 {
749 [SerializeField]
750 [Tooltip("The URL to the default video.")]
752
753 [SerializeField]
754 [Tooltip("If AutoPlay is enabled the default video will be played automatically.")]
755 private bool autoPlay = true;
756
757 [SerializeField]
758 [Tooltip("If Loop is enabled the video will play repeatedly until the video player is stopped.")]
759 private bool loop = true;
760
761 [SerializeField]
762 [Tooltip("The maximum virtual resolution to retrieve from sites that support multiple resolutions.")]
763 private int maximumResolution = 720;
764
765 [SerializeField]
766 [Tooltip("Lower Latency for Live Streams from Advanced Sources. ")]
767 private bool useLowLatency;
768
769 private IAVProVideoPlayerInternal _playerInternal;
770
771 [PublicAPI]
772 [ExcludeFromUdonWrapper]
773 [field: CompilerGenerated]
774 public static Func<VRCAVProVideoPlayer, IAVProVideoPlayerInternal> Initialize
775 {
776 [CompilerGenerated]
777 get;
778 [CompilerGenerated]
779 set;
780 }
781
782 [PublicAPI]
783 [ExcludeFromUdonWrapper]
785
786 [PublicAPI]
787 [ExcludeFromUdonWrapper]
788 public bool AutoPlay => autoPlay;
789
790 [PublicAPI]
791 [ExcludeFromUdonWrapper]
793
794 [PublicAPI]
795 [ExcludeFromUdonWrapper]
796 [field: CompilerGenerated]
797 public bool Initialized
798 {
799 [CompilerGenerated]
800 get;
801 [CompilerGenerated]
802 private set;
803 }
804
805 [PublicAPI]
806 [ExcludeFromUdonWrapper]
808
809 public override bool Loop
810 {
811 get
812 {
813 return _playerInternal?.Loop ?? false;
814 }
815 set
816 {
817 if (_playerInternal != null)
818 {
819 _playerInternal.Loop = value;
820 }
821 }
822 }
823
824 public override bool IsPlaying => _playerInternal?.IsPlaying ?? false;
825
826 public override bool IsReady => _playerInternal?.IsReady ?? false;
827
828 [PublicAPI]
829 public override int VideoWidth => _playerInternal?.VideoWidth ?? 0;
830
831 [PublicAPI]
832 public override int VideoHeight => _playerInternal?.VideoHeight ?? 0;
833
834 private void OnValidate()
835 {
836 Loop = loop;
837 }
838
839 protected override void Start()
840 {
841 base.Start();
842 _playerInternal = Initialize?.Invoke(this);
843 if (_playerInternal != null)
844 {
845 _playerInternal.Loop = loop;
846 }
848 Initialized = true;
849 }
850
851 public override void LoadURL(VRCUrl url)
852 {
853 _playerInternal?.LoadURL(url);
854 }
855
856 public override void PlayURL(VRCUrl url)
857 {
858 _playerInternal?.PlayURL(url);
859 base.PlayURL(url);
860 }
861
862 public override void Play()
863 {
864 _playerInternal?.Play();
865 base.Play();
866 }
867
868 public override void Pause()
869 {
870 _playerInternal?.Pause();
871 }
872
873 public override void Stop()
874 {
875 _playerInternal?.Stop();
876 }
877
878 public override float GetDuration()
879 {
880 return _playerInternal?.GetDuration() ?? 0f;
881 }
882
883 public override float GetTime()
884 {
885 return _playerInternal?.GetTime() ?? 0f;
886 }
887
888 public override void SetTime(float value)
889 {
890 _playerInternal?.SetTime(value);
891 base.SetTime(value);
892 }
893 }
894 [RequireComponent(/*Could not decode attribute arguments.*/)]
895 [AddComponentMenu("VRChat/Video/VRC AVPro Video Screen")]
896 public class VRCAVProVideoScreen : MonoBehaviour
897 {
898 [SerializeField]
900
901 [SerializeField]
902 private int materialIndex;
903
904 [SerializeField]
905 private string textureProperty = "_MainTex";
906
907 [SerializeField]
908 private bool useSharedMaterial;
909
910 [PublicAPI]
911 [field: CompilerGenerated]
912 public static Action<VRCAVProVideoScreen> Initialize
913 {
914 [CompilerGenerated]
915 get;
916 [CompilerGenerated]
917 set;
918 }
919
920 [PublicAPI]
922
923 [PublicAPI]
925
926 [PublicAPI]
928
929 [PublicAPI]
931
932 private void Start()
933 {
934 if ((Object)(object)videoPlayer != (Object)null)
935 {
936 Initialize?.Invoke(this);
937 }
938 }
939 }
940 [RequireComponent(/*Could not decode attribute arguments.*/)]
941 [DisallowMultipleComponent]
942 [AddComponentMenu("VRChat/Video/VRC AVPro Video Speaker")]
943 public class VRCAVProVideoSpeaker : MonoBehaviour
944 {
945 [Serializable]
946 [PublicAPI]
947 public enum ChannelMode : Enum
948 {
949 StereoMix,
950 MonoLeft,
951 MonoRight,
952 Three,
953 Four,
954 Five,
955 Six,
956 Seven,
957 Eight
958 }
959
960 [SerializeField]
962
963 [SerializeField]
965
966 [PublicAPI]
967 [field: CompilerGenerated]
968 public static Action<VRCAVProVideoSpeaker> Initialize
969 {
970 [CompilerGenerated]
971 get;
972 [CompilerGenerated]
973 set;
974 }
975
976 [PublicAPI]
978
979 [PublicAPI]
981
982 private void Start()
983 {
984 if ((Object)(object)videoPlayer != (Object)null)
985 {
986 Initialize?.Invoke(this);
987 }
988 }
989 }
990}
992{
993 public abstract class BaseVRCVideoPlayer : MonoBehaviour, IVRCVideoPlayer
994 {
995 private readonly List<IUdonBehaviour> _udonBehaviours = new List<IUdonBehaviour>();
996
997 [HideInInspector]
999
1000 [PublicAPI]
1001 [field: CompilerGenerated]
1002 public static Action<BaseVRCVideoPlayer> InitializeBase
1003 {
1004 [CompilerGenerated]
1005 get;
1006 [CompilerGenerated]
1007 set;
1008 }
1009
1010 [PublicAPI]
1011 [ExcludeFromUdonWrapper]
1012 [field: CompilerGenerated]
1013 public float SyncIndexTimeSet
1014 {
1015 [CompilerGenerated]
1016 get;
1017 [CompilerGenerated]
1018 private set;
1019 }
1020
1021 [PublicAPI]
1022 [ExcludeFromUdonWrapper]
1023 [field: CompilerGenerated]
1025 {
1026 [CompilerGenerated]
1027 get;
1028 [CompilerGenerated]
1029 private set;
1030 }
1031
1032 public abstract bool Loop { get; set; }
1033
1034 public abstract bool IsPlaying { get; }
1035
1036 public abstract bool IsReady { get; }
1037
1038 [PublicAPI]
1039 public abstract int VideoWidth { get; }
1040
1041 [PublicAPI]
1042 public abstract int VideoHeight { get; }
1043
1044 protected virtual void Start()
1045 {
1046 ((Component)this).GetComponents<IUdonBehaviour>(_udonBehaviours);
1047 }
1048
1049 [ExcludeFromUdonWrapper]
1050 public void SetIndexMarker(float desiredTime)
1051 {
1052 SyncIndexTimeSet = Time.time;
1053 SyncIndexPosition = desiredTime;
1054 }
1055
1056 [ExcludeFromUdonWrapper]
1057 public void SetIndexMarker()
1058 {
1060 }
1061
1062 public virtual void PlayURL(VRCUrl url)
1063 {
1065 }
1066
1067 public virtual void Play()
1068 {
1070 }
1071
1072 public virtual void SetTime(float value)
1073 {
1075 }
1076
1077 public abstract void LoadURL(VRCUrl url);
1078
1079 public abstract void Pause();
1080
1081 public abstract void Stop();
1082
1083 public abstract float GetTime();
1084
1085 public abstract float GetDuration();
1086
1087 [ExcludeFromUdonWrapper]
1088 public void OnVideoReady()
1089 {
1090 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
1091 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
1092 Enumerator<IUdonBehaviour> enumerator = _udonBehaviours.GetEnumerator();
1093 try
1094 {
1095 while (enumerator.MoveNext())
1096 {
1097 ((IUdonEventReceiver)enumerator.Current).RunEvent("_onVideoReady");
1098 }
1099 }
1100 finally
1101 {
1102 ((IDisposable)enumerator).Dispose();
1103 }
1104 }
1105
1106 [ExcludeFromUdonWrapper]
1107 public void OnVideoError(VideoError videoError)
1108 {
1109 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
1110 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
1111 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
1112 Enumerator<IUdonBehaviour> enumerator = _udonBehaviours.GetEnumerator();
1113 try
1114 {
1115 while (enumerator.MoveNext())
1116 {
1117 ((IUdonEventReceiver)enumerator.Current).RunEvent<VideoError>("_onVideoError", new ValueTuple<string, VideoError>("videoError", videoError));
1118 }
1119 }
1120 finally
1121 {
1122 ((IDisposable)enumerator).Dispose();
1123 }
1124 }
1125
1126 [ExcludeFromUdonWrapper]
1127 public void OnVideoStart()
1128 {
1129 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
1130 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
1131 Enumerator<IUdonBehaviour> enumerator = _udonBehaviours.GetEnumerator();
1132 try
1133 {
1134 while (enumerator.MoveNext())
1135 {
1136 ((IUdonEventReceiver)enumerator.Current).RunEvent("_onVideoStart");
1137 }
1138 }
1139 finally
1140 {
1141 ((IDisposable)enumerator).Dispose();
1142 }
1143 }
1144
1145 [ExcludeFromUdonWrapper]
1146 public void OnVideoLoop()
1147 {
1148 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
1149 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
1151 Enumerator<IUdonBehaviour> enumerator = _udonBehaviours.GetEnumerator();
1152 try
1153 {
1154 while (enumerator.MoveNext())
1155 {
1156 ((IUdonEventReceiver)enumerator.Current).RunEvent("_onVideoLoop");
1157 }
1158 }
1159 finally
1160 {
1161 ((IDisposable)enumerator).Dispose();
1162 }
1163 }
1164
1165 [ExcludeFromUdonWrapper]
1166 public void OnVideoEnd()
1167 {
1168 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
1169 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
1170 Enumerator<IUdonBehaviour> enumerator = _udonBehaviours.GetEnumerator();
1171 try
1172 {
1173 while (enumerator.MoveNext())
1174 {
1175 ((IUdonEventReceiver)enumerator.Current).RunEvent("_onVideoEnd");
1176 }
1177 }
1178 finally
1179 {
1180 ((IDisposable)enumerator).Dispose();
1181 }
1182 }
1183 }
1184}
1185namespace VRC.SDK3.Midi
1186{
1187 [Serializable]
1188 public class MidiData : Object
1189 {
1190 [Serializable]
1191 public class MidiBlock : Object
1192 {
1193 public float startTimeMs;
1194
1195 public float endTimeMs;
1196
1197 public byte note;
1198
1199 public byte velocity;
1200
1201 public int channel;
1202
1203 public float startTimeSec => startTimeMs / 1000f;
1204
1205 public float endTimeSec => endTimeMs / 1000f;
1206
1208
1209 public override string ToString()
1210 {
1211 return String.Format("note: {0}, velocity: {1}, time: {2}s -> {3}s ({4}s)", (object[])(object)new Object[5]
1212 {
1213 (object)note,
1214 (object)velocity,
1215 (object)startTimeSec,
1216 (object)endTimeSec,
1217 (object)(endTimeSec - startTimeSec)
1218 });
1219 }
1220 }
1221
1222 [Serializable]
1223 public class MidiTrack : Object
1224 {
1226
1227 public byte minNote = 255;
1228
1229 public byte maxNote;
1230
1231 public byte minVelocity = 255;
1232
1233 public byte maxVelocity;
1234
1235 public void SetBlocks(List<MidiBlock> blocks)
1236 {
1237 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
1238 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
1239 Enumerator<MidiBlock> enumerator = blocks.GetEnumerator();
1240 try
1241 {
1242 while (enumerator.MoveNext())
1243 {
1244 MidiBlock current = enumerator.Current;
1245 minNote = (byte)Mathf.Min((int)minNote, (int)current.note);
1246 maxNote = (byte)Mathf.Max((int)maxNote, (int)current.note);
1247 minVelocity = (byte)Mathf.Min((int)minVelocity, (int)current.velocity);
1248 maxVelocity = (byte)Mathf.Max((int)maxVelocity, (int)current.velocity);
1249 }
1250 }
1251 finally
1252 {
1253 ((IDisposable)enumerator).Dispose();
1254 }
1255 this.blocks = blocks.ToArray();
1256 }
1257 }
1258
1260
1261 public byte bpm;
1262 }
1263 public class MidiFile : ScriptableObject
1264 {
1266
1268
1269 public AudioClip audioClip;
1270
1271 public static MidiFile Create(string filePath, MidiImportSettings midiImportSettings)
1272 {
1273 MidiFile midiFile = ScriptableObject.CreateInstance<MidiFile>();
1274 ParsedMidiFile parsedMidiFile = new ParsedMidiFile(filePath);
1275 midiFile.rawData = new MidiRawData
1276 {
1277 Format = parsedMidiFile.Format,
1278 TicksPerQuarterNote = parsedMidiFile.TicksPerQuarterNote,
1279 Tracks = parsedMidiFile.Tracks,
1280 TracksCount = parsedMidiFile.TracksCount
1281 };
1282 MidiRawDataProcessor midiRawDataProcessor = new MidiRawDataProcessor(parsedMidiFile, midiImportSettings);
1283 midiFile.data = new MidiData
1284 {
1285 tracks = midiRawDataProcessor.tracks.ToArray(),
1286 bpm = midiRawDataProcessor.Bpm
1287 };
1288 if (Object.op_Implicit((Object)(object)midiImportSettings.AudioClip))
1289 {
1290 midiFile.audioClip = midiImportSettings.AudioClip;
1291 }
1292 return midiFile;
1293 }
1294
1295 [ContextMenu("Print raw data")]
1296 public void PrintRawData()
1297 {
1298 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
1299 //IL_0096: Unknown result type (might be due to invalid IL or missing references)
1300 Debug.Log((object)String.Format("Format: {0}", (object)rawData.Format));
1301 Debug.Log((object)String.Format("TicksPerQuarterNote: {0}", (object)rawData.TicksPerQuarterNote));
1302 Debug.Log((object)String.Format("TracksCount: {0}", (object)rawData.TracksCount));
1304 foreach (MidiRawData.MidiRawTrack midiRawTrack in tracks)
1305 {
1306 Debug.Log((object)String.Format("\nTrack: {0}\n", (object)midiRawTrack.Index));
1307 Enumerator<MidiRawData.MidiEvent> enumerator = midiRawTrack.MidiEvents.GetEnumerator();
1308 try
1309 {
1310 while (enumerator.MoveNext())
1311 {
1312 Debug.Log((object)enumerator.Current);
1313 }
1314 }
1315 finally
1316 {
1317 ((IDisposable)enumerator).Dispose();
1318 }
1319 }
1320 }
1321
1322 [ContextMenu("Print processed data")]
1324 {
1325 Debug.Log((object)String.Format("TracksCount: {0}", (object)data.tracks.Length));
1326 for (int i = 0; i < data.tracks.Length; i++)
1327 {
1328 MidiData.MidiTrack midiTrack = data.tracks[i];
1329 Debug.Log((object)String.Format("\nTrack: {0}. note range: {1} -> {2}, velocity range: {3} -> {4}\n", (object[])(object)new Object[5]
1330 {
1331 (object)i,
1332 (object)midiTrack.minNote,
1333 (object)midiTrack.maxNote,
1334 (object)midiTrack.minVelocity,
1335 (object)midiTrack.maxVelocity
1336 }));
1337 MidiData.MidiBlock[] blocks = midiTrack.blocks;
1338 for (int j = 0; j < blocks.Length; j++)
1339 {
1340 Debug.Log((object)blocks[j]);
1341 }
1342 }
1343 }
1344 }
1345 [Serializable]
1346 public class MidiImportSettings : Object
1347 {
1349
1350 public bool OverrideBpm;
1351
1352 public byte Bpm = 120;
1353 }
1354 [AddComponentMenu("VRChat/Midi/VRC Midi Player")]
1355 public class VRCMidiPlayer : MonoBehaviour
1356 {
1357 public class TrackProgress : Object
1358 {
1360
1362
1363 public int currentBlockIndex = -1;
1364 }
1365
1366 [Serializable]
1367 [CompilerGenerated]
1368 private sealed class <>c : Object
1369 {
1370 public static readonly <>c <>9 = new <>c();
1371
1372 public static Action<MidiData.MidiBlock> <>9__14_0;
1373
1374 public static Action<MidiData.MidiBlock> <>9__16_0;
1375
1376 public static Action <>9__18_0;
1377
1378 public static Action<bool> <>9__20_0;
1379
1380 internal void <get_OnBlockStarted>b__14_0(MidiData.MidiBlock midiBlock)
1381 {
1382 }
1383
1384 internal void <get_OnBlockCompleted>b__16_0(MidiData.MidiBlock midiBlock)
1385 {
1386 }
1387
1388 internal void <get_OnPlayingStarted>b__18_0()
1389 {
1390 }
1391
1392 internal void <get_OnPlayingStopped>b__20_0(bool completed)
1393 {
1394 }
1395 }
1396
1398
1399 public AudioSource audioSource;
1400
1402
1403 public readonly List<TrackProgress> activeTracks = new List<TrackProgress>();
1404
1405 private float lastAudioSampleTime;
1406
1407 private Coroutine _coroutine;
1408
1409 private readonly ValueTuple<string, object>[] argsArray = new ValueTuple<string, object>[3];
1410
1412
1413 public float Time
1414 {
1415 get
1416 {
1417 return audioSource.time;
1418 }
1419 set
1420 {
1421 audioSource.time = value;
1422 }
1423 }
1424
1425 public Coroutine Coroutine => _coroutine;
1426
1427 public Action<MidiData.MidiBlock> OnBlockStarted => delegate
1428 {
1429 };
1430
1431 public Action<MidiData.MidiBlock> OnBlockCompleted => delegate
1432 {
1433 };
1434
1435 public Action OnPlayingStarted
1436 {
1437 get
1438 {
1439 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
1440 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
1441 //IL_001f: Expected O, but got Unknown
1442 object obj = <>c.<>9__18_0;
1443 if (obj == null)
1444 {
1445 Action val = delegate
1446 {
1447 };
1448 <>c.<>9__18_0 = val;
1449 obj = (object)val;
1450 }
1451 return (Action)obj;
1452 }
1453 }
1454
1455 public Action<bool> OnPlayingStopped => delegate
1456 {
1457 };
1458
1459 private void Awake()
1460 {
1461 if (!Object.op_Implicit((Object)(object)audioSource))
1462 {
1463 Debug.LogWarning((object)"Cannot use VRCMidiPlayer without AudioSource");
1464 ((Component)this).gameObject.SetActive(false);
1465 }
1466 }
1467
1468 public void Play()
1469 {
1470 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
1471 Stop();
1472 if (!Object.op_Implicit((Object)(object)midiFile))
1473 {
1474 throw new Exception("MidiPlayer MidiAsset is null");
1475 }
1476 _coroutine = ((MonoBehaviour)this).StartCoroutine(MidiEnumerator(midiFile));
1477 if (Object.op_Implicit((Object)(object)audioSource))
1478 {
1479 audioSource.Play();
1480 }
1481 }
1482
1483 public void Stop()
1484 {
1485 if (_coroutine != null)
1486 {
1487 OnPlayingStopped?.Invoke(false);
1488 ((MonoBehaviour)this).StopCoroutine(_coroutine);
1489 _coroutine = null;
1490 }
1491 if (Object.op_Implicit((Object)(object)audioSource))
1492 {
1493 audioSource.Stop();
1494 }
1495 }
1496
1497 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
1498 private IEnumerator MidiEnumerator(MidiFile midiAsset)
1499 {
1500 Action onPlayingStarted = OnPlayingStarted;
1501 if (onPlayingStarted != null)
1502 {
1503 onPlayingStarted.Invoke();
1504 }
1505 activeTracks.Clear();
1506 float maxEndTime = 0f;
1507 MidiData.MidiTrack[] tracks = midiAsset.data.tracks;
1508 foreach (MidiData.MidiTrack midiTrack in tracks)
1509 {
1511 {
1512 track = midiTrack
1513 });
1514 if (midiTrack.blocks.Length != 0)
1515 {
1516 float endTimeSec = midiTrack.blocks[midiTrack.blocks.Length - 1].endTimeSec;
1517 if (endTimeSec > maxEndTime)
1518 {
1519 maxEndTime = endTimeSec;
1520 }
1521 }
1522 }
1523 while (true)
1524 {
1525 float time = audioSource.time;
1526 bool flag = false;
1527 Enumerator<TrackProgress> enumerator = activeTracks.GetEnumerator();
1528 try
1529 {
1530 while (enumerator.MoveNext())
1531 {
1532 TrackProgress current = enumerator.Current;
1533 bool flag2;
1534 do
1535 {
1536 flag2 = false;
1537 int num = current.currentBlockIndex + 1;
1538 if (num < current.track.blocks.Length)
1539 {
1540 flag = true;
1541 MidiData.MidiBlock midiBlock = current.track.blocks[num];
1542 if (time >= midiBlock.startTimeSec)
1543 {
1544 current.activeBlocks.Add(midiBlock);
1545 current.currentBlockIndex = num;
1546 OnBlockStart(midiBlock);
1547 flag2 = true;
1548 }
1549 }
1550 }
1551 while (flag2);
1552 for (int num2 = current.activeBlocks.Count - 1; num2 >= 0; num2--)
1553 {
1554 MidiData.MidiBlock midiBlock2 = current.activeBlocks[num2];
1555 if (time >= midiBlock2.endTimeSec)
1556 {
1557 current.activeBlocks.RemoveAt(num2);
1558 OnBlockEnd(midiBlock2);
1559 }
1560 }
1561 }
1562 }
1563 finally
1564 {
1565 ((IDisposable)enumerator).Dispose();
1566 }
1567 if (!flag && time >= maxEndTime)
1568 {
1569 enumerator = activeTracks.GetEnumerator();
1570 try
1571 {
1572 while (enumerator.MoveNext())
1573 {
1574 Enumerator<MidiData.MidiBlock> enumerator2 = enumerator.Current.activeBlocks.GetEnumerator();
1575 try
1576 {
1577 while (enumerator2.MoveNext())
1578 {
1579 MidiData.MidiBlock current2 = enumerator2.Current;
1580 OnBlockEnd(current2);
1581 }
1582 }
1583 finally
1584 {
1585 ((IDisposable)enumerator2).Dispose();
1586 }
1587 }
1588 }
1589 finally
1590 {
1591 ((IDisposable)enumerator).Dispose();
1592 }
1593 if (!audioSource.loop)
1594 {
1595 break;
1596 }
1597 }
1598 else if ((float)audioSource.timeSamples < lastAudioSampleTime)
1599 {
1600 enumerator = activeTracks.GetEnumerator();
1601 try
1602 {
1603 while (enumerator.MoveNext())
1604 {
1605 TrackProgress current3 = enumerator.Current;
1606 current3.currentBlockIndex = -1;
1607 current3.activeBlocks.Clear();
1608 }
1609 }
1610 finally
1611 {
1612 ((IDisposable)enumerator).Dispose();
1613 }
1614 }
1615 lastAudioSampleTime = audioSource.timeSamples;
1616 yield return null;
1617 }
1618 }
1619
1620 private void OnBlockStart(MidiData.MidiBlock block)
1621 {
1622 //IL_0043: Unknown result type (might be due to invalid IL or missing references)
1623 //IL_0048: Unknown result type (might be due to invalid IL or missing references)
1624 //IL_0064: Unknown result type (might be due to invalid IL or missing references)
1625 //IL_0069: Unknown result type (might be due to invalid IL or missing references)
1626 //IL_0085: Unknown result type (might be due to invalid IL or missing references)
1627 //IL_008a: Unknown result type (might be due to invalid IL or missing references)
1628 OnBlockStarted?.Invoke(block);
1630 foreach (AbstractUdonBehaviour abstractUdonBehaviour in array)
1631 {
1632 if (Utilities.IsValid((object)abstractUdonBehaviour))
1633 {
1634 argsArray[0] = new ValueTuple<string, object>("channel", (object)block.channel);
1635 argsArray[1] = new ValueTuple<string, object>("number", (object)(Int32)block.note);
1636 argsArray[2] = new ValueTuple<string, object>("velocity", (object)(Int32)block.velocity);
1637 abstractUdonBehaviour.RunEvent("_midiNoteOn", argsArray);
1638 }
1639 }
1640 }
1641
1642 private void OnBlockEnd(MidiData.MidiBlock block)
1643 {
1644 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
1645 //IL_002e: Unknown result type (might be due to invalid IL or missing references)
1646 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
1647 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
1648 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
1649 //IL_0070: Unknown result type (might be due to invalid IL or missing references)
1650 OnBlockCompleted?.Invoke(block);
1651 argsArray[0] = new ValueTuple<string, object>("channel", (object)block.channel);
1652 argsArray[1] = new ValueTuple<string, object>("number", (object)(Int32)block.note);
1653 argsArray[2] = new ValueTuple<string, object>("velocity", (object)(Int32)block.velocity);
1655 foreach (AbstractUdonBehaviour abstractUdonBehaviour in array)
1656 {
1657 if (Utilities.IsValid((object)abstractUdonBehaviour))
1658 {
1659 abstractUdonBehaviour.RunEvent("_midiNoteOff", argsArray);
1660 }
1661 }
1662 }
1663 }
1664 [Serializable]
1665 public class MidiRawData : Object
1666 {
1667 [Serializable]
1668 public class MidiRawTrack : Object
1669 {
1670 public int Index;
1671
1672 public List<MidiEvent> MidiEvents = new List<MidiEvent>();
1673
1674 public List<TextEvent> TextEvents = new List<TextEvent>();
1675 }
1676
1677 [Serializable]
1678 public struct MidiEvent : ValueType
1679 {
1680 public int Time;
1681
1682 public byte Type;
1683
1684 public byte Arg1;
1685
1686 public byte Arg2;
1687
1688 public byte Arg3;
1689
1691
1693
1694 public int Channel => Arg1;
1695
1696 public int Note => Arg2;
1697
1698 public int Velocity => Arg3;
1699
1701
1702 public int Value => Arg3;
1703
1704 public override string ToString()
1705 {
1706 if (MidiEventType != MidiEventType.MetaEvent)
1707 {
1708 return String.Format("event type: {0}, channel: {1}, time: {2}, note: {3}, velocity: {4}", (object[])(object)new Object[5]
1709 {
1710 (object)MidiEventType,
1711 (object)Channel,
1712 (object)Time,
1713 (object)Note,
1714 (object)Velocity
1715 });
1716 }
1717 return String.Format("event type: {0}, channel: -, time: {1}, note: {2}, velocity: {3}", (object[])(object)new Object[4]
1718 {
1719 (object)MetaEventType,
1720 (object)Time,
1721 (object)Note,
1722 (object)Velocity
1723 });
1724 }
1725 }
1726
1727 [Serializable]
1728 public struct TextEvent : ValueType
1729 {
1730 public int Time;
1731
1732 public byte Type;
1733
1734 public string Value;
1735
1737 }
1738
1739 public enum MidiEventType : Enum
1740 {
1741 NoteOff = 128,
1742 NoteOn = 144,
1743 KeyAfterTouch = 160,
1744 ControlChange = 176,
1745 ProgramChange = 192,
1746 ChannelAfterTouch = 208,
1747 PitchBendChange = 224,
1748 MetaEvent = 255
1749 }
1750
1751 public enum ControlChangeType : Enum
1752 {
1753 BankSelect = 0,
1754 Modulation = 1,
1755 Volume = 7,
1756 Balance = 8,
1757 Pan = 10,
1758 Sustain = 64
1759 }
1760
1761 public enum TextEventType : Enum
1762 {
1763 Text = 1,
1764 TrackName = 3,
1765 Lyric = 5
1766 }
1767
1768 public enum MetaEventType : Enum
1769 {
1770 Tempo = 81,
1771 TimeSignature = 88,
1772 KeySignature = 89
1773 }
1774
1775 public int Format;
1776
1778
1780
1781 public int TracksCount;
1782 }
1783 public class MidiRawDataProcessor : Object
1784 {
1785 private struct NoteOnEvent : ValueType
1786 {
1787 public float StartTimeMs;
1788
1789 public byte Velocity;
1790
1791 public int Count;
1792
1793 public bool Equals(NoteOnEvent other)
1794 {
1795 return StartTimeMs == other.StartTimeMs;
1796 }
1797
1798 public override int GetHashCode()
1799 {
1800 return ((Single)(ref StartTimeMs)).GetHashCode();
1801 }
1802 }
1803
1804 public readonly List<MidiData.MidiBlock> allBlocks = new List<MidiData.MidiBlock>();
1805
1806 public readonly List<MidiData.MidiTrack> tracks;
1807
1808 private readonly List<Dictionary<byte, NoteOnEvent>> _noteTimeMap = new List<Dictionary<byte, NoteOnEvent>>();
1809
1810 [field: CompilerGenerated]
1811 public byte Bpm
1812 {
1813 [CompilerGenerated]
1814 get;
1815 [CompilerGenerated]
1816 private set;
1817 } = 120;
1818
1819
1820 public MidiRawDataProcessor(ParsedMidiFile midiFile, MidiImportSettings midiImportSettings)
1821 {
1822 //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
1823 //IL_00b1: Unknown result type (might be due to invalid IL or missing references)
1824 //IL_0351: Unknown result type (might be due to invalid IL or missing references)
1825 //IL_0356: Unknown result type (might be due to invalid IL or missing references)
1826 //IL_0234: Unknown result type (might be due to invalid IL or missing references)
1827 //IL_0304: Unknown result type (might be due to invalid IL or missing references)
1828 //IL_02fe: Unknown result type (might be due to invalid IL or missing references)
1829 tracks = new List<MidiData.MidiTrack>(midiFile.TracksCount);
1830 for (int i = 0; i < midiFile.TracksCount; i++)
1831 {
1832 tracks.Add(new MidiData.MidiTrack());
1833 _noteTimeMap.Add(new Dictionary<byte, NoteOnEvent>());
1834 }
1835 if (midiImportSettings.OverrideBpm)
1836 {
1837 Bpm = midiImportSettings.Bpm;
1838 }
1839 MidiRawData.MidiRawTrack[] array = midiFile.Tracks;
1840 NoteOnEvent noteOnEvent3 = default(NoteOnEvent);
1841 NoteOnEvent noteOnEvent = default(NoteOnEvent);
1842 foreach (MidiRawData.MidiRawTrack midiRawTrack in array)
1843 {
1844 Dictionary<byte, NoteOnEvent> val = _noteTimeMap[midiRawTrack.Index];
1845 List<MidiData.MidiBlock> val2 = new List<MidiData.MidiBlock>();
1846 Enumerator<MidiRawData.MidiEvent> enumerator = midiRawTrack.MidiEvents.GetEnumerator();
1847 try
1848 {
1849 while (enumerator.MoveNext())
1850 {
1851 MidiRawData.MidiEvent current = enumerator.Current;
1852 float num = MidiUtilities.MidiTimeToMs(Bpm, midiFile.TicksPerQuarterNote, current.Time);
1853 byte arg = current.Arg2;
1854 switch ((MidiRawData.MidiEventType)current.Type)
1855 {
1856 case MidiRawData.MidiEventType.NoteOff:
1857 {
1858 NoteOnEvent noteOnEvent2 = val[arg];
1860 {
1861 startTimeMs = noteOnEvent2.StartTimeMs,
1862 endTimeMs = num,
1863 note = arg,
1864 velocity = noteOnEvent2.Velocity,
1865 channel = current.Channel
1866 };
1867 val2.Add(midiBlock);
1868 if (val.TryGetValue(arg, ref noteOnEvent3))
1869 {
1870 if (noteOnEvent3.Count == 1)
1871 {
1872 val.Remove(arg);
1873 }
1874 else
1875 {
1876 val[arg] = new NoteOnEvent
1877 {
1878 Count = noteOnEvent3.Count - 1,
1879 Velocity = noteOnEvent3.Velocity,
1880 StartTimeMs = noteOnEvent3.StartTimeMs
1881 };
1882 }
1883 allBlocks.Add(midiBlock);
1884 break;
1885 }
1886 throw new Exception("note off event - could not find matching on event");
1887 }
1888 case MidiRawData.MidiEventType.NoteOn:
1889 if (val.TryGetValue(arg, ref noteOnEvent))
1890 {
1891 val[arg] = new NoteOnEvent
1892 {
1893 StartTimeMs = num,
1894 Velocity = current.Arg3,
1895 Count = noteOnEvent.Count + 1
1896 };
1897 }
1898 else
1899 {
1900 val.Add(arg, new NoteOnEvent
1901 {
1902 StartTimeMs = num,
1903 Velocity = current.Arg3,
1904 Count = 1
1905 });
1906 }
1907 break;
1908 case MidiRawData.MidiEventType.MetaEvent:
1909 switch (current.MetaEventType)
1910 {
1911 case MidiRawData.MetaEventType.Tempo:
1912 if (!midiImportSettings.OverrideBpm)
1913 {
1914 Bpm = (byte)current.Note;
1915 }
1916 break;
1917 default:
1918 throw new ArgumentOutOfRangeException();
1919 case MidiRawData.MetaEventType.TimeSignature:
1920 case MidiRawData.MetaEventType.KeySignature:
1921 break;
1922 }
1923 break;
1924 default:
1925 throw new ArgumentOutOfRangeException();
1926 case MidiRawData.MidiEventType.KeyAfterTouch:
1927 case MidiRawData.MidiEventType.ControlChange:
1928 case MidiRawData.MidiEventType.ProgramChange:
1929 case MidiRawData.MidiEventType.ChannelAfterTouch:
1930 case MidiRawData.MidiEventType.PitchBendChange:
1931 break;
1932 }
1933 }
1934 }
1935 finally
1936 {
1937 ((IDisposable)enumerator).Dispose();
1938 }
1939 tracks[midiRawTrack.Index].SetBlocks(val2);
1940 }
1941 Enumerator<MidiData.MidiTrack> enumerator2 = tracks.GetEnumerator();
1942 try
1943 {
1944 while (enumerator2.MoveNext())
1945 {
1946 MidiData.MidiTrack current2 = enumerator2.Current;
1947 if (current2.blocks.Length == 0)
1948 {
1949 current2.minNote = (current2.maxNote = 0);
1950 current2.minVelocity = (current2.maxVelocity = 0);
1951 }
1952 }
1953 }
1954 finally
1955 {
1956 ((IDisposable)enumerator2).Dispose();
1957 }
1958 }
1959 }
1960 public static class MidiUtilities : Object
1961 {
1962 public static float MidiTimeToMs(int bpm, int ppq, int time)
1963 {
1964 return 60000f / (float)(bpm * ppq) * (float)time;
1965 }
1966 }
1967 [AddComponentMenu("VRChat/Midi/VRC Midi Handler")]
1968 public class VRCMidiHandler : MonoBehaviour
1969 {
1970 public const int STATUS_NOTE_OFF = 128;
1971
1972 public const int STATUS_NOTE_ON = 144;
1973
1974 public const int STATUS_CONTROL_CHANGE = 176;
1975
1976 private IVRCMidiInput _midiIn;
1977
1978 [CompilerGenerated]
1980
1981 [CompilerGenerated]
1983
1984 [CompilerGenerated]
1986
1987 private static VRCMidiHandler _instance;
1988
1990 {
1991 get
1992 {
1993 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
1994 //IL_004e: Expected O, but got Unknown
1995 if (_midiIn == null)
1996 {
1997 _instance._midiIn = Initialize?.Invoke();
1998 if (_instance._midiIn != null)
1999 {
2000 _instance._midiIn.OnMidiVoiceMessage += new MidiVoiceMessageDelegate(_instance.SendMidiMessage);
2001 }
2002 }
2003 return _midiIn;
2004 }
2005 }
2006
2007 [PublicAPI]
2008 [field: CompilerGenerated]
2009 public static Func<IVRCMidiInput> Initialize
2010 {
2011 [CompilerGenerated]
2012 get;
2013 [CompilerGenerated]
2014 set;
2015 }
2016
2017 [PublicAPI]
2018 [field: CompilerGenerated]
2019 public static Action<string> OnLog
2020 {
2021 [CompilerGenerated]
2022 get;
2023 [CompilerGenerated]
2024 set;
2025 }
2026
2028 {
2029 get
2030 {
2031 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
2032 if ((Object)(object)_instance == (Object)null)
2033 {
2034 _instance = Object.FindObjectOfType<VRCMidiHandler>();
2035 if ((Object)(object)_instance == (Object)null)
2036 {
2037 _instance = new GameObject("VRCMidiHandler").AddComponent<VRCMidiHandler>();
2038 }
2039 }
2040 return _instance;
2041 }
2042 set
2043 {
2044 _instance = value;
2045 }
2046 }
2047
2049 {
2050 [CompilerGenerated]
2051 add
2052 {
2053 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
2054 //IL_0016: Expected O, but got Unknown
2057 do
2058 {
2059 val2 = val;
2060 MidiVoiceMessageDelegate val3 = (MidiVoiceMessageDelegate)Delegate.Combine((Delegate)(object)val2, (Delegate)(object)value);
2061 val = Interlocked.CompareExchange<MidiVoiceMessageDelegate>(ref this.m_OnNoteOn, val3, val2);
2062 }
2063 while (val != val2);
2064 }
2065 [CompilerGenerated]
2066 remove
2067 {
2068 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
2069 //IL_0016: Expected O, but got Unknown
2072 do
2073 {
2074 val2 = val;
2075 MidiVoiceMessageDelegate val3 = (MidiVoiceMessageDelegate)Delegate.Remove((Delegate)(object)val2, (Delegate)(object)value);
2076 val = Interlocked.CompareExchange<MidiVoiceMessageDelegate>(ref this.m_OnNoteOn, val3, val2);
2077 }
2078 while (val != val2);
2079 }
2080 }
2081
2083 {
2084 [CompilerGenerated]
2085 add
2086 {
2087 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
2088 //IL_0016: Expected O, but got Unknown
2091 do
2092 {
2093 val2 = val;
2094 MidiVoiceMessageDelegate val3 = (MidiVoiceMessageDelegate)Delegate.Combine((Delegate)(object)val2, (Delegate)(object)value);
2095 val = Interlocked.CompareExchange<MidiVoiceMessageDelegate>(ref this.m_OnNoteOff, val3, val2);
2096 }
2097 while (val != val2);
2098 }
2099 [CompilerGenerated]
2100 remove
2101 {
2102 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
2103 //IL_0016: Expected O, but got Unknown
2106 do
2107 {
2108 val2 = val;
2109 MidiVoiceMessageDelegate val3 = (MidiVoiceMessageDelegate)Delegate.Remove((Delegate)(object)val2, (Delegate)(object)value);
2110 val = Interlocked.CompareExchange<MidiVoiceMessageDelegate>(ref this.m_OnNoteOff, val3, val2);
2111 }
2112 while (val != val2);
2113 }
2114 }
2115
2117 {
2118 [CompilerGenerated]
2119 add
2120 {
2121 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
2122 //IL_0016: Expected O, but got Unknown
2125 do
2126 {
2127 val2 = val;
2128 MidiVoiceMessageDelegate val3 = (MidiVoiceMessageDelegate)Delegate.Combine((Delegate)(object)val2, (Delegate)(object)value);
2129 val = Interlocked.CompareExchange<MidiVoiceMessageDelegate>(ref this.m_OnControlChange, val3, val2);
2130 }
2131 while (val != val2);
2132 }
2133 [CompilerGenerated]
2134 remove
2135 {
2136 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
2137 //IL_0016: Expected O, but got Unknown
2140 do
2141 {
2142 val2 = val;
2143 MidiVoiceMessageDelegate val3 = (MidiVoiceMessageDelegate)Delegate.Remove((Delegate)(object)val2, (Delegate)(object)value);
2144 val = Interlocked.CompareExchange<MidiVoiceMessageDelegate>(ref this.m_OnControlChange, val3, val2);
2145 }
2146 while (val != val2);
2147 }
2148 }
2149
2150 public static IVRCMidiInput OpenMidiInput<T>(string deviceName = null) where T : IVRCMidiInput, new()
2151 {
2152 T val = new T();
2153 if (((IVRCMidiInput)val).OpenDevice(deviceName))
2154 {
2155 Log(String.Concat("Opened Midi Device ", ((IVRCMidiInput)val).Name));
2156 }
2157 else
2158 {
2159 Log(String.Concat("Could Not Open Midi Device ", deviceName));
2160 }
2161 return (IVRCMidiInput)(object)val;
2162 }
2163
2164 private void SendMidiMessage(object sender, MidiVoiceEventArgs args)
2165 {
2166 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
2167 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
2168 //IL_0040: Unknown result type (might be due to invalid IL or missing references)
2169 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
2170 //IL_0039: Unknown result type (might be due to invalid IL or missing references)
2171 //IL_0059: Unknown result type (might be due to invalid IL or missing references)
2172 if (args.command == 144)
2173 {
2174 MidiVoiceMessageDelegate onNoteOn = this.OnNoteOn;
2175 if (onNoteOn != null)
2176 {
2177 onNoteOn.Invoke((object)this, args);
2178 }
2179 }
2180 else if (args.command == 128)
2181 {
2182 MidiVoiceMessageDelegate onNoteOff = this.OnNoteOff;
2183 if (onNoteOff != null)
2184 {
2185 onNoteOff.Invoke((object)this, args);
2186 }
2187 }
2188 else if (args.command == 176)
2189 {
2190 MidiVoiceMessageDelegate onControlChange = this.OnControlChange;
2191 if (onControlChange != null)
2192 {
2193 onControlChange.Invoke((object)this, args);
2194 }
2195 }
2196 }
2197
2198 private void Update()
2199 {
2200 IVRCMidiInput midiIn = MidiIn;
2201 if (midiIn != null)
2202 {
2203 midiIn.Update();
2204 }
2205 }
2206
2207 private void OnDestroy()
2208 {
2209 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
2210 //IL_001f: Expected O, but got Unknown
2211 if (_midiIn != null)
2212 {
2213 _midiIn.OnMidiVoiceMessage -= new MidiVoiceMessageDelegate(SendMidiMessage);
2214 _midiIn.Close();
2215 _midiIn = null;
2216 }
2217 _instance = null;
2218 }
2219
2220 private static void Log(string message)
2221 {
2222 OnLog?.Invoke(message);
2223 }
2224 }
2225 [AddComponentMenu("VRChat/Midi/VRC Midi Listener")]
2226 public class VRCMidiListener : MonoBehaviour
2227 {
2228 [Flags]
2229 public enum MidiEvents : Enum
2230 {
2231 NoteOn = 1,
2232 NoteOff = 2,
2233 CC = 4
2234 }
2235
2236 private VRCMidiHandler _plugin;
2237
2238 private readonly ValueTuple<string, object>[] argsArray = new ValueTuple<string, object>[3];
2239
2240 [SerializeField]
2242
2243 [EnumFlag]
2245
2246 private void OnEnable()
2247 {
2248 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
2249 //IL_002c: Expected O, but got Unknown
2250 //IL_0043: Unknown result type (might be due to invalid IL or missing references)
2251 //IL_004d: Expected O, but got Unknown
2252 //IL_0064: Unknown result type (might be due to invalid IL or missing references)
2253 //IL_006e: Expected O, but got Unknown
2254 _plugin = VRCMidiHandler.Instance;
2255 if ((activeEvents & MidiEvents.NoteOn) != 0)
2256 {
2257 _plugin.OnNoteOn += new MidiVoiceMessageDelegate(NoteOn);
2258 }
2259 if ((activeEvents & MidiEvents.NoteOff) != 0)
2260 {
2261 _plugin.OnNoteOff += new MidiVoiceMessageDelegate(NoteOff);
2262 }
2263 if ((activeEvents & MidiEvents.CC) != 0)
2264 {
2265 _plugin.OnControlChange += new MidiVoiceMessageDelegate(ControlChange);
2266 }
2267 }
2268
2269 private void NoteOn(object sender, MidiVoiceEventArgs args)
2270 {
2271 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
2272 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
2273 //IL_002a: Unknown result type (might be due to invalid IL or missing references)
2274 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
2275 //IL_0046: Unknown result type (might be due to invalid IL or missing references)
2276 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
2277 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
2278 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
2279 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
2280 if ((Object)(object)behaviour != (Object)null)
2281 {
2282 argsArray[0] = new ValueTuple<string, object>("channel", (object)args.channel);
2283 argsArray[1] = new ValueTuple<string, object>("number", (object)args.number);
2284 argsArray[2] = new ValueTuple<string, object>("velocity", (object)args.value);
2285 behaviour.RunEvent("_midiNoteOn", argsArray);
2286 }
2287 }
2288
2289 private void NoteOff(object sender, MidiVoiceEventArgs args)
2290 {
2291 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
2292 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
2293 //IL_002a: Unknown result type (might be due to invalid IL or missing references)
2294 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
2295 //IL_0046: Unknown result type (might be due to invalid IL or missing references)
2296 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
2297 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
2298 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
2299 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
2300 if ((Object)(object)behaviour != (Object)null)
2301 {
2302 argsArray[0] = new ValueTuple<string, object>("channel", (object)args.channel);
2303 argsArray[1] = new ValueTuple<string, object>("number", (object)args.number);
2304 argsArray[2] = new ValueTuple<string, object>("velocity", (object)args.value);
2305 behaviour.RunEvent("_midiNoteOff", argsArray);
2306 }
2307 }
2308
2309 private void ControlChange(object sender, MidiVoiceEventArgs args)
2310 {
2311 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
2312 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
2313 //IL_002a: Unknown result type (might be due to invalid IL or missing references)
2314 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
2315 //IL_0046: Unknown result type (might be due to invalid IL or missing references)
2316 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
2317 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
2318 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
2319 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
2320 if ((Object)(object)behaviour != (Object)null)
2321 {
2322 argsArray[0] = new ValueTuple<string, object>("channel", (object)args.channel);
2323 argsArray[1] = new ValueTuple<string, object>("number", (object)args.number);
2324 argsArray[2] = new ValueTuple<string, object>("value", (object)args.value);
2325 behaviour.RunEvent("_midiControlChange", argsArray);
2326 }
2327 }
2328
2329 private void OnDisable()
2330 {
2331 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
2332 //IL_0021: Expected O, but got Unknown
2333 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
2334 //IL_0042: Expected O, but got Unknown
2335 //IL_0059: Unknown result type (might be due to invalid IL or missing references)
2336 //IL_0063: Expected O, but got Unknown
2337 if ((activeEvents & MidiEvents.NoteOn) != 0)
2338 {
2339 _plugin.OnNoteOn -= new MidiVoiceMessageDelegate(NoteOn);
2340 }
2341 if ((activeEvents & MidiEvents.NoteOff) != 0)
2342 {
2343 _plugin.OnNoteOff -= new MidiVoiceMessageDelegate(NoteOff);
2344 }
2345 if ((activeEvents & MidiEvents.CC) != 0)
2346 {
2347 _plugin.OnControlChange -= new MidiVoiceMessageDelegate(ControlChange);
2348 }
2349 }
2350 }
2351}
2353{
2354 public interface IVRCStringDownload
2355 {
2356 string Result { get; }
2357
2358 byte[] ResultBytes { get; }
2359
2360 string Error { get; }
2361
2362 int ErrorCode { get; }
2363
2364 VRCUrl Url { get; }
2365
2366 IUdonEventReceiver UdonBehaviour { get; }
2367
2368 [ExcludeFromUdonWrapper]
2370
2371 [ExcludeFromUdonWrapper]
2373 }
2374 public class MaxBufferDownloadHandler : DownloadHandlerScript
2375 {
2376 private int _max;
2377
2378 private int _current;
2379
2380 private List<byte> _buffer = new List<byte>();
2381
2382 public bool lengthFail;
2383
2384 private string _convertedText;
2385
2386 public byte[] downloadedBytes => _buffer.ToArray();
2387
2388 public string downloadedText => _convertedText ?? (_convertedText = Encoding.UTF8.GetString(downloadedBytes));
2389
2391 {
2392 _max = max;
2393 }
2394
2395 public MaxBufferDownloadHandler(int max, byte[] buffer)
2396 : base(buffer)
2397 {
2398 _max = max;
2399 }
2400
2401 protected override void ReceiveContentLengthHeader(ulong contentLength)
2402 {
2403 lengthFail = contentLength > (ulong)_max;
2404 if (!lengthFail)
2405 {
2406 _buffer.Capacity = (int)contentLength;
2407 }
2408 }
2409
2410 protected override bool ReceiveData(byte[] data, int dataLength)
2411 {
2412 _current += dataLength;
2413 if (_current > _max || lengthFail)
2414 {
2415 return false;
2416 }
2417 for (int i = 0; i < dataLength; i++)
2418 {
2419 _buffer.Add(data[i]);
2420 }
2421 return ((DownloadHandler)this).ReceiveData(data, dataLength);
2422 }
2423 }
2425 {
2426 [StructLayout(3)]
2427 [CompilerGenerated]
2428 private struct <StartAtCorrectTime>d__33 : ValueType, IAsyncStateMachine
2429 {
2430 public int <>1__state;
2431
2432 public AsyncUniTaskMethodBuilder <>t__builder;
2433
2434 public CancellationToken cancellationToken;
2435
2436 public VRCStringDownload <>4__this;
2437
2438 private Awaiter <>u__1;
2439
2440 private void MoveNext()
2441 {
2442 //IL_011f: Expected O, but got Unknown
2443 //IL_0075: Unknown result type (might be due to invalid IL or missing references)
2444 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
2445 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
2446 //IL_0035: Unknown result type (might be due to invalid IL or missing references)
2447 //IL_003a: Unknown result type (might be due to invalid IL or missing references)
2448 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
2449 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
2450 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
2451 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
2452 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
2453 int num = <>1__state;
2454 VRCStringDownload CS$<>8__locals0 = <>4__this;
2455 try
2456 {
2457 try
2458 {
2459 Awaiter awaiter;
2460 if (num != 0)
2461 {
2462 UniTask val = UniTask.WaitWhile((Func<bool>)(() => Time.realtimeSinceStartup - _lastStringRequest < 5f), (PlayerLoopTiming)8, cancellationToken);
2463 awaiter = ((UniTask)(ref val)).GetAwaiter();
2464 if (!((Awaiter)(ref awaiter)).IsCompleted)
2465 {
2466 num = (<>1__state = 0);
2467 <>u__1 = awaiter;
2468 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <StartAtCorrectTime>d__33>(ref awaiter, ref this);
2469 return;
2470 }
2471 }
2472 else
2473 {
2474 awaiter = <>u__1;
2475 <>u__1 = default(Awaiter);
2476 num = (<>1__state = -1);
2477 }
2478 ((Awaiter)(ref awaiter)).GetResult();
2479 _lastStringRequest = Time.realtimeSinceStartup;
2480 UnityWebRequest.ClearCookieCache(CS$<>8__locals0._webRequest.uri);
2481 CS$<>8__locals0._asyncOperation = CS$<>8__locals0._webRequest.SendWebRequest();
2482 ((AsyncOperation)CS$<>8__locals0._asyncOperation).completed += [CompilerGenerated] (AsyncOperation _) =>
2483 {
2484 CS$<>8__locals0.CompletedRequest();
2485 };
2486 }
2487 catch (OperationCanceledException)
2488 {
2489 UnityWebRequest webRequest = CS$<>8__locals0._webRequest;
2490 if (webRequest != null)
2491 {
2492 webRequest.Dispose();
2493 }
2494 CS$<>8__locals0._webRequest = null;
2495 CS$<>8__locals0._asyncOperation = null;
2496 CancellationTokenSource cancellationTokenSource = CS$<>8__locals0._cancellationTokenSource;
2497 if (cancellationTokenSource != null)
2498 {
2499 cancellationTokenSource.Dispose();
2500 }
2501 CS$<>8__locals0._cancellationTokenSource = null;
2502 VRCStringDownloader.RemoveFromManager(CS$<>8__locals0);
2503 }
2504 }
2505 catch (Exception val3)
2506 {
2507 Exception exception = val3;
2508 <>1__state = -2;
2509 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
2510 return;
2511 }
2512 <>1__state = -2;
2513 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
2514 }
2515
2516 [DebuggerHidden]
2517 private void SetStateMachine(IAsyncStateMachine stateMachine)
2518 {
2519 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
2520 }
2521 }
2522
2523 private const float MINIMUM_DELAY_BETWEEN_REQUESTS = 5f;
2524
2525 private const int MAXIMUM_DOWNLOAD_SIZE_MB = 104857600;
2526
2527 private static float _lastStringRequest = -5f;
2528
2529 private UnityWebRequest _webRequest;
2530
2531 private MaxBufferDownloadHandler _DownloadHandler;
2532
2533 private UnityWebRequestAsyncOperation _asyncOperation;
2534
2535 protected CancellationTokenSource _cancellationTokenSource;
2536
2537 [field: CompilerGenerated]
2538 public string Result
2539 {
2540 [CompilerGenerated]
2541 get;
2542 [CompilerGenerated]
2543 private set;
2544 }
2545
2546 [field: CompilerGenerated]
2547 public byte[] ResultBytes
2548 {
2549 [CompilerGenerated]
2550 get;
2551 [CompilerGenerated]
2552 private set;
2553 }
2554
2555 [field: CompilerGenerated]
2556 public string Error
2557 {
2558 [CompilerGenerated]
2559 get;
2560 [CompilerGenerated]
2561 private set;
2562 }
2563
2564 [field: CompilerGenerated]
2565 public int ErrorCode
2566 {
2567 [CompilerGenerated]
2568 get;
2569 [CompilerGenerated]
2570 private set;
2571 }
2572
2573 [field: CompilerGenerated]
2575 {
2576 [CompilerGenerated]
2577 get;
2578 [CompilerGenerated]
2579 private set;
2580 }
2581
2582 [field: CompilerGenerated]
2583 public IUdonEventReceiver UdonBehaviour
2584 {
2585 [CompilerGenerated]
2586 get;
2587 [CompilerGenerated]
2588 private set;
2589 }
2590
2591 public VRCStringDownload(VRCUrl url, IUdonEventReceiver udonbehavior)
2592 {
2593 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
2594 //IL_001f: Expected O, but got Unknown
2595 Url = url;
2596 UdonBehaviour = udonbehavior;
2597 _cancellationTokenSource = new CancellationTokenSource();
2598 }
2599
2600 public void StartDownload()
2601 {
2602 //IL_0077: Unknown result type (might be due to invalid IL or missing references)
2603 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
2604 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
2605 //IL_004d: Expected O, but got Unknown
2606 //IL_00e0: Unknown result type (might be due to invalid IL or missing references)
2607 //IL_0103: Unknown result type (might be due to invalid IL or missing references)
2608 //IL_010d: Expected O, but got Unknown
2609 //IL_0141: Unknown result type (might be due to invalid IL or missing references)
2610 //IL_0146: Unknown result type (might be due to invalid IL or missing references)
2612 {
2613 ErrorCode = 429;
2614 Error = "Client has too many requests (limit is 1000).";
2615 UdonBehaviour.RunEvent<VRCStringDownload>("_onStringLoadError", new ValueTuple<string, VRCStringDownload>("IVRCStringDownload", this));
2616 return;
2617 }
2618 Uri val;
2619 try
2620 {
2621 val = new Uri(Url.Get());
2622 }
2623 catch (Exception)
2624 {
2625 ErrorCode = 400;
2626 Error = "Invalid URL";
2627 UdonBehaviour.RunEvent<VRCStringDownload>("_onStringLoadError", new ValueTuple<string, VRCStringDownload>("IVRCStringDownload", this));
2629 return;
2630 }
2631 if (!val.IsAbsoluteUri || (val.Scheme != Uri.UriSchemeHttps && val.Scheme != Uri.UriSchemeHttp))
2632 {
2633 ErrorCode = 400;
2634 Error = "Strings may only be downloaded from HTTP(S) URLs.";
2635 UdonBehaviour.RunEvent<VRCStringDownload>("_onStringLoadError", new ValueTuple<string, VRCStringDownload>("IVRCStringDownload", this));
2637 }
2638 else
2639 {
2640 _webRequest = new UnityWebRequest(Url.Get(), "GET");
2641 _webRequest.redirectLimit = 0;
2642 _DownloadHandler = new MaxBufferDownloadHandler(104857600);
2643 _webRequest.downloadHandler = (DownloadHandler)(object)_DownloadHandler;
2644 UniTaskExtensions.Forget(StartAtCorrectTime(_cancellationTokenSource.Token));
2645 }
2646 }
2647
2648 [AsyncStateMachine(/*Could not decode attribute arguments.*/)]
2649 private UniTask StartAtCorrectTime(CancellationToken cancellationToken)
2650 {
2651 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
2652 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
2653 //IL_0016: Unknown result type (might be due to invalid IL or missing references)
2654 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
2655 //IL_0039: Unknown result type (might be due to invalid IL or missing references)
2656 <StartAtCorrectTime>d__33 <StartAtCorrectTime>d__ = default(<StartAtCorrectTime>d__33);
2657 <StartAtCorrectTime>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
2658 <StartAtCorrectTime>d__.<>4__this = this;
2659 <StartAtCorrectTime>d__.cancellationToken = cancellationToken;
2660 <StartAtCorrectTime>d__.<>1__state = -1;
2661 ((AsyncUniTaskMethodBuilder)(ref <StartAtCorrectTime>d__.<>t__builder)).Start<<StartAtCorrectTime>d__33>(ref <StartAtCorrectTime>d__);
2662 return ((AsyncUniTaskMethodBuilder)(ref <StartAtCorrectTime>d__.<>t__builder)).Task;
2663 }
2664
2665 private void CompletedRequest()
2666 {
2667 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
2668 //IL_0015: Invalid comparison between Unknown and I4
2669 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
2670 //IL_0023: Invalid comparison between Unknown and I4
2671 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
2672 //IL_0079: Unknown result type (might be due to invalid IL or missing references)
2673 if (_webRequest == null)
2674 {
2675 return;
2676 }
2677 if ((int)_webRequest.result != 2 && (int)_webRequest.result != 3 && !_DownloadHandler.lengthFail)
2678 {
2679 Result = ((MaxBufferDownloadHandler)(object)_webRequest.downloadHandler).downloadedText;
2680 ResultBytes = ((MaxBufferDownloadHandler)(object)_webRequest.downloadHandler).downloadedBytes;
2681 UdonBehaviour.RunEvent<VRCStringDownload>("_onStringLoadSuccess", new ValueTuple<string, VRCStringDownload>("IVRCStringDownload", this));
2682 }
2683 else
2684 {
2685 if (_DownloadHandler.lengthFail)
2686 {
2687 ErrorCode = 413;
2688 Error = String.Format("Content longer than {0}MB", (object)100);
2689 }
2690 else
2691 {
2692 Error = _webRequest.error;
2693 ErrorCode = (int)_webRequest.responseCode;
2694 }
2695 UdonBehaviour.RunEvent<VRCStringDownload>("_onStringLoadError", new ValueTuple<string, VRCStringDownload>("IVRCStringDownload", this));
2696 }
2697 UnityWebRequest webRequest = _webRequest;
2698 if (webRequest != null)
2699 {
2700 webRequest.Dispose();
2701 }
2702 _webRequest = null;
2703 _asyncOperation = null;
2704 CancellationTokenSource cancellationTokenSource = _cancellationTokenSource;
2705 if (cancellationTokenSource != null)
2706 {
2707 cancellationTokenSource.Dispose();
2708 }
2709 _cancellationTokenSource = null;
2711 }
2712
2713 public void CancelDownload()
2714 {
2715 UnityWebRequest webRequest = _webRequest;
2716 if (webRequest != null)
2717 {
2718 webRequest.Abort();
2719 }
2720 UnityWebRequest webRequest2 = _webRequest;
2721 if (webRequest2 != null)
2722 {
2723 webRequest2.Dispose();
2724 }
2725 _webRequest = null;
2726 _asyncOperation = null;
2727 CancellationTokenSource cancellationTokenSource = _cancellationTokenSource;
2728 if (cancellationTokenSource != null)
2729 {
2730 cancellationTokenSource.Cancel();
2731 }
2732 CancellationTokenSource cancellationTokenSource2 = _cancellationTokenSource;
2733 if (cancellationTokenSource2 != null)
2734 {
2735 cancellationTokenSource2.Dispose();
2736 }
2737 _cancellationTokenSource = null;
2739 }
2740 }
2741 public static class VRCStringDownloader : Object
2742 {
2743 private static List<IVRCStringDownload> _stringDownloads = new List<IVRCStringDownload>();
2744
2745 [ExcludeFromUdonWrapper]
2746 [field: CompilerGenerated]
2747 public static Action<VRCUrl, IUdonEventReceiver> StartDownload
2748 {
2749 [CompilerGenerated]
2750 get;
2751 [CompilerGenerated]
2752 set;
2753 } = LoadUrlInternal;
2754
2755
2756 public static void LoadUrl(VRCUrl url, IUdonEventReceiver udonBehaviour = null)
2757 {
2758 StartDownload.Invoke(url, udonBehaviour);
2759 }
2760
2761 [ExcludeFromUdonWrapper]
2762 private static void LoadUrlInternal(VRCUrl url, IUdonEventReceiver udonBehaviour)
2763 {
2764 new VRCStringDownload(url, udonBehaviour).StartDownload();
2765 }
2766
2767 [ExcludeFromUdonWrapper]
2768 public static bool AddToManager(IVRCStringDownload download)
2769 {
2770 if (_stringDownloads.Count < 1000)
2771 {
2772 _stringDownloads.Add(download);
2773 return true;
2774 }
2775 return false;
2776 }
2777
2778 [ExcludeFromUdonWrapper]
2779 public static void RemoveFromManager(IVRCStringDownload download)
2780 {
2781 _stringDownloads.Remove(download);
2782 }
2783
2784 [ExcludeFromUdonWrapper]
2785 public static void ClearQueue()
2786 {
2787 Debug.Log((object)"[String Download] Clearing string download queue");
2788 for (int num = _stringDownloads.Count - 1; num >= 0; num--)
2789 {
2790 _stringDownloads[num].CancelDownload();
2791 }
2792 _stringDownloads.Clear();
2793 }
2794 }
2795}
2797{
2798 [PublicAPI]
2799 public interface IVRCImageDownload : IDisposable
2800 {
2802
2804
2805 string ErrorMessage { get; }
2806
2807 Texture2D Result { get; }
2808
2810
2811 float Progress { get; }
2812
2813 VRCUrl Url { get; }
2814
2816
2817 IUdonEventReceiver UdonBehaviour { get; }
2818
2820
2821 [ExcludeFromUdonWrapper]
2823
2824 [ExcludeFromUdonWrapper]
2826 }
2827 [Serializable]
2828 public class TextureInfo : Object
2829 {
2830 public TextureWrapMode WrapModeU;
2831
2832 public TextureWrapMode WrapModeV;
2833
2834 public TextureWrapMode WrapModeW;
2835
2837
2838 public int AnisoLevel = 9;
2839
2840 public string MaterialProperty = "_MainTex";
2841
2842 public bool GenerateMipMaps;
2843 }
2844 [PublicAPI]
2845 public sealed class VRCImageDownloader : Object, IDisposable
2846 {
2847 public class ImageDownloader : Object, IVRCImageDownload, IDisposable
2848 {
2849 [PublicAPI]
2850 public enum ImageError : Enum
2851 {
2852 Unknown,
2853 MaximumDimensionExceeded,
2854 LoadFailure,
2855 DecodeFailure,
2856 IoError,
2857 LimitsExceeded,
2858 UnsupportedOperation,
2859 UnknownFormat,
2860 OutputBufferTooSmall,
2861 Panic,
2862 UnsupportedLimits,
2863 MemoryLimitExceeded,
2864 BadDecoderParameters
2865 }
2866
2867 [PublicAPI]
2868 public enum ImageFormat : Enum
2869 {
2870 Unknown,
2871 R8,
2872 RG16,
2873 RGB24,
2874 RGBA32,
2875 R16,
2876 RG32,
2877 RGB48,
2878 RGBA64,
2879 RGBAFloat
2880 }
2881
2882 [Serializable]
2883 public struct ImageInfo : ValueType
2884 {
2885 public uint width;
2886
2887 public uint height;
2888
2890 }
2891
2892 [Serializable]
2893 public struct ImageResult : ValueType
2894 {
2895 public byte success;
2896
2898
2900 }
2901
2902 [Flags]
2903 public enum ImageLoadSettingsFlags : Enum
2904 {
2905 None = 0u,
2906 LimitAllocation = 1u,
2907 LimitResolution = 2u,
2908 VerticalFlip = 4u,
2909 OverrideOutputFormat = 8u,
2910 ResizeOutput = 0x10u,
2911 FastResize = 0x20u,
2912 GenerateMipMaps = 0x40u
2913 }
2914
2915 [Serializable]
2916 public readonly struct ImageLoadSettings : ValueType
2917 {
2918 private readonly ImageLoadSettingsFlags _flags;
2919
2920 private readonly uint _allocationLimit;
2921
2922 private readonly uint _resolutionLimit;
2923
2924 private readonly uint _targetWidth;
2925
2926 private readonly uint _targetHeight;
2927
2928 private readonly ImageFormat _outputFormatOverride;
2929
2930 private ImageLoadSettings(ImageLoadSettingsFlags flags, uint allocationLimit, uint resolutionLimit, uint targetWidth, uint targetHeight, ImageFormat outputFormatOverride)
2931 {
2932 _flags = flags;
2933 _allocationLimit = allocationLimit;
2934 _resolutionLimit = resolutionLimit;
2935 _targetWidth = targetWidth;
2936 _targetHeight = targetHeight;
2937 _outputFormatOverride = outputFormatOverride;
2938 }
2939
2940 public Nullable<uint> GetAllocationLimit()
2941 {
2942 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
2943 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
2944 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
2945 if (!HasFlag(ImageLoadSettingsFlags.LimitAllocation))
2946 {
2947 return default(Nullable<uint>);
2948 }
2949 return new Nullable<uint>(_allocationLimit);
2950 }
2951
2952 public ImageLoadSettings SetAllocationLimit(Nullable<uint> allocationLimit)
2953 {
2954 return new ImageLoadSettings(allocationLimit.HasValue ? (_flags | ImageLoadSettingsFlags.LimitAllocation) : (_flags & ~ImageLoadSettingsFlags.LimitAllocation), allocationLimit.GetValueOrDefault(), _resolutionLimit, _targetWidth, _targetHeight, _outputFormatOverride);
2955 }
2956
2957 public Nullable<uint> GetResolutionLimit()
2958 {
2959 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
2960 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
2961 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
2962 if (!HasFlag(ImageLoadSettingsFlags.LimitResolution))
2963 {
2964 return default(Nullable<uint>);
2965 }
2966 return new Nullable<uint>(_resolutionLimit);
2967 }
2968
2969 public ImageLoadSettings SetResolutionLimit(Nullable<uint> resolutionLimit)
2970 {
2971 return new ImageLoadSettings(resolutionLimit.HasValue ? (_flags | ImageLoadSettingsFlags.LimitResolution) : (_flags & ~ImageLoadSettingsFlags.LimitResolution), _allocationLimit, resolutionLimit.GetValueOrDefault(), _targetWidth, _targetHeight, _outputFormatOverride);
2972 }
2973
2974 public bool GetVerticalFlip()
2975 {
2976 return HasFlag(ImageLoadSettingsFlags.VerticalFlip);
2977 }
2978
2980 {
2981 return new ImageLoadSettings(flip ? (_flags | ImageLoadSettingsFlags.VerticalFlip) : (_flags & ~ImageLoadSettingsFlags.VerticalFlip), _allocationLimit, _resolutionLimit, _targetWidth, _targetHeight, _outputFormatOverride);
2982 }
2983
2984 public Nullable<ValueTuple<uint, uint>> GetResizeResolution()
2985 {
2986 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
2987 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
2988 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
2989 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
2990 if (!HasFlag(ImageLoadSettingsFlags.ResizeOutput))
2991 {
2992 return default(Nullable<ValueTuple<uint, uint>>);
2993 }
2994 return new Nullable<ValueTuple<uint, uint>>(new ValueTuple<uint, uint>(_targetWidth, _targetHeight));
2995 }
2996
2997 public ImageLoadSettings SetResizeResolution(Nullable<ValueTuple<uint, uint>> targetResolution)
2998 {
2999 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
3000 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
3001 return new ImageLoadSettings(targetResolution.HasValue ? (_flags | ImageLoadSettingsFlags.ResizeOutput) : (_flags & ~ImageLoadSettingsFlags.ResizeOutput), _allocationLimit, _resolutionLimit, targetResolution.GetValueOrDefault().Item1, targetResolution.GetValueOrDefault().Item2, _outputFormatOverride);
3002 }
3003
3005 {
3006 return new ImageLoadSettings(fast ? (_flags | ImageLoadSettingsFlags.FastResize) : (_flags & ~ImageLoadSettingsFlags.FastResize), _allocationLimit, _resolutionLimit, _targetWidth, _targetHeight, _outputFormatOverride);
3007 }
3008
3009 public bool GetFastResize()
3010 {
3011 return HasFlag(ImageLoadSettingsFlags.FastResize);
3012 }
3013
3014 public Nullable<ImageFormat> GetOutputFormatOverride()
3015 {
3016 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
3017 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
3018 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
3019 if (!HasFlag(ImageLoadSettingsFlags.OverrideOutputFormat))
3020 {
3021 return default(Nullable<ImageFormat>);
3022 }
3023 return new Nullable<ImageFormat>(_outputFormatOverride);
3024 }
3025
3026 public ImageLoadSettings SetOutputFormatOverride(Nullable<ImageFormat> outputFormatOverride)
3027 {
3028 return new ImageLoadSettings(outputFormatOverride.HasValue ? (_flags | ImageLoadSettingsFlags.OverrideOutputFormat) : (_flags & ~ImageLoadSettingsFlags.OverrideOutputFormat), _allocationLimit, _resolutionLimit, _targetWidth, _targetHeight, outputFormatOverride.GetValueOrDefault());
3029 }
3030
3032 {
3033 return new ImageLoadSettings(enable ? (_flags | ImageLoadSettingsFlags.GenerateMipMaps) : (_flags & ~ImageLoadSettingsFlags.GenerateMipMaps), _allocationLimit, _resolutionLimit, _targetWidth, _targetHeight, _outputFormatOverride);
3034 }
3035
3037 {
3038 return HasFlag(ImageLoadSettingsFlags.GenerateMipMaps);
3039 }
3040
3042 {
3043 return (_flags & flag) != 0;
3044 }
3045 }
3046
3047 [StructLayout(3)]
3048 [CompilerGenerated]
3049 private struct <<Dispose>g__DestroyAsync|53_0>d : ValueType, IAsyncStateMachine
3050 {
3051 public int <>1__state;
3052
3053 public AsyncUniTaskVoidMethodBuilder <>t__builder;
3054
3055 public Object obj;
3056
3057 private Awaiter <>u__1;
3058
3059 private void MoveNext()
3060 {
3061 //IL_009e: Expected O, but got Unknown
3062 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
3063 //IL_0050: Unknown result type (might be due to invalid IL or missing references)
3064 //IL_0057: Unknown result type (might be due to invalid IL or missing references)
3065 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
3066 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
3067 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
3068 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
3069 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
3070 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
3071 //IL_0034: Unknown result type (might be due to invalid IL or missing references)
3072 //IL_0035: Unknown result type (might be due to invalid IL or missing references)
3073 int num = <>1__state;
3074 try
3075 {
3076 Awaiter awaiter;
3077 if (num != 0)
3078 {
3079 SwitchToMainThreadAwaitable val = UniTask.SwitchToMainThread(default(CancellationToken));
3080 awaiter = ((SwitchToMainThreadAwaitable)(ref val)).GetAwaiter();
3081 if (!((Awaiter)(ref awaiter)).IsCompleted)
3082 {
3083 num = (<>1__state = 0);
3084 <>u__1 = awaiter;
3085 ((AsyncUniTaskVoidMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <<Dispose>g__DestroyAsync|53_0>d>(ref awaiter, ref this);
3086 return;
3087 }
3088 }
3089 else
3090 {
3091 awaiter = <>u__1;
3092 <>u__1 = default(Awaiter);
3093 num = (<>1__state = -1);
3094 }
3095 ((Awaiter)(ref awaiter)).GetResult();
3096 if (obj != (Object)null)
3097 {
3098 if (Application.isPlaying)
3099 {
3100 Object.Destroy(obj);
3101 }
3102 else
3103 {
3104 Object.DestroyImmediate(obj);
3105 }
3106 }
3107 }
3108 catch (Exception val2)
3109 {
3110 Exception exception = val2;
3111 <>1__state = -2;
3112 ((AsyncUniTaskVoidMethodBuilder)(ref <>t__builder)).SetException(exception);
3113 return;
3114 }
3115 <>1__state = -2;
3116 ((AsyncUniTaskVoidMethodBuilder)(ref <>t__builder)).SetResult();
3117 }
3118
3119 [DebuggerHidden]
3120 private void SetStateMachine(IAsyncStateMachine stateMachine)
3121 {
3122 ((AsyncUniTaskVoidMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
3123 }
3124 }
3125
3126 [StructLayout(3)]
3127 [CompilerGenerated]
3128 private struct <<DownloadImage>g__SlicedTextureUpload|51_0>d : ValueType, IAsyncStateMachine
3129 {
3130 public int <>1__state;
3131
3132 public AsyncUniTaskMethodBuilder <>t__builder;
3133
3134 public int width;
3135
3136 public int bytesPerPixel;
3137
3138 public int height;
3139
3140 public TextureFormat format;
3141
3142 public NativeSlice<byte> outputBuffer;
3143
3144 public Texture2D outputTexture;
3145
3146 public int mipLevel;
3147
3148 private int <sliceHeight>5__2;
3149
3150 private Texture2D <sliceTexture>5__3;
3151
3152 private Texture2D <uploadTexture>5__4;
3153
3154 private Awaiter <>u__1;
3155
3156 private int <sliceCount>5__5;
3157
3158 private int <bytesPerRow>5__6;
3159
3160 private int <sliceIndex>5__7;
3161
3162 private unsafe void MoveNext()
3163 {
3164 //IL_031a: Expected O, but got Unknown
3165 //IL_0109: Unknown result type (might be due to invalid IL or missing references)
3166 //IL_010e: Unknown result type (might be due to invalid IL or missing references)
3167 //IL_0115: Unknown result type (might be due to invalid IL or missing references)
3168 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
3169 //IL_0071: Unknown result type (might be due to invalid IL or missing references)
3170 //IL_0078: Unknown result type (might be due to invalid IL or missing references)
3171 //IL_0080: Unknown result type (might be due to invalid IL or missing references)
3172 //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
3173 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
3174 //IL_00d6: Unknown result type (might be due to invalid IL or missing references)
3175 //IL_00db: Unknown result type (might be due to invalid IL or missing references)
3176 //IL_0162: Unknown result type (might be due to invalid IL or missing references)
3177 //IL_0168: Unknown result type (might be due to invalid IL or missing references)
3178 //IL_0172: Expected O, but got Unknown
3179 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
3180 //IL_0055: Unknown result type (might be due to invalid IL or missing references)
3181 //IL_005f: Expected O, but got Unknown
3182 //IL_00ef: Unknown result type (might be due to invalid IL or missing references)
3183 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
3184 //IL_02ab: Unknown result type (might be due to invalid IL or missing references)
3185 //IL_02b0: Unknown result type (might be due to invalid IL or missing references)
3186 //IL_02b7: Unknown result type (might be due to invalid IL or missing references)
3187 //IL_01fd: Unknown result type (might be due to invalid IL or missing references)
3188 //IL_0206: Unknown result type (might be due to invalid IL or missing references)
3189 //IL_020b: Unknown result type (might be due to invalid IL or missing references)
3190 //IL_0213: Unknown result type (might be due to invalid IL or missing references)
3191 //IL_0226: Unknown result type (might be due to invalid IL or missing references)
3192 //IL_026f: Unknown result type (might be due to invalid IL or missing references)
3193 //IL_0274: Unknown result type (might be due to invalid IL or missing references)
3194 //IL_0278: Unknown result type (might be due to invalid IL or missing references)
3195 //IL_027d: Unknown result type (might be due to invalid IL or missing references)
3196 //IL_0291: Unknown result type (might be due to invalid IL or missing references)
3197 //IL_0292: Unknown result type (might be due to invalid IL or missing references)
3198 int num = <>1__state;
3199 try
3200 {
3201 if (num == 0)
3202 {
3203 goto IL_0060;
3204 }
3205 if (num != 1)
3206 {
3207 <sliceHeight>5__2 = Mathf.CeilToInt(1048576f / (float)(width * bytesPerPixel));
3208 if (<sliceHeight>5__2 >= height)
3209 {
3210 <uploadTexture>5__4 = new Texture2D(width, height, format, false);
3211 goto IL_0060;
3212 }
3213 <sliceTexture>5__3 = new Texture2D(width, <sliceHeight>5__2, format, false);
3214 }
3215 Awaiter awaiter;
3216 YieldAwaitable val2;
3217 try
3218 {
3219 if (num != 1)
3220 {
3221 <sliceCount>5__5 = Mathf.CeilToInt((float)height / (float)<sliceHeight>5__2);
3222 <bytesPerRow>5__6 = width * bytesPerPixel;
3223 <sliceIndex>5__7 = 0;
3224 goto IL_02df;
3225 }
3226 awaiter = <>u__1;
3227 <>u__1 = default(Awaiter);
3228 num = (<>1__state = -1);
3229 goto IL_02c6;
3230 IL_02c6:
3231 ((Awaiter)(ref awaiter)).GetResult();
3232 <sliceIndex>5__7++;
3233 goto IL_02df;
3234 IL_02df:
3235 if (<sliceIndex>5__7 < <sliceCount>5__5)
3236 {
3237 int num2 = <sliceIndex>5__7 * <sliceHeight>5__2;
3238 int num3 = ((num2 + <sliceHeight>5__2 < height) ? <sliceHeight>5__2 : (height - num2));
3239 int num4 = num2 * <bytesPerRow>5__6;
3240 int num5 = num3 * <bytesPerRow>5__6;
3241 NativeSlice<byte> val = NativeSliceExtensions.Slice<byte>(outputBuffer, num4, num5);
3242 NativeArray<byte> rawTextureData = <sliceTexture>5__3.GetRawTextureData<byte>();
3243 int num6 = UnsafeUtility.SizeOf<byte>();
3244 UnsafeUtility.MemCpyStride(NativeArrayUnsafeUtility.GetUnsafePtr<byte>(rawTextureData), num6, NativeSliceUnsafeUtility.GetUnsafeReadOnlyPtr<byte>(val), num6, num6, val.Length);
3245 <sliceTexture>5__3.Apply();
3246 Graphics.CopyTexture((Texture)(object)<sliceTexture>5__3, 0, 0, 0, 0, width, num3, (Texture)(object)outputTexture, 0, mipLevel, 0, num2);
3247 val2 = UniTask.Yield();
3248 awaiter = ((YieldAwaitable)(ref val2)).GetAwaiter();
3249 if (!((Awaiter)(ref awaiter)).IsCompleted)
3250 {
3251 num = (<>1__state = 1);
3252 <>u__1 = awaiter;
3253 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <<DownloadImage>g__SlicedTextureUpload|51_0>d>(ref awaiter, ref this);
3254 return;
3255 }
3256 goto IL_02c6;
3257 }
3258 }
3259 finally
3260 {
3261 if (num < 0)
3262 {
3263 if (Application.isPlaying)
3264 {
3265 Object.Destroy((Object)(object)<sliceTexture>5__3);
3266 }
3267 else
3268 {
3269 Object.DestroyImmediate((Object)(object)<sliceTexture>5__3);
3270 }
3271 }
3272 }
3273 goto end_IL_0007;
3274 IL_0060:
3275 try
3276 {
3277 if (num != 0)
3278 {
3279 NativeArray<byte> rawTextureData2 = <uploadTexture>5__4.GetRawTextureData<byte>();
3280 int num7 = UnsafeUtility.SizeOf<byte>();
3281 UnsafeUtility.MemCpyStride(NativeArrayUnsafeUtility.GetUnsafePtr<byte>(rawTextureData2), num7, NativeSliceUnsafeUtility.GetUnsafeReadOnlyPtr<byte>(outputBuffer), num7, num7, rawTextureData2.Length);
3282 <uploadTexture>5__4.Apply();
3283 Graphics.CopyTexture((Texture)(object)<uploadTexture>5__4, 0, 0, 0, 0, width, height, (Texture)(object)outputTexture, 0, mipLevel, 0, 0);
3284 val2 = UniTask.Yield();
3285 awaiter = ((YieldAwaitable)(ref val2)).GetAwaiter();
3286 if (!((Awaiter)(ref awaiter)).IsCompleted)
3287 {
3288 num = (<>1__state = 0);
3289 <>u__1 = awaiter;
3290 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <<DownloadImage>g__SlicedTextureUpload|51_0>d>(ref awaiter, ref this);
3291 return;
3292 }
3293 }
3294 else
3295 {
3296 awaiter = <>u__1;
3297 <>u__1 = default(Awaiter);
3298 num = (<>1__state = -1);
3299 }
3300 ((Awaiter)(ref awaiter)).GetResult();
3301 }
3302 finally
3303 {
3304 if (num < 0)
3305 {
3306 if (Application.isPlaying)
3307 {
3308 Object.Destroy((Object)(object)<uploadTexture>5__4);
3309 }
3310 else
3311 {
3312 Object.DestroyImmediate((Object)(object)<uploadTexture>5__4);
3313 }
3314 }
3315 }
3316 end_IL_0007:;
3317 }
3318 catch (Exception val3)
3319 {
3320 Exception exception = val3;
3321 <>1__state = -2;
3322 <sliceTexture>5__3 = null;
3323 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
3324 return;
3325 }
3326 <>1__state = -2;
3327 <sliceTexture>5__3 = null;
3328 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
3329 }
3330
3331 [DebuggerHidden]
3332 private void SetStateMachine(IAsyncStateMachine stateMachine)
3333 {
3334 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
3335 }
3336 }
3337
3338 [StructLayout(3)]
3339 [CompilerGenerated]
3340 private struct <DownloadImage>d__51 : ValueType, IAsyncStateMachine
3341 {
3342 public int <>1__state;
3343
3344 public AsyncUniTaskMethodBuilder <>t__builder;
3345
3346 public CancellationToken cancellationToken;
3347
3348 public ImageDownloader <>4__this;
3349
3350 public Uri uri;
3351
3352 private object <>7__wrap1;
3353
3354 private int <>7__wrap2;
3355
3356 private NativeArray<byte> <outputBuffer>5__4;
3357
3358 private UnityWebRequest <webRequest>5__5;
3359
3360 private ReadOnly<byte> <downloadBuffer>5__6;
3361
3362 private ImageInfo <imageInfo>5__7;
3363
3364 private TextureFormat <format>5__8;
3365
3366 private int <bytesPerPixel>5__9;
3367
3368 private Texture2D <outputTexture>5__10;
3369
3370 private NativeArray<byte> <outputTextureRawData>5__11;
3371
3372 private int <mipLevelWidth>5__12;
3373
3374 private int <mipLevelHeight>5__13;
3375
3376 private NativeSlice<byte> <outputSlice>5__14;
3377
3378 private Awaiter <>u__1;
3379
3380 private Awaiter<UnityWebRequest> <>u__2;
3381
3382 private Awaiter <>u__3;
3383
3384 private Awaiter <>u__4;
3385
3386 private int <mipLevel>5__15;
3387
3388 private unsafe void MoveNext()
3389 {
3390 //IL_0b57: Expected O, but got Unknown
3391 //IL_0b6a: Expected O, but got Unknown
3392 //IL_0da0: Expected O, but got Unknown
3393 //IL_0bf7: Unknown result type (might be due to invalid IL or missing references)
3394 //IL_0bfc: Unknown result type (might be due to invalid IL or missing references)
3395 //IL_0c04: Unknown result type (might be due to invalid IL or missing references)
3396 //IL_0cc3: Unknown result type (might be due to invalid IL or missing references)
3397 //IL_0cc8: Unknown result type (might be due to invalid IL or missing references)
3398 //IL_0cd0: Unknown result type (might be due to invalid IL or missing references)
3399 //IL_0d72: Unknown result type (might be due to invalid IL or missing references)
3400 //IL_0d77: Unknown result type (might be due to invalid IL or missing references)
3401 //IL_0d7f: Unknown result type (might be due to invalid IL or missing references)
3402 //IL_0bb3: Unknown result type (might be due to invalid IL or missing references)
3403 //IL_0bb8: Unknown result type (might be due to invalid IL or missing references)
3404 //IL_0bbd: Unknown result type (might be due to invalid IL or missing references)
3405 //IL_0bc1: Unknown result type (might be due to invalid IL or missing references)
3406 //IL_0bc6: Unknown result type (might be due to invalid IL or missing references)
3407 //IL_0bdc: Unknown result type (might be due to invalid IL or missing references)
3408 //IL_0bde: Unknown result type (might be due to invalid IL or missing references)
3409 //IL_0c25: Unknown result type (might be due to invalid IL or missing references)
3410 //IL_0c2c: Expected O, but got Unknown
3411 //IL_00de: Unknown result type (might be due to invalid IL or missing references)
3412 //IL_00e3: Unknown result type (might be due to invalid IL or missing references)
3413 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
3414 //IL_0d31: Unknown result type (might be due to invalid IL or missing references)
3415 //IL_0d36: Unknown result type (might be due to invalid IL or missing references)
3416 //IL_0d3b: Unknown result type (might be due to invalid IL or missing references)
3417 //IL_0d3f: Unknown result type (might be due to invalid IL or missing references)
3418 //IL_0d44: Unknown result type (might be due to invalid IL or missing references)
3419 //IL_0c7f: Unknown result type (might be due to invalid IL or missing references)
3420 //IL_0c84: Unknown result type (might be due to invalid IL or missing references)
3421 //IL_0c89: Unknown result type (might be due to invalid IL or missing references)
3422 //IL_0c8d: Unknown result type (might be due to invalid IL or missing references)
3423 //IL_0c92: Unknown result type (might be due to invalid IL or missing references)
3424 //IL_0d5a: Unknown result type (might be due to invalid IL or missing references)
3425 //IL_0d5c: Unknown result type (might be due to invalid IL or missing references)
3426 //IL_0ca8: Unknown result type (might be due to invalid IL or missing references)
3427 //IL_0caa: Unknown result type (might be due to invalid IL or missing references)
3428 //IL_0170: Unknown result type (might be due to invalid IL or missing references)
3429 //IL_017b: Expected O, but got Unknown
3430 //IL_0176: Unknown result type (might be due to invalid IL or missing references)
3431 //IL_0180: Expected O, but got Unknown
3432 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
3433 //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
3434 //IL_00a5: Unknown result type (might be due to invalid IL or missing references)
3435 //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
3436 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
3437 //IL_0152: Unknown result type (might be due to invalid IL or missing references)
3438 //IL_0157: Unknown result type (might be due to invalid IL or missing references)
3439 //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
3440 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
3441 //IL_0229: Unknown result type (might be due to invalid IL or missing references)
3442 //IL_022e: Unknown result type (might be due to invalid IL or missing references)
3443 //IL_0236: Unknown result type (might be due to invalid IL or missing references)
3444 //IL_02da: Unknown result type (might be due to invalid IL or missing references)
3445 //IL_02df: Unknown result type (might be due to invalid IL or missing references)
3446 //IL_02e7: Unknown result type (might be due to invalid IL or missing references)
3447 //IL_03a3: Unknown result type (might be due to invalid IL or missing references)
3448 //IL_03a8: Unknown result type (might be due to invalid IL or missing references)
3449 //IL_03b0: Unknown result type (might be due to invalid IL or missing references)
3450 //IL_0409: Unknown result type (might be due to invalid IL or missing references)
3451 //IL_040e: Unknown result type (might be due to invalid IL or missing references)
3452 //IL_0416: Unknown result type (might be due to invalid IL or missing references)
3453 //IL_0524: Unknown result type (might be due to invalid IL or missing references)
3454 //IL_0529: Unknown result type (might be due to invalid IL or missing references)
3455 //IL_0531: Unknown result type (might be due to invalid IL or missing references)
3456 //IL_06b4: Unknown result type (might be due to invalid IL or missing references)
3457 //IL_06b9: Unknown result type (might be due to invalid IL or missing references)
3458 //IL_06c1: Unknown result type (might be due to invalid IL or missing references)
3459 //IL_0724: Unknown result type (might be due to invalid IL or missing references)
3460 //IL_0729: Unknown result type (might be due to invalid IL or missing references)
3461 //IL_0731: Unknown result type (might be due to invalid IL or missing references)
3462 //IL_0880: Unknown result type (might be due to invalid IL or missing references)
3463 //IL_0885: Unknown result type (might be due to invalid IL or missing references)
3464 //IL_088d: Unknown result type (might be due to invalid IL or missing references)
3465 //IL_093e: Unknown result type (might be due to invalid IL or missing references)
3466 //IL_0943: Unknown result type (might be due to invalid IL or missing references)
3467 //IL_094b: Unknown result type (might be due to invalid IL or missing references)
3468 //IL_0ac0: Unknown result type (might be due to invalid IL or missing references)
3469 //IL_0ac5: Unknown result type (might be due to invalid IL or missing references)
3470 //IL_0acd: Unknown result type (might be due to invalid IL or missing references)
3471 //IL_01e6: Unknown result type (might be due to invalid IL or missing references)
3472 //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
3473 //IL_01f0: Unknown result type (might be due to invalid IL or missing references)
3474 //IL_01f4: Unknown result type (might be due to invalid IL or missing references)
3475 //IL_01f9: Unknown result type (might be due to invalid IL or missing references)
3476 //IL_0253: Unknown result type (might be due to invalid IL or missing references)
3477 //IL_0259: Invalid comparison between Unknown and I4
3478 //IL_043a: Unknown result type (might be due to invalid IL or missing references)
3479 //IL_0464: Unknown result type (might be due to invalid IL or missing references)
3480 //IL_047f: Unknown result type (might be due to invalid IL or missing references)
3481 //IL_0767: Unknown result type (might be due to invalid IL or missing references)
3482 //IL_0777: Unknown result type (might be due to invalid IL or missing references)
3483 //IL_077c: Unknown result type (might be due to invalid IL or missing references)
3484 //IL_0792: Unknown result type (might be due to invalid IL or missing references)
3485 //IL_07a3: Unknown result type (might be due to invalid IL or missing references)
3486 //IL_07aa: Unknown result type (might be due to invalid IL or missing references)
3487 //IL_07b4: Unknown result type (might be due to invalid IL or missing references)
3488 //IL_07bb: Unknown result type (might be due to invalid IL or missing references)
3489 //IL_07c5: Unknown result type (might be due to invalid IL or missing references)
3490 //IL_07cc: Unknown result type (might be due to invalid IL or missing references)
3491 //IL_07d6: Unknown result type (might be due to invalid IL or missing references)
3492 //IL_07dd: Unknown result type (might be due to invalid IL or missing references)
3493 //IL_07ec: Expected O, but got Unknown
3494 //IL_07f3: Unknown result type (might be due to invalid IL or missing references)
3495 //IL_07f8: Unknown result type (might be due to invalid IL or missing references)
3496 //IL_0963: Unknown result type (might be due to invalid IL or missing references)
3497 //IL_097c: Unknown result type (might be due to invalid IL or missing references)
3498 //IL_0981: Unknown result type (might be due to invalid IL or missing references)
3499 //IL_020e: Unknown result type (might be due to invalid IL or missing references)
3500 //IL_0210: Unknown result type (might be due to invalid IL or missing references)
3501 //IL_0297: Unknown result type (might be due to invalid IL or missing references)
3502 //IL_029c: Unknown result type (might be due to invalid IL or missing references)
3503 //IL_02a1: Unknown result type (might be due to invalid IL or missing references)
3504 //IL_02a5: Unknown result type (might be due to invalid IL or missing references)
3505 //IL_02aa: Unknown result type (might be due to invalid IL or missing references)
3506 //IL_0261: Unknown result type (might be due to invalid IL or missing references)
3507 //IL_0267: Invalid comparison between Unknown and I4
3508 //IL_04e1: Unknown result type (might be due to invalid IL or missing references)
3509 //IL_04e6: Unknown result type (might be due to invalid IL or missing references)
3510 //IL_04eb: Unknown result type (might be due to invalid IL or missing references)
3511 //IL_04ef: Unknown result type (might be due to invalid IL or missing references)
3512 //IL_04f4: Unknown result type (might be due to invalid IL or missing references)
3513 //IL_08ba: Unknown result type (might be due to invalid IL or missing references)
3514 //IL_08bf: Unknown result type (might be due to invalid IL or missing references)
3515 //IL_08c4: Unknown result type (might be due to invalid IL or missing references)
3516 //IL_083d: Unknown result type (might be due to invalid IL or missing references)
3517 //IL_0842: Unknown result type (might be due to invalid IL or missing references)
3518 //IL_0847: Unknown result type (might be due to invalid IL or missing references)
3519 //IL_084b: Unknown result type (might be due to invalid IL or missing references)
3520 //IL_0850: Unknown result type (might be due to invalid IL or missing references)
3521 //IL_02bf: Unknown result type (might be due to invalid IL or missing references)
3522 //IL_02c1: Unknown result type (might be due to invalid IL or missing references)
3523 //IL_030e: Unknown result type (might be due to invalid IL or missing references)
3524 //IL_0313: Unknown result type (might be due to invalid IL or missing references)
3525 //IL_0318: Unknown result type (might be due to invalid IL or missing references)
3526 //IL_0671: Unknown result type (might be due to invalid IL or missing references)
3527 //IL_0676: Unknown result type (might be due to invalid IL or missing references)
3528 //IL_067b: Unknown result type (might be due to invalid IL or missing references)
3529 //IL_067f: Unknown result type (might be due to invalid IL or missing references)
3530 //IL_0684: Unknown result type (might be due to invalid IL or missing references)
3531 //IL_059c: Unknown result type (might be due to invalid IL or missing references)
3532 //IL_05b0: Unknown result type (might be due to invalid IL or missing references)
3533 //IL_05c3: Unknown result type (might be due to invalid IL or missing references)
3534 //IL_05d6: Unknown result type (might be due to invalid IL or missing references)
3535 //IL_05ea: Unknown result type (might be due to invalid IL or missing references)
3536 //IL_05fe: Unknown result type (might be due to invalid IL or missing references)
3537 //IL_0612: Unknown result type (might be due to invalid IL or missing references)
3538 //IL_0626: Unknown result type (might be due to invalid IL or missing references)
3539 //IL_063a: Unknown result type (might be due to invalid IL or missing references)
3540 //IL_0509: Unknown result type (might be due to invalid IL or missing references)
3541 //IL_050b: Unknown result type (might be due to invalid IL or missing references)
3542 //IL_0865: Unknown result type (might be due to invalid IL or missing references)
3543 //IL_0867: Unknown result type (might be due to invalid IL or missing references)
3544 //IL_08e8: Unknown result type (might be due to invalid IL or missing references)
3545 //IL_08f4: Unknown result type (might be due to invalid IL or missing references)
3546 //IL_08ff: Unknown result type (might be due to invalid IL or missing references)
3547 //IL_0904: Unknown result type (might be due to invalid IL or missing references)
3548 //IL_0908: Unknown result type (might be due to invalid IL or missing references)
3549 //IL_090d: Unknown result type (might be due to invalid IL or missing references)
3550 //IL_0b1b: Unknown result type (might be due to invalid IL or missing references)
3551 //IL_0b2e: Unknown result type (might be due to invalid IL or missing references)
3552 //IL_0b41: Unknown result type (might be due to invalid IL or missing references)
3553 //IL_0b4d: Unknown result type (might be due to invalid IL or missing references)
3554 //IL_0360: Unknown result type (might be due to invalid IL or missing references)
3555 //IL_0365: Unknown result type (might be due to invalid IL or missing references)
3556 //IL_036a: Unknown result type (might be due to invalid IL or missing references)
3557 //IL_036e: Unknown result type (might be due to invalid IL or missing references)
3558 //IL_0373: Unknown result type (might be due to invalid IL or missing references)
3559 //IL_0699: Unknown result type (might be due to invalid IL or missing references)
3560 //IL_069b: Unknown result type (might be due to invalid IL or missing references)
3561 //IL_06de: Unknown result type (might be due to invalid IL or missing references)
3562 //IL_06e4: Unknown result type (might be due to invalid IL or missing references)
3563 //IL_06e6: Unknown result type (might be due to invalid IL or missing references)
3564 //IL_06eb: Unknown result type (might be due to invalid IL or missing references)
3565 //IL_06ef: Unknown result type (might be due to invalid IL or missing references)
3566 //IL_06f4: Unknown result type (might be due to invalid IL or missing references)
3567 //IL_0923: Unknown result type (might be due to invalid IL or missing references)
3568 //IL_0925: Unknown result type (might be due to invalid IL or missing references)
3569 //IL_0388: Unknown result type (might be due to invalid IL or missing references)
3570 //IL_038a: Unknown result type (might be due to invalid IL or missing references)
3571 //IL_03cb: Unknown result type (might be due to invalid IL or missing references)
3572 //IL_03d0: Unknown result type (might be due to invalid IL or missing references)
3573 //IL_03d4: Unknown result type (might be due to invalid IL or missing references)
3574 //IL_03d9: Unknown result type (might be due to invalid IL or missing references)
3575 //IL_0709: Unknown result type (might be due to invalid IL or missing references)
3576 //IL_070b: Unknown result type (might be due to invalid IL or missing references)
3577 //IL_0a7c: Unknown result type (might be due to invalid IL or missing references)
3578 //IL_0a81: Unknown result type (might be due to invalid IL or missing references)
3579 //IL_0a86: Unknown result type (might be due to invalid IL or missing references)
3580 //IL_0a8a: Unknown result type (might be due to invalid IL or missing references)
3581 //IL_0a8f: Unknown result type (might be due to invalid IL or missing references)
3582 //IL_03ee: Unknown result type (might be due to invalid IL or missing references)
3583 //IL_03f0: Unknown result type (might be due to invalid IL or missing references)
3584 //IL_0aa5: Unknown result type (might be due to invalid IL or missing references)
3585 //IL_0aa7: Unknown result type (might be due to invalid IL or missing references)
3586 int num = <>1__state;
3587 ImageDownloader imageDownloader = <>4__this;
3588 try
3589 {
3590 UniTask val;
3591 Awaiter awaiter;
3592 int num2;
3593 switch (num)
3594 {
3595 default:
3596 <>7__wrap2 = 0;
3597 goto case 0;
3598 case 0:
3599 case 1:
3600 case 2:
3601 case 3:
3602 case 4:
3603 case 5:
3604 case 6:
3605 case 7:
3606 case 8:
3607 case 9:
3608 case 10:
3609 try
3610 {
3611 if (num != 0)
3612 {
3613 if ((uint)(num - 1) <= 9u)
3614 {
3615 goto IL_015d;
3616 }
3617 if (CanBypassDelay != null && CanBypassDelay.Invoke())
3618 {
3619 goto IL_0101;
3620 }
3621 val = UniTask.WaitWhile((Func<bool>)(() => Time.realtimeSinceStartup - _lastImageRequest < 5f), (PlayerLoopTiming)8, cancellationToken);
3622 awaiter = ((UniTask)(ref val)).GetAwaiter();
3623 if (!((Awaiter)(ref awaiter)).IsCompleted)
3624 {
3625 num = (<>1__state = 0);
3626 <>u__1 = awaiter;
3627 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter, ref this);
3628 return;
3629 }
3630 }
3631 else
3632 {
3633 awaiter = <>u__1;
3634 <>u__1 = default(Awaiter);
3635 num = (<>1__state = -1);
3636 }
3637 ((Awaiter)(ref awaiter)).GetResult();
3638 goto IL_0101;
3639 IL_0101:
3640 if (!((CancellationToken)(ref cancellationToken)).IsCancellationRequested && imageDownloader.State != VRCImageDownloadState.Unloaded)
3641 {
3642 Debug.Log((object)String.Concat("[Image Download] Attempting to load image from URL '", uri.AbsoluteUri, "'"));
3643 _lastImageRequest = Time.realtimeSinceStartup;
3644 <outputBuffer>5__4 = new NativeArray<byte>(33554432, (Allocator)4, (NativeArrayOptions)0);
3645 goto IL_015d;
3646 }
3647 goto end_IL_0054;
3648 IL_015d:
3649 try
3650 {
3651 if ((uint)(num - 1) > 9u)
3652 {
3653 <webRequest>5__5 = new UnityWebRequest(uri, "GET", (DownloadHandler)new DownloadHandlerBuffer(), (UploadHandler)null);
3654 }
3655 try
3656 {
3657 Awaiter<UnityWebRequest> awaiter4;
3658 Awaiter awaiter3;
3659 Awaiter awaiter2;
3660 SwitchToThreadPoolAwaitable val2;
3661 int width;
3662 int height;
3663 ImageLoadSettings settings;
3664 ImageResult imageResult;
3665 SwitchToMainThreadAwaitable val3;
3666 switch (num)
3667 {
3668 default:
3669 <webRequest>5__5.redirectLimit = 0;
3670 UnityWebRequest.ClearCookieCache(uri);
3671 awaiter4 = UnityAsyncExtensions.ToUniTask(<webRequest>5__5.SendWebRequest(), (IProgress<float>)(object)new Progress<float>((Action<float>)imageDownloader.SetProgress), (PlayerLoopTiming)8, cancellationToken).GetAwaiter();
3672 if (!awaiter4.IsCompleted)
3673 {
3674 num = (<>1__state = 1);
3675 <>u__2 = awaiter4;
3676 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter<UnityWebRequest>, <DownloadImage>d__51>(ref awaiter4, ref this);
3677 return;
3678 }
3679 goto IL_0245;
3680 case 1:
3681 awaiter4 = <>u__2;
3682 <>u__2 = default(Awaiter<UnityWebRequest>);
3683 num = (<>1__state = -1);
3684 goto IL_0245;
3685 case 2:
3686 awaiter = <>u__1;
3687 <>u__1 = default(Awaiter);
3688 num = (<>1__state = -1);
3689 goto IL_02f6;
3690 case 3:
3691 awaiter = <>u__1;
3692 <>u__1 = default(Awaiter);
3693 num = (<>1__state = -1);
3694 goto IL_03bf;
3695 case 4:
3696 awaiter3 = <>u__3;
3697 <>u__3 = default(Awaiter);
3698 num = (<>1__state = -1);
3699 goto IL_0425;
3700 case 5:
3701 awaiter = <>u__1;
3702 <>u__1 = default(Awaiter);
3703 num = (<>1__state = -1);
3704 goto IL_0540;
3705 case 6:
3706 awaiter = <>u__1;
3707 <>u__1 = default(Awaiter);
3708 num = (<>1__state = -1);
3709 goto IL_06d0;
3710 case 7:
3711 awaiter2 = <>u__4;
3712 <>u__4 = default(Awaiter);
3713 num = (<>1__state = -1);
3714 goto IL_0740;
3715 case 8:
3716 awaiter = <>u__1;
3717 <>u__1 = default(Awaiter);
3718 num = (<>1__state = -1);
3719 goto IL_089c;
3720 case 9:
3721 awaiter = <>u__1;
3722 <>u__1 = default(Awaiter);
3723 num = (<>1__state = -1);
3724 goto IL_095a;
3725 case 10:
3726 {
3727 awaiter = <>u__1;
3728 <>u__1 = default(Awaiter);
3729 num = (<>1__state = -1);
3730 break;
3731 }
3732 IL_0540:
3733 ((Awaiter)(ref awaiter)).GetResult();
3734 goto end_IL_0054;
3735 IL_0245:
3736 awaiter4.GetResult();
3737 if ((int)<webRequest>5__5.result == 3 || (int)<webRequest>5__5.result == 2)
3738 {
3739 imageDownloader.State = VRCImageDownloadState.Error;
3740 imageDownloader.Error = VRCImageDownloadError.DownloadError;
3741 imageDownloader.ErrorMessage = <webRequest>5__5.error;
3742 val = imageDownloader.RunUdonEventOnMainThreadAndRemoveFromQueue("_onImageLoadError", new ValueTuple<string, object>("IVRCImageDownload", (object)imageDownloader));
3743 awaiter = ((UniTask)(ref val)).GetAwaiter();
3744 if (!((Awaiter)(ref awaiter)).IsCompleted)
3745 {
3746 num = (<>1__state = 2);
3747 <>u__1 = awaiter;
3748 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter, ref this);
3749 return;
3750 }
3751 goto IL_02f6;
3752 }
3753 <downloadBuffer>5__6 = ((DownloadHandler)(DownloadHandlerBuffer)<webRequest>5__5.downloadHandler).nativeData;
3754 if (!<downloadBuffer>5__6.IsCreated || <downloadBuffer>5__6.Length <= 0)
3755 {
3756 imageDownloader.State = VRCImageDownloadState.Error;
3757 imageDownloader.Error = VRCImageDownloadError.DownloadError;
3758 imageDownloader.ErrorMessage = "Failed to retrieve any data.";
3759 val = imageDownloader.RunUdonEventOnMainThreadAndRemoveFromQueue("_onImageLoadError", new ValueTuple<string, object>("IVRCImageDownload", (object)imageDownloader));
3760 awaiter = ((UniTask)(ref val)).GetAwaiter();
3761 if (!((Awaiter)(ref awaiter)).IsCompleted)
3762 {
3763 num = (<>1__state = 3);
3764 <>u__1 = awaiter;
3765 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter, ref this);
3766 return;
3767 }
3768 goto IL_03bf;
3769 }
3770 val2 = UniTask.SwitchToThreadPool();
3771 awaiter3 = ((SwitchToThreadPoolAwaitable)(ref val2)).GetAwaiter();
3772 if (!((Awaiter)(ref awaiter3)).IsCompleted)
3773 {
3774 num = (<>1__state = 4);
3775 <>u__3 = awaiter3;
3776 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter3, ref this);
3777 return;
3778 }
3779 goto IL_0425;
3780 IL_02f6:
3781 ((Awaiter)(ref awaiter)).GetResult();
3782 goto end_IL_0054;
3783 IL_089c:
3784 ((Awaiter)(ref awaiter)).GetResult();
3785 goto end_IL_0054;
3786 IL_0740:
3787 ((Awaiter)(ref awaiter2)).GetResult();
3788 width = (int)<imageInfo>5__7.width;
3789 height = (int)<imageInfo>5__7.height;
3790 <outputTexture>5__10 = new Texture2D(width, height, <format>5__8, imageDownloader.TextureInfo.GenerateMipMaps)
3791 {
3792 name = String.Format("ImageFrom:{0}", (object)uri),
3793 anisoLevel = imageDownloader.TextureInfo.AnisoLevel,
3794 filterMode = imageDownloader.TextureInfo.FilterMode,
3795 wrapModeU = imageDownloader.TextureInfo.WrapModeU,
3796 wrapModeV = imageDownloader.TextureInfo.WrapModeV,
3797 wrapModeW = imageDownloader.TextureInfo.WrapModeW
3798 };
3799 <outputTextureRawData>5__11 = <outputTexture>5__10.GetRawTextureData<byte>();
3800 if (<outputTextureRawData>5__11.Length > <outputBuffer>5__4.Length)
3801 {
3802 imageDownloader.State = VRCImageDownloadState.Error;
3803 imageDownloader.Error = VRCImageDownloadError.DownloadError;
3804 imageDownloader.ErrorMessage = "Decoded image was smaller than expected.";
3805 val = imageDownloader.RunUdonEventOnMainThreadAndRemoveFromQueue("_onImageLoadError", new ValueTuple<string, object>("IVRCImageDownload", (object)imageDownloader));
3806 awaiter = ((UniTask)(ref val)).GetAwaiter();
3807 if (!((Awaiter)(ref awaiter)).IsCompleted)
3808 {
3809 num = (<>1__state = 8);
3810 <>u__1 = awaiter;
3811 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter, ref this);
3812 return;
3813 }
3814 goto IL_089c;
3815 }
3816 <mipLevelWidth>5__12 = width;
3817 <mipLevelHeight>5__13 = height;
3818 <outputSlice>5__14 = NativeSlice<byte>.op_Implicit(<outputBuffer>5__4);
3819 <mipLevel>5__15 = 0;
3820 goto IL_09d4;
3821 IL_03bf:
3822 ((Awaiter)(ref awaiter)).GetResult();
3823 goto end_IL_0054;
3824 IL_06d0:
3825 ((Awaiter)(ref awaiter)).GetResult();
3826 goto end_IL_0054;
3827 IL_0425:
3828 ((Awaiter)(ref awaiter3)).GetResult();
3829 settings = default(ImageLoadSettings).SetResolutionLimit(new Nullable<uint>(2048u)).SetVerticalFlip(flip: true).SetGenerateMipMaps(imageDownloader.TextureInfo.GenerateMipMaps);
3830 imageResult = LoadImage((System.IntPtr)NativeArrayUnsafeUtility.GetUnsafeReadOnlyPtr<byte>(<downloadBuffer>5__6), (uint)<downloadBuffer>5__6.Length, (System.IntPtr)NativeArrayUnsafeUtility.GetUnsafePtr<byte>(<outputBuffer>5__4), (uint)<outputBuffer>5__4.Length, settings);
3831 if (imageResult.success < 1)
3832 {
3833 imageDownloader.State = VRCImageDownloadState.Error;
3834 imageDownloader.Error = VRCImageDownloadError.InvalidImage;
3835 imageDownloader.ErrorMessage = String.Format("Failed to load file: {0}", (object)imageResult.error);
3836 val = imageDownloader.RunUdonEventOnMainThreadAndRemoveFromQueue("_onImageLoadError", new ValueTuple<string, object>("IVRCImageDownload", (object)imageDownloader));
3837 awaiter = ((UniTask)(ref val)).GetAwaiter();
3838 if (!((Awaiter)(ref awaiter)).IsCompleted)
3839 {
3840 num = (<>1__state = 5);
3841 <>u__1 = awaiter;
3842 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter, ref this);
3843 return;
3844 }
3845 goto IL_0540;
3846 }
3847 <imageInfo>5__7 = imageResult.info;
3848 switch (<imageInfo>5__7.format)
3849 {
3850 case ImageFormat.R8:
3851 <format>5__8 = (TextureFormat)63;
3852 <bytesPerPixel>5__9 = 1;
3853 goto IL_06dc;
3854 case ImageFormat.RG16:
3855 <format>5__8 = (TextureFormat)62;
3856 <bytesPerPixel>5__9 = 2;
3857 goto IL_06dc;
3858 case ImageFormat.RGB24:
3859 <format>5__8 = (TextureFormat)3;
3860 <bytesPerPixel>5__9 = 3;
3861 goto IL_06dc;
3862 case ImageFormat.RGBA32:
3863 <format>5__8 = (TextureFormat)4;
3864 <bytesPerPixel>5__9 = 4;
3865 goto IL_06dc;
3866 case ImageFormat.R16:
3867 <format>5__8 = (TextureFormat)9;
3868 <bytesPerPixel>5__9 = 2;
3869 goto IL_06dc;
3870 case ImageFormat.RG32:
3871 <format>5__8 = (TextureFormat)72;
3872 <bytesPerPixel>5__9 = 4;
3873 goto IL_06dc;
3874 case ImageFormat.RGB48:
3875 <format>5__8 = (TextureFormat)73;
3876 <bytesPerPixel>5__9 = 6;
3877 goto IL_06dc;
3878 case ImageFormat.RGBA64:
3879 <format>5__8 = (TextureFormat)74;
3880 <bytesPerPixel>5__9 = 8;
3881 goto IL_06dc;
3882 case ImageFormat.RGBAFloat:
3883 {
3884 <format>5__8 = (TextureFormat)20;
3885 <bytesPerPixel>5__9 = 16;
3886 goto IL_06dc;
3887 }
3888 IL_06dc:
3889 val3 = UniTask.SwitchToMainThread(default(CancellationToken));
3890 awaiter2 = ((SwitchToMainThreadAwaitable)(ref val3)).GetAwaiter();
3891 if (!((Awaiter)(ref awaiter2)).IsCompleted)
3892 {
3893 num = (<>1__state = 7);
3894 <>u__4 = awaiter2;
3895 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter2, ref this);
3896 return;
3897 }
3898 goto IL_0740;
3899 }
3900 imageDownloader.State = VRCImageDownloadState.Error;
3901 imageDownloader.Error = VRCImageDownloadError.DownloadError;
3902 imageDownloader.ErrorMessage = "Invalid image file.";
3903 val = imageDownloader.RunUdonEventOnMainThreadAndRemoveFromQueue("_onImageLoadError", new ValueTuple<string, object>("IVRCImageDownload", (object)imageDownloader));
3904 awaiter = ((UniTask)(ref val)).GetAwaiter();
3905 if (!((Awaiter)(ref awaiter)).IsCompleted)
3906 {
3907 num = (<>1__state = 6);
3908 <>u__1 = awaiter;
3909 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter, ref this);
3910 return;
3911 }
3912 goto IL_06d0;
3913 IL_09d4:
3914 if (<mipLevel>5__15 < ((Texture)<outputTexture>5__10).mipmapCount)
3915 {
3916 val = <DownloadImage>g__SlicedTextureUpload|51_0(<mipLevelWidth>5__12, <mipLevelHeight>5__13, <bytesPerPixel>5__9, <format>5__8, <mipLevel>5__15, <outputSlice>5__14, <outputTexture>5__10);
3917 awaiter = ((UniTask)(ref val)).GetAwaiter();
3918 if (!((Awaiter)(ref awaiter)).IsCompleted)
3919 {
3920 num = (<>1__state = 9);
3921 <>u__1 = awaiter;
3922 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter, ref this);
3923 return;
3924 }
3925 goto IL_095a;
3926 }
3927 imageDownloader._sizeInMemoryBytes = <outputTextureRawData>5__11.Length;
3928 imageDownloader.Result = <outputTexture>5__10;
3929 if ((Object)(object)<outputTexture>5__10 != (Object)null)
3930 {
3931 DPIDMipmapper.GenerateDPIDMipmapsFast(<outputTexture>5__10, true, true, false, false);
3932 }
3933 imageDownloader.State = VRCImageDownloadState.Complete;
3934 if ((Object)(object)imageDownloader.Material != (Object)null)
3935 {
3936 if (imageDownloader.TextureInfo != null)
3937 {
3938 imageDownloader.Material.SetTexture(imageDownloader.TextureInfo.MaterialProperty, (Texture)(object)imageDownloader.Result);
3939 }
3940 else
3941 {
3942 imageDownloader.Material.mainTexture = (Texture)(object)imageDownloader.Result;
3943 }
3944 }
3945 val = imageDownloader.RunUdonEventOnMainThreadAndRemoveFromQueue("_onImageLoadSuccess", new ValueTuple<string, object>("IVRCImageDownload", (object)imageDownloader));
3946 awaiter = ((UniTask)(ref val)).GetAwaiter();
3947 if (!((Awaiter)(ref awaiter)).IsCompleted)
3948 {
3949 num = (<>1__state = 10);
3950 <>u__1 = awaiter;
3951 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter, ref this);
3952 return;
3953 }
3954 break;
3955 IL_095a:
3956 ((Awaiter)(ref awaiter)).GetResult();
3957 <outputSlice>5__14 = NativeSliceExtensions.Slice<byte>(<outputSlice>5__14, <mipLevelWidth>5__12 * <mipLevelHeight>5__13 * <bytesPerPixel>5__9);
3958 <mipLevelWidth>5__12 = Mathf.Max(1, Mathf.FloorToInt((float)<mipLevelWidth>5__12 / 2f));
3959 <mipLevelHeight>5__13 = Mathf.Max(1, Mathf.FloorToInt((float)<mipLevelHeight>5__13 / 2f));
3960 <mipLevel>5__15++;
3961 goto IL_09d4;
3962 }
3963 ((Awaiter)(ref awaiter)).GetResult();
3964 }
3965 finally
3966 {
3967 if (num < 0 && <webRequest>5__5 != null)
3968 {
3969 ((IDisposable)<webRequest>5__5).Dispose();
3970 }
3971 }
3972 }
3973 finally
3974 {
3975 if (num < 0)
3976 {
3977 ((IDisposable)<outputBuffer>5__4).Dispose();
3978 }
3979 }
3980 <outputBuffer>5__4 = default(NativeArray<byte>);
3981 <webRequest>5__5 = null;
3982 <downloadBuffer>5__6 = default(ReadOnly<byte>);
3983 <outputTexture>5__10 = null;
3984 <outputTextureRawData>5__11 = default(NativeArray<byte>);
3985 <outputSlice>5__14 = default(NativeSlice<byte>);
3986 goto IL_0b7b;
3987 end_IL_0054:;
3988 }
3989 catch (OperationCanceledException val4)
3990 {
3991 OperationCanceledException val5 = val4;
3992 <>7__wrap1 = val5;
3993 <>7__wrap2 = 1;
3994 goto IL_0b7b;
3995 }
3996 catch (UnityWebRequestException val6)
3997 {
3998 UnityWebRequestException val7 = val6;
3999 <>7__wrap1 = val7;
4000 <>7__wrap2 = 2;
4001 goto IL_0b7b;
4002 }
4003 goto end_IL_000e;
4004 case 11:
4005 awaiter = <>u__1;
4006 <>u__1 = default(Awaiter);
4007 num = (<>1__state = -1);
4008 goto IL_0c13;
4009 case 12:
4010 awaiter = <>u__1;
4011 <>u__1 = default(Awaiter);
4012 num = (<>1__state = -1);
4013 goto IL_0cdf;
4014 case 13:
4015 {
4016 awaiter = <>u__1;
4017 <>u__1 = default(Awaiter);
4018 num = (<>1__state = -1);
4019 goto IL_0d8e;
4020 }
4021 IL_0b7b:
4022 num2 = <>7__wrap2;
4023 if (num2 != 1)
4024 {
4025 if (num2 != 2)
4026 {
4027 break;
4028 }
4029 UnityWebRequestException val8 = (UnityWebRequestException)<>7__wrap1;
4030 if (((Exception)val8).Message == "Unable to write data")
4031 {
4032 Debug.Log((object)String.Concat("[Image Download] Loading image from URL '", uri.AbsoluteUri, "' failed because the image was too large."));
4033 imageDownloader.Error = VRCImageDownloadError.DownloadError;
4034 imageDownloader.ErrorMessage = "image was too large";
4035 val = imageDownloader.RunUdonEventOnMainThreadAndRemoveFromQueue("_onImageLoadError", new ValueTuple<string, object>("IVRCImageDownload", (object)imageDownloader));
4036 awaiter = ((UniTask)(ref val)).GetAwaiter();
4037 if (!((Awaiter)(ref awaiter)).IsCompleted)
4038 {
4039 num = (<>1__state = 12);
4040 <>u__1 = awaiter;
4041 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter, ref this);
4042 return;
4043 }
4044 goto IL_0cdf;
4045 }
4046 Debug.Log((object)String.Concat("[Image Download] A web request exception occurred while loading image from URL '", uri.AbsoluteUri, "'. Exception: ", val8.Error));
4047 imageDownloader.Error = VRCImageDownloadError.DownloadError;
4048 imageDownloader.ErrorMessage = val8.Error;
4049 val = imageDownloader.RunUdonEventOnMainThreadAndRemoveFromQueue("_onImageLoadError", new ValueTuple<string, object>("IVRCImageDownload", (object)imageDownloader));
4050 awaiter = ((UniTask)(ref val)).GetAwaiter();
4051 if (!((Awaiter)(ref awaiter)).IsCompleted)
4052 {
4053 num = (<>1__state = 13);
4054 <>u__1 = awaiter;
4055 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter, ref this);
4056 return;
4057 }
4058 goto IL_0d8e;
4059 }
4060 imageDownloader.Error = VRCImageDownloadError.Unknown;
4061 imageDownloader.ErrorMessage = "Canceled loading image";
4062 val = imageDownloader.RunUdonEventOnMainThreadAndRemoveFromQueue("_onImageLoadError", new ValueTuple<string, object>("IVRCImageDownload", (object)imageDownloader));
4063 awaiter = ((UniTask)(ref val)).GetAwaiter();
4064 if (!((Awaiter)(ref awaiter)).IsCompleted)
4065 {
4066 num = (<>1__state = 11);
4067 <>u__1 = awaiter;
4068 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <DownloadImage>d__51>(ref awaiter, ref this);
4069 return;
4070 }
4071 goto IL_0c13;
4072 IL_0cdf:
4073 ((Awaiter)(ref awaiter)).GetResult();
4074 goto end_IL_000e;
4075 IL_0d8e:
4076 ((Awaiter)(ref awaiter)).GetResult();
4077 break;
4078 IL_0c13:
4079 ((Awaiter)(ref awaiter)).GetResult();
4080 break;
4081 }
4082 <>7__wrap1 = null;
4083 end_IL_000e:;
4084 }
4085 catch (Exception val9)
4086 {
4087 Exception exception = val9;
4088 <>1__state = -2;
4089 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
4090 return;
4091 }
4092 <>1__state = -2;
4093 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
4094 }
4095
4096 [DebuggerHidden]
4097 private void SetStateMachine(IAsyncStateMachine stateMachine)
4098 {
4099 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
4100 }
4101 }
4102
4103 [StructLayout(3)]
4104 [CompilerGenerated]
4105 private struct <RunUdonEventOnMainThreadAndRemoveFromQueue>d__52 : ValueType, IAsyncStateMachine
4106 {
4107 public int <>1__state;
4108
4109 public AsyncUniTaskMethodBuilder <>t__builder;
4110
4111 public ImageDownloader <>4__this;
4112
4113 public string eventName;
4114
4115 public ValueTuple<string, object> argument;
4116
4117 private Awaiter <>u__1;
4118
4119 private void MoveNext()
4120 {
4121 //IL_00a4: Expected O, but got Unknown
4122 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
4123 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
4124 //IL_005f: Unknown result type (might be due to invalid IL or missing references)
4125 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
4126 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
4127 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
4128 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
4129 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
4130 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
4131 //IL_008a: Unknown result type (might be due to invalid IL or missing references)
4132 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
4133 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
4134 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
4135 int num = <>1__state;
4136 ImageDownloader imageDownloader = <>4__this;
4137 try
4138 {
4139 Awaiter awaiter;
4140 if (num != 0)
4141 {
4142 SwitchToMainThreadAwaitable val = UniTask.SwitchToMainThread(default(CancellationToken));
4143 awaiter = ((SwitchToMainThreadAwaitable)(ref val)).GetAwaiter();
4144 if (!((Awaiter)(ref awaiter)).IsCompleted)
4145 {
4146 num = (<>1__state = 0);
4147 <>u__1 = awaiter;
4148 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).AwaitUnsafeOnCompleted<Awaiter, <RunUdonEventOnMainThreadAndRemoveFromQueue>d__52>(ref awaiter, ref this);
4149 return;
4150 }
4151 }
4152 else
4153 {
4154 awaiter = <>u__1;
4155 <>u__1 = default(Awaiter);
4156 num = (<>1__state = -1);
4157 }
4158 ((Awaiter)(ref awaiter)).GetResult();
4159 imageDownloader.UdonBehaviour.RunEvent(eventName, new ValueTuple<string, object>[1] { argument });
4160 RemoveImageDownloadFromQueue(imageDownloader);
4161 }
4162 catch (Exception val2)
4163 {
4164 Exception exception = val2;
4165 <>1__state = -2;
4166 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetException(exception);
4167 return;
4168 }
4169 <>1__state = -2;
4170 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetResult();
4171 }
4172
4173 [DebuggerHidden]
4174 private void SetStateMachine(IAsyncStateMachine stateMachine)
4175 {
4176 ((AsyncUniTaskMethodBuilder)(ref <>t__builder)).SetStateMachine(stateMachine);
4177 }
4178 }
4179
4180 private const string NATIVE_LIB = "vrc_image_loader";
4181
4182 private const float MINIMUM_DELAY_BETWEEN_REQUESTS = 5f;
4183
4184 private const int MAXIMUM_DIMENSION = 2048;
4185
4186 private const int MAX_BUFFER_SIZE = 33554432;
4187
4188 private const int SLICE_SIZE_BYTES = 1048576;
4189
4190 private static float _lastImageRequest;
4191
4192 protected CancellationTokenSource _cancellationTokenSource;
4193
4194 private int _sizeInMemoryBytes;
4195
4196 [field: CompilerGenerated]
4198 {
4199 [CompilerGenerated]
4200 get;
4201 [CompilerGenerated]
4202 protected set;
4203 }
4204
4205 [field: CompilerGenerated]
4207 {
4208 [CompilerGenerated]
4209 get;
4210 [CompilerGenerated]
4211 protected set;
4212 }
4213
4214 [field: CompilerGenerated]
4215 public string ErrorMessage
4216 {
4217 [CompilerGenerated]
4218 get;
4219 [CompilerGenerated]
4220 protected set;
4221 }
4222
4223 [field: CompilerGenerated]
4224 public Texture2D Result
4225 {
4226 [CompilerGenerated]
4227 get;
4228 [CompilerGenerated]
4229 protected set;
4230 }
4231
4233 {
4234 get
4235 {
4236 if (!((Object)(object)Result != (Object)null))
4237 {
4238 return 0;
4239 }
4240 return _sizeInMemoryBytes;
4241 }
4242 }
4243
4244 [field: CompilerGenerated]
4245 public float Progress
4246 {
4247 [CompilerGenerated]
4248 get;
4249 [CompilerGenerated]
4250 protected set;
4251 }
4252
4253 [field: CompilerGenerated]
4255 {
4256 [CompilerGenerated]
4257 get;
4258 [CompilerGenerated]
4259 protected set;
4260 }
4261
4262 [field: CompilerGenerated]
4264 {
4265 [CompilerGenerated]
4266 get;
4267 [CompilerGenerated]
4268 protected set;
4269 }
4270
4271 [field: CompilerGenerated]
4272 public IUdonEventReceiver UdonBehaviour
4273 {
4274 [CompilerGenerated]
4275 get;
4276 [CompilerGenerated]
4277 protected set;
4278 }
4279
4280 [field: CompilerGenerated]
4282 {
4283 [CompilerGenerated]
4284 get;
4285 [CompilerGenerated]
4286 protected set;
4287 }
4288
4289 [DllImport("vrc_image_loader", CallingConvention = 2, EntryPoint = "load_image")]
4290 private static extern ImageResult LoadImage(System.IntPtr inputBytes, uint inputBytesLength, System.IntPtr outputBuffer, uint outputBufferLength, ImageLoadSettings settings);
4291
4292 public static IVRCImageDownload DownloadImage(VRCUrl url, Material material, IUdonEventReceiver udonBehaviour, TextureInfo textureInfo)
4293 {
4294 return new ImageDownloader(url, material, udonBehaviour, textureInfo);
4295 }
4296
4297 public ImageDownloader(VRCUrl url, Material material, IUdonEventReceiver udonBehaviour = null, TextureInfo textureInfo = null)
4298 {
4299 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
4300 //IL_0018: Expected O, but got Unknown
4301 Url = url;
4302 _cancellationTokenSource = new CancellationTokenSource();
4303 Material = material;
4304 UdonBehaviour = udonBehaviour;
4305 TextureInfo = textureInfo ?? new TextureInfo();
4306 }
4307
4308 public virtual void StartDownload()
4309 {
4310 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
4311 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
4312 //IL_0050: Unknown result type (might be due to invalid IL or missing references)
4313 //IL_0056: Expected O, but got Unknown
4314 //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
4315 //IL_0106: Unknown result type (might be due to invalid IL or missing references)
4316 //IL_010b: Unknown result type (might be due to invalid IL or missing references)
4317 if (!AddImageDownloadToQueue(this))
4318 {
4320 Error = VRCImageDownloadError.TooManyRequests;
4321 ErrorMessage = "Client has too many requests (limit is 1000).";
4322 UdonBehaviour.RunEvent<ImageDownloader>("_onImageLoadError", new ValueTuple<string, ImageDownloader>("IVRCImageDownload", this));
4323 return;
4324 }
4325 State = VRCImageDownloadState.Pending;
4326 Uri val;
4327 try
4328 {
4329 val = new Uri(Url.Get());
4330 }
4331 catch (Exception)
4332 {
4334 Error = VRCImageDownloadError.InvalidURL;
4335 ErrorMessage = "Invalid URL";
4336 UdonBehaviour.RunEvent<ImageDownloader>("_onImageLoadError", new ValueTuple<string, ImageDownloader>("IVRCImageDownload", this));
4338 return;
4339 }
4340 if (!val.IsAbsoluteUri || (val.Scheme != Uri.UriSchemeHttps && val.Scheme != Uri.UriSchemeHttp))
4341 {
4343 Error = VRCImageDownloadError.InvalidURL;
4344 ErrorMessage = "Images may only be downloaded from HTTP(S) URLs.";
4345 UdonBehaviour.RunEvent<ImageDownloader>("_onImageLoadError", new ValueTuple<string, ImageDownloader>("IVRCImageDownload", this));
4347 }
4348 else
4349 {
4350 UniTaskExtensions.Forget(DownloadImage(val, _cancellationTokenSource.Token));
4351 }
4352 }
4353
4354 private void SetProgress(float progress)
4355 {
4356 Progress = progress;
4357 }
4358
4359 [AsyncStateMachine(/*Could not decode attribute arguments.*/)]
4360 protected UniTask DownloadImage(Uri uri, CancellationToken cancellationToken)
4361 {
4362 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
4363 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
4364 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
4365 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
4366 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
4367 <DownloadImage>d__51 <DownloadImage>d__ = default(<DownloadImage>d__51);
4368 <DownloadImage>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
4369 <DownloadImage>d__.<>4__this = this;
4370 <DownloadImage>d__.uri = uri;
4371 <DownloadImage>d__.cancellationToken = cancellationToken;
4372 <DownloadImage>d__.<>1__state = -1;
4373 ((AsyncUniTaskMethodBuilder)(ref <DownloadImage>d__.<>t__builder)).Start<<DownloadImage>d__51>(ref <DownloadImage>d__);
4374 return ((AsyncUniTaskMethodBuilder)(ref <DownloadImage>d__.<>t__builder)).Task;
4375 }
4376
4377 [AsyncStateMachine(/*Could not decode attribute arguments.*/)]
4378 private UniTask RunUdonEventOnMainThreadAndRemoveFromQueue(string eventName, ValueTuple<string, object> argument)
4379 {
4380 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
4381 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
4382 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
4383 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
4384 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
4385 <RunUdonEventOnMainThreadAndRemoveFromQueue>d__52 <RunUdonEventOnMainThreadAndRemoveFromQueue>d__ = default(<RunUdonEventOnMainThreadAndRemoveFromQueue>d__52);
4386 <RunUdonEventOnMainThreadAndRemoveFromQueue>d__.<>t__builder = AsyncUniTaskMethodBuilder.Create();
4387 <RunUdonEventOnMainThreadAndRemoveFromQueue>d__.<>4__this = this;
4388 <RunUdonEventOnMainThreadAndRemoveFromQueue>d__.eventName = eventName;
4389 <RunUdonEventOnMainThreadAndRemoveFromQueue>d__.argument = argument;
4390 <RunUdonEventOnMainThreadAndRemoveFromQueue>d__.<>1__state = -1;
4391 ((AsyncUniTaskMethodBuilder)(ref <RunUdonEventOnMainThreadAndRemoveFromQueue>d__.<>t__builder)).Start<<RunUdonEventOnMainThreadAndRemoveFromQueue>d__52>(ref <RunUdonEventOnMainThreadAndRemoveFromQueue>d__);
4392 return ((AsyncUniTaskMethodBuilder)(ref <RunUdonEventOnMainThreadAndRemoveFromQueue>d__.<>t__builder)).Task;
4393 }
4394
4395 public void Dispose()
4396 {
4397 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
4398 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
4399 CancellationTokenSource cancellationTokenSource = _cancellationTokenSource;
4400 if (cancellationTokenSource != null)
4401 {
4402 cancellationTokenSource.Cancel();
4403 }
4404 CancellationTokenSource cancellationTokenSource2 = _cancellationTokenSource;
4405 if (cancellationTokenSource2 != null)
4406 {
4407 cancellationTokenSource2.Dispose();
4408 }
4409 _cancellationTokenSource = null;
4410 State = VRCImageDownloadState.Unloaded;
4412 UniTaskVoid val = DestroyAsync((Object)(object)Result);
4413 ((UniTaskVoid)(ref val)).Forget();
4414 Result = null;
4415 GC.SuppressFinalize((object)this);
4416 [AsyncStateMachine(/*Could not decode attribute arguments.*/)]
4417 [CompilerGenerated]
4418 static UniTaskVoid DestroyAsync(Object obj)
4419 {
4420 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
4421 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
4422 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
4423 <<Dispose>g__DestroyAsync|53_0>d <<Dispose>g__DestroyAsync|53_0>d = default(<<Dispose>g__DestroyAsync|53_0>d);
4424 <<Dispose>g__DestroyAsync|53_0>d.<>t__builder = AsyncUniTaskVoidMethodBuilder.Create();
4425 <<Dispose>g__DestroyAsync|53_0>d.obj = obj;
4426 <<Dispose>g__DestroyAsync|53_0>d.<>1__state = -1;
4427 ((AsyncUniTaskVoidMethodBuilder)(ref <<Dispose>g__DestroyAsync|53_0>d.<>t__builder)).Start<<<Dispose>g__DestroyAsync|53_0>d>(ref <<Dispose>g__DestroyAsync|53_0>d);
4428 return ((AsyncUniTaskVoidMethodBuilder)(ref <<Dispose>g__DestroyAsync|53_0>d.<>t__builder)).Task;
4429 }
4430 }
4431
4432 public void CancelDownload()
4433 {
4434 CancellationTokenSource cancellationTokenSource = _cancellationTokenSource;
4435 if (cancellationTokenSource != null)
4436 {
4437 cancellationTokenSource.Cancel();
4438 }
4439 State = VRCImageDownloadState.Unloaded;
4440 }
4441
4443 {
4444 try
4445 {
4446 Dispose();
4447 }
4448 finally
4449 {
4450 ((Object)this).Finalize();
4451 }
4452 }
4453
4454 [AsyncStateMachine(/*Could not decode attribute arguments.*/)]
4455 [CompilerGenerated]
4456 internal static UniTask <DownloadImage>g__SlicedTextureUpload|51_0(int width, int height, int bytesPerPixel, TextureFormat format, int mipLevel, NativeSlice<byte> outputBuffer, Texture2D outputTexture)
4457 {
4458 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
4459 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
4460 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
4461 //IL_0027: Unknown result type (might be due to invalid IL or missing references)
4462 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
4463 //IL_0039: Unknown result type (might be due to invalid IL or missing references)
4464 //IL_0064: Unknown result type (might be due to invalid IL or missing references)
4466 <<DownloadImage>g__SlicedTextureUpload|51_0>d.<>t__builder = AsyncUniTaskMethodBuilder.Create();
4467 <<DownloadImage>g__SlicedTextureUpload|51_0>d.width = width;
4468 <<DownloadImage>g__SlicedTextureUpload|51_0>d.height = height;
4469 <<DownloadImage>g__SlicedTextureUpload|51_0>d.bytesPerPixel = bytesPerPixel;
4470 <<DownloadImage>g__SlicedTextureUpload|51_0>d.format = format;
4471 <<DownloadImage>g__SlicedTextureUpload|51_0>d.mipLevel = mipLevel;
4472 <<DownloadImage>g__SlicedTextureUpload|51_0>d.outputBuffer = outputBuffer;
4473 <<DownloadImage>g__SlicedTextureUpload|51_0>d.outputTexture = outputTexture;
4474 <<DownloadImage>g__SlicedTextureUpload|51_0>d.<>1__state = -1;
4475 ((AsyncUniTaskMethodBuilder)(ref <<DownloadImage>g__SlicedTextureUpload|51_0>d.<>t__builder)).Start<<<DownloadImage>g__SlicedTextureUpload|51_0>d>(ref <<DownloadImage>g__SlicedTextureUpload|51_0>d);
4476 return ((AsyncUniTaskMethodBuilder)(ref <<DownloadImage>g__SlicedTextureUpload|51_0>d.<>t__builder)).Task;
4477 }
4478 }
4479
4480 private bool _disposed;
4481
4482 private List<IVRCImageDownload> _imageDownloads = new List<IVRCImageDownload>();
4483
4484 private static List<IVRCImageDownload> _imageDownloadQueue = new List<IVRCImageDownload>();
4485
4486 [ExcludeFromUdonWrapper]
4487 private static Func<bool> CanBypassDelay = null;
4488
4489 [PublicAPI]
4490 [ExcludeFromUdonWrapper]
4491 [field: CompilerGenerated]
4492 public static Func<VRCUrl, Material, IUdonEventReceiver, TextureInfo, IVRCImageDownload> StartDownload
4493 {
4494 [CompilerGenerated]
4495 get;
4496 [CompilerGenerated]
4497 set;
4499
4500
4501 [ExcludeFromUdonWrapper]
4502 public static bool HasAnyQueuedDownloads => _imageDownloadQueue.Count > 0;
4503
4504 public IVRCImageDownload DownloadImage(VRCUrl url, Material material, IUdonEventReceiver udonBehaviour, TextureInfo textureInfo = null)
4505 {
4506 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
4507 if (_disposed)
4508 {
4509 throw new ObjectDisposedException("Attempted to use a disposed VRCImageDownloader.");
4510 }
4511 IVRCImageDownload iVRCImageDownload = StartDownload.Invoke(url, material, udonBehaviour, textureInfo);
4512 iVRCImageDownload.StartDownload();
4513 _imageDownloads.Add(iVRCImageDownload);
4514 return iVRCImageDownload;
4515 }
4516
4517 public void Dispose()
4518 {
4519 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
4520 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
4521 Enumerator<IVRCImageDownload> enumerator = _imageDownloads.GetEnumerator();
4522 try
4523 {
4524 while (enumerator.MoveNext())
4525 {
4526 IVRCImageDownload current = enumerator.Current;
4527 if (current.State != VRCImageDownloadState.Unloaded)
4528 {
4529 ((IDisposable)current).Dispose();
4530 }
4531 }
4532 }
4533 finally
4534 {
4535 ((IDisposable)enumerator).Dispose();
4536 }
4537 _imageDownloads.Clear();
4538 GC.SuppressFinalize((object)this);
4539 }
4540
4542 {
4543 try
4544 {
4545 Dispose();
4546 Debug.LogWarning((object)"[Image Download] Leaked a VRCImageDownloader!");
4547 }
4548 finally
4549 {
4550 ((Object)this).Finalize();
4551 }
4552 }
4553
4554 [ExcludeFromUdonWrapper]
4555 public static bool AddImageDownloadToQueue(IVRCImageDownload imageDownload)
4556 {
4557 if (_imageDownloadQueue.Count < 1000)
4558 {
4559 _imageDownloadQueue.Add(imageDownload);
4560 return true;
4561 }
4562 return false;
4563 }
4564
4565 [ExcludeFromUdonWrapper]
4566 public static void RemoveImageDownloadFromQueue(IVRCImageDownload imageDownload)
4567 {
4568 _imageDownloadQueue.Remove(imageDownload);
4569 }
4570
4571 [ExcludeFromUdonWrapper]
4572 public static void ClearQueue()
4573 {
4574 Debug.Log((object)"[Image Download] Clearing download queue");
4575 for (int num = _imageDownloadQueue.Count - 1; num >= 0; num--)
4576 {
4577 _imageDownloadQueue[num].CancelDownload();
4578 ((IDisposable)_imageDownloadQueue[num]).Dispose();
4579 }
4580 _imageDownloadQueue.Clear();
4581 }
4582 }
4583 [PublicAPI]
4584 public enum VRCImageDownloadError : Enum
4585 {
4586 Unknown,
4587 InvalidURL,
4588 AccessDenied,
4589 DownloadError,
4590 InvalidImage,
4591 TooManyRequests
4592 }
4593 [PublicAPI]
4594 public enum VRCImageDownloadState : Enum
4595 {
4596 Unknown,
4597 Pending,
4598 Error,
4599 Complete,
4600 Unloaded
4601 }
4602}
4604{
4605 public static class VRCAsyncGPUReadback : Object
4606 {
4607 public static VRCAsyncGPUReadbackRequest Request(Texture src, int mipIndex, IUdonEventReceiver udonBehaviour)
4608 {
4609 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
4610 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
4611 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
4612 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
4613 VRCAsyncGPUReadbackRequest vRCAsyncGPUReadbackRequest = new VRCAsyncGPUReadbackRequest();
4614 AsyncGPUReadbackRequest request = AsyncGPUReadback.Request(src, mipIndex, (Action<AsyncGPUReadbackRequest>)vRCAsyncGPUReadbackRequest.HandleCallback);
4615 vRCAsyncGPUReadbackRequest.Request = request;
4616 vRCAsyncGPUReadbackRequest.UdonBehaviour = udonBehaviour;
4617 return vRCAsyncGPUReadbackRequest;
4618 }
4619
4620 public static VRCAsyncGPUReadbackRequest Request(Texture src, int mipIndex, TextureFormat dstFormat, IUdonEventReceiver udonBehaviour)
4621 {
4622 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
4623 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
4624 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
4625 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
4626 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
4627 VRCAsyncGPUReadbackRequest vRCAsyncGPUReadbackRequest = new VRCAsyncGPUReadbackRequest();
4628 AsyncGPUReadbackRequest request = AsyncGPUReadback.Request(src, mipIndex, dstFormat, (Action<AsyncGPUReadbackRequest>)vRCAsyncGPUReadbackRequest.HandleCallback);
4629 vRCAsyncGPUReadbackRequest.Request = request;
4630 vRCAsyncGPUReadbackRequest.UdonBehaviour = udonBehaviour;
4631 return vRCAsyncGPUReadbackRequest;
4632 }
4633
4634 public static VRCAsyncGPUReadbackRequest Request(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, IUdonEventReceiver udonBehaviour)
4635 {
4636 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
4637 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
4638 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
4639 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
4640 VRCAsyncGPUReadbackRequest vRCAsyncGPUReadbackRequest = new VRCAsyncGPUReadbackRequest();
4641 AsyncGPUReadbackRequest request = AsyncGPUReadback.Request(src, mipIndex, x, width, y, height, z, depth, (Action<AsyncGPUReadbackRequest>)vRCAsyncGPUReadbackRequest.HandleCallback);
4642 vRCAsyncGPUReadbackRequest.Request = request;
4643 vRCAsyncGPUReadbackRequest.UdonBehaviour = udonBehaviour;
4644 return vRCAsyncGPUReadbackRequest;
4645 }
4646
4647 public static VRCAsyncGPUReadbackRequest Request(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, TextureFormat dstFormat, IUdonEventReceiver udonBehaviour)
4648 {
4649 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
4650 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
4651 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
4652 //IL_0027: Unknown result type (might be due to invalid IL or missing references)
4653 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
4654 VRCAsyncGPUReadbackRequest vRCAsyncGPUReadbackRequest = new VRCAsyncGPUReadbackRequest();
4655 AsyncGPUReadbackRequest request = AsyncGPUReadback.Request(src, mipIndex, x, width, y, height, z, depth, dstFormat, (Action<AsyncGPUReadbackRequest>)vRCAsyncGPUReadbackRequest.HandleCallback);
4656 vRCAsyncGPUReadbackRequest.Request = request;
4657 vRCAsyncGPUReadbackRequest.UdonBehaviour = udonBehaviour;
4658 return vRCAsyncGPUReadbackRequest;
4659 }
4660 }
4661 [PublicAPI]
4662 public class VRCAsyncGPUReadbackRequest : Object
4663 {
4664 internal AsyncGPUReadbackRequest Request;
4665
4666 internal IUdonEventReceiver UdonBehaviour;
4667
4668 public bool done => ((AsyncGPUReadbackRequest)(ref Request)).done;
4669
4670 public bool hasError => ((AsyncGPUReadbackRequest)(ref Request)).hasError;
4671
4672 public int width => ((AsyncGPUReadbackRequest)(ref Request)).width;
4673
4674 public int height => ((AsyncGPUReadbackRequest)(ref Request)).height;
4675
4676 public int depth => ((AsyncGPUReadbackRequest)(ref Request)).depth;
4677
4678 public int layerCount => ((AsyncGPUReadbackRequest)(ref Request)).layerCount;
4679
4680 public int layerDataSize => ((AsyncGPUReadbackRequest)(ref Request)).layerDataSize;
4681
4683 {
4684 }
4685
4686 internal void HandleCallback(AsyncGPUReadbackRequest request)
4687 {
4688 //IL_0016: Unknown result type (might be due to invalid IL or missing references)
4689 IUdonEventReceiver udonBehaviour = UdonBehaviour;
4690 if (udonBehaviour != null)
4691 {
4692 udonBehaviour.RunEvent<VRCAsyncGPUReadbackRequest>("_onAsyncGpuReadbackComplete", new ValueTuple<string, VRCAsyncGPUReadbackRequest>("request", this));
4693 }
4694 }
4695
4696 public bool TryGetData(byte[] data, int layer = 0)
4697 {
4698 return TryGetData<byte>(data, layer);
4699 }
4700
4701 public bool TryGetData(float[] data, int layer = 0)
4702 {
4703 return TryGetData<float>(data, layer);
4704 }
4705
4706 public bool TryGetData(Color32[] data, int layer = 0)
4707 {
4708 return TryGetData<Color32>(data, layer);
4709 }
4710
4711 public bool TryGetData(Color[] data, int layer = 0)
4712 {
4713 return TryGetData<Color>(data, layer);
4714 }
4715
4716 private bool TryGetData<T>(T[] data, int layer = 0) where T : struct, ValueType
4717 {
4718 //IL_0094: Unknown result type (might be due to invalid IL or missing references)
4719 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
4720 //IL_009a: Unknown result type (might be due to invalid IL or missing references)
4721 if (!done)
4722 {
4723 return false;
4724 }
4725 if (hasError)
4726 {
4727 return false;
4728 }
4729 if (layer < 0 || layer >= layerCount)
4730 {
4731 Debug.LogError((object)String.Format("[VRCGraphics_AsyncGPUReadback] TryGetData Failed: Requested layer index {0} is invalid. Data has {1} layers.", (object)layer, (object)layerCount));
4732 return false;
4733 }
4734 if (data == null)
4735 {
4736 Debug.LogError((object)"[VRCGraphics_AsyncGPUReadback] TryGetData Failed: Provided data array is null.");
4737 return false;
4738 }
4739 if (data.Length < layerDataSize / UnsafeUtility.SizeOf<T>())
4740 {
4741 Debug.LogError((object)String.Format("[VRCGraphics_AsyncGPUReadback] TryGetData Failed: Provided array of length {0} is too small. Expected array with length of at least {1}", (object)data.Length, (object)(layerDataSize / UnsafeUtility.SizeOf<T>())));
4742 return false;
4743 }
4744 NativeArray<T> data2 = ((AsyncGPUReadbackRequest)(ref Request)).GetData<T>(0);
4745 NativeArray<T>.Copy(data2, data, data2.Length);
4746 return true;
4747 }
4748 }
4749}
4751{
4752 [PublicAPI]
4753 public enum ScreenUpdateType : Enum
4754 {
4755 OrientationChanged
4756 }
4757 public struct ScreenUpdateData : ValueType
4758 {
4760
4762
4763 public Vector2 resolution;
4764 }
4765}
4767{
4768 public static class PlayerData : Object
4769 {
4770 public enum State : Enum
4771 {
4772 Unchanged,
4773 Added,
4774 Removed,
4775 Changed,
4776 Restored
4777 }
4778
4779 public readonly struct Info : ValueType
4780 {
4781 public readonly State State;
4782
4783 public readonly string Key;
4784
4785 public Info(string key, State state)
4786 {
4787 State = state;
4788 Key = key;
4789 }
4790 }
4791
4792 private static Func<VRCPlayerApi, IEnumerable<string>> _getKeys;
4793
4794 private static Func<VRCPlayerApi, string, bool> _hasKey;
4795
4796 private static Func<VRCPlayerApi, string, Type> _getType;
4797
4798 private static Action<string, bool> _setBool;
4799
4800 private static Func<VRCPlayerApi, string, bool> _getBool;
4801
4802 private static Action<string, sbyte> _setSByte;
4803
4804 private static Func<VRCPlayerApi, string, sbyte> _getSByte;
4805
4806 private static Action<string, byte> _setByte;
4807
4808 private static Func<VRCPlayerApi, string, byte> _getByte;
4809
4810 private static Action<string, byte[]> _setBytes;
4811
4812 private static Func<VRCPlayerApi, string, byte[]> _getBytes;
4813
4814 private static Action<string, string> _setString;
4815
4816 private static Func<VRCPlayerApi, string, string> _getString;
4817
4818 private static Action<string, short> _setShort;
4819
4820 private static Func<VRCPlayerApi, string, short> _getShort;
4821
4822 private static Action<string, ushort> _setUShort;
4823
4824 private static Func<VRCPlayerApi, string, ushort> _getUShort;
4825
4826 private static Action<string, int> _setInt;
4827
4828 private static Func<VRCPlayerApi, string, int> _getInt;
4829
4830 private static Action<string, uint> _setUInt;
4831
4832 private static Func<VRCPlayerApi, string, uint> _getUInt;
4833
4834 private static Action<string, long> _setLong;
4835
4836 private static Func<VRCPlayerApi, string, long> _getLong;
4837
4838 private static Action<string, ulong> _setULong;
4839
4840 private static Func<VRCPlayerApi, string, ulong> _getULong;
4841
4842 private static Action<string, float> _setFloat;
4843
4844 private static Func<VRCPlayerApi, string, float> _getFloat;
4845
4846 private static Action<string, double> _setDouble;
4847
4848 private static Func<VRCPlayerApi, string, double> _getDouble;
4849
4850 private static Action<string, Vector2> _setVector2;
4851
4852 private static Func<VRCPlayerApi, string, Vector2> _getVector2;
4853
4854 private static Action<string, Vector3> _setVector3;
4855
4856 private static Func<VRCPlayerApi, string, Vector3> _getVector3;
4857
4858 private static Action<string, Vector4> _setVector4;
4859
4860 private static Func<VRCPlayerApi, string, Vector4> _getVector4;
4861
4862 private static Action<string, Quaternion> _setQuaternion;
4863
4864 private static Func<VRCPlayerApi, string, Quaternion> _getQuaternion;
4865
4866 private static Action<string, Color> _setColor;
4867
4868 private static Func<VRCPlayerApi, string, Color> _getColor;
4869
4870 private static Action<string, Color32> _setColor32;
4871
4872 private static Func<VRCPlayerApi, string, Color32> _getColor32;
4873
4874 public static bool HasKey(VRCPlayerApi player, string key)
4875 {
4876 return _hasKey?.Invoke(player, key) ?? false;
4877 }
4878
4879 public static Type GetType(VRCPlayerApi player, string key)
4880 {
4881 return _getType?.Invoke(player, key);
4882 }
4883
4884 public static bool TryGetType(VRCPlayerApi player, string key, out Type t)
4885 {
4886 t = GetType(player, key);
4887 return t != (Type)null;
4888 }
4889
4890 public static bool IsType(VRCPlayerApi player, string key, Type t)
4891 {
4892 return GetType(player, key) == t;
4893 }
4894
4895 public static void SetString(string key, string value)
4896 {
4897 _setString?.Invoke(key, value);
4898 }
4899
4900 public static string GetString(VRCPlayerApi player, string key)
4901 {
4902 return _getString?.Invoke(player, key);
4903 }
4904
4905 public static bool TryGetString(VRCPlayerApi player, string key, out string value)
4906 {
4907 if (GetType(player, key) == typeof(String))
4908 {
4909 value = GetString(player, key);
4910 return true;
4911 }
4912 value = null;
4913 return false;
4914 }
4915
4916 public static void SetBool(string key, bool value)
4917 {
4918 _setBool?.Invoke(key, value);
4919 }
4920
4921 public static bool GetBool(VRCPlayerApi player, string key)
4922 {
4923 return _getBool?.Invoke(player, key) ?? false;
4924 }
4925
4926 public static bool TryGetBool(VRCPlayerApi player, string key, out bool value)
4927 {
4928 if (GetType(player, key) == typeof(Boolean))
4929 {
4930 value = GetBool(player, key);
4931 return true;
4932 }
4933 value = false;
4934 return false;
4935 }
4936
4937 public static void SetSByte(string key, sbyte value)
4938 {
4939 _setSByte?.Invoke(key, value);
4940 }
4941
4942 public static sbyte GetSByte(VRCPlayerApi player, string key)
4943 {
4944 return _getSByte?.Invoke(player, key) ?? 0;
4945 }
4946
4947 public static bool TryGetSByte(VRCPlayerApi player, string key, out sbyte value)
4948 {
4949 if (GetType(player, key) == typeof(SByte))
4950 {
4951 value = GetSByte(player, key);
4952 return true;
4953 }
4954 value = 0;
4955 return false;
4956 }
4957
4958 public static void SetByte(string key, byte value)
4959 {
4960 _setByte?.Invoke(key, value);
4961 }
4962
4963 public static byte GetByte(VRCPlayerApi player, string key)
4964 {
4965 return _getByte?.Invoke(player, key) ?? 0;
4966 }
4967
4968 public static bool TryGetByte(VRCPlayerApi player, string key, out byte value)
4969 {
4970 if (GetType(player, key) == typeof(Byte))
4971 {
4972 value = GetByte(player, key);
4973 return true;
4974 }
4975 value = 0;
4976 return false;
4977 }
4978
4979 public static void SetBytes(string key, byte[] value)
4980 {
4981 _setBytes?.Invoke(key, value);
4982 }
4983
4984 public static byte[] GetBytes(VRCPlayerApi player, string key)
4985 {
4986 return _getBytes?.Invoke(player, key);
4987 }
4988
4989 public static bool TryGetBytes(VRCPlayerApi player, string key, out byte[] value)
4990 {
4991 if (GetType(player, key) == typeof(byte[]))
4992 {
4993 value = GetBytes(player, key);
4994 return true;
4995 }
4996 value = null;
4997 return false;
4998 }
4999
5000 public static void SetShort(string key, short value)
5001 {
5002 _setShort?.Invoke(key, value);
5003 }
5004
5005 public static short GetShort(VRCPlayerApi player, string key)
5006 {
5007 return _getShort?.Invoke(player, key) ?? 0;
5008 }
5009
5010 public static bool TryGetShort(VRCPlayerApi player, string key, out short value)
5011 {
5012 if (GetType(player, key) == typeof(Int16))
5013 {
5014 value = GetShort(player, key);
5015 return true;
5016 }
5017 value = 0;
5018 return false;
5019 }
5020
5021 public static void SetUShort(string key, ushort value)
5022 {
5023 _setUShort?.Invoke(key, value);
5024 }
5025
5026 public static ushort GetUShort(VRCPlayerApi player, string key)
5027 {
5028 return _getUShort?.Invoke(player, key) ?? 0;
5029 }
5030
5031 public static bool TryGetUShort(VRCPlayerApi player, string key, out ushort value)
5032 {
5033 if (GetType(player, key) == typeof(UInt16))
5034 {
5035 value = GetUShort(player, key);
5036 return true;
5037 }
5038 value = 0;
5039 return false;
5040 }
5041
5042 public static void SetInt(string key, int value)
5043 {
5044 _setInt?.Invoke(key, value);
5045 }
5046
5047 public static int GetInt(VRCPlayerApi player, string key)
5048 {
5049 return _getInt?.Invoke(player, key) ?? 0;
5050 }
5051
5052 public static bool TryGetInt(VRCPlayerApi player, string key, out int value)
5053 {
5054 if (GetType(player, key) == typeof(Int32))
5055 {
5056 value = GetInt(player, key);
5057 return true;
5058 }
5059 value = 0;
5060 return false;
5061 }
5062
5063 public static void SetUInt(string key, uint value)
5064 {
5065 _setUInt?.Invoke(key, value);
5066 }
5067
5068 public static uint GetUInt(VRCPlayerApi player, string key)
5069 {
5070 return _getUInt?.Invoke(player, key) ?? 0;
5071 }
5072
5073 public static bool TryGetUInt(VRCPlayerApi player, string key, out uint value)
5074 {
5075 if (GetType(player, key) == typeof(UInt32))
5076 {
5077 value = GetUInt(player, key);
5078 return true;
5079 }
5080 value = 0u;
5081 return false;
5082 }
5083
5084 public static void SetLong(string key, long value)
5085 {
5086 _setLong?.Invoke(key, value);
5087 }
5088
5089 public static long GetLong(VRCPlayerApi player, string key)
5090 {
5091 return _getLong?.Invoke(player, key) ?? 0;
5092 }
5093
5094 public static bool TryGetLong(VRCPlayerApi player, string key, out long value)
5095 {
5096 if (GetType(player, key) == typeof(Int64))
5097 {
5098 value = GetLong(player, key);
5099 return true;
5100 }
5101 value = 0L;
5102 return false;
5103 }
5104
5105 public static void SetULong(string key, ulong value)
5106 {
5107 _setULong?.Invoke(key, value);
5108 }
5109
5110 public static ulong GetULong(VRCPlayerApi player, string key)
5111 {
5112 return _getULong?.Invoke(player, key) ?? 0;
5113 }
5114
5115 public static bool TryGetULong(VRCPlayerApi player, string key, out ulong value)
5116 {
5117 if (GetType(player, key) == typeof(UInt64))
5118 {
5119 value = GetULong(player, key);
5120 return true;
5121 }
5122 value = 0uL;
5123 return false;
5124 }
5125
5126 public static void SetFloat(string key, float value)
5127 {
5128 _setFloat?.Invoke(key, value);
5129 }
5130
5131 public static float GetFloat(VRCPlayerApi player, string key)
5132 {
5133 return _getFloat?.Invoke(player, key) ?? 0f;
5134 }
5135
5136 public static void SetDouble(string key, double value)
5137 {
5138 _setDouble?.Invoke(key, value);
5139 }
5140
5141 public static double GetDouble(VRCPlayerApi player, string key)
5142 {
5143 return _getDouble?.Invoke(player, key) ?? 0.0;
5144 }
5145
5146 public static bool TryGetDouble(VRCPlayerApi player, string key, out double value)
5147 {
5148 if (GetType(player, key) == typeof(Double))
5149 {
5150 value = GetDouble(player, key);
5151 return true;
5152 }
5153 value = 0.0;
5154 return false;
5155 }
5156
5157 public static bool TryGetFloat(VRCPlayerApi player, string key, out float value)
5158 {
5159 if (GetType(player, key) == typeof(Single))
5160 {
5161 value = GetFloat(player, key);
5162 return true;
5163 }
5164 value = 0f;
5165 return false;
5166 }
5167
5168 public static void SetQuaternion(string key, Quaternion value)
5169 {
5170 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5171 _setQuaternion?.Invoke(key, value);
5172 }
5173
5174 public static Quaternion GetQuaternion(VRCPlayerApi player, string key)
5175 {
5176 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
5177 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5178 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
5179 return (Quaternion)(((??)_getQuaternion?.Invoke(player, key)) ?? default(Quaternion));
5180 }
5181
5182 public static bool TryGetQuaternion(VRCPlayerApi player, string key, out Quaternion value)
5183 {
5184 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
5185 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
5186 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
5187 if (GetType(player, key) == typeof(Quaternion))
5188 {
5189 value = GetQuaternion(player, key);
5190 return true;
5191 }
5192 value = default(Quaternion);
5193 return false;
5194 }
5195
5196 public static void SetVector4(string key, Vector4 value)
5197 {
5198 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5199 _setVector4?.Invoke(key, value);
5200 }
5201
5202 public static Vector4 GetVector4(VRCPlayerApi player, string key)
5203 {
5204 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
5205 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5206 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
5207 return (Vector4)(((??)_getVector4?.Invoke(player, key)) ?? default(Vector4));
5208 }
5209
5210 public static bool TryGetVector4(VRCPlayerApi player, string key, out Vector4 value)
5211 {
5212 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
5213 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
5214 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
5215 if (GetType(player, key) == typeof(Vector4))
5216 {
5217 value = GetVector4(player, key);
5218 return true;
5219 }
5220 value = default(Vector4);
5221 return false;
5222 }
5223
5224 public static void SetVector3(string key, Vector3 value)
5225 {
5226 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5227 _setVector3?.Invoke(key, value);
5228 }
5229
5230 public static Vector3 GetVector3(VRCPlayerApi player, string key)
5231 {
5232 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
5233 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5234 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
5235 return (Vector3)(((??)_getVector3?.Invoke(player, key)) ?? default(Vector3));
5236 }
5237
5238 public static bool TryGetVector3(VRCPlayerApi player, string key, out Vector3 value)
5239 {
5240 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
5241 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
5242 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
5243 if (GetType(player, key) == typeof(Vector3))
5244 {
5245 value = GetVector3(player, key);
5246 return true;
5247 }
5248 value = default(Vector3);
5249 return false;
5250 }
5251
5252 public static void SetVector2(string key, Vector2 value)
5253 {
5254 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5255 _setVector2?.Invoke(key, value);
5256 }
5257
5258 public static Vector2 GetVector2(VRCPlayerApi player, string key)
5259 {
5260 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
5261 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5262 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
5263 return (Vector2)(((??)_getVector2?.Invoke(player, key)) ?? default(Vector2));
5264 }
5265
5266 public static bool TryGetVector2(VRCPlayerApi player, string key, out Vector2 value)
5267 {
5268 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
5269 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
5270 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
5271 if (GetType(player, key) == typeof(Vector2))
5272 {
5273 value = GetVector2(player, key);
5274 return true;
5275 }
5276 value = default(Vector2);
5277 return false;
5278 }
5279
5280 public static void SetColor(string key, Color value)
5281 {
5282 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5283 _setColor?.Invoke(key, value);
5284 }
5285
5286 public static Color GetColor(VRCPlayerApi player, string key)
5287 {
5288 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
5289 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5290 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
5291 return (Color)(((??)_getColor?.Invoke(player, key)) ?? default(Color));
5292 }
5293
5294 public static bool TryGetColor(VRCPlayerApi player, string key, out Color value)
5295 {
5296 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
5297 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
5298 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
5299 if (GetType(player, key) == typeof(Color))
5300 {
5301 value = GetColor(player, key);
5302 return true;
5303 }
5304 value = default(Color);
5305 return false;
5306 }
5307
5308 public static void SetColor32(string key, Color32 value)
5309 {
5310 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5311 _setColor32?.Invoke(key, value);
5312 }
5313
5314 public static Color32 GetColor32(VRCPlayerApi player, string key)
5315 {
5316 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
5317 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
5318 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
5319 return (Color32)(((??)_getColor32?.Invoke(player, key)) ?? default(Color32));
5320 }
5321
5322 public static bool TryGetColor32(VRCPlayerApi player, string key, out Color32 value)
5323 {
5324 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
5325 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
5326 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
5327 if (GetType(player, key) == typeof(Color32))
5328 {
5329 value = GetColor32(player, key);
5330 return true;
5331 }
5332 value = default(Color32);
5333 return false;
5334 }
5335
5336 public static IEnumerable<string> GetKeys(VRCPlayerApi player)
5337 {
5338 return _getKeys?.Invoke(player) ?? Enumerable.Empty<string>();
5339 }
5340 }
5341}
5343{
5345 {
5346 [CompilerGenerated]
5347 private static Action<VRCNetworkBehaviour> m_OnNetworkBehaviourAwake;
5348
5349 public static event Action<VRCNetworkBehaviour> OnNetworkBehaviourAwake
5350 {
5351 [CompilerGenerated]
5352 add
5353 {
5354 Action<VRCNetworkBehaviour> val = VRCNetworkBehaviour.m_OnNetworkBehaviourAwake;
5355 Action<VRCNetworkBehaviour> val2;
5356 do
5357 {
5358 val2 = val;
5359 Action<VRCNetworkBehaviour> val3 = (Action<VRCNetworkBehaviour>)(object)Delegate.Combine((Delegate)(object)val2, (Delegate)(object)value);
5360 val = Interlocked.CompareExchange<Action<VRCNetworkBehaviour>>(ref VRCNetworkBehaviour.m_OnNetworkBehaviourAwake, val3, val2);
5361 }
5362 while (val != val2);
5363 }
5364 [CompilerGenerated]
5365 remove
5366 {
5367 Action<VRCNetworkBehaviour> val = VRCNetworkBehaviour.m_OnNetworkBehaviourAwake;
5368 Action<VRCNetworkBehaviour> val2;
5369 do
5370 {
5371 val2 = val;
5372 Action<VRCNetworkBehaviour> val3 = (Action<VRCNetworkBehaviour>)(object)Delegate.Remove((Delegate)(object)val2, (Delegate)(object)value);
5373 val = Interlocked.CompareExchange<Action<VRCNetworkBehaviour>>(ref VRCNetworkBehaviour.m_OnNetworkBehaviourAwake, val3, val2);
5374 }
5375 while (val != val2);
5376 }
5377 }
5378
5379 [ExcludeFromUdonWrapper]
5380 public abstract void NetworkConfigure();
5381
5382 [ExcludeFromUdonWrapper]
5383 public virtual void Awake()
5384 {
5386 }
5387 }
5388}
5390{
5399 [Serializable]
5400 [DefaultMember("Item")]
5401 public class DataDictionary : Object, ICollection<KeyValuePair<DataToken, DataToken>>, IEnumerable<KeyValuePair<DataToken, DataToken>>, IEnumerable
5402 {
5403 internal Dictionary<DataToken, DataToken> _values = new Dictionary<DataToken, DataToken>();
5404
5406
5407 internal bool keysDirty = true;
5408
5410
5411 internal bool valuesDirty = true;
5412
5417 public virtual int Count => _values.Count;
5418
5423 [ExcludeFromUdonWrapper]
5424 [field: CompilerGenerated]
5425 public bool IsReadOnly
5426 {
5427 [CompilerGenerated]
5428 get;
5429 }
5430
5431 public DataToken this[DataToken key]
5432 {
5433 get
5434 {
5435 TryGetValue(key, out var value);
5436 return value;
5437 }
5438 set
5439 {
5440 SetValue(key, value);
5441 }
5442 }
5443
5450 public virtual void SetValue(DataToken key, DataToken value)
5451 {
5452 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
5453 valuesDirty = true;
5454 if (!keysDirty && !_values.ContainsKey(key))
5455 {
5456 keysDirty = true;
5457 }
5458 if (key.IsNull)
5459 {
5460 throw new ArgumentNullException("key", "Key of dictionary cannot be null");
5461 }
5462 _values[key] = value;
5463 }
5464
5469 public bool TryGetValue(DataToken key, TokenType type, out DataToken value)
5470 {
5471 if (!TryGetValue(key, out value))
5472 {
5473 return false;
5474 }
5475 if (value.TokenType != type)
5476 {
5477 value = new DataToken(DataError.TypeMismatch, String.Format("Expected TokenType {0} but found {1} instead", (object)type, (object)value.TokenType));
5478 return false;
5479 }
5480 return true;
5481 }
5482
5487 public bool TryGetValue(DataToken key, out DataToken value)
5488 {
5489 value = GetValue(key, out var success);
5490 return success;
5491 }
5492
5493 protected virtual DataToken GetValue(DataToken key, out bool success)
5494 {
5495 if (_values.ContainsKey(key))
5496 {
5497 success = true;
5498 return _values[key];
5499 }
5500 success = false;
5501 return DataError.KeyDoesNotExist;
5502 }
5503
5510 {
5511 ParseAll();
5512 DataList keys = GetKeys();
5513 DataDictionary dataDictionary = new DataDictionary();
5514 for (int i = 0; i < keys.Count; i++)
5515 {
5516 dataDictionary[keys[i]] = _values[keys[i]];
5517 }
5518 return dataDictionary;
5519 }
5520
5528 {
5529 ParseAll();
5530 DataList keys = GetKeys();
5531 DataDictionary dataDictionary = new DataDictionary();
5532 for (int i = 0; i < keys.Count; i++)
5533 {
5534 switch (_values[keys[i]].TokenType)
5535 {
5536 case TokenType.DataDictionary:
5537 dataDictionary[keys[i]] = _values[keys[i]].DataDictionary.DeepClone();
5538 break;
5539 case TokenType.DataList:
5540 dataDictionary[keys[i]] = _values[keys[i]].DataList.DeepClone();
5541 break;
5542 default:
5543 dataDictionary[keys[i]] = _values[keys[i]];
5544 break;
5545 }
5546 }
5547 return dataDictionary;
5548 }
5549
5553 public virtual void Clear()
5554 {
5555 keysDirty = true;
5556 valuesDirty = true;
5557 _values.Clear();
5558 }
5559
5565 public virtual bool Remove(DataToken key)
5566 {
5567 keysDirty = true;
5568 valuesDirty = true;
5569 return _values.Remove(key);
5570 }
5571
5578 public bool Remove(DataToken key, out DataToken value)
5579 {
5580 keysDirty = true;
5581 valuesDirty = true;
5582 bool result = TryGetValue(key, out value);
5583 _values.Remove(key);
5584 return result;
5585 }
5586
5591 public virtual bool ContainsKey(DataToken key)
5592 {
5593 return _values.ContainsKey(key);
5594 }
5595
5600 public virtual bool ContainsValue(DataToken value)
5601 {
5602 ParseAll();
5603 return _values.ContainsValue(value);
5604 }
5605
5606 internal virtual void ParseAll()
5607 {
5608 }
5609
5614 public virtual DataList GetKeys()
5615 {
5616 if (keysDirty)
5617 {
5618 keyCache = new DataList((IEnumerable<DataToken>)(object)_values.Keys);
5619 keysDirty = false;
5620 return keyCache;
5621 }
5622 return keyCache;
5623 }
5624
5630 {
5631 if (valuesDirty)
5632 {
5633 ParseAll();
5634 valueCache = new DataList((IEnumerable<DataToken>)(object)_values.Values);
5635 valuesDirty = false;
5636 return valueCache;
5637 }
5638 return valueCache;
5639 }
5640
5645 [ExcludeFromUdonWrapper]
5646 public IEnumerator<KeyValuePair<DataToken, DataToken>> GetEnumerator()
5647 {
5648 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
5649 ParseAll();
5650 return (IEnumerator<KeyValuePair<DataToken, DataToken>>)(object)_values.GetEnumerator();
5651 }
5652
5653 [ExcludeFromUdonWrapper]
5654 IEnumerator IEnumerable.GetEnumerator()
5655 {
5656 return (IEnumerator)(object)GetEnumerator();
5657 }
5658
5659 [ExcludeFromUdonWrapper]
5660 public void Add(KeyValuePair<DataToken, DataToken> item)
5661 {
5662 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
5663 if (item.Key.IsNull)
5664 {
5665 throw new ArgumentNullException("item", "Key of dictionary cannot be null");
5666 }
5667 keysDirty = true;
5668 valuesDirty = true;
5669 _values.Add(item.Key, item.Value);
5670 }
5671
5680 public virtual void Add(DataToken key, DataToken value)
5681 {
5682 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
5683 if (key.IsNull)
5684 {
5685 throw new ArgumentNullException("key", "Key of dictionary cannot be null");
5686 }
5687 keysDirty = true;
5688 valuesDirty = true;
5689 _values.Add(key, value);
5690 }
5691
5692 [ExcludeFromUdonWrapper]
5693 public bool Contains(KeyValuePair<DataToken, DataToken> item)
5694 {
5695 ParseAll();
5696 if (!_values.ContainsKey(item.Key))
5697 {
5698 return false;
5699 }
5700 DataToken lhs = _values[item.Key];
5701 DataToken rhs = item.Value;
5702 if (lhs != rhs)
5703 {
5704 return false;
5705 }
5706 return true;
5707 }
5708
5709 [ExcludeFromUdonWrapper]
5710 public void CopyTo(KeyValuePair<DataToken, DataToken>[] array, int arrayIndex)
5711 {
5712 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
5713 throw new NotImplementedException();
5714 }
5715
5716 [ExcludeFromUdonWrapper]
5717 public bool Remove(KeyValuePair<DataToken, DataToken> item)
5718 {
5719 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
5720 if (!Contains(item))
5721 {
5722 return false;
5723 }
5724 return Remove(item.Key);
5725 }
5726 }
5727 [Serializable]
5728 [DefaultMember("Item")]
5729 public class DataList : Object, ICollection<DataToken>, IEnumerable<DataToken>, IEnumerable
5730 {
5731 [SerializeField]
5732 internal List<DataToken> _values = new List<DataToken>();
5733
5734 public int Count => _values.Count;
5735
5736 public int Capacity
5737 {
5738 get
5739 {
5740 return _values.Capacity;
5741 }
5742 set
5743 {
5744 _values.Capacity = value;
5745 }
5746 }
5747
5748 [ExcludeFromUdonWrapper]
5749 [field: CompilerGenerated]
5750 public bool IsReadOnly
5751 {
5752 [CompilerGenerated]
5753 get;
5754 }
5755
5756 public DataToken this[int index]
5757 {
5758 get
5759 {
5760 TryGetValue(index, out var value);
5761 return value;
5762 }
5763 set
5764 {
5765 SetValue(index, value);
5766 }
5767 }
5768
5769 public DataList()
5770 {
5771 }
5772
5773 public DataList(params DataToken[] array)
5774 {
5775 for (int i = 0; i < array.Length; i++)
5776 {
5777 _values.Add(array[i]);
5778 }
5779 }
5780
5781 internal DataList(IEnumerable<DataToken> values)
5782 {
5783 IEnumerator<DataToken> enumerator = values.GetEnumerator();
5784 try
5785 {
5786 while (((IEnumerator)enumerator).MoveNext())
5787 {
5788 DataToken current = enumerator.Current;
5789 _values.Add(current);
5790 }
5791 }
5792 finally
5793 {
5794 if (enumerator != null)
5795 {
5796 ((IDisposable)enumerator).Dispose();
5797 }
5798 }
5799 }
5800
5801 internal DataList(List<DataToken> list)
5802 {
5803 _values = list;
5804 }
5805
5806 public void TrimExcess()
5807 {
5808 _values.TrimExcess();
5809 }
5810
5811 public virtual bool SetValue(int index, DataToken value)
5812 {
5813 _values[index] = value;
5814 return true;
5815 }
5816
5817 public virtual bool TryGetValue(int index, TokenType type, out DataToken value)
5818 {
5819 if (!TryGetValue(index, out value))
5820 {
5821 return false;
5822 }
5823 if (value.TokenType != type)
5824 {
5825 value = new DataToken(DataError.TypeMismatch, String.Format("Expected TokenType {0} but found {1} instead", (object)type, (object)value.TokenType));
5826 return false;
5827 }
5828 return true;
5829 }
5830
5831 public virtual bool TryGetValue(int index, out DataToken value)
5832 {
5833 value = GetValue(index, out var success);
5834 return success;
5835 }
5836
5837 protected virtual DataToken GetValue(int index, out bool success)
5838 {
5839 if (index < 0 || index >= Count)
5840 {
5841 success = false;
5842 return DataError.IndexOutOfRange;
5843 }
5844 success = true;
5845 return _values[index];
5846 }
5847
5848 public virtual void Insert(int index, DataToken value)
5849 {
5850 _values.Insert(index, value);
5851 }
5852
5853 public virtual void InsertRange(int index, DataList input)
5854 {
5855 _values.InsertRange(index, (IEnumerable<DataToken>)(object)input._values);
5856 }
5857
5858 public DataList GetRange(int index, int count)
5859 {
5860 ParseAll();
5861 return new DataList(_values.GetRange(index, count));
5862 }
5863
5865 {
5866 ParseAll();
5867 return new DataList(_values.GetRange(0, Count))
5868 {
5870 };
5871 }
5872
5874 {
5875 ParseAll();
5876 DataList dataList = new DataList();
5877 dataList.Capacity = Capacity;
5878 for (int i = 0; i < _values.Count; i++)
5879 {
5880 switch (_values[i].TokenType)
5881 {
5882 case TokenType.DataDictionary:
5883 dataList.Add(_values[i].DataDictionary.DeepClone());
5884 break;
5885 case TokenType.DataList:
5886 dataList.Add(_values[i].DataList.DeepClone());
5887 break;
5888 default:
5889 dataList.Add(_values[i]);
5890 break;
5891 }
5892 }
5893 return dataList;
5894 }
5895
5897 {
5898 ParseAll();
5899 return _values.ToArray();
5900 }
5901
5902 public virtual void Add(DataToken value)
5903 {
5904 _values.Add(value);
5905 }
5906
5907 public void AddRange(DataList list)
5908 {
5909 ParseAll();
5910 _values.AddRange((IEnumerable<DataToken>)(object)list._values);
5911 }
5912
5913 internal void AddRange(IEnumerable<DataToken> values)
5914 {
5915 ParseAll();
5916 IEnumerator<DataToken> enumerator = values.GetEnumerator();
5917 try
5918 {
5919 while (((IEnumerator)enumerator).MoveNext())
5920 {
5921 DataToken current = enumerator.Current;
5922 Add(current);
5923 }
5924 }
5925 finally
5926 {
5927 if (enumerator != null)
5928 {
5929 ((IDisposable)enumerator).Dispose();
5930 }
5931 }
5932 }
5933
5934 public bool Contains(DataToken value)
5935 {
5936 ParseAll();
5937 return _values.Contains(value);
5938 }
5939
5940 public int IndexOf(DataToken value)
5941 {
5942 ParseAll();
5943 return _values.IndexOf(value);
5944 }
5945
5946 public int IndexOf(DataToken item, int index)
5947 {
5948 ParseAll();
5949 return _values.IndexOf(item, index);
5950 }
5951
5952 public int IndexOf(DataToken item, int index, int count)
5953 {
5954 ParseAll();
5955 return _values.IndexOf(item, index, count);
5956 }
5957
5958 public int LastIndexOf(DataToken item)
5959 {
5960 ParseAll();
5961 return _values.LastIndexOf(item);
5962 }
5963
5964 public int LastIndexOf(DataToken item, int index)
5965 {
5966 ParseAll();
5967 return _values.LastIndexOf(item, index);
5968 }
5969
5970 public int LastIndexOf(DataToken item, int index, int count)
5971 {
5972 ParseAll();
5973 return _values.LastIndexOf(item, index, count);
5974 }
5975
5976 public bool Remove(DataToken value)
5977 {
5978 ParseAll();
5979 return _values.Remove(value);
5980 }
5981
5982 public bool RemoveAll(DataToken value)
5983 {
5984 ParseAll();
5985 bool result = false;
5986 while (Remove(value))
5987 {
5988 result = true;
5989 }
5990 return result;
5991 }
5992
5993 public virtual void Clear()
5994 {
5995 _values.Clear();
5996 }
5997
5998 public virtual void RemoveAt(int index)
5999 {
6000 _values.RemoveAt(index);
6001 }
6002
6003 public virtual void RemoveRange(int index, int count)
6004 {
6005 _values.RemoveRange(index, count);
6006 }
6007
6008 public virtual void Reverse()
6009 {
6010 _values.Reverse();
6011 }
6012
6013 public virtual void Reverse(int index, int count)
6014 {
6015 _values.Reverse(index, count);
6016 }
6017
6018 public void Sort()
6019 {
6020 ParseAll();
6021 _values.Sort();
6022 }
6023
6024 public void Sort(int index, int count)
6025 {
6026 ParseAll();
6027 _values.Sort(index, count, (IComparer<DataToken>)null);
6028 }
6029
6030 public int BinarySearch(DataToken token)
6031 {
6032 ParseAll();
6033 return _values.BinarySearch(token);
6034 }
6035
6036 public int BinarySearch(int index, int count, DataToken token)
6037 {
6038 ParseAll();
6039 return _values.BinarySearch(index, count, token, (IComparer<DataToken>)null);
6040 }
6041
6042 protected virtual void ParseAll()
6043 {
6044 ParseInRange(0, Count);
6045 }
6046
6047 protected virtual void ParseInRange(int startIndex)
6048 {
6049 ParseInRange(startIndex, Count);
6050 }
6051
6052 protected virtual void ParseInRange(int startIndex, int stopIndex)
6053 {
6054 }
6055
6056 [ExcludeFromUdonWrapper]
6057 public void CopyTo(DataToken[] array, int arrayIndex)
6058 {
6059 _values.CopyTo(array, arrayIndex);
6060 }
6061
6062 [ExcludeFromUdonWrapper]
6063 public IEnumerator<DataToken> GetEnumerator()
6064 {
6065 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
6066 ParseAll();
6067 return (IEnumerator<DataToken>)(object)_values.GetEnumerator();
6068 }
6069
6070 [ExcludeFromUdonWrapper]
6071 IEnumerator IEnumerable.GetEnumerator()
6072 {
6073 return (IEnumerator)(object)GetEnumerator();
6074 }
6075 }
6076 public enum DataError : Enum
6077 {
6078 None,
6079 KeyDoesNotExist,
6080 TypeMismatch,
6081 TypeUnsupported,
6082 ValueUnsupported,
6083 UnableToParse,
6084 IndexOutOfRange
6085 }
6086 public enum TokenType : Enum
6087 {
6088 Null,
6089 Boolean,
6090 SByte,
6091 Byte,
6092 Short,
6093 UShort,
6094 Int,
6095 UInt,
6096 Long,
6097 ULong,
6098 Float,
6099 Double,
6100 String,
6101 DataList,
6103 Reference,
6104 Error
6105 }
6106 [Serializable]
6107 [StructLayout(2)]
6108 public struct DataToken : ValueType, IComparable, IComparable<DataToken>, IEquatable<DataToken>, IEquatable<string>, IEquatable<object>, IEquatable<bool>, IEquatable<sbyte>, IEquatable<byte>, IEquatable<short>, IEquatable<ushort>, IEquatable<int>, IEquatable<uint>, IEquatable<long>, IEquatable<ulong>, IEquatable<float>, IEquatable<double>, IEquatable<DataList>, IEquatable<DataDictionary>, IEquatable<DataError>
6109 {
6110 [FieldOffset(0)]
6111 private string _string;
6112
6113 [FieldOffset(0)]
6114 private object _reference;
6115
6116 [FieldOffset(8)]
6117 private bool _boolean;
6118
6119 [FieldOffset(8)]
6120 private sbyte _sbyte;
6121
6122 [FieldOffset(8)]
6123 private byte _byte;
6124
6125 [FieldOffset(8)]
6126 private short _short;
6127
6128 [FieldOffset(8)]
6129 private ushort _ushort;
6130
6131 [FieldOffset(8)]
6132 private int _int;
6133
6134 [FieldOffset(8)]
6135 private uint _uint;
6136
6137 [FieldOffset(8)]
6138 private long _long;
6139
6140 [FieldOffset(8)]
6141 private ulong _ulong;
6142
6143 [FieldOffset(8)]
6144 private float _float;
6145
6146 [FieldOffset(8)]
6147 private double _double;
6148
6149 [FieldOffset(8)]
6150 private DataError _error;
6151
6152 [FieldOffset(16)]
6153 [SerializeField]
6154 private TokenType _tokenType;
6155
6156 public TokenType TokenType => _tokenType;
6157
6158 public bool IsEmpty => _tokenType == TokenType.Null;
6159
6160 public bool Boolean
6161 {
6162 get
6163 {
6164 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
6165 if (_tokenType == TokenType.Boolean)
6166 {
6167 return _boolean;
6168 }
6169 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.Boolean));
6170 }
6171 }
6172
6173 public sbyte SByte
6174 {
6175 get
6176 {
6177 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
6178 if (_tokenType == TokenType.SByte)
6179 {
6180 return _sbyte;
6181 }
6182 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.SByte));
6183 }
6184 }
6185
6186 public byte Byte
6187 {
6188 get
6189 {
6190 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
6191 if (_tokenType == TokenType.Byte)
6192 {
6193 return _byte;
6194 }
6195 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.Byte));
6196 }
6197 }
6198
6199 public short Short
6200 {
6201 get
6202 {
6203 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
6204 if (_tokenType == TokenType.Short)
6205 {
6206 return _short;
6207 }
6208 if (_tokenType == TokenType.SByte)
6209 {
6210 return _sbyte;
6211 }
6212 if (_tokenType == TokenType.Byte)
6213 {
6214 return _byte;
6215 }
6216 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.Short));
6217 }
6218 }
6219
6220 public ushort UShort
6221 {
6222 get
6223 {
6224 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
6225 if (_tokenType == TokenType.UShort)
6226 {
6227 return _ushort;
6228 }
6229 if (_tokenType == TokenType.Byte)
6230 {
6231 return _byte;
6232 }
6233 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.UShort));
6234 }
6235 }
6236
6237 public int Int
6238 {
6239 get
6240 {
6241 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
6242 if (_tokenType == TokenType.Int)
6243 {
6244 return _int;
6245 }
6246 if (_tokenType == TokenType.SByte)
6247 {
6248 return _sbyte;
6249 }
6250 if (_tokenType == TokenType.Byte)
6251 {
6252 return _byte;
6253 }
6254 if (_tokenType == TokenType.Short)
6255 {
6256 return _short;
6257 }
6258 if (_tokenType == TokenType.UShort)
6259 {
6260 return _ushort;
6261 }
6262 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.Int));
6263 }
6264 }
6265
6266 public uint UInt
6267 {
6268 get
6269 {
6270 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
6271 if (_tokenType == TokenType.UInt)
6272 {
6273 return _uint;
6274 }
6275 if (_tokenType == TokenType.Byte)
6276 {
6277 return _byte;
6278 }
6279 if (_tokenType == TokenType.UShort)
6280 {
6281 return _ushort;
6282 }
6283 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.UInt));
6284 }
6285 }
6286
6287 public long Long
6288 {
6289 get
6290 {
6291 //IL_0080: Unknown result type (might be due to invalid IL or missing references)
6292 if (_tokenType == TokenType.Long)
6293 {
6294 return _long;
6295 }
6296 if (_tokenType == TokenType.SByte)
6297 {
6298 return _sbyte;
6299 }
6300 if (_tokenType == TokenType.Byte)
6301 {
6302 return _byte;
6303 }
6304 if (_tokenType == TokenType.Short)
6305 {
6306 return _short;
6307 }
6308 if (_tokenType == TokenType.UShort)
6309 {
6310 return _ushort;
6311 }
6312 if (_tokenType == TokenType.Int)
6313 {
6314 return _uint;
6315 }
6316 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.Long));
6317 }
6318 }
6319
6320 public ulong ULong
6321 {
6322 get
6323 {
6324 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
6325 if (_tokenType == TokenType.ULong)
6326 {
6327 return _ulong;
6328 }
6329 if (_tokenType == TokenType.Byte)
6330 {
6331 return _byte;
6332 }
6333 if (_tokenType == TokenType.UShort)
6334 {
6335 return _ushort;
6336 }
6337 if (_tokenType == TokenType.UInt)
6338 {
6339 return _uint;
6340 }
6341 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.ULong));
6342 }
6343 }
6344
6345 public float Float
6346 {
6347 get
6348 {
6349 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
6350 if (_tokenType == TokenType.Float)
6351 {
6352 return _float;
6353 }
6354 if (_tokenType == TokenType.SByte)
6355 {
6356 return _sbyte;
6357 }
6358 if (_tokenType == TokenType.Byte)
6359 {
6360 return (int)_byte;
6361 }
6362 if (_tokenType == TokenType.Short)
6363 {
6364 return _short;
6365 }
6366 if (_tokenType == TokenType.UShort)
6367 {
6368 return (int)_ushort;
6369 }
6370 if (_tokenType == TokenType.Int)
6371 {
6372 return _int;
6373 }
6374 if (_tokenType == TokenType.UInt)
6375 {
6376 return _uint;
6377 }
6378 if (_tokenType == TokenType.Long)
6379 {
6380 return _long;
6381 }
6382 if (_tokenType == TokenType.ULong)
6383 {
6384 return _ulong;
6385 }
6386 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.Float));
6387 }
6388 }
6389
6390 public double Double
6391 {
6392 get
6393 {
6394 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
6395 if (_tokenType == TokenType.Double)
6396 {
6397 return _double;
6398 }
6399 if (_tokenType == TokenType.SByte)
6400 {
6401 return _sbyte;
6402 }
6403 if (_tokenType == TokenType.Byte)
6404 {
6405 return (int)_byte;
6406 }
6407 if (_tokenType == TokenType.Short)
6408 {
6409 return _short;
6410 }
6411 if (_tokenType == TokenType.UShort)
6412 {
6413 return (int)_ushort;
6414 }
6415 if (_tokenType == TokenType.Int)
6416 {
6417 return _int;
6418 }
6419 if (_tokenType == TokenType.UInt)
6420 {
6421 return _uint;
6422 }
6423 if (_tokenType == TokenType.Long)
6424 {
6425 return _long;
6426 }
6427 if (_tokenType == TokenType.ULong)
6428 {
6429 return _ulong;
6430 }
6431 if (_tokenType == TokenType.Float)
6432 {
6433 return _float;
6434 }
6435 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.Double));
6436 }
6437 }
6438
6439 public double Number
6440 {
6441 get
6442 {
6443 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
6444 if (_tokenType == TokenType.Double)
6445 {
6446 return _double;
6447 }
6448 if (_tokenType == TokenType.SByte)
6449 {
6450 return _sbyte;
6451 }
6452 if (_tokenType == TokenType.Byte)
6453 {
6454 return (int)_byte;
6455 }
6456 if (_tokenType == TokenType.Short)
6457 {
6458 return _short;
6459 }
6460 if (_tokenType == TokenType.UShort)
6461 {
6462 return (int)_ushort;
6463 }
6464 if (_tokenType == TokenType.Int)
6465 {
6466 return _int;
6467 }
6468 if (_tokenType == TokenType.UInt)
6469 {
6470 return _uint;
6471 }
6472 if (_tokenType == TokenType.Long)
6473 {
6474 return _long;
6475 }
6476 if (_tokenType == TokenType.ULong)
6477 {
6478 return _ulong;
6479 }
6480 if (_tokenType == TokenType.Float)
6481 {
6482 return _float;
6483 }
6484 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.Double));
6485 }
6486 }
6487
6488 public string String
6489 {
6490 get
6491 {
6492 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
6493 if (_tokenType != TokenType.String && _tokenType != TokenType.Error)
6494 {
6495 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.String));
6496 }
6497 return _string;
6498 }
6499 }
6500
6502 {
6503 get
6504 {
6505 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
6506 if (_tokenType != TokenType.DataList)
6507 {
6508 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.DataList));
6509 }
6510 return (DataList)_reference;
6511 }
6512 }
6513
6515 {
6516 get
6517 {
6518 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
6519 if (_tokenType != TokenType.DataDictionary)
6520 {
6521 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.DataDictionary));
6522 }
6523 return (DataDictionary)_reference;
6524 }
6525 }
6526
6527 public object Reference
6528 {
6529 get
6530 {
6531 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
6532 if (_tokenType != TokenType.Reference)
6533 {
6534 throw new InvalidOperationException(String.Format("Attempted to access {0} token as {1}", (object)_tokenType, (object)TokenType.Reference));
6535 }
6536 return _reference;
6537 }
6538 }
6539
6541 {
6542 get
6543 {
6544 if (_tokenType != TokenType.Error)
6545 {
6546 return DataError.None;
6547 }
6548 return _error;
6549 }
6550 }
6551
6552 public bool IsNumber => TokenType switch
6553 {
6554 TokenType.SByte => true,
6555 TokenType.Byte => true,
6556 TokenType.Short => true,
6557 TokenType.UShort => true,
6558 TokenType.Int => true,
6559 TokenType.UInt => true,
6560 TokenType.Long => true,
6561 TokenType.ULong => true,
6562 TokenType.Float => true,
6563 TokenType.Double => true,
6564 _ => false,
6565 };
6566
6567 public bool IsNull
6568 {
6569 get
6570 {
6571 //IL_0084: Unknown result type (might be due to invalid IL or missing references)
6572 switch (TokenType)
6573 {
6574 case TokenType.Boolean:
6575 case TokenType.SByte:
6576 case TokenType.Byte:
6577 case TokenType.Short:
6578 case TokenType.UShort:
6579 case TokenType.Int:
6580 case TokenType.UInt:
6581 case TokenType.Long:
6582 case TokenType.ULong:
6583 case TokenType.Float:
6584 case TokenType.Double:
6585 case TokenType.Error:
6586 return false;
6587 case TokenType.Null:
6588 return true;
6589 case TokenType.String:
6590 return String == null;
6591 case TokenType.DataList:
6592 return DataList == null;
6593 case TokenType.DataDictionary:
6594 return DataDictionary == null;
6595 case TokenType.Reference:
6596 return !Utilities.IsValid(Reference);
6597 default:
6598 throw new ArgumentOutOfRangeException();
6599 }
6600 }
6601 }
6602
6603 public DataToken(bool b)
6604 {
6605 this = default(DataToken);
6606 _boolean = b;
6607 _tokenType = TokenType.Boolean;
6608 }
6609
6610 public DataToken(sbyte number)
6611 {
6612 this = default(DataToken);
6613 _sbyte = number;
6614 _tokenType = TokenType.SByte;
6615 }
6616
6617 public DataToken(byte number)
6618 {
6619 this = default(DataToken);
6620 _byte = number;
6621 _tokenType = TokenType.Byte;
6622 }
6623
6624 public DataToken(short number)
6625 {
6626 this = default(DataToken);
6627 _short = number;
6628 _tokenType = TokenType.Short;
6629 }
6630
6631 public DataToken(ushort number)
6632 {
6633 this = default(DataToken);
6634 _ushort = number;
6635 _tokenType = TokenType.UShort;
6636 }
6637
6638 public DataToken(int number)
6639 {
6640 this = default(DataToken);
6641 _int = number;
6642 _tokenType = TokenType.Int;
6643 }
6644
6645 public DataToken(uint number)
6646 {
6647 this = default(DataToken);
6648 _uint = number;
6649 _tokenType = TokenType.UInt;
6650 }
6651
6652 public DataToken(long number)
6653 {
6654 this = default(DataToken);
6655 _long = number;
6656 _tokenType = TokenType.Long;
6657 }
6658
6659 public DataToken(ulong number)
6660 {
6661 this = default(DataToken);
6662 _ulong = number;
6663 _tokenType = TokenType.ULong;
6664 }
6665
6666 public DataToken(float number)
6667 {
6668 this = default(DataToken);
6669 _float = number;
6670 _tokenType = TokenType.Float;
6671 }
6672
6673 public DataToken(double number)
6674 {
6675 this = default(DataToken);
6676 _double = number;
6677 _tokenType = TokenType.Double;
6678 }
6679
6680 public DataToken(string str)
6681 {
6682 this = default(DataToken);
6683 if (str == null)
6684 {
6685 _tokenType = TokenType.Null;
6686 return;
6687 }
6688 _string = str;
6689 _tokenType = TokenType.String;
6690 }
6691
6692 public DataToken(DataList list)
6693 {
6694 this = default(DataToken);
6695 if (list == null)
6696 {
6697 _tokenType = TokenType.Null;
6698 return;
6699 }
6700 _reference = list;
6701 _tokenType = TokenType.DataList;
6702 }
6703
6705 {
6706 this = default(DataToken);
6707 if (obj == null)
6708 {
6709 _tokenType = TokenType.Null;
6710 return;
6711 }
6712 _reference = obj;
6713 _tokenType = TokenType.DataDictionary;
6714 }
6715
6716 public DataToken(object reference)
6717 {
6718 this = default(DataToken);
6719 _reference = reference;
6720 _tokenType = TokenType.Reference;
6721 }
6722
6723 public DataToken(Object reference)
6724 {
6725 this = default(DataToken);
6726 _reference = reference;
6727 _tokenType = TokenType.Reference;
6728 }
6729
6730 public DataToken(DataError error)
6731 {
6732 this = default(DataToken);
6733 _error = error;
6734 _tokenType = TokenType.Error;
6735 }
6736
6737 public DataToken(DataError error, string errorMessage)
6738 {
6739 this = default(DataToken);
6740 _error = error;
6741 _string = errorMessage;
6742 _tokenType = TokenType.Error;
6743 }
6744
6745 public static explicit operator bool(DataToken value)
6746 {
6747 return value.Boolean;
6748 }
6749
6750 public static explicit operator sbyte(DataToken value)
6751 {
6752 return value.SByte;
6753 }
6754
6755 public static explicit operator byte(DataToken value)
6756 {
6757 return value.Byte;
6758 }
6759
6760 public static explicit operator short(DataToken value)
6761 {
6762 return value.Short;
6763 }
6764
6765 public static explicit operator ushort(DataToken value)
6766 {
6767 return value.UShort;
6768 }
6769
6770 public static explicit operator int(DataToken value)
6771 {
6772 return value.Int;
6773 }
6774
6775 public static explicit operator uint(DataToken value)
6776 {
6777 return value.UInt;
6778 }
6779
6780 public static explicit operator long(DataToken value)
6781 {
6782 return value.Long;
6783 }
6784
6785 public static explicit operator ulong(DataToken value)
6786 {
6787 return value.ULong;
6788 }
6789
6790 public static explicit operator float(DataToken value)
6791 {
6792 return value.Float;
6793 }
6794
6795 public static explicit operator double(DataToken value)
6796 {
6797 return value.Double;
6798 }
6799
6800 public static explicit operator string(DataToken value)
6801 {
6802 return value.String;
6803 }
6804
6805 public static explicit operator DataDictionary(DataToken value)
6806 {
6807 return value.DataDictionary;
6808 }
6809
6810 public static explicit operator DataList(DataToken value)
6811 {
6812 return value.DataList;
6813 }
6814
6815 public static explicit operator DataError(DataToken value)
6816 {
6817 return value.Error;
6818 }
6819
6820 public static implicit operator DataToken(Object value)
6821 {
6822 return new DataToken(value);
6823 }
6824
6825 public static implicit operator DataToken(bool value)
6826 {
6827 return new DataToken(value);
6828 }
6829
6830 public static implicit operator DataToken(sbyte value)
6831 {
6832 return new DataToken(value);
6833 }
6834
6835 public static implicit operator DataToken(byte value)
6836 {
6837 return new DataToken(value);
6838 }
6839
6840 public static implicit operator DataToken(short value)
6841 {
6842 return new DataToken(value);
6843 }
6844
6845 public static implicit operator DataToken(ushort value)
6846 {
6847 return new DataToken(value);
6848 }
6849
6850 public static implicit operator DataToken(int value)
6851 {
6852 return new DataToken(value);
6853 }
6854
6855 public static implicit operator DataToken(uint value)
6856 {
6857 return new DataToken(value);
6858 }
6859
6860 public static implicit operator DataToken(long value)
6861 {
6862 return new DataToken(value);
6863 }
6864
6865 public static implicit operator DataToken(ulong value)
6866 {
6867 return new DataToken(value);
6868 }
6869
6870 public static implicit operator DataToken(float value)
6871 {
6872 return new DataToken(value);
6873 }
6874
6875 public static implicit operator DataToken(double value)
6876 {
6877 return new DataToken(value);
6878 }
6879
6880 public static implicit operator DataToken(string value)
6881 {
6882 return new DataToken(value);
6883 }
6884
6885 public static implicit operator DataToken(DataDictionary value)
6886 {
6887 return new DataToken(value);
6888 }
6889
6890 public static implicit operator DataToken(DataList value)
6891 {
6892 return new DataToken(value);
6893 }
6894
6895 public static implicit operator DataToken(DataError value)
6896 {
6897 return new DataToken(value);
6898 }
6899
6900 public override string ToString()
6901 {
6902 switch (TokenType)
6903 {
6904 case TokenType.Null:
6905 return "Null";
6906 case TokenType.Boolean:
6907 {
6908 bool boolean = Boolean;
6909 return ((Boolean)(ref boolean)).ToString();
6910 }
6911 case TokenType.SByte:
6912 {
6913 sbyte sByte = SByte;
6914 return ((SByte)(ref sByte)).ToString();
6915 }
6916 case TokenType.Byte:
6917 {
6918 byte @byte = Byte;
6919 return ((Byte)(ref @byte)).ToString();
6920 }
6921 case TokenType.Short:
6922 {
6923 short @short = Short;
6924 return ((Int16)(ref @short)).ToString();
6925 }
6926 case TokenType.UShort:
6927 {
6928 ushort uShort = UShort;
6929 return ((UInt16)(ref uShort)).ToString();
6930 }
6931 case TokenType.Int:
6932 {
6933 int @int = Int;
6934 return ((Int32)(ref @int)).ToString();
6935 }
6936 case TokenType.UInt:
6937 {
6938 uint uInt = UInt;
6939 return ((UInt32)(ref uInt)).ToString();
6940 }
6941 case TokenType.Long:
6942 {
6943 long @long = Long;
6944 return ((Int64)(ref @long)).ToString();
6945 }
6946 case TokenType.ULong:
6947 {
6948 ulong uLong = ULong;
6949 return ((UInt64)(ref uLong)).ToString();
6950 }
6951 case TokenType.Float:
6952 {
6953 float @float = Float;
6954 return ((Single)(ref @float)).ToString("G", (IFormatProvider)(object)CultureInfo.InvariantCulture);
6955 }
6956 case TokenType.Double:
6957 {
6958 double @double = Double;
6959 return ((Double)(ref @double)).ToString("G", (IFormatProvider)(object)CultureInfo.InvariantCulture);
6960 }
6961 case TokenType.String:
6962 return String;
6963 case TokenType.DataList:
6964 if (DataList == null)
6965 {
6966 return "Null";
6967 }
6968 return ((Object)DataList).ToString();
6969 case TokenType.DataDictionary:
6970 if (DataDictionary == null)
6971 {
6972 return "Null";
6973 }
6974 return ((Object)DataDictionary).ToString();
6975 case TokenType.Reference:
6976 if (Reference == null)
6977 {
6978 return "Null";
6979 }
6980 return Reference.ToString();
6981 case TokenType.Error:
6982 if (String.IsNullOrEmpty(String))
6983 {
6984 return ((Object)Error).ToString();
6985 }
6986 return String.Concat(((Object)Error).ToString(), ": ", String);
6987 default:
6988 return String.Format("DataToken({0})", (object)_tokenType);
6989 }
6990 }
6991
6992 public override int GetHashCode()
6993 {
6994 //IL_0159: Unknown result type (might be due to invalid IL or missing references)
6995 switch (TokenType)
6996 {
6997 case TokenType.Null:
6998 return ((Object)TokenType.Null).GetHashCode();
6999 case TokenType.Boolean:
7000 return ((Boolean)(ref _boolean)).GetHashCode();
7001 case TokenType.SByte:
7002 return ((SByte)(ref _sbyte)).GetHashCode();
7003 case TokenType.Byte:
7004 return ((Byte)(ref _byte)).GetHashCode();
7005 case TokenType.Short:
7006 return ((Int16)(ref _short)).GetHashCode();
7007 case TokenType.UShort:
7008 return ((UInt16)(ref _ushort)).GetHashCode();
7009 case TokenType.Int:
7010 return ((Int32)(ref _int)).GetHashCode();
7011 case TokenType.UInt:
7012 return ((UInt32)(ref _uint)).GetHashCode();
7013 case TokenType.Long:
7014 return ((Int64)(ref _long)).GetHashCode();
7015 case TokenType.ULong:
7016 return ((UInt64)(ref _ulong)).GetHashCode();
7017 case TokenType.Float:
7018 return ((Single)(ref _float)).GetHashCode();
7019 case TokenType.Double:
7020 return ((Double)(ref _double)).GetHashCode();
7021 case TokenType.String:
7022 if (_string == null)
7023 {
7024 return ((Object)TokenType.Null).GetHashCode();
7025 }
7026 return ((Object)_string).GetHashCode();
7027 case TokenType.DataList:
7028 case TokenType.DataDictionary:
7029 case TokenType.Reference:
7030 if (_reference == null)
7031 {
7032 return ((Object)TokenType.Null).GetHashCode();
7033 }
7034 return _reference.GetHashCode();
7035 case TokenType.Error:
7036 return ((Object)_error).GetHashCode();
7037 default:
7038 throw new NotImplementedException(String.Format("GetHashCode not implemented for TokenType {0}", (object)_tokenType));
7039 }
7040 }
7041
7042 public int CompareTo(object obj)
7043 {
7044 if (obj is DataToken other)
7045 {
7046 return CompareTo(other);
7047 }
7048 return 1;
7049 }
7050
7051 public int CompareTo(DataToken other)
7052 {
7053 int num;
7054 if (IsNumber && other.IsNumber)
7055 {
7056 double @double;
7057 if (TokenType == other.TokenType)
7058 {
7059 switch (TokenType)
7060 {
7061 case TokenType.Byte:
7062 {
7063 byte @byte = Byte;
7064 return ((Byte)(ref @byte)).CompareTo(other.Byte);
7065 }
7066 case TokenType.Short:
7067 {
7068 short @short = Short;
7069 return ((Int16)(ref @short)).CompareTo(other.Short);
7070 }
7071 case TokenType.UShort:
7072 {
7073 ushort uShort = UShort;
7074 return ((UInt16)(ref uShort)).CompareTo(other.UShort);
7075 }
7076 case TokenType.Int:
7077 num = Int;
7078 return ((Int32)(ref num)).CompareTo(other.Int);
7079 case TokenType.UInt:
7080 {
7081 uint uInt = UInt;
7082 return ((UInt32)(ref uInt)).CompareTo(other.UInt);
7083 }
7084 case TokenType.Long:
7085 {
7086 long @long = Long;
7087 return ((Int64)(ref @long)).CompareTo(other.Long);
7088 }
7089 case TokenType.ULong:
7090 {
7091 ulong uLong = ULong;
7092 return ((UInt64)(ref uLong)).CompareTo(other.ULong);
7093 }
7094 case TokenType.Float:
7095 {
7096 float @float = Float;
7097 return ((Single)(ref @float)).CompareTo(other.Float);
7098 }
7099 case TokenType.Double:
7100 @double = Double;
7101 return ((Double)(ref @double)).CompareTo(other.Double);
7102 }
7103 }
7104 @double = Double;
7105 return ((Double)(ref @double)).CompareTo(other.Double);
7106 }
7107 if (TokenType == other.TokenType)
7108 {
7109 switch (TokenType)
7110 {
7111 case TokenType.String:
7112 return String.Compare(_string, other._string, (StringComparison)2);
7113 case TokenType.DataList:
7114 num = DataList.Count;
7115 return ((Int32)(ref num)).CompareTo(other.DataList.Count);
7116 case TokenType.DataDictionary:
7117 num = DataDictionary.Count;
7118 return ((Int32)(ref num)).CompareTo(other.DataDictionary.Count);
7119 case TokenType.Error:
7120 return ((Enum)Error).CompareTo((object)other.Error);
7121 }
7122 }
7123 return ((Enum)TokenType).CompareTo((object)other.TokenType);
7124 }
7125
7126 public static bool operator ==(in DataToken lhs, in DataToken rhs)
7127 {
7128 return lhs.Equals(rhs);
7129 }
7130
7131 public static bool operator !=(in DataToken lhs, in DataToken rhs)
7132 {
7133 return !lhs.Equals(rhs);
7134 }
7135
7136 public bool Equals(DataToken other)
7137 {
7138 if (TokenType != other.TokenType)
7139 {
7140 return false;
7141 }
7142 return TokenType switch
7143 {
7144 TokenType.Null => true,
7145 TokenType.Boolean => ((Boolean)(ref _boolean)).Equals(other._boolean),
7146 TokenType.SByte => ((SByte)(ref _sbyte)).Equals(other._sbyte),
7147 TokenType.Byte => ((Byte)(ref _byte)).Equals(other._byte),
7148 TokenType.Short => ((Int16)(ref _short)).Equals(other._short),
7149 TokenType.UShort => ((UInt16)(ref _ushort)).Equals(other._ushort),
7150 TokenType.Int => ((Int32)(ref _int)).Equals(other._int),
7151 TokenType.UInt => ((UInt32)(ref _uint)).Equals(other._uint),
7152 TokenType.Long => ((Int64)(ref _long)).Equals(other._long),
7153 TokenType.ULong => ((UInt64)(ref _ulong)).Equals(other._ulong),
7154 TokenType.Float => ((Single)(ref _float)).Equals(other._float),
7155 TokenType.Double => ((Double)(ref _double)).Equals(other._double),
7156 TokenType.String => _string == other._string,
7157 TokenType.DataList => _reference == other._reference,
7158 TokenType.DataDictionary => _reference == other._reference,
7159 TokenType.Reference => _reference == other._reference,
7160 TokenType.Error => _error == other._error,
7161 _ => false,
7162 };
7163 }
7164
7165 public static bool operator ==(in DataToken lhs, in object rhs)
7166 {
7167 return ((Object)lhs).Equals(rhs);
7168 }
7169
7170 public static bool operator !=(in DataToken lhs, in object rhs)
7171 {
7172 return !((Object)lhs).Equals(rhs);
7173 }
7174
7175 public static bool operator ==(in object lhs, in DataToken rhs)
7176 {
7177 return ((Object)rhs).Equals(lhs);
7178 }
7179
7180 public static bool operator !=(in object lhs, in DataToken rhs)
7181 {
7182 return !((Object)rhs).Equals(lhs);
7183 }
7184
7185 public override bool Equals(object obj)
7186 {
7187 if (obj is DataToken other)
7188 {
7189 return Equals(other);
7190 }
7191 if (TokenType == TokenType.Null)
7192 {
7193 return obj == null;
7194 }
7195 if (TokenType == TokenType.Reference && _reference != null)
7196 {
7197 return _reference.Equals(obj);
7198 }
7199 if (TokenType == TokenType.Reference && _reference == null && obj == null)
7200 {
7201 return true;
7202 }
7203 return false;
7204 }
7205
7206 public static bool operator ==(in DataToken lhs, in DataList rhs)
7207 {
7208 return lhs.Equals(rhs);
7209 }
7210
7211 public static bool operator !=(in DataToken lhs, in DataList rhs)
7212 {
7213 return !lhs.Equals(rhs);
7214 }
7215
7216 public static bool operator ==(in DataList lhs, in DataToken rhs)
7217 {
7218 return rhs.Equals(lhs);
7219 }
7220
7221 public static bool operator !=(in DataList lhs, in DataToken rhs)
7222 {
7223 return !rhs.Equals(lhs);
7224 }
7225
7226 public bool Equals(DataList other)
7227 {
7228 if (TokenType == TokenType.DataList)
7229 {
7230 return DataList == other;
7231 }
7232 return false;
7233 }
7234
7235 public static bool operator ==(in DataToken lhs, in DataDictionary rhs)
7236 {
7237 return lhs.Equals(rhs);
7238 }
7239
7240 public static bool operator !=(in DataToken lhs, in DataDictionary rhs)
7241 {
7242 return !lhs.Equals(rhs);
7243 }
7244
7245 public static bool operator ==(in DataDictionary lhs, in DataToken rhs)
7246 {
7247 return rhs.Equals(lhs);
7248 }
7249
7250 public static bool operator !=(in DataDictionary lhs, in DataToken rhs)
7251 {
7252 return !rhs.Equals(lhs);
7253 }
7254
7255 public bool Equals(DataDictionary other)
7256 {
7257 if (TokenType == TokenType.DataDictionary)
7258 {
7259 return DataDictionary == other;
7260 }
7261 return false;
7262 }
7263
7264 public bool Equals(bool other)
7265 {
7266 if (TokenType == TokenType.Boolean)
7267 {
7268 return Boolean == other;
7269 }
7270 return false;
7271 }
7272
7273 public static bool operator ==(in DataToken lhs, in string rhs)
7274 {
7275 return lhs.Equals(rhs);
7276 }
7277
7278 public static bool operator !=(in DataToken lhs, in string rhs)
7279 {
7280 return !lhs.Equals(rhs);
7281 }
7282
7283 public static bool operator ==(in string lhs, in DataToken rhs)
7284 {
7285 return rhs.Equals(lhs);
7286 }
7287
7288 public static bool operator !=(in string lhs, in DataToken rhs)
7289 {
7290 return !rhs.Equals(lhs);
7291 }
7292
7293 public bool Equals(string other)
7294 {
7295 if (TokenType == TokenType.String)
7296 {
7297 return String == other;
7298 }
7299 return false;
7300 }
7301
7302 public static bool operator ==(in DataToken lhs, in sbyte rhs)
7303 {
7304 return lhs.Equals(rhs);
7305 }
7306
7307 public static bool operator !=(in DataToken lhs, in sbyte rhs)
7308 {
7309 return !lhs.Equals(rhs);
7310 }
7311
7312 public static bool operator ==(in sbyte lhs, in DataToken rhs)
7313 {
7314 return rhs.Equals(lhs);
7315 }
7316
7317 public static bool operator !=(in sbyte lhs, in DataToken rhs)
7318 {
7319 return !rhs.Equals(lhs);
7320 }
7321
7322 public bool Equals(sbyte other)
7323 {
7324 if (TokenType == TokenType.SByte)
7325 {
7326 return SByte == other;
7327 }
7328 if (IsNumber)
7329 {
7330 return Double == (double)other;
7331 }
7332 return false;
7333 }
7334
7335 public static bool operator ==(in DataToken lhs, in byte rhs)
7336 {
7337 return lhs.Equals(rhs);
7338 }
7339
7340 public static bool operator !=(in DataToken lhs, in byte rhs)
7341 {
7342 return !lhs.Equals(rhs);
7343 }
7344
7345 public static bool operator ==(in byte lhs, in DataToken rhs)
7346 {
7347 return rhs.Equals(lhs);
7348 }
7349
7350 public static bool operator !=(in byte lhs, in DataToken rhs)
7351 {
7352 return !rhs.Equals(lhs);
7353 }
7354
7355 public bool Equals(byte other)
7356 {
7357 if (TokenType == TokenType.Byte)
7358 {
7359 return Byte == other;
7360 }
7361 if (IsNumber)
7362 {
7363 return Double == (double)(int)other;
7364 }
7365 return false;
7366 }
7367
7368 public static bool operator ==(in DataToken lhs, in short rhs)
7369 {
7370 return lhs.Equals(rhs);
7371 }
7372
7373 public static bool operator !=(in DataToken lhs, in short rhs)
7374 {
7375 return !lhs.Equals(rhs);
7376 }
7377
7378 public static bool operator ==(in short lhs, in DataToken rhs)
7379 {
7380 return rhs.Equals(lhs);
7381 }
7382
7383 public static bool operator !=(in short lhs, in DataToken rhs)
7384 {
7385 return !rhs.Equals(lhs);
7386 }
7387
7388 public bool Equals(short other)
7389 {
7390 if (TokenType == TokenType.Short)
7391 {
7392 return Short == other;
7393 }
7394 if (IsNumber)
7395 {
7396 return Double == (double)other;
7397 }
7398 return false;
7399 }
7400
7401 public static bool operator ==(in DataToken lhs, in ushort rhs)
7402 {
7403 return lhs.Equals(rhs);
7404 }
7405
7406 public static bool operator !=(in DataToken lhs, in ushort rhs)
7407 {
7408 return !lhs.Equals(rhs);
7409 }
7410
7411 public static bool operator ==(in ushort lhs, in DataToken rhs)
7412 {
7413 return rhs.Equals(lhs);
7414 }
7415
7416 public static bool operator !=(in ushort lhs, in DataToken rhs)
7417 {
7418 return !rhs.Equals(lhs);
7419 }
7420
7421 public bool Equals(ushort other)
7422 {
7423 if (TokenType == TokenType.UShort)
7424 {
7425 return UShort == other;
7426 }
7427 if (IsNumber)
7428 {
7429 return Double == (double)(int)other;
7430 }
7431 return false;
7432 }
7433
7434 public static bool operator ==(in DataToken lhs, in int rhs)
7435 {
7436 return lhs.Equals(rhs);
7437 }
7438
7439 public static bool operator !=(in DataToken lhs, in int rhs)
7440 {
7441 return !lhs.Equals(rhs);
7442 }
7443
7444 public static bool operator ==(in int lhs, in DataToken rhs)
7445 {
7446 return rhs.Equals(lhs);
7447 }
7448
7449 public static bool operator !=(in int lhs, in DataToken rhs)
7450 {
7451 return !rhs.Equals(lhs);
7452 }
7453
7454 public bool Equals(int other)
7455 {
7456 if (TokenType == TokenType.Int)
7457 {
7458 return Int == other;
7459 }
7460 if (IsNumber)
7461 {
7462 return Double == (double)other;
7463 }
7464 return false;
7465 }
7466
7467 public static bool operator ==(in DataToken lhs, in uint rhs)
7468 {
7469 return lhs.Equals(rhs);
7470 }
7471
7472 public static bool operator !=(in DataToken lhs, in uint rhs)
7473 {
7474 return !lhs.Equals(rhs);
7475 }
7476
7477 public static bool operator ==(in uint lhs, in DataToken rhs)
7478 {
7479 return rhs.Equals(lhs);
7480 }
7481
7482 public static bool operator !=(in uint lhs, in DataToken rhs)
7483 {
7484 return !rhs.Equals(lhs);
7485 }
7486
7487 public bool Equals(uint other)
7488 {
7489 if (TokenType == TokenType.UInt)
7490 {
7491 return UInt == other;
7492 }
7493 if (IsNumber)
7494 {
7495 return Double == (double)other;
7496 }
7497 return false;
7498 }
7499
7500 public static bool operator ==(in DataToken lhs, in ulong rhs)
7501 {
7502 return lhs.Equals(rhs);
7503 }
7504
7505 public static bool operator !=(in DataToken lhs, in ulong rhs)
7506 {
7507 return !lhs.Equals(rhs);
7508 }
7509
7510 public static bool operator ==(in ulong lhs, in DataToken rhs)
7511 {
7512 return rhs.Equals(lhs);
7513 }
7514
7515 public static bool operator !=(in ulong lhs, in DataToken rhs)
7516 {
7517 return !rhs.Equals(lhs);
7518 }
7519
7520 public bool Equals(ulong other)
7521 {
7522 if (TokenType == TokenType.ULong)
7523 {
7524 return ULong == other;
7525 }
7526 if (IsNumber)
7527 {
7528 return Double == (double)other;
7529 }
7530 return false;
7531 }
7532
7533 public static bool operator ==(in DataToken lhs, in long rhs)
7534 {
7535 return lhs.Equals(rhs);
7536 }
7537
7538 public static bool operator !=(in DataToken lhs, in long rhs)
7539 {
7540 return !lhs.Equals(rhs);
7541 }
7542
7543 public static bool operator ==(in long lhs, in DataToken rhs)
7544 {
7545 return rhs.Equals(lhs);
7546 }
7547
7548 public static bool operator !=(in long lhs, in DataToken rhs)
7549 {
7550 return !rhs.Equals(lhs);
7551 }
7552
7553 public bool Equals(long other)
7554 {
7555 if (TokenType == TokenType.Long)
7556 {
7557 return Long == other;
7558 }
7559 if (IsNumber)
7560 {
7561 return Double == (double)other;
7562 }
7563 return false;
7564 }
7565
7566 public static bool operator ==(in DataToken lhs, in float rhs)
7567 {
7568 return lhs.Equals(rhs);
7569 }
7570
7571 public static bool operator !=(in DataToken lhs, in float rhs)
7572 {
7573 return !lhs.Equals(rhs);
7574 }
7575
7576 public static bool operator ==(in float lhs, in DataToken rhs)
7577 {
7578 return rhs.Equals(lhs);
7579 }
7580
7581 public static bool operator !=(in float lhs, in DataToken rhs)
7582 {
7583 return !rhs.Equals(lhs);
7584 }
7585
7586 public bool Equals(float other)
7587 {
7588 if (TokenType == TokenType.Float)
7589 {
7590 return Float == other;
7591 }
7592 if (IsNumber)
7593 {
7594 return Double == (double)other;
7595 }
7596 return false;
7597 }
7598
7599 public static bool operator ==(in DataToken lhs, in double rhs)
7600 {
7601 return lhs.Equals(rhs);
7602 }
7603
7604 public static bool operator !=(in DataToken lhs, in double rhs)
7605 {
7606 return !lhs.Equals(rhs);
7607 }
7608
7609 public static bool operator ==(in double lhs, in DataToken rhs)
7610 {
7611 return rhs.Equals(lhs);
7612 }
7613
7614 public static bool operator !=(in double lhs, in DataToken rhs)
7615 {
7616 return !rhs.Equals(lhs);
7617 }
7618
7619 public bool Equals(double other)
7620 {
7621 if (TokenType == TokenType.Double)
7622 {
7623 return Double == other;
7624 }
7625 if (IsNumber)
7626 {
7627 return Double == other;
7628 }
7629 return false;
7630 }
7631
7632 public static bool operator ==(in DataToken lhs, in DataError rhs)
7633 {
7634 return lhs.Equals(rhs);
7635 }
7636
7637 public static bool operator !=(in DataToken lhs, in DataError rhs)
7638 {
7639 return !lhs.Equals(rhs);
7640 }
7641
7642 public static bool operator ==(in DataError lhs, in DataToken rhs)
7643 {
7644 return rhs.Equals(lhs);
7645 }
7646
7647 public static bool operator !=(in DataError lhs, in DataToken rhs)
7648 {
7649 return !rhs.Equals(lhs);
7650 }
7651
7652 public bool Equals(DataError other)
7653 {
7654 if (TokenType == TokenType.Error)
7655 {
7656 return Error == other;
7657 }
7658 return Equals(new DataToken(other));
7659 }
7660
7661 public readonly DataToken Bitcast(TokenType targetType)
7662 {
7663 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
7664 //IL_00ef: Unknown result type (might be due to invalid IL or missing references)
7665 TokenType tokenType = _tokenType;
7666 if (tokenType - 1 > TokenType.Float)
7667 {
7668 throw new InvalidOperationException(String.Format("Attempted to bitcast from {0} token", (object)_tokenType));
7669 }
7670 DataToken dataToken = default(DataToken);
7671 dataToken._tokenType = targetType;
7672 DataToken result = dataToken;
7673 switch (targetType)
7674 {
7675 case TokenType.Boolean:
7676 result._boolean = _boolean;
7677 break;
7678 case TokenType.SByte:
7679 case TokenType.Byte:
7680 result._sbyte = _sbyte;
7681 break;
7682 case TokenType.Short:
7683 case TokenType.UShort:
7684 result._short = _short;
7685 break;
7686 case TokenType.Int:
7687 case TokenType.UInt:
7688 result._int = _int;
7689 break;
7690 case TokenType.Long:
7691 case TokenType.ULong:
7692 result._long = _long;
7693 break;
7694 case TokenType.Float:
7695 result._float = _float;
7696 break;
7697 case TokenType.Double:
7698 result._double = _double;
7699 break;
7700 default:
7701 throw new InvalidOperationException(String.Format("Attempted to bitcast to {0} token", (object)_tokenType));
7702 }
7703 return result;
7704 }
7705
7706 [ExcludeFromUdonWrapper]
7707 public void GetObjectData(SerializationInfo info, StreamingContext context)
7708 {
7709 info.AddValue("_type", (object)_tokenType);
7710 switch (_tokenType)
7711 {
7712 case TokenType.Boolean:
7713 info.AddValue("_boolean", _boolean);
7714 break;
7715 case TokenType.SByte:
7716 info.AddValue("_sbyte", _sbyte);
7717 break;
7718 case TokenType.Byte:
7719 info.AddValue("_byte", _byte);
7720 break;
7721 case TokenType.Short:
7722 info.AddValue("_short", _short);
7723 break;
7724 case TokenType.UShort:
7725 info.AddValue("_ushort", _ushort);
7726 break;
7727 case TokenType.Int:
7728 info.AddValue("_int", _int);
7729 break;
7730 case TokenType.UInt:
7731 info.AddValue("_uint", _uint);
7732 break;
7733 case TokenType.Long:
7734 info.AddValue("_long", _long);
7735 break;
7736 case TokenType.ULong:
7737 info.AddValue("_ulong", _ulong);
7738 break;
7739 case TokenType.Float:
7740 info.AddValue("_float", _float);
7741 break;
7742 case TokenType.Double:
7743 info.AddValue("_double", _double);
7744 break;
7745 case TokenType.String:
7746 info.AddValue("_string", (object)_string);
7747 break;
7748 case TokenType.DataDictionary:
7749 info.AddValue("_reference", _reference);
7750 break;
7751 case TokenType.DataList:
7752 info.AddValue("_reference", _reference);
7753 break;
7754 case TokenType.Reference:
7755 info.AddValue("_reference", _reference);
7756 break;
7757 case TokenType.Error:
7758 info.AddValue("_error", (object)_error);
7759 break;
7760 }
7761 }
7762
7763 public DataToken(SerializationInfo info, StreamingContext context)
7764 {
7765 //IL_008d: Unknown result type (might be due to invalid IL or missing references)
7766 //IL_0097: Expected I4, but got Unknown
7767 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
7768 //IL_00b8: Expected I4, but got Unknown
7769 //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
7770 //IL_00d9: Expected I4, but got Unknown
7771 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
7772 //IL_00fa: Expected I4, but got Unknown
7773 //IL_0111: Unknown result type (might be due to invalid IL or missing references)
7774 //IL_011b: Expected I4, but got Unknown
7775 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
7776 //IL_013c: Expected I4, but got Unknown
7777 //IL_0153: Unknown result type (might be due to invalid IL or missing references)
7778 //IL_015d: Expected I4, but got Unknown
7779 //IL_0174: Unknown result type (might be due to invalid IL or missing references)
7780 //IL_017e: Expected I8, but got Unknown
7781 //IL_0195: Unknown result type (might be due to invalid IL or missing references)
7782 //IL_019f: Expected I8, but got Unknown
7783 //IL_01b6: Unknown result type (might be due to invalid IL or missing references)
7784 //IL_01c0: Expected F4, but got Unknown
7785 //IL_01d7: Unknown result type (might be due to invalid IL or missing references)
7786 //IL_01e1: Expected F8, but got Unknown
7787 //IL_01f8: Unknown result type (might be due to invalid IL or missing references)
7788 //IL_0202: Expected O, but got Unknown
7789 this = default(DataToken);
7790 _tokenType = (TokenType)info.GetValue("_type", typeof(TokenType));
7791 switch (_tokenType)
7792 {
7793 case TokenType.Boolean:
7794 _boolean = (byte)(int)(Boolean)info.GetValue("_boolean", typeof(Boolean)) != 0;
7795 break;
7796 case TokenType.SByte:
7797 _sbyte = (sbyte)(int)(SByte)info.GetValue("_sbyte", typeof(SByte));
7798 break;
7799 case TokenType.Byte:
7800 _byte = (byte)(int)(Byte)info.GetValue("_byte", typeof(Byte));
7801 break;
7802 case TokenType.Short:
7803 _short = (short)(int)(Int16)info.GetValue("_short", typeof(Int16));
7804 break;
7805 case TokenType.UShort:
7806 _ushort = (ushort)(int)(UInt16)info.GetValue("_ushort", typeof(UInt16));
7807 break;
7808 case TokenType.Int:
7809 _int = (int)(Int32)info.GetValue("_int", typeof(Int32));
7810 break;
7811 case TokenType.UInt:
7812 _uint = (uint)(int)(UInt32)info.GetValue("_uint", typeof(UInt32));
7813 break;
7814 case TokenType.Long:
7815 _long = (long)(Int64)info.GetValue("_long", typeof(Int64));
7816 break;
7817 case TokenType.ULong:
7818 _ulong = (ulong)(long)(UInt64)info.GetValue("_ulong", typeof(UInt64));
7819 break;
7820 case TokenType.Float:
7821 _float = (float)(Single)info.GetValue("_float", typeof(Single));
7822 break;
7823 case TokenType.Double:
7824 _double = (double)(Double)info.GetValue("_double", typeof(Double));
7825 break;
7826 case TokenType.String:
7827 _string = (string)(String)info.GetValue("_string", typeof(String));
7828 break;
7829 case TokenType.DataDictionary:
7830 _reference = info.GetValue("_reference", typeof(Object));
7831 break;
7832 case TokenType.DataList:
7833 _reference = info.GetValue("_reference", typeof(Object));
7834 break;
7835 case TokenType.Reference:
7836 _reference = info.GetValue("_reference", typeof(Object));
7837 break;
7838 case TokenType.Error:
7839 _reference = info.GetValue("_error", typeof(DataError));
7840 break;
7841 }
7842 }
7843 }
7845 {
7846 private string _source;
7847
7848 private Dictionary<DataToken, ValueTuple<JsonType, int>> _lazyValues = new Dictionary<DataToken, ValueTuple<JsonType, int>>();
7849
7850 public override int Count => _lazyValues.Count + _values.Count;
7851
7852 public JsonDictionary(string source)
7853 {
7854 _source = source;
7855 }
7856
7857 public override void SetValue(DataToken key, DataToken value)
7858 {
7859 if (_lazyValues.Remove(key))
7860 {
7861 keysDirty = true;
7862 }
7863 base.SetValue(key, value);
7864 }
7865
7866 protected override DataToken GetValue(DataToken key, out bool success)
7867 {
7868 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
7869 //IL_004c: Unknown result type (might be due to invalid IL or missing references)
7870 if (!_lazyValues.ContainsKey(key))
7871 {
7872 return base.GetValue(key, out success);
7873 }
7874 if (String.IsNullOrEmpty(_source))
7875 {
7876 success = false;
7877 return DataError.UnableToParse;
7878 }
7879 DataToken result;
7880 bool num = VRCJson.TryParseToken(_source, _lazyValues[key].Item1, _lazyValues[key].Item2, out result);
7881 _lazyValues.Remove(key);
7882 _values.Add(key, result);
7883 if (!num)
7884 {
7885 success = false;
7886 return DataError.UnableToParse;
7887 }
7888 success = true;
7889 return result;
7890 }
7891
7892 public override void Clear()
7893 {
7894 _lazyValues.Clear();
7895 base.Clear();
7896 }
7897
7898 public override bool ContainsKey(DataToken key)
7899 {
7900 if (_lazyValues.ContainsKey(key))
7901 {
7902 return true;
7903 }
7904 return base.ContainsKey(key);
7905 }
7906
7907 public override bool Remove(DataToken key)
7908 {
7909 if (_lazyValues.Remove(key))
7910 {
7911 return true;
7912 }
7913 return base.Remove(key);
7914 }
7915
7916 internal override void ParseAll()
7917 {
7918 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
7919 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
7920 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
7921 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
7922 //IL_002c: Unknown result type (might be due to invalid IL or missing references)
7923 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
7924 if (_lazyValues.Count == 0)
7925 {
7926 return;
7927 }
7928 Enumerator<DataToken, ValueTuple<JsonType, int>> enumerator = _lazyValues.GetEnumerator();
7929 try
7930 {
7931 while (enumerator.MoveNext())
7932 {
7933 KeyValuePair<DataToken, ValueTuple<JsonType, int>> current = enumerator.Current;
7934 if (VRCJson.TryParseToken(_source, current.Value.Item1, current.Value.Item2, out var result))
7935 {
7936 _values[current.Key] = result;
7937 }
7938 }
7939 }
7940 finally
7941 {
7942 ((IDisposable)enumerator).Dispose();
7943 }
7944 _lazyValues.Clear();
7945 }
7946
7947 public override DataList GetKeys()
7948 {
7949 if (keysDirty)
7950 {
7951 keyCache = new DataList((IEnumerable<DataToken>)(object)_values.Keys);
7952 keyCache.AddRange((IEnumerable<DataToken>)(object)_lazyValues.Keys);
7953 keysDirty = false;
7954 return keyCache;
7955 }
7956 return keyCache;
7957 }
7958
7959 public override void Add(DataToken key, DataToken value)
7960 {
7961 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
7962 if (_lazyValues.ContainsKey(key))
7963 {
7964 throw new ArgumentException(String.Format("Key {0} already exists in the dictionary", (object)key), "key");
7965 }
7966 base.Add(key, value);
7967 }
7968
7969 internal void AddLazyValue(DataToken key, JsonType type, int index)
7970 {
7971 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
7972 _lazyValues.Add(key, new ValueTuple<JsonType, int>(type, index));
7973 }
7974 }
7975 public class JsonList : DataList
7976 {
7977 private List<ValueTuple<JsonType, string>> _lazyValues = new List<ValueTuple<JsonType, string>>();
7978
7979 internal JsonList()
7980 {
7981 }
7982
7983 protected override DataToken GetValue(int index, out bool success)
7984 {
7985 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
7986 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
7987 //IL_008c: Unknown result type (might be due to invalid IL or missing references)
7988 if (index < 0 || index >= _values.Count)
7989 {
7990 success = false;
7991 return DataError.IndexOutOfRange;
7992 }
7993 if (_values[index].TokenType == TokenType.Null)
7994 {
7995 if (_lazyValues == null || index > _lazyValues.Count || String.IsNullOrEmpty(_lazyValues[index].Item2))
7996 {
7997 success = true;
7998 return _values[index];
7999 }
8000 success = VRCJson.TryParseToken(_lazyValues[index].Item2, _lazyValues[index].Item1, 0, out var result);
8001 if (!success)
8002 {
8003 return DataError.UnableToParse;
8004 }
8005 _values[index] = result;
8006 }
8007 success = true;
8008 ClearLazyValue(index);
8009 return _values[index];
8010 }
8011
8012 public override void Insert(int index, DataToken value)
8013 {
8014 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
8015 _values.Insert(index, value);
8016 _lazyValues.Insert(index, new ValueTuple<JsonType, string>(JsonType.Invalid, String.Empty));
8017 }
8018
8019 public override void InsertRange(int index, DataList input)
8020 {
8021 _lazyValues.InsertRange(index, (IEnumerable<ValueTuple<JsonType, string>>)(object)new ValueTuple<JsonType, string>[input.Count]);
8022 _values.InsertRange(index, (IEnumerable<DataToken>)(object)input._values);
8023 }
8024
8025 public override void Add(DataToken value)
8026 {
8027 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
8028 _values.Add(value);
8029 _lazyValues.Add(new ValueTuple<JsonType, string>(JsonType.Invalid, String.Empty));
8030 }
8031
8032 public override void RemoveAt(int index)
8033 {
8034 base.RemoveAt(index);
8035 _lazyValues.RemoveAt(index);
8036 }
8037
8038 public override void Clear()
8039 {
8040 _lazyValues.Clear();
8041 base.Clear();
8042 }
8043
8044 public override void RemoveRange(int index, int count)
8045 {
8046 _lazyValues.RemoveRange(index, count);
8047 _values.RemoveRange(index, count);
8048 }
8049
8050 public override void Reverse()
8051 {
8052 _lazyValues.Reverse();
8053 base.Reverse();
8054 }
8055
8056 public override void Reverse(int index, int count)
8057 {
8058 _lazyValues.Reverse(index, count);
8059 _values.Reverse(index, count);
8060 }
8061
8062 protected override void ParseInRange(int startIndex, int stopIndex)
8063 {
8064 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
8065 //IL_0039: Unknown result type (might be due to invalid IL or missing references)
8066 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
8067 for (int i = startIndex; i < stopIndex; i++)
8068 {
8069 if (_values[i].TokenType == TokenType.Null && !String.IsNullOrEmpty(_lazyValues[i].Item2) && VRCJson.TryParseToken(_lazyValues[i].Item2, _lazyValues[i].Item1, 0, out var result))
8070 {
8071 _values[i] = result;
8072 ClearLazyValue(i);
8073 }
8074 }
8075 }
8076
8077 internal void AddLazyValue(JsonType type, string source)
8078 {
8079 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
8080 _lazyValues.Add(new ValueTuple<JsonType, string>(type, source));
8081 _values.Add(default(DataToken));
8082 }
8083
8084 internal void ClearLazyValue(int index)
8085 {
8086 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
8087 _lazyValues[index] = new ValueTuple<JsonType, string>(JsonType.Invalid, (string)null);
8088 }
8089 }
8090 public enum JsonType : Enum
8091 {
8092 Invalid,
8093 Null,
8094 Object,
8095 Array,
8096 String,
8097 Boolean,
8098 Number
8099 }
8100 public enum ParseState : Enum
8101 {
8102 Key,
8103 Value,
8104 EndOfKey,
8105 EndOfValue
8106 }
8107 public enum JsonExportType : Enum
8108 {
8109 Beautify,
8110 Minify
8111 }
8112 public static class VRCJson : Object
8113 {
8114 private static readonly char[] parseArrayChars;
8115
8116 private static readonly char[] scanObjectChars;
8117
8118 private static readonly char[] scanArrayChars;
8119
8120 private static readonly char[] scanStringChars;
8121
8122 private static readonly char[] scanWordChars;
8123
8124 private static readonly char[] whitespaceChars;
8125
8126 private static readonly char[] numberChars;
8127
8128 private static HashSet<DataToken> seenContainers;
8129
8149 public static bool TryDeserializeFromJson(string source, out DataToken result)
8150 {
8151 if (String.IsNullOrEmpty(source))
8152 {
8153 result = new DataToken(DataError.UnableToParse, "Unable to Deserialize from Json: string was null or empty");
8154 return false;
8155 }
8156 int i;
8157 for (i = 0; i < source.Length && source[i] == '\ufeff'; i++)
8158 {
8159 }
8160 if (TryIdentifyType(source, i, out var result2))
8161 {
8162 switch (result2)
8163 {
8164 case JsonType.Object:
8165 return TryParseObject(source, i, out result);
8166 case JsonType.Array:
8167 return TryParseArray(source, i, out result);
8168 }
8169 }
8170 result = new DataToken(DataError.TypeUnsupported, String.Format("Unable to Deserialize from Json: Root object must be a list or dictionary, was {0} instead", (object)result2));
8171 return false;
8172 }
8173
8196 public static bool TrySerializeToJson(DataToken input, JsonExportType jsonExportType, out DataToken result)
8197 {
8198 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
8199 //IL_0010: Expected O, but got Unknown
8200 seenContainers.Clear();
8201 StringBuilder val = new StringBuilder();
8202 if (input.TokenType == TokenType.DataDictionary)
8203 {
8204 if (SerializeObject(input.DataDictionary, jsonExportType, val, 0, out var error))
8205 {
8206 result = ((Object)val).ToString();
8207 seenContainers.Clear();
8208 return true;
8209 }
8210 result = error;
8211 seenContainers.Clear();
8212 return false;
8213 }
8214 if (input.TokenType == TokenType.DataList)
8215 {
8216 if (SerializeArray(input.DataList, jsonExportType, val, 0, out var error2))
8217 {
8218 result = ((Object)val).ToString();
8219 seenContainers.Clear();
8220 return true;
8221 }
8222 result = error2;
8223 seenContainers.Clear();
8224 return false;
8225 }
8226 seenContainers.Clear();
8227 result = new DataToken(DataError.TypeUnsupported, String.Format("Unable to serialize to Json: Root object must be a list or dictionary, was {0} instead", (object)input.TokenType));
8228 return false;
8229 }
8230
8231 private static bool SerializeObject(DataDictionary dataDictionary, JsonExportType jsonExportType, StringBuilder builder, int indent, out DataToken error)
8232 {
8233 if (seenContainers.Contains((DataToken)dataDictionary))
8234 {
8235 error = new DataToken(DataError.ValueUnsupported, "Unable to serialize to JSON: Recursive containers found");
8236 return false;
8237 }
8238 seenContainers.Add((DataToken)dataDictionary);
8239 if (jsonExportType == JsonExportType.Beautify)
8240 {
8241 indent++;
8242 builder.Append("{\n");
8243 AppendIndent(builder, indent);
8244 }
8245 else
8246 {
8247 builder.Append("{");
8248 }
8249 DataList keys = dataDictionary.GetKeys();
8250 bool flag = true;
8251 for (int i = 0; i < keys.Count; i++)
8252 {
8253 if (keys[i].TokenType != TokenType.String)
8254 {
8255 error = new DataToken(DataError.TypeUnsupported, String.Format("Unable to serialize to JSON: {0} {1} unsupported key type", (object)keys[i].TokenType, (object)((Object)keys[i]).ToString()));
8256 return false;
8257 }
8258 if (!flag)
8259 {
8260 if (jsonExportType == JsonExportType.Beautify)
8261 {
8262 builder.Append(",\n");
8263 AppendIndent(builder, indent);
8264 }
8265 else
8266 {
8267 builder.Append(", ");
8268 }
8269 }
8270 flag = false;
8271 if (!dataDictionary.TryGetValue(keys[i], out var value))
8272 {
8273 continue;
8274 }
8275 builder.Append('"');
8276 builder.Append(keys[i].String);
8277 builder.Append("\": ");
8278 switch (value.TokenType)
8279 {
8280 case TokenType.DataDictionary:
8281 if (!SerializeObject(value.DataDictionary, jsonExportType, builder, indent, out error))
8282 {
8283 return false;
8284 }
8285 break;
8286 case TokenType.DataList:
8287 if (!SerializeArray(value.DataList, jsonExportType, builder, indent, out error))
8288 {
8289 return false;
8290 }
8291 break;
8292 case TokenType.String:
8293 builder.Append('"');
8294 builder.Append(EscapeString(((Object)value).ToString()));
8295 builder.Append('"');
8296 break;
8297 case TokenType.SByte:
8298 case TokenType.Byte:
8299 case TokenType.Short:
8300 case TokenType.UShort:
8301 case TokenType.Int:
8302 case TokenType.UInt:
8303 case TokenType.Long:
8304 case TokenType.ULong:
8305 case TokenType.Float:
8306 case TokenType.Double:
8307 if (Double.IsNaN(value.Number) || Double.IsInfinity(value.Number))
8308 {
8309 error = new DataToken(DataError.ValueUnsupported, String.Concat("Unable to serialize to JSON: ", ((Object)keys[i]).ToString(), " contains an unsupported NaN or Infinity value"));
8310 return false;
8311 }
8312 builder.Append(((Object)value).ToString());
8313 break;
8314 case TokenType.Boolean:
8315 builder.Append(value.Boolean ? "true" : "false");
8316 break;
8317 case TokenType.Null:
8318 builder.Append("null");
8319 break;
8320 default:
8321 error = new DataToken(DataError.TypeUnsupported, String.Format("Unable to serialize to JSON: {0} contains an unsupported type {1}", (object)((Object)keys[i]).ToString(), (object)value.TokenType));
8322 return false;
8323 }
8324 }
8325 if (jsonExportType == JsonExportType.Beautify)
8326 {
8327 indent--;
8328 builder.Append("\n");
8329 AppendIndent(builder, indent);
8330 builder.Append("}");
8331 }
8332 else
8333 {
8334 builder.Append("}");
8335 }
8336 seenContainers.Remove((DataToken)dataDictionary);
8337 error = DataError.None;
8338 return true;
8339 }
8340
8341 private static bool SerializeArray(DataList dataList, JsonExportType jsonExportType, StringBuilder builder, int indent, out DataToken error)
8342 {
8343 if (seenContainers.Contains((DataToken)dataList))
8344 {
8345 error = new DataToken(DataError.ValueUnsupported, "Unable to serialize to JSON: Recursive containers found");
8346 return false;
8347 }
8348 seenContainers.Add((DataToken)dataList);
8349 if (jsonExportType == JsonExportType.Beautify)
8350 {
8351 indent++;
8352 builder.Append("[\n");
8353 AppendIndent(builder, indent);
8354 }
8355 else
8356 {
8357 builder.Append("[");
8358 }
8359 for (int i = 0; i < dataList.Count; i++)
8360 {
8361 if (i > 0)
8362 {
8363 if (jsonExportType == JsonExportType.Beautify)
8364 {
8365 builder.Append(",\n");
8366 AppendIndent(builder, indent);
8367 }
8368 else
8369 {
8370 builder.Append(", ");
8371 }
8372 }
8373 if (!dataList.TryGetValue(i, out var value))
8374 {
8375 continue;
8376 }
8377 switch (value.TokenType)
8378 {
8379 case TokenType.DataDictionary:
8380 {
8381 if (!SerializeObject(value.DataDictionary, jsonExportType, builder, indent, out var error2))
8382 {
8383 error = error2;
8384 return false;
8385 }
8386 break;
8387 }
8388 case TokenType.DataList:
8389 {
8390 if (!SerializeArray(value.DataList, jsonExportType, builder, indent, out var error3))
8391 {
8392 error = error3;
8393 return false;
8394 }
8395 break;
8396 }
8397 case TokenType.String:
8398 builder.Append('"');
8399 builder.Append(EscapeString(((Object)value).ToString()));
8400 builder.Append('"');
8401 break;
8402 case TokenType.SByte:
8403 case TokenType.Byte:
8404 case TokenType.Short:
8405 case TokenType.UShort:
8406 case TokenType.Int:
8407 case TokenType.UInt:
8408 case TokenType.Long:
8409 case TokenType.ULong:
8410 case TokenType.Float:
8411 case TokenType.Double:
8412 if (Double.IsNaN(value.Number) || Double.IsInfinity(value.Number))
8413 {
8414 error = new DataToken(DataError.ValueUnsupported, String.Format("Unable to serialize to JSON: index {0} contains an unsupported NaN or Infinity value", (object)i));
8415 return false;
8416 }
8417 builder.Append(((Object)value).ToString());
8418 break;
8419 case TokenType.Boolean:
8420 builder.Append(value.Boolean ? "true" : "false");
8421 break;
8422 case TokenType.Null:
8423 builder.Append("null");
8424 break;
8425 default:
8426 error = new DataToken(DataError.TypeUnsupported, String.Format("Unable to serialize to JSON: index {0} unsupported type {1}", (object)i, (object)value.TokenType));
8427 return false;
8428 }
8429 }
8430 if (jsonExportType == JsonExportType.Beautify)
8431 {
8432 indent--;
8433 builder.Append("\n");
8434 AppendIndent(builder, indent);
8435 builder.Append("]");
8436 }
8437 else
8438 {
8439 builder.Append("]");
8440 }
8441 seenContainers.Remove((DataToken)dataList);
8442 error = DataError.None;
8443 return true;
8444 }
8445
8446 private static void AppendIndent(StringBuilder builder, int indent)
8447 {
8448 for (int i = 0; i < indent; i++)
8449 {
8450 builder.Append("\t");
8451 }
8452 }
8453
8454 internal static bool TryParseToken(string source, JsonType type, int index, out DataToken result)
8455 {
8456 switch (type)
8457 {
8458 case JsonType.Object:
8459 return TryParseObject(source, index, out result);
8460 case JsonType.Array:
8461 return TryParseArray(source, index, out result);
8462 case JsonType.String:
8463 return TryParseString(source, ref index, out result);
8464 case JsonType.Number:
8465 return TryParseNumber(source, index, out result);
8466 case JsonType.Boolean:
8467 return TryParseBool(source, index, out result);
8468 case JsonType.Null:
8469 result = default(DataToken);
8470 return true;
8471 default:
8472 result = default(DataToken);
8473 return false;
8474 }
8475 }
8476
8477 internal static bool TryParseObject(string source, int index, out DataToken result)
8478 {
8479 index++;
8480 ParseState parseState = ParseState.Key;
8481 JsonDictionary jsonDictionary = new JsonDictionary(source);
8482 DataToken result2 = default(DataToken);
8483 while (index < source.Length)
8484 {
8485 SkipWhitespace(source, ref index);
8486 if (source[index] == '}')
8487 {
8488 if (parseState == ParseState.EndOfValue || parseState == ParseState.Key)
8489 {
8490 result = jsonDictionary;
8491 return true;
8492 }
8493 result = new DataToken(DataError.UnableToParse, String.Format("Unable to Deserialize from Json: Found unexpected end of object while looking for {0}", (object)parseState));
8494 return false;
8495 }
8496 switch (parseState)
8497 {
8498 case ParseState.Key:
8499 {
8500 bool flag = TryIdentifyType(source, index, out var result3);
8501 if (!flag)
8502 {
8503 result = new DataToken(DataError.UnableToParse, String.Format("Unable to Deserialize from Json: Unable to identify type at character {0}", (object)index));
8504 return flag;
8505 }
8506 if (result3 == JsonType.String)
8507 {
8508 parseState = ParseState.EndOfKey;
8509 flag = TryParseString(source, ref index, out result2);
8510 if (!flag)
8511 {
8512 result = new DataToken(DataError.UnableToParse, String.Format("Unable to Deserialize from Json: Failed to parse string at character {0}", (object)index));
8513 return flag;
8514 }
8515 break;
8516 }
8517 index++;
8518 result = new DataToken(DataError.UnableToParse, String.Format("Unable to Deserialize from Json: Found unexpected type {0} while looking for key", (object)result3));
8519 return false;
8520 }
8521 case ParseState.EndOfKey:
8522 if (source[index] == ':')
8523 {
8524 index++;
8525 parseState = ParseState.Value;
8526 break;
8527 }
8528 result = new DataToken(DataError.UnableToParse, String.Format("Unable to Deserialize from Json: Found unexpected character {0} while looking for ':'", (object)source[index]));
8529 return false;
8530 case ParseState.Value:
8531 {
8532 JsonType result4;
8533 bool success = TryIdentifyType(source, index, out result4);
8534 if (!success)
8535 {
8536 result = new DataToken(DataError.UnableToParse, String.Format("Unable to Deserialize from Json: Unable to identify type at character {0}", (object)index));
8537 return false;
8538 }
8539 int index2;
8540 switch (result4)
8541 {
8542 case JsonType.String:
8543 parseState = ParseState.EndOfValue;
8544 index2 = index;
8545 ScanString(out success, source, ref index);
8546 if (!success)
8547 {
8548 result = new DataToken(DataError.UnableToParse, "Unable to Deserialize from Json: String is not valid");
8549 return false;
8550 }
8551 break;
8552 case JsonType.Number:
8553 parseState = ParseState.EndOfValue;
8554 index2 = index;
8555 ScanNumber(out success, source, ref index);
8556 if (!success)
8557 {
8558 result = new DataToken(DataError.UnableToParse, "Unable to Deserialize from Json: Number is not valid");
8559 return false;
8560 }
8561 break;
8562 case JsonType.Array:
8563 parseState = ParseState.EndOfValue;
8564 index2 = index;
8565 ScanArray(out success, source, ref index);
8566 if (!success)
8567 {
8568 result = new DataToken(DataError.UnableToParse, "Unable to Deserialize from Json: Array is not valid");
8569 return false;
8570 }
8571 break;
8572 case JsonType.Object:
8573 parseState = ParseState.EndOfValue;
8574 index2 = index;
8575 ScanObject(out success, source, ref index);
8576 if (!success)
8577 {
8578 result = new DataToken(DataError.UnableToParse, "Unable to Deserialize from Json: Object is not valid");
8579 return false;
8580 }
8581 break;
8582 case JsonType.Boolean:
8583 parseState = ParseState.EndOfValue;
8584 index2 = index;
8585 ScanBool(out success, source, ref index);
8586 if (!success)
8587 {
8588 result = new DataToken(DataError.UnableToParse, "Unable to Deserialize from Json: Boolean is not valid");
8589 return false;
8590 }
8591 break;
8592 case JsonType.Null:
8593 parseState = ParseState.EndOfValue;
8594 index2 = index;
8595 ScanNull(out success, source, ref index);
8596 if (!success)
8597 {
8598 result = new DataToken(DataError.UnableToParse, "Unable to Deserialize from Json: Null is not valid");
8599 return false;
8600 }
8601 break;
8602 case JsonType.Invalid:
8603 parseState = ParseState.EndOfValue;
8604 index2 = index;
8605 ScanUnknown(source, ref index);
8606 break;
8607 default:
8608 parseState = ParseState.EndOfValue;
8609 index2 = index;
8610 index++;
8611 break;
8612 }
8613 jsonDictionary.AddLazyValue(result2, result4, index2);
8614 break;
8615 }
8616 case ParseState.EndOfValue:
8617 if (source[index] == ',')
8618 {
8619 parseState = ParseState.Key;
8620 index++;
8621 break;
8622 }
8623 result = new DataToken(DataError.UnableToParse, String.Format("Unable to Deserialize from Json: Found unexpected character '{0}' while looking for character ','", (object)source[index]));
8624 return false;
8625 }
8626 }
8627 result = new DataToken(DataError.UnableToParse, "Unable to Deserialize from Json: Found end of string before finishing object");
8628 return false;
8629 }
8630
8631 internal static bool TryParseArray(string source, int index, out DataToken result)
8632 {
8633 if (!IsComplexArray(source, index))
8634 {
8635 index++;
8636 int num = index;
8637 SkipToCharacter(source, ref index, ']');
8638 string text = source.Substring(num, index - num);
8639 index++;
8640 if (String.IsNullOrEmpty(text))
8641 {
8642 result = new DataList();
8643 return true;
8644 }
8645 string[] array = text.Split((char[])(object)new Char[1] { (Char)44 }, (StringSplitOptions)1);
8646 JsonList jsonList = new JsonList();
8647 for (int i = 0; i < array.Length; i++)
8648 {
8649 array[i] = TrimWhitespace(array[i]);
8650 if (!String.IsNullOrEmpty(array[i]))
8651 {
8652 if (!TryIdentifyType(array[i], 0, out var result2))
8653 {
8654 result = new DataToken(DataError.UnableToParse, String.Format("Unable to Deserialize from Json: Unable to identify type at character {0}", (object)index));
8655 return false;
8656 }
8657 jsonList.AddLazyValue(result2, array[i]);
8658 }
8659 }
8660 result = jsonList;
8661 return true;
8662 }
8663 JsonList jsonList2 = new JsonList();
8664 index++;
8665 int num2 = index;
8666 int num3 = 0;
8667 bool flag = false;
8668 while (index < source.Length)
8669 {
8670 SkipToAnyCharacter(source, ref index, parseArrayChars);
8671 switch (source[index])
8672 {
8673 case '\\':
8674 if (flag)
8675 {
8676 index++;
8677 }
8678 break;
8679 case '"':
8680 flag = !flag;
8681 break;
8682 case '{':
8683 num3++;
8684 break;
8685 case '}':
8686 num3--;
8687 break;
8688 case ',':
8689 if (num3 == 0 && !flag)
8690 {
8691 string input2 = source.Substring(num2, index - num2);
8692 input2 = TrimWhitespace(input2);
8693 if (!TryIdentifyType(input2, 0, out var result4))
8694 {
8695 result = new DataToken(DataError.UnableToParse, String.Format("Unable to Deserialize from Json: Unable to identify type at character {0}", (object)index));
8696 return false;
8697 }
8698 jsonList2.AddLazyValue(result4, input2);
8699 num2 = index + 1;
8700 }
8701 break;
8702 case '[':
8703 num3++;
8704 break;
8705 case ']':
8706 if (num3 == 0)
8707 {
8708 if (!flag)
8709 {
8710 string input = source.Substring(num2, index - num2);
8711 input = TrimWhitespace(input);
8712 if (String.IsNullOrEmpty(input))
8713 {
8714 result = jsonList2;
8715 return true;
8716 }
8717 if (!TryIdentifyType(input, 0, out var result3))
8718 {
8719 result = new DataToken(DataError.UnableToParse, String.Format("Unable to Deserialize from Json: Unable to identify type at character {0}", (object)index));
8720 return false;
8721 }
8722 jsonList2.AddLazyValue(result3, input);
8723 index++;
8724 result = jsonList2;
8725 return true;
8726 }
8727 }
8728 else
8729 {
8730 num3--;
8731 }
8732 break;
8733 }
8734 index++;
8735 }
8736 result = new DataToken(DataError.UnableToParse, "Unable to Deserialize from Json: Found end of string before finishing array");
8737 return false;
8738 }
8739
8740 internal static bool TryParseString(string source, ref int index, out DataToken result)
8741 {
8742 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
8743 //IL_003c: Expected O, but got Unknown
8744 int stringEnd = GetStringEnd(source, index);
8745 if (stringEnd != -1)
8746 {
8747 int num = index + 1;
8748 index = stringEnd + 1;
8749 result = source.Substring(num, stringEnd - num);
8750 return true;
8751 }
8752 index++;
8753 bool flag = false;
8754 StringBuilder val = new StringBuilder();
8755 while (index < source.Length)
8756 {
8757 if (flag)
8758 {
8759 val.Append(UnEscapeCharacter(out var success, source, ref index));
8760 flag = false;
8761 if (!success)
8762 {
8763 result = new DataToken(DataError.UnableToParse, "Unable to Deserialize from Json: String had invalid escape characters");
8764 return false;
8765 }
8766 continue;
8767 }
8768 string text = source.Substring(index, 1);
8769 if (text == "\\")
8770 {
8771 flag = true;
8772 index++;
8773 continue;
8774 }
8775 if (text == "\"")
8776 {
8777 index++;
8778 result = ((Object)val).ToString();
8779 return true;
8780 }
8781 val.Append(text);
8782 index++;
8783 }
8784 result = default(DataToken);
8785 return false;
8786 }
8787
8788 internal static bool TryParseNumber(string source, int index, out DataToken result)
8789 {
8790 int num = index;
8791 while (index < source.Length)
8792 {
8793 char c = source[index];
8794 if (Array.IndexOf<char>(numberChars, c) != -1 || Char.IsNumber(c) || Char.IsWhiteSpace(c))
8795 {
8796 index++;
8797 continue;
8798 }
8799 switch (c)
8800 {
8801 }
8802 break;
8803 }
8804 string text = source.Substring(num, index - num);
8805 double num2 = default(double);
8806 if (Double.TryParse(text, (NumberStyles)167, (IFormatProvider)(object)CultureInfo.InvariantCulture, ref num2))
8807 {
8808 result = num2;
8809 return true;
8810 }
8811 text = text.ToLower();
8812 if (text.Contains("e"))
8813 {
8814 int num3 = text.IndexOf("e");
8815 if (num3 > 1 && num3 < text.Length - 1)
8816 {
8817 string text2 = text.Substring(0, num3 - 1);
8818 string text3 = text.Substring(num3 + 1);
8819 double num4 = default(double);
8820 if (!Double.TryParse(text2, (NumberStyles)167, (IFormatProvider)(object)CultureInfo.InvariantCulture, ref num4))
8821 {
8822 result = new DataToken(DataError.UnableToParse, String.Concat("Unable to Deserialize Json: Failed to parse number '", text, "'"));
8823 return false;
8824 }
8825 double num5 = default(double);
8826 if (!Double.TryParse(text3, (NumberStyles)167, (IFormatProvider)(object)CultureInfo.InvariantCulture, ref num5))
8827 {
8828 result = new DataToken(DataError.UnableToParse, String.Concat("Unable to Deserialize Json: Failed to parse number '", text, "'"));
8829 return false;
8830 }
8831 num2 = num4 * Math.Pow(10.0, num5);
8832 result = num2;
8833 return true;
8834 }
8835 }
8836 else if (text.EndsWith("0"))
8837 {
8838 string text4 = text.TrimEnd('0');
8839 int num6 = text.Length - text4.Length;
8840 if (Double.TryParse(text4, (NumberStyles)167, (IFormatProvider)(object)CultureInfo.InvariantCulture, ref num2))
8841 {
8842 num2 *= Math.Pow(10.0, (double)num6);
8843 if (Double.IsPositiveInfinity(num2))
8844 {
8845 num2 = 1.7976931348623157E+308;
8846 }
8847 else if (Double.IsNegativeInfinity(num2))
8848 {
8849 num2 = -1.7976931348623157E+308;
8850 }
8851 result = num2;
8852 return true;
8853 }
8854 }
8855 result = new DataToken(DataError.UnableToParse, String.Concat("Unable to Deserialize Json: Failed to parse number '", text, "'"));
8856 return false;
8857 }
8858
8859 internal static bool TryParseBool(string source, int index, out DataToken result)
8860 {
8861 int num = index;
8862 SkipToAnyCharacter(source, ref index, scanWordChars);
8863 string text = source.Substring(num, index - num).ToLower();
8864 if (text == "true")
8865 {
8866 result = true;
8867 return true;
8868 }
8869 if (text == "false")
8870 {
8871 result = false;
8872 return true;
8873 }
8874 result = new DataToken(DataError.UnableToParse, String.Concat("Unable to Deserialize Json: Failed to parse bool '", text, "'"));
8875 return false;
8876 }
8877
8878 private static void ScanObject(out bool success, string source, ref int index)
8879 {
8880 int num = 0;
8881 bool flag = false;
8882 while (index < source.Length)
8883 {
8884 SkipToAnyCharacter(source, ref index, scanObjectChars);
8885 if (index >= source.Length)
8886 {
8887 success = false;
8888 break;
8889 }
8890 switch (source[index])
8891 {
8892 case '\\':
8893 if (flag)
8894 {
8895 index++;
8896 }
8897 else
8898 {
8899 success = false;
8900 }
8901 break;
8902 case '"':
8903 flag = !flag;
8904 break;
8905 case '{':
8906 if (!flag)
8907 {
8908 num++;
8909 }
8910 break;
8911 case '}':
8912 if (!flag)
8913 {
8914 num--;
8915 if (num == 0)
8916 {
8917 index++;
8918 success = true;
8919 return;
8920 }
8921 }
8922 break;
8923 }
8924 index++;
8925 }
8926 if (num > 0)
8927 {
8928 success = false;
8929 }
8930 else
8931 {
8932 success = false;
8933 }
8934 }
8935
8936 private static void ScanArray(out bool success, string source, ref int index)
8937 {
8938 if (!IsComplexArray(source, index))
8939 {
8940 index++;
8941 SkipToCharacter(source, ref index, ']');
8942 index++;
8943 success = true;
8944 return;
8945 }
8946 index++;
8947 int num = 0;
8948 int num2 = 0;
8949 bool flag = false;
8950 while (index < source.Length)
8951 {
8952 SkipToAnyCharacter(source, ref index, scanArrayChars);
8953 if (index >= source.Length)
8954 {
8955 success = false;
8956 break;
8957 }
8958 switch (source[index])
8959 {
8960 case '\\':
8961 if (flag)
8962 {
8963 index++;
8964 }
8965 else
8966 {
8967 success = false;
8968 }
8969 break;
8970 case '"':
8971 flag = !flag;
8972 break;
8973 case '[':
8974 if (!flag)
8975 {
8976 num2++;
8977 }
8978 break;
8979 case ']':
8980 if (!flag)
8981 {
8982 if (num2 == 0)
8983 {
8984 num++;
8985 index++;
8986 success = true;
8987 return;
8988 }
8989 num2--;
8990 }
8991 break;
8992 }
8993 index++;
8994 }
8995 success = false;
8996 }
8997
8998 private static void ScanString(out bool success, string source, ref int index)
8999 {
9000 int stringEnd = GetStringEnd(source, index);
9001 if (stringEnd != -1)
9002 {
9003 index = stringEnd + 1;
9004 success = true;
9005 return;
9006 }
9007 index++;
9008 bool flag = false;
9009 while (index < source.Length)
9010 {
9011 SkipToAnyCharacter(source, ref index, scanStringChars);
9012 if (index >= source.Length)
9013 {
9014 success = false;
9015 return;
9016 }
9017 if (flag)
9018 {
9019 flag = false;
9020 continue;
9021 }
9022 switch (source[index])
9023 {
9024 case '\\':
9025 flag = true;
9026 index++;
9027 index++;
9028 break;
9029 case '"':
9030 index++;
9031 success = true;
9032 return;
9033 default:
9034 index++;
9035 break;
9036 }
9037 }
9038 success = false;
9039 }
9040
9041 private static void ScanNumber(out bool success, string source, ref int index)
9042 {
9043 while (index < source.Length)
9044 {
9045 char c = source[index];
9046 if (Array.IndexOf<char>(numberChars, c) != -1 || Char.IsNumber(c) || Char.IsWhiteSpace(c))
9047 {
9048 index++;
9049 continue;
9050 }
9051 if (c != ',' && c != '}' && c != ']')
9052 {
9053 success = false;
9054 }
9055 break;
9056 }
9057 success = true;
9058 }
9059
9060 private static void ScanBool(out bool success, string source, ref int index)
9061 {
9062 int num = index;
9063 SkipToAnyCharacter(source, ref index, scanWordChars);
9064 string text = source.Substring(num, index - num).ToLower();
9065 if (text != "true" && text != "false")
9066 {
9067 success = false;
9068 }
9069 success = true;
9070 }
9071
9072 private static void ScanNull(out bool success, string source, ref int index)
9073 {
9074 int num = index;
9075 SkipToAnyCharacter(source, ref index, scanWordChars);
9076 if (source.Substring(num, index - num) != "null")
9077 {
9078 success = false;
9079 }
9080 success = true;
9081 }
9082
9083 private static void ScanUnknown(string source, ref int index)
9084 {
9085 SkipToAnyCharacter(source, ref index, scanWordChars);
9086 }
9087
9088 private static void SkipWhitespace(string source, ref int index)
9089 {
9090 while (index + 1 < source.Length && Char.IsWhiteSpace(source, index))
9091 {
9092 index++;
9093 }
9094 }
9095
9096 private static bool IsComplexObject(string source, int index)
9097 {
9098 for (index++; index < source.Length; index++)
9099 {
9100 switch (source[index])
9101 {
9102 case '{':
9103 return false;
9104 case '[':
9105 return false;
9106 case '\\':
9107 return false;
9108 }
9109 }
9110 return false;
9111 }
9112
9113 private static int GetStringEnd(string source, int index)
9114 {
9115 index++;
9116 while (index + 1 < source.Length)
9117 {
9118 switch (source[index])
9119 {
9120 case '"':
9121 return index;
9122 case '\\':
9123 return -1;
9124 }
9125 index++;
9126 }
9127 return -1;
9128 }
9129
9130 private static bool IsComplexArray(string source, int index)
9131 {
9132 for (index++; index < source.Length; index++)
9133 {
9134 switch (source[index])
9135 {
9136 case ']':
9137 return false;
9138 case '"':
9139 case '[':
9140 case '{':
9141 return true;
9142 }
9143 }
9144 return false;
9145 }
9146
9147 private static void SkipToCharacter(string source, ref int index, char character)
9148 {
9149 while (index < source.Length && source[index] != character)
9150 {
9151 index++;
9152 }
9153 }
9154
9155 private static bool SkipToAnyCharacter(string source, ref int index, char[] characters)
9156 {
9157 while (index < source.Length)
9158 {
9159 if (Array.IndexOf<char>(characters, source[index]) == -1)
9160 {
9161 index++;
9162 continue;
9163 }
9164 return true;
9165 }
9166 return false;
9167 }
9168
9169 private static string UnEscapeCharacter(out bool success, string source, ref int index)
9170 {
9171 char c = source[index];
9172 char c2;
9173 switch (c)
9174 {
9175 case '"':
9176 index++;
9177 success = true;
9178 return "\"";
9179 case '/':
9180 index++;
9181 success = true;
9182 return "/";
9183 case '\\':
9184 index++;
9185 success = true;
9186 return "\\";
9187 case 'b':
9188 index++;
9189 success = true;
9190 c2 = '\b';
9191 return ((Char)(ref c2)).ToString();
9192 case 'f':
9193 index++;
9194 success = true;
9195 c2 = '\f';
9196 return ((Char)(ref c2)).ToString();
9197 case 'n':
9198 index++;
9199 success = true;
9200 c2 = '\n';
9201 return ((Char)(ref c2)).ToString();
9202 case 'r':
9203 index++;
9204 success = true;
9205 c2 = '\r';
9206 return ((Char)(ref c2)).ToString();
9207 case 't':
9208 index++;
9209 success = true;
9210 c2 = '\t';
9211 return ((Char)(ref c2)).ToString();
9212 case 'u':
9213 {
9214 if (index + 4 >= source.Length)
9215 {
9216 success = false;
9217 break;
9218 }
9219 string text = source.Substring(index + 1, 4);
9220 index += 5;
9221 int num = default(int);
9222 if (Int32.TryParse(text, (NumberStyles)515, (IFormatProvider)null, ref num))
9223 {
9224 try
9225 {
9226 success = true;
9227 return Char.ConvertFromUtf32(num);
9228 }
9229 catch (Object)
9230 {
9231 success = false;
9232 }
9233 }
9234 else
9235 {
9236 success = false;
9237 }
9238 break;
9239 }
9240 }
9241 success = true;
9242 index++;
9243 return String.Concat("\\", ((Char)(ref c)).ToString());
9244 }
9245
9246 private static string EscapeString(string input)
9247 {
9248 return input.Replace("\"", "\\\"").Replace("\n", "\\n").Replace("\r", "\\r")
9249 .Replace("\t", "\\t");
9250 }
9251
9252 private static string TrimWhitespace(string input)
9253 {
9254 input = input.TrimStart(whitespaceChars);
9255 input = input.TrimEnd(whitespaceChars);
9256 return input;
9257 }
9258
9259 internal static bool TryIdentifyType(string source, int index, out JsonType result)
9260 {
9261 if (String.IsNullOrEmpty(source))
9262 {
9263 result = JsonType.Invalid;
9264 return false;
9265 }
9266 if (index < 0 || index >= source.Length)
9267 {
9268 result = JsonType.Invalid;
9269 return false;
9270 }
9271 char c = source[index];
9272 if (Char.IsWhiteSpace(c))
9273 {
9274 SkipWhitespace(source, ref index);
9275 if (index < 0 || index >= source.Length)
9276 {
9277 result = JsonType.Invalid;
9278 return false;
9279 }
9280 c = source[index];
9281 }
9282 c = Char.ToLower(c);
9283 switch (c)
9284 {
9285 case '{':
9286 result = JsonType.Object;
9287 return true;
9288 case '[':
9289 result = JsonType.Array;
9290 return true;
9291 case '"':
9292 result = JsonType.String;
9293 return true;
9294 case 'n':
9295 result = JsonType.Null;
9296 return true;
9297 case 't':
9298 result = JsonType.Boolean;
9299 return true;
9300 case 'f':
9301 result = JsonType.Boolean;
9302 return true;
9303 case '-':
9304 result = JsonType.Number;
9305 return true;
9306 default:
9307 if (Char.IsNumber(c))
9308 {
9309 result = JsonType.Number;
9310 return true;
9311 }
9312 result = JsonType.Invalid;
9313 return false;
9314 }
9315 }
9316
9317 static VRCJson()
9318 {
9319 Char[] array = new Char[7];
9320 RuntimeHelpers.InitializeArray((Array)(object)array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
9321 parseArrayChars = (char[])(object)array;
9322 Char[] array2 = new Char[3];
9323 RuntimeHelpers.InitializeArray((Array)(object)array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
9324 scanObjectChars = (char[])(object)array2;
9325 Char[] array3 = new Char[4];
9326 RuntimeHelpers.InitializeArray((Array)(object)array3, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
9327 scanArrayChars = (char[])(object)array3;
9328 scanStringChars = (char[])(object)new Char[2]
9329 {
9330 (Char)92,
9331 (Char)34
9332 };
9333 Char[] array4 = new Char[7];
9334 RuntimeHelpers.InitializeArray((Array)(object)array4, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
9335 scanWordChars = (char[])(object)array4;
9336 Char[] array5 = new Char[4];
9337 RuntimeHelpers.InitializeArray((Array)(object)array5, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
9338 whitespaceChars = (char[])(object)array5;
9339 Char[] array6 = new Char[5];
9340 RuntimeHelpers.InitializeArray((Array)(object)array6, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
9341 numberChars = (char[])(object)array6;
9342 seenContainers = new HashSet<DataToken>();
9343 }
9344 }
9345}
9346namespace VRC.SDK3.Components
9347{
9348 public abstract class AbstractUdonBehaviour : VRCInteractable, IUdonBehaviour, IUdonEventReceiver, IUdonProgramVariableAccessTarget, IUdonSyncTarget, IVRCNetworkId, INetworkID
9349 {
9350 public abstract bool DisableInteractive { get; set; }
9351
9352 public abstract bool DisableEventProcessing { get; set; }
9353
9354 public abstract IUdonSyncMetadataTable SyncMetadataTable { get; }
9355
9356 public abstract bool IsNetworkingSupported { get; set; }
9357
9358 public abstract string InteractionText { get; set; }
9359
9360 public abstract Type GetProgramVariableType(string symbolName);
9361
9362 public abstract T GetProgramVariable<T>(string symbolName);
9363
9364 public abstract object GetProgramVariable(string symbolName);
9365
9366 public abstract bool TryGetProgramVariable<T>(string symbolName, out T value);
9367
9368 public abstract bool TryGetProgramVariable(string symbolName, out object value);
9369
9370 public abstract void SetProgramVariable<T>(string symbolName, T value);
9371
9372 public abstract void SetProgramVariable(string symbolName, object value);
9373
9374 public abstract void SendCustomEvent(string eventName);
9375
9376 public abstract void SendCustomNetworkEvent(NetworkEventTarget target, string eventName);
9377
9378 public abstract void SendCustomEventDelayedSeconds(string eventName, float delaySeconds, EventTiming eventTiming = 0);
9379
9380 public abstract void SendCustomEventDelayedFrames(string eventName, int delayFrames, EventTiming eventTiming = 0);
9381
9382 public abstract void InitializeUdonContent();
9383
9384 public abstract void RunProgram(string eventName);
9385
9386 public abstract bool RunEvent(string eventName);
9387
9388 public abstract bool RunEvent<T0>(string eventName, ValueTuple<string, T0> parameter0);
9389
9390 public abstract bool RunEvent<T0, T1>(string eventName, ValueTuple<string, T0> parameter0, ValueTuple<string, T1> parameter1);
9391
9392 public abstract bool RunEvent<T0, T1, T2>(string eventName, ValueTuple<string, T0> parameter0, ValueTuple<string, T1> parameter1, ValueTuple<string, T2> parameter2);
9393
9394 public abstract bool RunEvent(string eventName, params ValueTuple<string, object>[] programVariables);
9395
9396 public abstract void RunInputEvent(string eventName, UdonInputEventArgs args);
9397
9398 public abstract void RequestSerialization();
9399
9400 bool IUdonEventReceiver.get_enabled()
9401 {
9402 return ((Behaviour)this).enabled;
9403 }
9404
9405 void IUdonEventReceiver.set_enabled(bool value)
9406 {
9407 ((Behaviour)this).enabled = value;
9408 }
9409 }
9410 public interface IUdonSignatureHolder
9411 {
9412 byte[] Signature { get; set; }
9413
9414 byte[] SignedData { get; }
9415
9417
9419 }
9420 [AttributeUsage(/*Could not decode attribute arguments.*/)]
9421 public class UdonSignatureHolderMarker : Attribute
9422 {
9423 [field: CompilerGenerated]
9424 public Type type
9425 {
9426 [CompilerGenerated]
9427 get;
9428 }
9429
9431 {
9432 this.type = type;
9433 }
9434 }
9435 public abstract class VRCInteractable : VRC_Interactable
9436 {
9437 }
9438 [HelpURL("https://creators.vrchat.com/worlds/udon/persistence/player-object/")]
9439 [AddComponentMenu("VRChat/Persistence/VRC Enable Persistence")]
9440 public class VRCEnablePersistence : MonoBehaviour
9441 {
9442 private void Awake()
9443 {
9444 if (!Object.op_Implicit((Object)(object)((Component)this).gameObject.GetComponentInParent<VRCPlayerObject>()))
9445 {
9446 Debug.LogError((object)"VRCEnablePersistence must be a child of a VRCPlayerObject to enable persistence.", (Object)(object)((Component)this).gameObject);
9447 }
9448 }
9449 }
9450 [HelpURL("https://creators.vrchat.com/worlds/udon/persistence/player-object/")]
9451 [AddComponentMenu("VRChat/Persistence/VRC Player Object")]
9453 {
9454 public static Func<VRCPlayerObject, VRCPlayerApi> _GetPlayer;
9455
9457 {
9458 return _GetPlayer?.Invoke(this) ?? null;
9459 }
9460
9461 [ExcludeFromUdonWrapper]
9462 public override void NetworkConfigure()
9463 {
9464 }
9465 }
9466 [ExecuteInEditMode]
9467 [RequireComponent(/*Could not decode attribute arguments.*/)]
9468 [DisallowMultipleComponent]
9469 [AddComponentMenu("VRChat/VRC Spatial Audio Source")]
9471 {
9472 }
9473 [AddComponentMenu("VRChat/VRC Object Pool")]
9474 [HelpURL("https://creators.vrchat.com/worlds/examples/udon-example-scene/#objectpool")]
9476 {
9477 public GameObject[] Pool = (GameObject[])(object)new GameObject[0];
9478
9479 [ExcludeFromUdonWrapper]
9480 public static Action<VRCObjectPool> OnInit;
9481
9482 [ExcludeFromUdonWrapper]
9483 public static Action<VRCObjectPool, int> OnSpawn;
9484
9485 [ExcludeFromUdonWrapper]
9486 public static Action<VRCObjectPool, int> OnReturn;
9487
9488 private Dictionary<GameObject, int> _indices = new Dictionary<GameObject, int>();
9489
9490 private int _lastSpawnIndex = -1;
9491
9492 private int[] _spawnOrder;
9493
9494 private bool didInit;
9495
9496 [ExcludeFromUdonWrapper]
9497 [HideInInspector]
9498 public Vector3[] StartPositions;
9499
9500 [ExcludeFromUdonWrapper]
9501 [HideInInspector]
9502 public Quaternion[] StartRotations;
9503
9504 [ExcludeFromUdonWrapper]
9505 public override void NetworkConfigure()
9506 {
9507 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
9508 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
9509 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)
9510 //IL_00d9: Unknown result type (might be due to invalid IL or missing references)
9511 if (!didInit)
9512 {
9513 if (OnInit != null)
9514 {
9515 OnInit.Invoke(this);
9516 }
9517 if (Pool == null)
9518 {
9519 Pool = (GameObject[])(object)new GameObject[0];
9520 }
9521 StartPositions = (Vector3[])(object)new Vector3[Pool.Length];
9522 StartRotations = (Quaternion[])(object)new Quaternion[Pool.Length];
9523 _spawnOrder = (int[])(object)new Int32[Pool.Length];
9524 _indices.Clear();
9525 for (int i = 0; i < Pool.Length; i++)
9526 {
9527 Pool[i].SetActive(false);
9528 _indices.Add(Pool[i], i);
9529 _spawnOrder[i] = i;
9530 StartRotations[i] = Pool[i].transform.rotation;
9531 StartPositions[i] = Pool[i].transform.position;
9532 }
9533 didInit = true;
9534 }
9535 }
9536
9537 public void Shuffle()
9538 {
9539 Utilities.ShuffleArray(_spawnOrder);
9540 }
9541
9542 public GameObject TryToSpawn()
9543 {
9544 if (!didInit)
9545 {
9546 Debug.LogError((object)String.Concat("TryToSpawn on ", ((Object)((Component)this).gameObject).name, " called before initialized"));
9547 return null;
9548 }
9549 if (Pool == null || Pool.Length == 0 || _indices == null)
9550 {
9551 return null;
9552 }
9553 if (Pool.Length != _indices.Count)
9554 {
9555 Debug.LogError((object)String.Concat("Pool size on ", ((Object)((Component)this).gameObject).name, " has changed since Awake()"));
9556 return null;
9557 }
9558 if (!Networking.IsOwner(((Component)this).gameObject))
9559 {
9560 Debug.LogError((object)String.Concat("Non-owner attempted to spawn object from ", ((Object)((Component)this).gameObject).name));
9561 return null;
9562 }
9563 int num = _lastSpawnIndex;
9564 for (int i = 0; i < Pool.Length; i++)
9565 {
9566 num = (num + 1) % Pool.Length;
9567 int num2 = _spawnOrder[num];
9568 GameObject val = Pool[num2];
9569 if (Object.op_Implicit((Object)(object)val) && !val.activeInHierarchy)
9570 {
9571 GameObject obj = Pool[num2];
9572 obj.SetActive(true);
9573 if (OnSpawn != null)
9574 {
9575 OnSpawn.Invoke(this, num2);
9576 }
9577 _lastSpawnIndex = num;
9578 return obj;
9579 }
9580 }
9581 return null;
9582 }
9583
9584 public void Return(GameObject obj)
9585 {
9586 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
9587 //IL_0077: Unknown result type (might be due to invalid IL or missing references)
9588 if (!Object.op_Implicit((Object)(object)obj))
9589 {
9590 return;
9591 }
9592 int num = default(int);
9593 if (!Networking.IsOwner(((Component)this).gameObject))
9594 {
9595 Debug.LogError((object)String.Concat("Non-owner attempted to return ", ((Object)obj).name, " to ", ((Object)((Component)this).gameObject).name));
9596 }
9597 else if (_indices.TryGetValue(obj, ref num))
9598 {
9599 obj.SetActive(false);
9600 obj.transform.position = StartPositions[num];
9601 obj.transform.rotation = StartRotations[num];
9602 if (OnReturn != null)
9603 {
9604 OnReturn.Invoke(this, num);
9605 }
9606 }
9607 }
9608 }
9610 {
9611 }
9613 {
9614 }
9615 [AddComponentMenu("VRChat/VRC Avatar Pedestal")]
9616 [HelpURL("https://creators.vrchat.com/worlds/components/vrc_avatarpedestal/")]
9618 {
9619 [RPC(/*Could not decode attribute arguments.*/)]
9620 [ExcludeFromUdonWrapper]
9621 public override void SwitchAvatar(string id, VRCPlayerApi instigator)
9622 {
9623 if (instigator != null && instigator.isLocal)
9624 {
9625 ((VRC_AvatarPedestal)this).SwitchAvatar(id, instigator);
9626 }
9627 }
9628
9629 public override void SwitchAvatar(string id)
9630 {
9631 ((VRC_AvatarPedestal)this).SwitchAvatar(id);
9632 }
9633 }
9634 [AddComponentMenu("VRChat/VRC Object Sync")]
9635 [HelpURL("https://creators.vrchat.com/worlds/components/vrc_objectsync")]
9637 {
9638 public delegate void AwakeDelegate(VRCObjectSync obj);
9639
9641
9642 [ExcludeFromUdonWrapper]
9643 public static Action<VRCObjectSync, Vector3, Quaternion> TeleportHandler = null;
9644
9645 [ExcludeFromUdonWrapper]
9646 public static Action<VRCObjectSync> RespawnHandler = null;
9647
9648 [ExcludeFromUdonWrapper]
9649 public static AwakeDelegate OnAwake;
9650
9651 private bool didInit;
9652
9653 [ExcludeFromUdonWrapper]
9654 [field: CompilerGenerated]
9655 public static Action<VRCObjectSync, bool> SetKinematicHook
9656 {
9657 [CompilerGenerated]
9658 get;
9659 [CompilerGenerated]
9660 set;
9662
9663
9664 [ExcludeFromUdonWrapper]
9665 [field: CompilerGenerated]
9666 public static Action<VRCObjectSync, bool> SetGravityHook
9667 {
9668 [CompilerGenerated]
9669 get;
9670 [CompilerGenerated]
9671 set;
9672 } = EditorSetGravity;
9673
9674
9675 [ExcludeFromUdonWrapper]
9676 [field: CompilerGenerated]
9677 public static Action<VRCObjectSync> FlagDiscontinuityHook
9678 {
9679 [CompilerGenerated]
9680 get;
9681 [CompilerGenerated]
9682 set;
9683 } = null;
9684
9685
9686 public void SetKinematic(bool value)
9687 {
9688 SetKinematicHook?.Invoke(this, value);
9689 }
9690
9691 private static void EditorSetKinematic(VRCObjectSync target, bool value)
9692 {
9693 Rigidbody component = ((Component)target).GetComponent<Rigidbody>();
9694 if (Object.op_Implicit((Object)(object)component))
9695 {
9696 component.isKinematic = value;
9697 }
9698 }
9699
9700 public void SetGravity(bool value)
9701 {
9702 SetGravityHook?.Invoke(this, value);
9703 }
9704
9705 private static void EditorSetGravity(VRCObjectSync target, bool value)
9706 {
9707 Rigidbody component = ((Component)target).GetComponent<Rigidbody>();
9708 if (Object.op_Implicit((Object)(object)component))
9709 {
9710 component.useGravity = value;
9711 }
9712 }
9713
9714 public void FlagDiscontinuity()
9715 {
9716 FlagDiscontinuityHook?.Invoke(this);
9717 }
9718
9719 public void TeleportTo(Transform targetLocation)
9720 {
9721 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
9722 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
9723 TeleportHandler?.Invoke(this, targetLocation.position, targetLocation.rotation);
9724 }
9725
9726 public void Respawn()
9727 {
9728 RespawnHandler?.Invoke(this);
9729 }
9730
9731 [ExcludeFromUdonWrapper]
9732 public override void NetworkConfigure()
9733 {
9734 if (!didInit)
9735 {
9736 if (OnAwake != null)
9737 {
9738 OnAwake(this);
9739 }
9740 didInit = true;
9741 }
9742 }
9743 }
9744 [AddComponentMenu("VRChat/VRC Pickup")]
9745 [HelpURL("https://creators.vrchat.com/worlds/components/vrc_pickup")]
9746 public class VRCPickup : VRC_Pickup
9747 {
9748 }
9749 [AddComponentMenu("VRChat/VRC Portal Marker")]
9750 [HelpURL("https://creators.vrchat.com/worlds/components/vrc_portalmarker")]
9752 {
9753 }
9754 [ExecuteInEditMode]
9755 [HelpURL("https://creators.vrchat.com/worlds/components/vrc_mirrorreflection")]
9756 [AddComponentMenu("VRChat/VRC Mirror Reflection")]
9758 {
9759 [Tooltip("The mirror camera can be set to use a custom skybox shader or a solid clear color. By default it renders the same as the reference camera.")]
9761
9762 [Tooltip("Overrides the skybox material used by the mirror camera. Only used if clear flags are set to CustomSkybox.")]
9763 public Material customSkybox;
9764
9765 [Tooltip("Set the solid clear color used by the mirror camera if clear flags are set to SolidColor.")]
9766 public Color customClearColor = new Color(0f, 0f, 0f, 1f);
9767
9768 protected override void UpdateCameraClearing(Camera src, Camera mirrorCamera, Skybox mirrorSkybox)
9769 {
9770 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
9771 //IL_0034: Unknown result type (might be due to invalid IL or missing references)
9772 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
9773 //IL_0045: Invalid comparison between Unknown and I4
9774 //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
9775 //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
9776 //IL_0112: Unknown result type (might be due to invalid IL or missing references)
9777 switch (cameraClearFlags)
9778 {
9779 case MirrorClearFlags.FromReferenceCamera:
9780 mirrorCamera.clearFlags = src.clearFlags;
9781 mirrorCamera.backgroundColor = src.backgroundColor;
9782 if ((int)src.clearFlags == 1)
9783 {
9784 Component component = ((Component)src).GetComponent(typeof(Skybox));
9785 Skybox val = (Skybox)(object)((component is Skybox) ? component : null);
9786 if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.material))
9787 {
9788 ((Behaviour)mirrorSkybox).enabled = false;
9789 break;
9790 }
9791 ((Behaviour)mirrorSkybox).enabled = true;
9792 mirrorSkybox.material = val.material;
9793 }
9794 else
9795 {
9796 ((Behaviour)mirrorSkybox).enabled = false;
9797 }
9798 break;
9799 case MirrorClearFlags.CustomSkybox:
9800 if ((Object)(object)customSkybox != (Object)null)
9801 {
9802 ((Behaviour)mirrorSkybox).enabled = true;
9803 mirrorSkybox.material = customSkybox;
9804 mirrorCamera.clearFlags = (CameraClearFlags)1;
9805 }
9806 else
9807 {
9808 ((Behaviour)mirrorSkybox).enabled = false;
9809 mirrorCamera.clearFlags = (CameraClearFlags)2;
9810 mirrorCamera.backgroundColor = Color.black;
9811 }
9812 break;
9813 case MirrorClearFlags.SolidColor:
9814 ((Behaviour)mirrorSkybox).enabled = false;
9815 mirrorCamera.clearFlags = (CameraClearFlags)2;
9816 mirrorCamera.backgroundColor = customClearColor;
9817 break;
9818 case MirrorClearFlags.Nothing:
9819 ((Behaviour)mirrorSkybox).enabled = false;
9820 mirrorCamera.clearFlags = (CameraClearFlags)4;
9821 break;
9822 case MirrorClearFlags.Depth:
9823 ((Behaviour)mirrorSkybox).enabled = false;
9824 mirrorCamera.clearFlags = (CameraClearFlags)3;
9825 break;
9826 default:
9827 throw new ArgumentOutOfRangeException();
9828 }
9829 }
9830 }
9831 [PublicAPI]
9832 public enum MirrorClearFlags : Enum
9833 {
9834 FromReferenceCamera,
9835 CustomSkybox,
9836 SolidColor,
9837 Nothing,
9838 Depth
9839 }
9840 [AddComponentMenu("VRChat/VRC Scene Descriptor")]
9841 [HelpURL("https://creators.vrchat.com/worlds/components/vrc_scenedescriptor/")]
9843 {
9844 [HideInInspector]
9846
9847 [HideInInspector]
9848 public float[] NavigationAreas;
9849
9850 public override void Awake()
9851 {
9852 ((VRC_SceneDescriptor)this).Awake();
9853 VRCPlayerObject[] playerPersistence = PlayerPersistence;
9854 PlayerPersistence = ((playerPersistence != null) ? Enumerable.ToArray<VRCPlayerObject>(Enumerable.Where<VRCPlayerObject>((IEnumerable<VRCPlayerObject>)(object)playerPersistence, (Func<VRCPlayerObject, bool>)((VRCPlayerObject pp) => (Object)(object)pp != (Object)null && (Object)null == (Object)(object)((Component)pp).GetComponentInParent<VRCPlayerObject>()))) : null);
9855 }
9856 }
9857 [AddComponentMenu("VRChat/VRC Station")]
9858 [HelpURL("https://creators.vrchat.com/worlds/components/vrc_station")]
9859 public class VRCStation : VRCStation
9860 {
9861 public readonly string OnRemotePlayerEnterStation = "_onStationEntered";
9862
9863 public readonly string OnLocalPlayerEnterStation = "_onStationEntered";
9864
9865 public readonly string OnRemotePlayerExitStation = "_onStationExited";
9866
9867 public readonly string OnLocalPlayerExitStation = "_onStationExited";
9868 }
9869 internal static class MultipleDisplayUtilities : Object
9870 {
9871 public static bool GetRelativeMousePositionForDrag(PointerEventData eventData, ref Vector2 position)
9872 {
9873 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
9874 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
9875 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
9876 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
9877 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
9878 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
9879 //IL_0035: Unknown result type (might be due to invalid IL or missing references)
9880 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
9881 //IL_002e: Unknown result type (might be due to invalid IL or missing references)
9882 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
9883 int displayIndex = eventData.pointerPressRaycast.displayIndex;
9884 Vector3 val = Display.RelativeMouseAt(Vector2.op_Implicit(eventData.position));
9885 if ((int)val.z != displayIndex)
9886 {
9887 return false;
9888 }
9889 position = ((displayIndex != 0) ? Vector2.op_Implicit(val) : eventData.position);
9890 return true;
9891 }
9892
9894 {
9895 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
9896 //IL_0005: Unknown result type (might be due to invalid IL or missing references)
9897 //IL_0085: Unknown result type (might be due to invalid IL or missing references)
9898 //IL_0086: Unknown result type (might be due to invalid IL or missing references)
9899 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
9900 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
9901 //IL_0062: Invalid comparison between Unknown and I4
9902 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
9903 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
9904 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
9905 Vector3 mousePosition = Input.mousePosition;
9906 if (Display.main.renderingHeight != Display.main.systemHeight && (mousePosition.y < 0f || mousePosition.y > (float)Display.main.renderingHeight || mousePosition.x < 0f || mousePosition.x > (float)Display.main.renderingWidth) && (int)Screen.fullScreenMode != 3)
9907 {
9908 mousePosition.y += Display.main.systemHeight - Display.main.renderingHeight;
9909 }
9910 return Vector2.op_Implicit(mousePosition);
9911 }
9912 }
9913 internal static class SetPropertyUtility : Object
9914 {
9915 public static bool SetColor(ref Color currentValue, Color newValue)
9916 {
9917 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
9918 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
9919 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
9920 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
9921 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
9922 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
9923 if (currentValue.r == newValue.r && currentValue.g == newValue.g && currentValue.b == newValue.b && currentValue.a == newValue.a)
9924 {
9925 return false;
9926 }
9927 currentValue = newValue;
9928 return true;
9929 }
9930
9931 public static bool SetStruct<T>(ref T currentValue, T newValue) where T : struct, ValueType
9932 {
9933 if (EqualityComparer<T>.Default.Equals(currentValue, newValue))
9934 {
9935 return false;
9936 }
9937 currentValue = newValue;
9938 return true;
9939 }
9940
9941 public static bool SetClass<T>(ref T currentValue, T newValue) where T : class
9942 {
9943 if ((currentValue == null && newValue == null) || (currentValue != null && ((Object)currentValue).Equals((object)newValue)))
9944 {
9945 return false;
9946 }
9947 currentValue = newValue;
9948 return true;
9949 }
9950 }
9951 [AddComponentMenu("VRChat/UI/VRC InputField Keyboard Override")]
9952 [HelpURL("https://creators.vrchat.com/worlds/components/vrc_uishape/#if-youd-like-a-textfield-not-to-show-vrchats-keyboard")]
9953 public class VRCInputFieldKeyboardOverride : MonoBehaviour
9954 {
9955 public enum OverrideBehaviorType : Enum
9956 {
9957 Default,
9958 Override
9959 }
9960
9961 [SerializeField]
9962 private OverrideBehaviorType _overrideBehavior;
9963
9964 public OverrideBehaviorType OverrideBehavior => _overrideBehavior;
9965 }
9966 public static class VRCTMPDropdownExtension : Object
9967 {
9968 public static void AddOptions(this TMP_Dropdown dropdown, string[] options)
9969 {
9970 dropdown.AddOptions(Enumerable.ToList<string>((IEnumerable<string>)(object)options));
9971 }
9972
9973 public static void AddOptions(this TMP_Dropdown dropdown, OptionData[] options)
9974 {
9975 dropdown.AddOptions(Enumerable.ToList<OptionData>((IEnumerable<OptionData>)(object)options));
9976 }
9977
9978 public static void AddOptions(this TMP_Dropdown dropdown, Sprite[] options)
9979 {
9980 dropdown.AddOptions(Enumerable.ToList<Sprite>((IEnumerable<Sprite>)(object)options));
9981 }
9982 }
9983 [AddComponentMenu("VRChat/UI/VRC UI Shape")]
9984 [HelpURL("https://creators.vrchat.com/worlds/components/vrc_uishape")]
9986 {
9987 }
9988 [AddComponentMenu("VRChat/UI/VRC URL Input Field")]
9989 [HelpURL("https://udonsharp.docs.vrchat.com/vrchat-api/#vrcurlinputfield")]
9990 public class VRCUrlInputField : Selectable, IUpdateSelectedHandler, IEventSystemHandler, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerClickHandler, ISubmitHandler, ICanvasElement, ILayoutElement
9991 {
9992 public enum ContentType : Enum
9993 {
9994 Standard,
9995 Autocorrected,
9996 IntegerNumber,
9997 DecimalNumber,
9998 Alphanumeric,
9999 Name,
10000 EmailAddress,
10001 Password,
10002 Pin,
10003 Custom
10004 }
10005
10006 public enum InputType : Enum
10007 {
10008 Standard,
10009 AutoCorrect,
10010 Password
10011 }
10012
10013 public enum CharacterValidation : Enum
10014 {
10015 None,
10016 Integer,
10017 Decimal,
10018 Alphanumeric,
10019 Name,
10020 EmailAddress
10021 }
10022
10023 public enum LineType : Enum
10024 {
10025 SingleLine,
10026 MultiLineSubmit,
10027 MultiLineNewline
10028 }
10029
10030 public delegate char OnValidateInput(string text, int charIndex, char addedChar);
10031
10032 [Serializable]
10033 public class SubmitEvent : UnityEvent<string>
10034 {
10035 }
10036
10037 [Serializable]
10038 public class OnChangeEvent : UnityEvent<string>
10039 {
10040 }
10041
10042 protected enum EditState : Enum
10043 {
10044 Continue,
10045 Finish
10046 }
10047
10048 [CompilerGenerated]
10049 private Action m_onSelected;
10050
10051 protected TouchScreenKeyboard m_Keyboard;
10052
10053 private static readonly char[] kSeparators;
10054
10055 private static bool s_AreDevicesEvaluated;
10056
10057 private static bool s_IsQuestDevice;
10058
10059 private static bool s_IsPicoDevice;
10060
10061 [SerializeField]
10062 [FormerlySerializedAs("text")]
10063 protected Text m_TextComponent;
10064
10065 [SerializeField]
10066 protected Graphic m_Placeholder;
10067
10068 [SerializeField]
10070
10071 [FormerlySerializedAs("inputType")]
10072 [SerializeField]
10074
10075 [FormerlySerializedAs("asteriskChar")]
10076 [SerializeField]
10077 private char m_AsteriskChar = '*';
10078
10079 [FormerlySerializedAs("keyboardType")]
10080 [SerializeField]
10081 private TouchScreenKeyboardType m_KeyboardType;
10082
10083 [SerializeField]
10085
10086 [FormerlySerializedAs("hideMobileInput")]
10087 [SerializeField]
10088 private bool m_HideMobileInput;
10089
10090 [FormerlySerializedAs("validation")]
10091 [SerializeField]
10093
10094 [FormerlySerializedAs("characterLimit")]
10095 [SerializeField]
10096 private int m_CharacterLimit;
10097
10098 [FormerlySerializedAs("onSubmit")]
10099 [FormerlySerializedAs("m_OnSubmit")]
10100 [FormerlySerializedAs("m_EndEdit")]
10101 [SerializeField]
10103
10104 [FormerlySerializedAs("onValueChange")]
10105 [FormerlySerializedAs("m_OnValueChange")]
10106 [SerializeField]
10108
10109 [FormerlySerializedAs("onValidateInput")]
10110 [SerializeField]
10112
10113 [FormerlySerializedAs("selectionColor")]
10114 [SerializeField]
10115 private Color m_CaretColor = new Color(10f / 51f, 10f / 51f, 10f / 51f, 1f);
10116
10117 [SerializeField]
10119
10120 [SerializeField]
10121 private Color m_SelectionColor = new Color(56f / 85f, 0.80784315f, 1f, 64f / 85f);
10122
10123 [SerializeField]
10124 [FormerlySerializedAs("mValue")]
10125 protected string m_Text = String.Empty;
10126
10127 [SerializeField]
10128 [Range(0f, 4f)]
10129 private float m_CaretBlinkRate = 0.85f;
10130
10131 [SerializeField]
10132 [Range(1f, 5f)]
10133 private int m_CaretWidth = 1;
10134
10135 [SerializeField]
10136 private bool m_ReadOnly;
10137
10138 [SerializeField]
10139 private bool m_ShouldActivateOnSelect = true;
10140
10141 protected int m_CaretPosition;
10142
10144
10145 private RectTransform caretRectTrans;
10146
10147 protected UIVertex[] m_CursorVerts;
10148
10149 private TextGenerator m_InputTextCache;
10150
10151 private CanvasRenderer m_CachedInputRenderer;
10152
10154
10155 [NonSerialized]
10156 protected Mesh m_Mesh;
10157
10158 private bool m_AllowInput;
10159
10161
10162 private bool m_UpdateDrag;
10163
10165
10166 private const float kHScrollSpeed = 0.05f;
10167
10168 private const float kVScrollSpeed = 0.1f;
10169
10170 protected bool m_CaretVisible;
10171
10172 private Coroutine m_BlinkCoroutine;
10173
10174 private float m_BlinkStartTime;
10175
10176 protected int m_DrawStart;
10177
10178 protected int m_DrawEnd;
10179
10180 private Coroutine m_DragCoroutine;
10181
10182 private string m_OriginalText = "";
10183
10184 private bool m_WasCanceled;
10185
10187
10188 private WaitForSecondsRealtime m_WaitForSecondsRealtime;
10189
10191
10192 private const string kEmailSpecialCharacters = "!#$%&'*+-/=?^_`{|}~";
10193
10194 private const string kOculusQuestDeviceModel = "Oculus Quest";
10195
10196 private const string kPicoDeviceModel = "Pico";
10197
10198 public bool AllowSendingOnEndEdit = true;
10199
10200 private Event m_ProcessingEvent = new Event();
10201
10202 private const int k_MaxTextLength = 16382;
10203
10204 private BaseInput input
10205 {
10206 get
10207 {
10208 if (Object.op_Implicit((Object)(object)EventSystem.current) && Object.op_Implicit((Object)(object)EventSystem.current.currentInputModule))
10209 {
10210 return EventSystem.current.currentInputModule.input;
10211 }
10212 return null;
10213 }
10214 }
10215
10216 private string compositionString
10217 {
10218 get
10219 {
10220 if (!((Object)(object)input != (Object)null))
10221 {
10222 return Input.compositionString;
10223 }
10224 return input.compositionString;
10225 }
10226 }
10227
10228 protected Mesh mesh
10229 {
10230 get
10231 {
10232 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
10233 //IL_0019: Expected O, but got Unknown
10234 if ((Object)(object)m_Mesh == (Object)null)
10235 {
10236 m_Mesh = new Mesh();
10237 }
10238 return m_Mesh;
10239 }
10240 }
10241
10242 protected TextGenerator cachedInputTextGenerator
10243 {
10244 get
10245 {
10246 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
10247 //IL_0013: Expected O, but got Unknown
10248 if (m_InputTextCache == null)
10249 {
10250 m_InputTextCache = new TextGenerator();
10251 }
10252 return m_InputTextCache;
10253 }
10254 }
10255
10257 {
10258 get
10259 {
10260 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
10261 //IL_0005: Unknown result type (might be due to invalid IL or missing references)
10262 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
10263 //IL_0008: Invalid comparison between Unknown and I4
10264 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
10265 //IL_000d: Invalid comparison between Unknown and I4
10266 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
10267 //IL_0012: Invalid comparison between Unknown and I4
10268 RuntimePlatform platform = Application.platform;
10269 if ((int)platform == 8 || (int)platform == 11 || (int)platform == 31)
10270 {
10271 return m_HideMobileInput;
10272 }
10273 return true;
10274 }
10275 set
10276 {
10277 SetPropertyUtility.SetStruct<bool>(ref m_HideMobileInput, value);
10278 }
10279 }
10280
10282 {
10283 get
10284 {
10285 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
10286 //IL_000f: Invalid comparison between Unknown and I4
10288 {
10289 return (int)Application.platform != 31;
10290 }
10291 return false;
10292 }
10293 set
10294 {
10296 }
10297 }
10298
10299 public string text
10300 {
10301 get
10302 {
10303 return m_Text;
10304 }
10305 set
10306 {
10307 SetText(value);
10308 }
10309 }
10310
10311 public bool isFocused => m_AllowInput;
10312
10313 public float caretBlinkRate
10314 {
10315 get
10316 {
10317 return m_CaretBlinkRate;
10318 }
10319 set
10320 {
10321 if (SetPropertyUtility.SetStruct<float>(ref m_CaretBlinkRate, value) && m_AllowInput)
10322 {
10324 }
10325 }
10326 }
10327
10328 public int caretWidth
10329 {
10330 get
10331 {
10332 return m_CaretWidth;
10333 }
10334 set
10335 {
10336 if (SetPropertyUtility.SetStruct<int>(ref m_CaretWidth, value))
10337 {
10339 }
10340 }
10341 }
10342
10343 public Text textComponent
10344 {
10345 get
10346 {
10347 return m_TextComponent;
10348 }
10349 set
10350 {
10351 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
10352 //IL_0025: Expected O, but got Unknown
10353 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
10354 //IL_003c: Expected O, but got Unknown
10355 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
10356 //IL_0053: Expected O, but got Unknown
10357 //IL_0082: Unknown result type (might be due to invalid IL or missing references)
10358 //IL_008c: Expected O, but got Unknown
10359 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
10360 //IL_00a3: Expected O, but got Unknown
10361 //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
10362 //IL_00ba: Expected O, but got Unknown
10363 if ((Object)(object)m_TextComponent != (Object)null)
10364 {
10365 ((Graphic)m_TextComponent).UnregisterDirtyVerticesCallback(new UnityAction(MarkGeometryAsDirty));
10366 ((Graphic)m_TextComponent).UnregisterDirtyVerticesCallback(new UnityAction(UpdateLabel));
10367 ((Graphic)m_TextComponent).UnregisterDirtyMaterialCallback(new UnityAction(UpdateCaretMaterial));
10368 }
10369 if (SetPropertyUtility.SetClass(ref m_TextComponent, value))
10370 {
10372 if ((Object)(object)m_TextComponent != (Object)null)
10373 {
10374 ((Graphic)m_TextComponent).RegisterDirtyVerticesCallback(new UnityAction(MarkGeometryAsDirty));
10375 ((Graphic)m_TextComponent).RegisterDirtyVerticesCallback(new UnityAction(UpdateLabel));
10376 ((Graphic)m_TextComponent).RegisterDirtyMaterialCallback(new UnityAction(UpdateCaretMaterial));
10377 }
10378 }
10379 }
10380 }
10381
10382 public Graphic placeholder
10383 {
10384 get
10385 {
10386 return m_Placeholder;
10387 }
10388 set
10389 {
10390 SetPropertyUtility.SetClass(ref m_Placeholder, value);
10391 }
10392 }
10393
10394 public Color caretColor
10395 {
10396 get
10397 {
10398 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
10399 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
10400 if (!customCaretColor)
10401 {
10402 return ((Graphic)textComponent).color;
10403 }
10404 return m_CaretColor;
10405 }
10406 set
10407 {
10408 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
10410 {
10412 }
10413 }
10414 }
10415
10417 {
10418 get
10419 {
10420 return m_CustomCaretColor;
10421 }
10422 set
10423 {
10424 if (m_CustomCaretColor != value)
10425 {
10426 m_CustomCaretColor = value;
10428 }
10429 }
10430 }
10431
10432 public Color selectionColor
10433 {
10434 get
10435 {
10436 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
10437 return m_SelectionColor;
10438 }
10439 set
10440 {
10441 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
10443 {
10445 }
10446 }
10447 }
10448
10450 {
10451 get
10452 {
10453 return m_OnEndEdit;
10454 }
10455 set
10456 {
10457 SetPropertyUtility.SetClass(ref m_OnEndEdit, value);
10458 }
10459 }
10460
10461 [Obsolete("onValueChange has been renamed to onValueChanged")]
10463 {
10464 get
10465 {
10466 return onValueChanged;
10467 }
10468 set
10469 {
10470 onValueChanged = value;
10471 }
10472 }
10473
10475 {
10476 get
10477 {
10478 return m_OnValueChanged;
10479 }
10480 set
10481 {
10482 SetPropertyUtility.SetClass(ref m_OnValueChanged, value);
10483 }
10484 }
10485
10487 {
10488 get
10489 {
10490 return m_OnValidateInput;
10491 }
10492 set
10493 {
10494 SetPropertyUtility.SetClass(ref m_OnValidateInput, value);
10495 }
10496 }
10497
10499 {
10500 get
10501 {
10502 return m_CharacterLimit;
10503 }
10504 set
10505 {
10506 if (SetPropertyUtility.SetStruct<int>(ref m_CharacterLimit, Math.Max(0, value)))
10507 {
10508 UpdateLabel();
10509 if (m_Keyboard != null)
10510 {
10511 m_Keyboard.characterLimit = value;
10512 }
10513 }
10514 }
10515 }
10516
10518 {
10519 get
10520 {
10521 return m_ContentType;
10522 }
10523 set
10524 {
10525 if (SetPropertyUtility.SetStruct<ContentType>(ref m_ContentType, value))
10526 {
10528 }
10529 }
10530 }
10531
10533 {
10534 get
10535 {
10536 return m_LineType;
10537 }
10538 set
10539 {
10540 if (SetPropertyUtility.SetStruct<LineType>(ref m_LineType, value))
10541 {
10542 SetToCustomIfContentTypeIsNot(ContentType.Standard, ContentType.Autocorrected);
10544 }
10545 }
10546 }
10547
10549 {
10550 get
10551 {
10552 return m_InputType;
10553 }
10554 set
10555 {
10556 if (SetPropertyUtility.SetStruct<InputType>(ref m_InputType, value))
10557 {
10558 SetToCustom();
10559 }
10560 }
10561 }
10562
10563 public TouchScreenKeyboard touchScreenKeyboard => m_Keyboard;
10564
10565 public TouchScreenKeyboardType keyboardType
10566 {
10567 get
10568 {
10569 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
10570 return m_KeyboardType;
10571 }
10572 set
10573 {
10574 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
10575 if (SetPropertyUtility.SetStruct<TouchScreenKeyboardType>(ref m_KeyboardType, value))
10576 {
10577 SetToCustom();
10578 }
10579 }
10580 }
10581
10583 {
10584 get
10585 {
10586 return m_CharacterValidation;
10587 }
10588 set
10589 {
10591 {
10592 SetToCustom();
10593 }
10594 }
10595 }
10596
10597 public bool readOnly
10598 {
10599 get
10600 {
10601 return m_ReadOnly;
10602 }
10603 set
10604 {
10605 m_ReadOnly = value;
10606 }
10607 }
10608
10609 public bool multiLine
10610 {
10611 get
10612 {
10613 if (m_LineType != LineType.MultiLineNewline)
10614 {
10615 return lineType == LineType.MultiLineSubmit;
10616 }
10617 return true;
10618 }
10619 }
10620
10621 public char asteriskChar
10622 {
10623 get
10624 {
10625 return m_AsteriskChar;
10626 }
10627 set
10628 {
10629 if (SetPropertyUtility.SetStruct<char>(ref m_AsteriskChar, value))
10630 {
10631 UpdateLabel();
10632 }
10633 }
10634 }
10635
10637
10639 {
10640 get
10641 {
10642 return m_CaretPosition + compositionString.Length;
10643 }
10644 set
10645 {
10646 m_CaretPosition = value;
10648 }
10649 }
10650
10652 {
10653 get
10654 {
10656 }
10657 set
10658 {
10659 m_CaretSelectPosition = value;
10661 }
10662 }
10663
10665
10666 [ExcludeFromUdonWrapper]
10667 public int caretPosition
10668 {
10669 get
10670 {
10672 }
10673 set
10674 {
10676 selectionFocusPosition = value;
10677 }
10678 }
10679
10680 [ExcludeFromUdonWrapper]
10682 {
10683 get
10684 {
10685 return m_CaretPosition + compositionString.Length;
10686 }
10687 set
10688 {
10689 if (compositionString.Length == 0)
10690 {
10691 m_CaretPosition = value;
10693 }
10694 }
10695 }
10696
10697 [ExcludeFromUdonWrapper]
10699 {
10700 get
10701 {
10703 }
10704 set
10705 {
10706 if (compositionString.Length == 0)
10707 {
10708 m_CaretSelectPosition = value;
10710 }
10711 }
10712 }
10713
10714 private static string clipboard
10715 {
10716 get
10717 {
10718 return GUIUtility.systemCopyBuffer;
10719 }
10720 set
10721 {
10722 GUIUtility.systemCopyBuffer = value;
10723 }
10724 }
10725
10726 public virtual float minWidth => 0f;
10727
10728 public virtual float preferredWidth
10729 {
10730 get
10731 {
10732 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
10733 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
10734 //IL_0024: Unknown result type (might be due to invalid IL or missing references)
10735 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
10736 if ((Object)(object)textComponent == (Object)null)
10737 {
10738 return 0f;
10739 }
10740 TextGenerationSettings generationSettings = textComponent.GetGenerationSettings(Vector2.zero);
10741 return textComponent.cachedTextGeneratorForLayout.GetPreferredWidth(m_Text, generationSettings) / textComponent.pixelsPerUnit;
10742 }
10743 }
10744
10745 public virtual float flexibleWidth => -1f;
10746
10747 public virtual float minHeight => 0f;
10748
10749 public virtual float preferredHeight
10750 {
10751 get
10752 {
10753 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
10754 //IL_002a: Unknown result type (might be due to invalid IL or missing references)
10755 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
10756 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
10757 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
10758 //IL_0046: Unknown result type (might be due to invalid IL or missing references)
10759 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
10760 if ((Object)(object)textComponent == (Object)null)
10761 {
10762 return 0f;
10763 }
10764 Text obj = textComponent;
10765 Rect rect = ((Graphic)textComponent).rectTransform.rect;
10766 TextGenerationSettings generationSettings = obj.GetGenerationSettings(new Vector2(((Rect)(ref rect)).size.x, 0f));
10767 return textComponent.cachedTextGeneratorForLayout.GetPreferredHeight(m_Text, generationSettings) / textComponent.pixelsPerUnit;
10768 }
10769 }
10770
10771 public virtual float flexibleHeight => -1f;
10772
10773 public virtual int layoutPriority => 1;
10774
10775 public event Action onSelected
10776 {
10777 [CompilerGenerated]
10778 add
10779 {
10780 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
10781 //IL_0016: Expected O, but got Unknown
10782 Action val = this.m_onSelected;
10783 Action val2;
10784 do
10785 {
10786 val2 = val;
10787 Action val3 = (Action)Delegate.Combine((Delegate)(object)val2, (Delegate)(object)value);
10788 val = Interlocked.CompareExchange<Action>(ref this.m_onSelected, val3, val2);
10789 }
10790 while (val != val2);
10791 }
10792 [CompilerGenerated]
10793 remove
10794 {
10795 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
10796 //IL_0016: Expected O, but got Unknown
10797 Action val = this.m_onSelected;
10798 Action val2;
10799 do
10800 {
10801 val2 = val;
10802 Action val3 = (Action)Delegate.Remove((Delegate)(object)val2, (Delegate)(object)value);
10803 val = Interlocked.CompareExchange<Action>(ref this.m_onSelected, val3, val2);
10804 }
10805 while (val != val2);
10806 }
10807 }
10808
10810 {
10811 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
10812 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
10813 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
10814 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
10815 //IL_0038: Expected O, but got Unknown
10816 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
10817 //IL_002c: Expected O, but got Unknown
10818 _ = ((Component)this).gameObject.scene;
10819 Scene scene = ((Component)this).gameObject.scene;
10820 if (((Scene)(ref scene)).IsValid())
10821 {
10822 return new VRCUrl(text);
10823 }
10824 return new VRCUrl("");
10825 }
10826
10827 public void SetUrl(VRCUrl url)
10828 {
10829 text = url.Get();
10830 }
10831
10832 protected override void Awake()
10833 {
10834 ((Selectable)this).Awake();
10835 text = "";
10837 {
10838 s_IsQuestDevice = SystemInfo.deviceModel == "Oculus Quest";
10839 s_IsPicoDevice = SystemInfo.deviceModel.Contains("Pico", (StringComparison)3);
10840 s_AreDevicesEvaluated = true;
10841 }
10842 }
10843
10845 {
10846 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
10847 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
10848 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
10849 //IL_0057: Unknown result type (might be due to invalid IL or missing references)
10850 //IL_0093: Unknown result type (might be due to invalid IL or missing references)
10851 //IL_009d: Expected O, but got Unknown
10853 }
10854
10855 private void SetText(string value, bool sendCallback = true)
10856 {
10857 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
10858 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
10859 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
10860 _ = ((Component)this).gameObject.scene;
10861 Scene scene = ((Component)this).gameObject.scene;
10862 if (!((Scene)(ref scene)).IsValid() || text == value)
10863 {
10864 return;
10865 }
10866 if (value == null)
10867 {
10868 value = "";
10869 }
10870 value = value.Replace("\0", String.Empty);
10871 if (m_LineType == LineType.SingleLine)
10872 {
10873 value = value.Replace("\n", "").Replace("\t", "");
10874 }
10875 if (this.onValidateInput != null || characterValidation != 0)
10876 {
10877 m_Text = "";
10878 OnValidateInput onValidateInput = this.onValidateInput ?? new OnValidateInput(Validate);
10879 m_CaretPosition = (m_CaretSelectPosition = value.Length);
10880 int num = ((characterLimit > 0) ? Math.Min(characterLimit, value.Length) : value.Length);
10881 for (int i = 0; i < num; i++)
10882 {
10883 char c = onValidateInput(m_Text, m_Text.Length, value[i]);
10884 if (c != 0)
10885 {
10886 m_Text = String.Concat(m_Text, ((Char)(ref c)).ToString());
10887 }
10888 }
10889 }
10890 else
10891 {
10892 m_Text = ((characterLimit > 0 && value.Length > characterLimit) ? value.Substring(0, characterLimit) : value);
10893 }
10894 if (m_Keyboard != null)
10895 {
10896 m_Keyboard.text = m_Text;
10897 }
10898 if (m_CaretPosition > m_Text.Length)
10899 {
10901 }
10902 else if (m_CaretSelectPosition > m_Text.Length)
10903 {
10905 }
10906 if (sendCallback)
10907 {
10909 }
10910 UpdateLabel();
10911 }
10912
10913 protected void ClampPos(ref int pos)
10914 {
10915 if (pos < 0)
10916 {
10917 pos = 0;
10918 }
10919 else if (pos > text.Length)
10920 {
10921 pos = text.Length;
10922 }
10923 }
10924
10925 protected override void OnEnable()
10926 {
10927 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
10928 //IL_0084: Expected O, but got Unknown
10929 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
10930 //IL_009b: Expected O, but got Unknown
10931 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
10932 //IL_00b2: Expected O, but got Unknown
10933 ((Selectable)this).OnEnable();
10934 if (m_Text == null)
10935 {
10936 m_Text = String.Empty;
10937 }
10938 m_DrawStart = 0;
10939 m_DrawEnd = m_Text.Length;
10940 if ((Object)(object)m_CachedInputRenderer != (Object)null)
10941 {
10942 m_CachedInputRenderer.SetMaterial(((MaskableGraphic)m_TextComponent).GetModifiedMaterial(Graphic.defaultGraphicMaterial), (Texture)(object)Texture2D.whiteTexture);
10943 }
10944 if ((Object)(object)m_TextComponent != (Object)null)
10945 {
10946 ((Graphic)m_TextComponent).RegisterDirtyVerticesCallback(new UnityAction(MarkGeometryAsDirty));
10947 ((Graphic)m_TextComponent).RegisterDirtyVerticesCallback(new UnityAction(UpdateLabel));
10948 ((Graphic)m_TextComponent).RegisterDirtyMaterialCallback(new UnityAction(UpdateCaretMaterial));
10949 UpdateLabel();
10950 }
10951 }
10952
10953 protected override void OnDisable()
10954 {
10955 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
10956 //IL_0032: Expected O, but got Unknown
10957 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
10958 //IL_0049: Expected O, but got Unknown
10959 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
10960 //IL_0060: Expected O, but got Unknown
10961 m_BlinkCoroutine = null;
10963 if ((Object)(object)m_TextComponent != (Object)null)
10964 {
10965 ((Graphic)m_TextComponent).UnregisterDirtyVerticesCallback(new UnityAction(MarkGeometryAsDirty));
10966 ((Graphic)m_TextComponent).UnregisterDirtyVerticesCallback(new UnityAction(UpdateLabel));
10967 ((Graphic)m_TextComponent).UnregisterDirtyMaterialCallback(new UnityAction(UpdateCaretMaterial));
10968 }
10969 CanvasUpdateRegistry.UnRegisterCanvasElementForRebuild((ICanvasElement)(object)this);
10970 if ((Object)(object)m_CachedInputRenderer != (Object)null)
10971 {
10972 m_CachedInputRenderer.Clear();
10973 }
10974 if ((Object)(object)m_Mesh != (Object)null)
10975 {
10976 Object.DestroyImmediate((Object)(object)m_Mesh);
10977 }
10978 m_Mesh = null;
10979 ((Selectable)this).OnDisable();
10980 }
10981
10982 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
10983 private IEnumerator CaretBlink()
10984 {
10985 m_CaretVisible = true;
10986 yield return null;
10987 while (isFocused && m_CaretBlinkRate > 0f)
10988 {
10989 float num = 1f / m_CaretBlinkRate;
10990 bool flag = (Time.unscaledTime - m_BlinkStartTime) % num < num / 2f;
10991 if (m_CaretVisible != flag)
10992 {
10993 m_CaretVisible = flag;
10994 if (!hasSelection)
10995 {
10997 }
10998 }
10999 yield return null;
11000 }
11001 m_BlinkCoroutine = null;
11002 }
11003
11004 private void SetCaretVisible()
11005 {
11006 if (m_AllowInput)
11007 {
11008 m_CaretVisible = true;
11009 m_BlinkStartTime = Time.unscaledTime;
11011 }
11012 }
11013
11014 private void SetCaretActive()
11015 {
11016 if (!m_AllowInput)
11017 {
11018 return;
11019 }
11020 if (m_CaretBlinkRate > 0f)
11021 {
11022 if (m_BlinkCoroutine == null)
11023 {
11024 m_BlinkCoroutine = ((MonoBehaviour)this).StartCoroutine(CaretBlink());
11025 }
11026 }
11027 else
11028 {
11029 m_CaretVisible = true;
11030 }
11031 }
11032
11033 private void UpdateCaretMaterial()
11034 {
11035 if ((Object)(object)m_TextComponent != (Object)null && (Object)(object)m_CachedInputRenderer != (Object)null)
11036 {
11037 m_CachedInputRenderer.SetMaterial(((MaskableGraphic)m_TextComponent).GetModifiedMaterial(Graphic.defaultGraphicMaterial), (Texture)(object)Texture2D.whiteTexture);
11038 }
11039 }
11040
11041 protected void OnFocus()
11042 {
11043 SelectAll();
11044 }
11045
11046 protected void SelectAll()
11047 {
11048 caretPositionInternal = text.Length;
11050 }
11051
11052 public void MoveTextEnd(bool shift)
11053 {
11054 int length = text.Length;
11055 if (shift)
11056 {
11058 }
11059 else
11060 {
11061 caretPositionInternal = length;
11063 }
11064 UpdateLabel();
11065 }
11066
11067 public void MoveTextStart(bool shift)
11068 {
11069 int num = 0;
11070 if (shift)
11071 {
11073 }
11074 else
11075 {
11078 }
11079 UpdateLabel();
11080 }
11081
11083 {
11084 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
11085 //IL_0007: Invalid comparison between Unknown and I4
11086 if ((int)Application.platform == 11)
11087 {
11088 if (s_IsQuestDevice)
11089 {
11090 return TouchScreenKeyboard.isSupported;
11091 }
11092 if (s_IsPicoDevice)
11093 {
11094 return false;
11095 }
11096 return !TouchScreenKeyboard.isInPlaceEditingAllowed;
11097 }
11098 return TouchScreenKeyboard.isSupported;
11099 }
11100
11101 private bool InPlaceEditing()
11102 {
11103 if (TouchScreenKeyboard.isSupported && !m_TouchKeyboardAllowsInPlaceEditing && !s_IsQuestDevice)
11104 {
11105 return s_IsPicoDevice;
11106 }
11107 return true;
11108 }
11109
11111 {
11113 {
11114 return m_TouchKeyboardAllowsInPlaceEditing != TouchScreenKeyboard.isInPlaceEditingAllowed;
11115 }
11116 return false;
11117 }
11118
11120 {
11121 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11122 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
11123 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
11124 RangeInt selection = m_Keyboard.selection;
11125 int start = selection.start;
11126 int end = ((RangeInt)(ref selection)).end;
11127 bool flag = false;
11128 if (caretPositionInternal != start)
11129 {
11130 flag = true;
11131 caretPositionInternal = start;
11132 }
11133 if (caretSelectPositionInternal != end)
11134 {
11136 flag = true;
11137 }
11138 if (flag)
11139 {
11140 m_BlinkStartTime = Time.unscaledTime;
11141 UpdateLabel();
11142 }
11143 }
11144
11145 protected virtual void LateUpdate()
11146 {
11147 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
11148 //IL_004f: Expected O, but got Unknown
11149 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
11150 //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
11151 //IL_00d1: Invalid comparison between Unknown and I4
11152 //IL_02dd: Unknown result type (might be due to invalid IL or missing references)
11153 //IL_02b0: Unknown result type (might be due to invalid IL or missing references)
11154 //IL_02ea: Unknown result type (might be due to invalid IL or missing references)
11155 //IL_02f0: Invalid comparison between Unknown and I4
11157 {
11158 if (!isFocused)
11159 {
11162 return;
11163 }
11165 }
11168 {
11169 if ((Object)(object)m_CachedInputRenderer != (Object)null)
11170 {
11171 VertexHelper val = new VertexHelper();
11172 try
11173 {
11174 val.FillMesh(mesh);
11175 }
11176 finally
11177 {
11178 if (val != null)
11179 {
11180 ((IDisposable)val).Dispose();
11181 }
11182 }
11183 m_CachedInputRenderer.SetMesh(mesh);
11184 }
11186 }
11187 if (!isFocused || InPlaceEditing())
11188 {
11189 return;
11190 }
11191 if (m_Keyboard == null || (int)m_Keyboard.status != 0)
11192 {
11193 if (m_Keyboard != null)
11194 {
11195 if (!m_ReadOnly)
11196 {
11197 this.text = m_Keyboard.text;
11198 }
11199 if ((int)m_Keyboard.status == 2)
11200 {
11201 m_WasCanceled = true;
11202 }
11203 }
11204 ((Selectable)this).OnDeselect((BaseEventData)null);
11205 return;
11206 }
11207 string text = m_Keyboard.text;
11208 if (m_Text != text)
11209 {
11210 if (m_ReadOnly)
11211 {
11212 m_Keyboard.text = m_Text;
11213 }
11214 else
11215 {
11216 m_Text = "";
11217 for (int i = 0; i < text.Length; i++)
11218 {
11219 char c = text[i];
11220 if (c == '\r' || c == '\u0003')
11221 {
11222 c = '\n';
11223 }
11224 if (onValidateInput != null)
11225 {
11226 c = onValidateInput(m_Text, m_Text.Length, c);
11227 }
11228 else if (characterValidation != 0)
11229 {
11230 c = Validate(m_Text, m_Text.Length, c);
11231 }
11232 if (lineType == LineType.MultiLineSubmit && c == '\n')
11233 {
11234 m_Keyboard.text = m_Text;
11235 ((Selectable)this).OnDeselect((BaseEventData)null);
11236 return;
11237 }
11238 if (c != 0)
11239 {
11240 m_Text = String.Concat(m_Text, ((Char)(ref c)).ToString());
11241 }
11242 }
11243 if (characterLimit > 0 && m_Text.Length > characterLimit)
11244 {
11245 m_Text = m_Text.Substring(0, characterLimit);
11246 }
11247 if (m_Keyboard.canGetSelection)
11248 {
11250 }
11251 else
11252 {
11253 int num = (caretSelectPositionInternal = m_Text.Length);
11255 }
11256 if (m_Text != text)
11257 {
11258 m_Keyboard.text = m_Text;
11259 }
11261 }
11262 }
11263 else if (m_HideMobileInput && m_Keyboard.canSetSelection)
11264 {
11266 int num3 = Mathf.Abs(caretSelectPositionInternal - caretPositionInternal);
11267 m_Keyboard.selection = new RangeInt(num2, num3);
11268 }
11269 else if (m_Keyboard.canGetSelection && !m_HideMobileInput)
11270 {
11272 }
11273 if ((int)m_Keyboard.status != 0)
11274 {
11275 if ((int)m_Keyboard.status == 2)
11276 {
11277 m_WasCanceled = true;
11278 }
11279 ((Selectable)this).OnDeselect((BaseEventData)null);
11280 }
11281 }
11282
11283 [Obsolete("This function is no longer used. Please use RectTransformUtility.ScreenPointToLocalPointInRectangle() instead.")]
11284 public Vector2 ScreenToLocal(Vector2 screen)
11285 {
11286 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
11287 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
11288 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
11289 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
11290 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
11291 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
11292 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
11293 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
11294 //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
11295 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
11296 //IL_00b5: Unknown result type (might be due to invalid IL or missing references)
11297 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
11298 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
11299 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
11300 //IL_005d: Unknown result type (might be due to invalid IL or missing references)
11301 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
11302 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
11303 //IL_0087: Unknown result type (might be due to invalid IL or missing references)
11304 //IL_009e: Unknown result type (might be due to invalid IL or missing references)
11305 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
11306 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
11307 Canvas canvas = ((Graphic)m_TextComponent).canvas;
11308 if ((Object)(object)canvas == (Object)null)
11309 {
11310 return screen;
11311 }
11312 Vector3 val = Vector3.zero;
11313 if ((int)canvas.renderMode == 0)
11314 {
11315 val = ((Component)m_TextComponent).transform.InverseTransformPoint(Vector2.op_Implicit(screen));
11316 }
11317 else if ((Object)(object)canvas.worldCamera != (Object)null)
11318 {
11319 Ray val2 = canvas.worldCamera.ScreenPointToRay(Vector2.op_Implicit(screen));
11320 Plane val3 = default(Plane);
11321 ((Plane)(ref val3))..ctor(((Component)m_TextComponent).transform.forward, ((Component)m_TextComponent).transform.position);
11322 float num = default(float);
11323 ((Plane)(ref val3)).Raycast(val2, ref num);
11324 val = ((Component)m_TextComponent).transform.InverseTransformPoint(((Ray)(ref val2)).GetPoint(num));
11325 }
11326 return new Vector2(val.x, val.y);
11327 }
11328
11329 private int GetUnclampedCharacterLineFromPosition(Vector2 pos, TextGenerator generator)
11330 {
11331 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
11332 //IL_002e: Unknown result type (might be due to invalid IL or missing references)
11333 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
11334 if (!multiLine)
11335 {
11336 return 0;
11337 }
11338 float num = pos.y * m_TextComponent.pixelsPerUnit;
11339 float num2 = 0f;
11340 for (int i = 0; i < generator.lineCount; i++)
11341 {
11342 float topY = generator.lines[i].topY;
11343 float num3 = topY - (float)generator.lines[i].height;
11344 if (num > topY)
11345 {
11346 float num4 = topY - num2;
11347 if (num > topY - 0.5f * num4)
11348 {
11349 return i - 1;
11350 }
11351 return i;
11352 }
11353 if (num > num3)
11354 {
11355 return i;
11356 }
11357 num2 = num3;
11358 }
11359 return generator.lineCount;
11360 }
11361
11362 protected int GetCharacterIndexFromPosition(Vector2 pos)
11363 {
11364 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
11365 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
11366 //IL_0061: Unknown result type (might be due to invalid IL or missing references)
11367 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
11368 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
11369 //IL_006a: Unknown result type (might be due to invalid IL or missing references)
11370 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
11371 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
11372 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
11373 //IL_0087: Unknown result type (might be due to invalid IL or missing references)
11374 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
11375 //IL_0096: Unknown result type (might be due to invalid IL or missing references)
11376 //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
11377 TextGenerator cachedTextGenerator = m_TextComponent.cachedTextGenerator;
11378 if (cachedTextGenerator.lineCount == 0)
11379 {
11380 return 0;
11381 }
11382 int unclampedCharacterLineFromPosition = GetUnclampedCharacterLineFromPosition(pos, cachedTextGenerator);
11383 if (unclampedCharacterLineFromPosition < 0)
11384 {
11385 return 0;
11386 }
11387 if (unclampedCharacterLineFromPosition >= cachedTextGenerator.lineCount)
11388 {
11389 return cachedTextGenerator.characterCountVisible;
11390 }
11391 int startCharIdx = cachedTextGenerator.lines[unclampedCharacterLineFromPosition].startCharIdx;
11392 int lineEndPosition = GetLineEndPosition(cachedTextGenerator, unclampedCharacterLineFromPosition);
11393 for (int i = startCharIdx; i < lineEndPosition && i < cachedTextGenerator.characterCountVisible; i++)
11394 {
11395 UICharInfo val = cachedTextGenerator.characters[i];
11396 Vector2 val2 = val.cursorPos / m_TextComponent.pixelsPerUnit;
11397 float num = pos.x - val2.x;
11398 float num2 = val2.x + val.charWidth / m_TextComponent.pixelsPerUnit - pos.x;
11399 if (num < num2)
11400 {
11401 return i;
11402 }
11403 }
11404 return lineEndPosition;
11405 }
11406
11407 private bool MayDrag(PointerEventData eventData)
11408 {
11409 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
11410 if (((UIBehaviour)this).IsActive() && ((Selectable)this).IsInteractable() && (int)eventData.button == 0 && (Object)(object)m_TextComponent != (Object)null)
11411 {
11412 if (!InPlaceEditing())
11413 {
11414 return m_HideMobileInput;
11415 }
11416 return true;
11417 }
11418 return false;
11419 }
11420
11421 public virtual void OnBeginDrag(PointerEventData eventData)
11422 {
11423 if (MayDrag(eventData))
11424 {
11425 m_UpdateDrag = true;
11426 }
11427 }
11428
11429 public virtual void OnDrag(PointerEventData eventData)
11430 {
11431 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
11432 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
11433 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
11434 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
11435 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
11436 if (!MayDrag(eventData))
11437 {
11438 return;
11439 }
11440 Vector2 position = Vector2.zero;
11441 if (MultipleDisplayUtilities.GetRelativeMousePositionForDrag(eventData, ref position))
11442 {
11443 Vector2 pos = default(Vector2);
11444 RectTransformUtility.ScreenPointToLocalPointInRectangle(((Graphic)textComponent).rectTransform, position, eventData.pressEventCamera, ref pos);
11447 m_DragPositionOutOfBounds = !RectTransformUtility.RectangleContainsScreenPoint(((Graphic)textComponent).rectTransform, eventData.position, eventData.pressEventCamera);
11449 {
11450 m_DragCoroutine = ((MonoBehaviour)this).StartCoroutine(MouseDragOutsideRect(eventData));
11451 }
11452 ((AbstractEventData)eventData).Use();
11453 }
11454 }
11455
11456 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
11457 private IEnumerator MouseDragOutsideRect(PointerEventData eventData)
11458 {
11459 Vector2 val = default(Vector2);
11461 {
11462 Vector2 position = Vector2.zero;
11463 if (!MultipleDisplayUtilities.GetRelativeMousePositionForDrag(eventData, ref position))
11464 {
11465 break;
11466 }
11467 RectTransformUtility.ScreenPointToLocalPointInRectangle(((Graphic)textComponent).rectTransform, position, eventData.pressEventCamera, ref val);
11468 Rect rect = ((Graphic)textComponent).rectTransform.rect;
11469 if (multiLine)
11470 {
11471 if (val.y > ((Rect)(ref rect)).yMax)
11472 {
11473 MoveUp(shift: true, goToFirstChar: true);
11474 }
11475 else if (val.y < ((Rect)(ref rect)).yMin)
11476 {
11477 MoveDown(shift: true, goToLastChar: true);
11478 }
11479 }
11480 else if (val.x < ((Rect)(ref rect)).xMin)
11481 {
11482 MoveLeft(shift: true, ctrl: false);
11483 }
11484 else if (val.x > ((Rect)(ref rect)).xMax)
11485 {
11486 MoveRight(shift: true, ctrl: false);
11487 }
11488 UpdateLabel();
11489 float num = (multiLine ? 0.1f : 0.05f);
11490 if (m_WaitForSecondsRealtime == null)
11491 {
11492 m_WaitForSecondsRealtime = new WaitForSecondsRealtime(num);
11493 }
11494 else
11495 {
11496 m_WaitForSecondsRealtime.waitTime = num;
11497 }
11498 yield return m_WaitForSecondsRealtime;
11499 }
11500 m_DragCoroutine = null;
11501 }
11502
11503 public virtual void OnEndDrag(PointerEventData eventData)
11504 {
11505 if (MayDrag(eventData))
11506 {
11507 m_UpdateDrag = false;
11508 }
11509 }
11510
11511 public override void OnPointerDown(PointerEventData eventData)
11512 {
11513 //IL_005d: Unknown result type (might be due to invalid IL or missing references)
11514 //IL_0062: Unknown result type (might be due to invalid IL or missing references)
11515 //IL_0078: Unknown result type (might be due to invalid IL or missing references)
11516 if (!MayDrag(eventData))
11517 {
11518 return;
11519 }
11520 EventSystem.current.SetSelectedGameObject(((Component)this).gameObject, (BaseEventData)(object)eventData);
11521 bool allowInput = m_AllowInput;
11522 ((Selectable)this).OnPointerDown(eventData);
11523 if (!InPlaceEditing() && (m_Keyboard == null || !m_Keyboard.active))
11524 {
11525 ((Selectable)this).OnSelect((BaseEventData)(object)eventData);
11526 return;
11527 }
11528 if (allowInput)
11529 {
11530 Vector2 pos = default(Vector2);
11531 RectTransformUtility.ScreenPointToLocalPointInRectangle(((Graphic)textComponent).rectTransform, eventData.pointerPressRaycast.screenPosition, eventData.pressEventCamera, ref pos);
11534 }
11535 UpdateLabel();
11536 ((AbstractEventData)eventData).Use();
11537 }
11538
11539 protected EditState KeyPressed(Event evt)
11540 {
11541 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11542 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11543 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
11544 //IL_000d: Invalid comparison between Unknown and I4
11545 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
11546 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
11547 //IL_001b: Invalid comparison between Unknown and I4
11548 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
11549 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
11550 //IL_0013: Invalid comparison between Unknown and I4
11551 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
11552 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
11553 //IL_0022: Invalid comparison between Unknown and I4
11554 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
11555 //IL_0027: Unknown result type (might be due to invalid IL or missing references)
11556 //IL_0029: Invalid comparison between Unknown and I4
11557 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
11558 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
11559 //IL_0043: Unknown result type (might be due to invalid IL or missing references)
11560 //IL_0047: Invalid comparison between Unknown and I4
11561 //IL_007c: Unknown result type (might be due to invalid IL or missing references)
11562 //IL_0080: Invalid comparison between Unknown and I4
11563 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
11564 //IL_004d: Invalid comparison between Unknown and I4
11565 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
11566 //IL_009d: Invalid comparison between Unknown and I4
11567 //IL_0082: Unknown result type (might be due to invalid IL or missing references)
11568 //IL_0086: Invalid comparison between Unknown and I4
11569 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
11570 //IL_0069: Invalid comparison between Unknown and I4
11571 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
11572 //IL_0052: Invalid comparison between Unknown and I4
11573 //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
11574 //IL_00a6: Invalid comparison between Unknown and I4
11575 //IL_008b: Unknown result type (might be due to invalid IL or missing references)
11576 //IL_008f: Invalid comparison between Unknown and I4
11577 //IL_006e: Unknown result type (might be due to invalid IL or missing references)
11578 //IL_0072: Invalid comparison between Unknown and I4
11579 //IL_0057: Unknown result type (might be due to invalid IL or missing references)
11580 //IL_005b: Invalid comparison between Unknown and I4
11581 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
11582 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
11583 //IL_00d9: Expected I4, but got Unknown
11584 EventModifiers modifiers = evt.modifiers;
11585 bool flag = (((int)SystemInfo.operatingSystemFamily == 1) ? ((modifiers & 8) > 0) : ((modifiers & 2) > 0));
11586 bool flag2 = (modifiers & 1) > 0;
11587 bool flag3 = (modifiers & 4) > 0;
11588 bool flag4 = flag && !flag3 && !flag2;
11589 KeyCode keyCode = evt.keyCode;
11590 if ((int)keyCode <= 97)
11591 {
11592 if ((int)keyCode <= 13)
11593 {
11594 if ((int)keyCode == 8)
11595 {
11596 Backspace();
11597 return EditState.Continue;
11598 }
11599 if ((int)keyCode == 13)
11600 {
11601 goto IL_01b1;
11602 }
11603 }
11604 else
11605 {
11606 if ((int)keyCode == 27)
11607 {
11608 m_WasCanceled = true;
11609 return EditState.Finish;
11610 }
11611 if ((int)keyCode == 97 && flag4)
11612 {
11613 SelectAll();
11614 return EditState.Continue;
11615 }
11616 }
11617 }
11618 else if ((int)keyCode <= 118)
11619 {
11620 if ((int)keyCode != 99)
11621 {
11622 if ((int)keyCode == 118 && flag4)
11623 {
11625 UpdateLabel();
11626 return EditState.Continue;
11627 }
11628 }
11629 else if (flag4)
11630 {
11631 if (inputType != InputType.Password)
11632 {
11634 }
11635 else
11636 {
11637 clipboard = "";
11638 }
11639 return EditState.Continue;
11640 }
11641 }
11642 else
11643 {
11644 if ((int)keyCode != 120)
11645 {
11646 if ((int)keyCode != 127)
11647 {
11648 switch (keyCode - 271)
11649 {
11650 case 7:
11651 MoveTextStart(flag2);
11652 return EditState.Continue;
11653 case 8:
11654 MoveTextEnd(flag2);
11655 return EditState.Continue;
11656 case 5:
11657 MoveLeft(flag2, flag);
11658 return EditState.Continue;
11659 case 4:
11660 MoveRight(flag2, flag);
11661 return EditState.Continue;
11662 case 2:
11663 MoveUp(flag2);
11664 return EditState.Continue;
11665 case 3:
11666 MoveDown(flag2);
11667 return EditState.Continue;
11668 case 0:
11669 break;
11670 default:
11671 goto IL_01c5;
11672 }
11673 goto IL_01b1;
11674 }
11675 ForwardSpace();
11676 return EditState.Continue;
11677 }
11678 if (flag4)
11679 {
11680 if (inputType != InputType.Password)
11681 {
11683 }
11684 else
11685 {
11686 clipboard = "";
11687 }
11688 Delete();
11691 return EditState.Continue;
11692 }
11693 }
11694 goto IL_01c5;
11695 IL_01b1:
11696 if (lineType != LineType.MultiLineNewline)
11697 {
11698 return EditState.Finish;
11699 }
11700 goto IL_01c5;
11701 IL_01c5:
11702 char c = evt.character;
11703 if (!multiLine && (c == '\t' || c == '\r' || c == '\n'))
11704 {
11705 return EditState.Continue;
11706 }
11707 if (c == '\r' || c == '\u0003')
11708 {
11709 c = '\n';
11710 }
11711 if (IsValidChar(c))
11712 {
11713 Append(c);
11714 }
11715 if (c == '\0' && compositionString.Length > 0)
11716 {
11717 UpdateLabel();
11718 }
11719 return EditState.Continue;
11720 }
11721
11722 private bool IsValidChar(char c)
11723 {
11724 switch (c)
11725 {
11726 case '\u007f':
11727 return false;
11728 case '\t':
11729 case '\n':
11730 return true;
11731 default:
11732 return m_TextComponent.font.HasCharacter(c);
11733 }
11734 }
11735
11736 public void ProcessEvent(Event e)
11737 {
11738 KeyPressed(e);
11739 }
11740
11741 public virtual void OnUpdateSelected(BaseEventData eventData)
11742 {
11743 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
11744 //IL_0019: Invalid comparison between Unknown and I4
11745 //IL_003a: Unknown result type (might be due to invalid IL or missing references)
11746 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
11747 //IL_0040: Unknown result type (might be due to invalid IL or missing references)
11748 //IL_0043: Unknown result type (might be due to invalid IL or missing references)
11749 //IL_0045: Invalid comparison between Unknown and I4
11750 if (!isFocused)
11751 {
11752 return;
11753 }
11754 bool flag = false;
11755 while (Event.PopEvent(m_ProcessingEvent))
11756 {
11757 if ((int)m_ProcessingEvent.rawType == 4)
11758 {
11759 flag = true;
11760 if (KeyPressed(m_ProcessingEvent) == EditState.Finish)
11761 {
11763 break;
11764 }
11765 }
11766 EventType type = m_ProcessingEvent.type;
11767 if (type - 13 <= 1 && m_ProcessingEvent.commandName == "SelectAll")
11768 {
11769 SelectAll();
11770 flag = true;
11771 }
11772 }
11773 if (flag)
11774 {
11775 UpdateLabel();
11776 }
11777 ((AbstractEventData)eventData).Use();
11778 }
11779
11780 private string GetSelectedString()
11781 {
11782 if (!hasSelection)
11783 {
11784 return "";
11785 }
11786 int num = caretPositionInternal;
11787 int num2 = caretSelectPositionInternal;
11788 if (num > num2)
11789 {
11790 int num3 = num;
11791 num = num2;
11792 num2 = num3;
11793 }
11794 return text.Substring(num, num2 - num);
11795 }
11796
11798 {
11799 if (caretSelectPositionInternal + 1 >= text.Length)
11800 {
11801 return text.Length;
11802 }
11803 int num = text.IndexOfAny(kSeparators, caretSelectPositionInternal + 1);
11804 if (num == -1)
11805 {
11806 return text.Length;
11807 }
11808 return num + 1;
11809 }
11810
11811 private void MoveRight(bool shift, bool ctrl)
11812 {
11813 int num2;
11814 if (hasSelection && !shift)
11815 {
11817 caretPositionInternal = num2;
11818 return;
11819 }
11820 int num3 = ((!ctrl) ? (caretSelectPositionInternal + 1) : FindtNextWordBegin());
11821 if (shift)
11822 {
11824 return;
11825 }
11826 num2 = (caretPositionInternal = num3);
11828 }
11829
11831 {
11832 if (caretSelectPositionInternal - 2 < 0)
11833 {
11834 return 0;
11835 }
11836 int num = text.LastIndexOfAny(kSeparators, caretSelectPositionInternal - 2);
11837 if (num == -1)
11838 {
11839 return 0;
11840 }
11841 return num + 1;
11842 }
11843
11844 private void MoveLeft(bool shift, bool ctrl)
11845 {
11846 int num2;
11847 if (hasSelection && !shift)
11848 {
11850 caretPositionInternal = num2;
11851 return;
11852 }
11853 int num3 = ((!ctrl) ? (caretSelectPositionInternal - 1) : FindtPrevWordBegin());
11854 if (shift)
11855 {
11857 return;
11858 }
11859 num2 = (caretPositionInternal = num3);
11861 }
11862
11863 private int DetermineCharacterLine(int charPos, TextGenerator generator)
11864 {
11865 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
11866 for (int i = 0; i < generator.lineCount - 1; i++)
11867 {
11868 if (generator.lines[i + 1].startCharIdx > charPos)
11869 {
11870 return i;
11871 }
11872 }
11873 return generator.lineCount - 1;
11874 }
11875
11876 private int LineUpCharacterPosition(int originalPos, bool goToFirstChar)
11877 {
11878 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
11879 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
11880 //IL_004c: Unknown result type (might be due to invalid IL or missing references)
11881 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
11882 //IL_0080: Unknown result type (might be due to invalid IL or missing references)
11883 //IL_0085: Unknown result type (might be due to invalid IL or missing references)
11884 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
11885 //IL_0090: Unknown result type (might be due to invalid IL or missing references)
11886 if (originalPos >= ((ICollection<UICharInfo>)(object)cachedInputTextGenerator.characters).Count)
11887 {
11888 return 0;
11889 }
11890 UICharInfo val = cachedInputTextGenerator.characters[originalPos];
11891 int num = DetermineCharacterLine(originalPos, cachedInputTextGenerator);
11892 if (num <= 0)
11893 {
11894 if (!goToFirstChar)
11895 {
11896 return originalPos;
11897 }
11898 return 0;
11899 }
11900 int num2 = cachedInputTextGenerator.lines[num].startCharIdx - 1;
11901 for (int i = cachedInputTextGenerator.lines[num - 1].startCharIdx; i < num2; i++)
11902 {
11903 if (cachedInputTextGenerator.characters[i].cursorPos.x >= val.cursorPos.x)
11904 {
11905 return i;
11906 }
11907 }
11908 return num2;
11909 }
11910
11911 private int LineDownCharacterPosition(int originalPos, bool goToLastChar)
11912 {
11913 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
11914 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
11915 //IL_0078: Unknown result type (might be due to invalid IL or missing references)
11916 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
11917 //IL_0096: Unknown result type (might be due to invalid IL or missing references)
11918 //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
11919 //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
11920 if (originalPos >= cachedInputTextGenerator.characterCountVisible)
11921 {
11922 return text.Length;
11923 }
11924 UICharInfo val = cachedInputTextGenerator.characters[originalPos];
11925 int num = DetermineCharacterLine(originalPos, cachedInputTextGenerator);
11926 if (num + 1 >= cachedInputTextGenerator.lineCount)
11927 {
11928 if (!goToLastChar)
11929 {
11930 return originalPos;
11931 }
11932 return text.Length;
11933 }
11934 int lineEndPosition = GetLineEndPosition(cachedInputTextGenerator, num + 1);
11935 for (int i = cachedInputTextGenerator.lines[num + 1].startCharIdx; i < lineEndPosition; i++)
11936 {
11937 if (cachedInputTextGenerator.characters[i].cursorPos.x >= val.cursorPos.x)
11938 {
11939 return i;
11940 }
11941 }
11942 return lineEndPosition;
11943 }
11944
11945 private void MoveDown(bool shift)
11946 {
11947 MoveDown(shift, goToLastChar: true);
11948 }
11949
11950 private void MoveDown(bool shift, bool goToLastChar)
11951 {
11952 int num2;
11953 if (hasSelection && !shift)
11954 {
11956 caretPositionInternal = num2;
11957 }
11958 int num3 = (multiLine ? LineDownCharacterPosition(caretSelectPositionInternal, goToLastChar) : text.Length);
11959 if (shift)
11960 {
11962 return;
11963 }
11964 num2 = (caretSelectPositionInternal = num3);
11965 caretPositionInternal = num2;
11966 }
11967
11968 private void MoveUp(bool shift)
11969 {
11970 MoveUp(shift, goToFirstChar: true);
11971 }
11972
11973 private void MoveUp(bool shift, bool goToFirstChar)
11974 {
11975 int num2;
11976 if (hasSelection && !shift)
11977 {
11979 caretPositionInternal = num2;
11980 }
11981 int num3 = (multiLine ? LineUpCharacterPosition(caretSelectPositionInternal, goToFirstChar) : 0);
11982 if (shift)
11983 {
11985 return;
11986 }
11987 num2 = (caretPositionInternal = num3);
11989 }
11990
11991 private void Delete()
11992 {
11994 {
11996 {
11997 m_Text = String.Concat(text.Substring(0, caretPositionInternal), text.Substring(caretSelectPositionInternal, text.Length - caretSelectPositionInternal));
11999 }
12000 else
12001 {
12002 m_Text = String.Concat(text.Substring(0, caretSelectPositionInternal), text.Substring(caretPositionInternal, text.Length - caretPositionInternal));
12004 }
12005 }
12006 }
12007
12008 private void ForwardSpace()
12009 {
12010 if (!m_ReadOnly)
12011 {
12012 if (hasSelection)
12013 {
12014 Delete();
12017 }
12018 else if (caretPositionInternal < text.Length)
12019 {
12020 m_Text = text.Remove(caretPositionInternal, 1);
12023 }
12024 }
12025 }
12026
12027 private void Backspace()
12028 {
12029 if (!m_ReadOnly)
12030 {
12031 if (hasSelection)
12032 {
12033 Delete();
12036 }
12037 else if (caretPositionInternal > 0)
12038 {
12039 m_Text = text.Remove(caretPositionInternal - 1, 1);
12043 }
12044 }
12045 }
12046
12047 private void Insert(char c)
12048 {
12049 if (!m_ReadOnly)
12050 {
12051 string text = ((Char)(ref c)).ToString();
12052 Delete();
12053 if (characterLimit <= 0 || this.text.Length < characterLimit)
12054 {
12055 m_Text = this.text.Insert(m_CaretPosition, text);
12059 }
12060 }
12061 }
12062
12064 {
12065 if (m_Keyboard != null && InPlaceEditing())
12066 {
12067 m_Keyboard.text = m_Text;
12068 }
12069 }
12070
12072 {
12074 UpdateLabel();
12075 }
12076
12077 private void SendOnValueChanged()
12078 {
12079 UISystemProfilerApi.AddMarker("InputField.value", (Object)(object)this);
12080 if (onValueChanged != null)
12081 {
12082 ((UnityEvent<string>)onValueChanged).Invoke(text);
12083 }
12084 }
12085
12086 protected void SendOnSubmit()
12087 {
12088 UISystemProfilerApi.AddMarker("InputField.onSubmit", (Object)(object)this);
12089 if (onEndEdit != null)
12090 {
12091 ((UnityEvent<string>)onEndEdit).Invoke(m_Text);
12092 }
12093 }
12094
12095 private void Append(string input, bool secure = true)
12096 {
12097 if (m_ReadOnly || !InPlaceEditing())
12098 {
12099 return;
12100 }
12101 int i = 0;
12102 for (int length = input.Length; i < length; i++)
12103 {
12104 char c = input[i];
12105 if (c >= ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\n')
12106 {
12107 Append(c);
12108 }
12109 }
12110 }
12111
12112 protected virtual void Append(char input)
12113 {
12114 if (!Char.IsSurrogate(input) && !m_ReadOnly && text.Length < 16382 && InPlaceEditing())
12115 {
12117 if (onValidateInput != null)
12118 {
12120 }
12121 else if (characterValidation != 0)
12122 {
12123 input = Validate(text, num, input);
12124 }
12125 if (input != 0)
12126 {
12127 Insert(input);
12128 }
12129 }
12130 }
12131
12132 protected void UpdateLabel()
12133 {
12134 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
12135 //IL_00be: Expected O, but got Unknown
12136 //IL_0111: Unknown result type (might be due to invalid IL or missing references)
12137 //IL_0116: Unknown result type (might be due to invalid IL or missing references)
12138 //IL_011a: Unknown result type (might be due to invalid IL or missing references)
12139 //IL_011f: Unknown result type (might be due to invalid IL or missing references)
12140 //IL_0126: Unknown result type (might be due to invalid IL or missing references)
12141 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
12142 //IL_012c: Unknown result type (might be due to invalid IL or missing references)
12143 //IL_013d: Unknown result type (might be due to invalid IL or missing references)
12144 if ((Object)(object)m_TextComponent != (Object)null && (Object)(object)m_TextComponent.font != (Object)null && !m_PreventFontCallback)
12145 {
12146 m_PreventFontCallback = true;
12147 string text = ((!((Object)(object)EventSystem.current != (Object)null) || !((Object)(object)((Component)this).gameObject == (Object)(object)EventSystem.current.currentSelectedGameObject) || compositionString.Length <= 0) ? this.text : String.Concat(this.text.Substring(0, m_CaretPosition), compositionString, this.text.Substring(m_CaretPosition)));
12148 string text2 = ((inputType != InputType.Password) ? text : ((string)new String(asteriskChar, text.Length)));
12149 bool flag = String.IsNullOrEmpty(text);
12150 if ((Object)(object)m_Placeholder != (Object)null)
12151 {
12152 ((Behaviour)m_Placeholder).enabled = flag;
12153 }
12154 if (!m_AllowInput)
12155 {
12156 m_DrawStart = 0;
12157 m_DrawEnd = m_Text.Length;
12158 }
12159 if (!flag)
12160 {
12161 Rect rect = ((Graphic)m_TextComponent).rectTransform.rect;
12162 Vector2 size = ((Rect)(ref rect)).size;
12163 TextGenerationSettings generationSettings = m_TextComponent.GetGenerationSettings(size);
12164 generationSettings.generateOutOfBounds = true;
12165 cachedInputTextGenerator.PopulateWithErrors(text2, generationSettings, ((Component)this).gameObject);
12167 text2 = text2.Substring(m_DrawStart, Mathf.Min(m_DrawEnd, text2.Length) - m_DrawStart);
12169 }
12170 m_TextComponent.text = text2;
12172 m_PreventFontCallback = false;
12173 }
12174 }
12175
12176 private bool IsSelectionVisible()
12177 {
12179 {
12180 return false;
12181 }
12183 {
12184 return false;
12185 }
12186 return true;
12187 }
12188
12189 private static int GetLineStartPosition(TextGenerator gen, int line)
12190 {
12191 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
12192 line = Mathf.Clamp(line, 0, ((ICollection<UILineInfo>)(object)gen.lines).Count - 1);
12193 return gen.lines[line].startCharIdx;
12194 }
12195
12196 private static int GetLineEndPosition(TextGenerator gen, int line)
12197 {
12198 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
12199 line = Mathf.Max(line, 0);
12200 if (line + 1 < ((ICollection<UILineInfo>)(object)gen.lines).Count)
12201 {
12202 return gen.lines[line + 1].startCharIdx - 1;
12203 }
12204 return gen.characterCountVisible;
12205 }
12206
12207 private void SetDrawRangeToContainCaretPosition(int caretPos)
12208 {
12209 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
12210 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
12211 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
12212 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
12213 //IL_0068: Unknown result type (might be due to invalid IL or missing references)
12214 //IL_0074: Unknown result type (might be due to invalid IL or missing references)
12215 //IL_0112: Unknown result type (might be due to invalid IL or missing references)
12216 //IL_0121: Unknown result type (might be due to invalid IL or missing references)
12217 //IL_012e: Unknown result type (might be due to invalid IL or missing references)
12218 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
12219 //IL_014d: Unknown result type (might be due to invalid IL or missing references)
12220 //IL_0285: Unknown result type (might be due to invalid IL or missing references)
12221 //IL_0290: Unknown result type (might be due to invalid IL or missing references)
12222 //IL_0161: Unknown result type (might be due to invalid IL or missing references)
12223 //IL_0170: Unknown result type (might be due to invalid IL or missing references)
12224 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
12225 //IL_00b5: Unknown result type (might be due to invalid IL or missing references)
12226 //IL_02a2: Unknown result type (might be due to invalid IL or missing references)
12227 //IL_01a5: Unknown result type (might be due to invalid IL or missing references)
12228 //IL_0193: Unknown result type (might be due to invalid IL or missing references)
12229 //IL_02fe: Unknown result type (might be due to invalid IL or missing references)
12230 //IL_030d: Unknown result type (might be due to invalid IL or missing references)
12231 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)
12232 //IL_01ea: Unknown result type (might be due to invalid IL or missing references)
12233 if (cachedInputTextGenerator.lineCount <= 0)
12234 {
12235 return;
12236 }
12237 Rect rectExtents = cachedInputTextGenerator.rectExtents;
12238 Vector2 size = ((Rect)(ref rectExtents)).size;
12239 if (multiLine)
12240 {
12241 IList<UILineInfo> lines = cachedInputTextGenerator.lines;
12243 if (caretPos > m_DrawEnd)
12244 {
12246 float num2 = lines[num].topY - (float)lines[num].height;
12247 if (num == ((ICollection<UILineInfo>)(object)lines).Count - 1)
12248 {
12249 num2 += lines[num].leading;
12250 }
12251 int num3 = num;
12252 while (num3 > 0 && !(lines[num3 - 1].topY - num2 > size.y))
12253 {
12254 num3--;
12255 }
12257 return;
12258 }
12259 if (caretPos < m_DrawStart)
12260 {
12262 }
12264 int i = num4;
12265 float topY = lines[num4].topY;
12266 float num5 = lines[i].topY - (float)lines[i].height;
12267 if (i == ((ICollection<UILineInfo>)(object)lines).Count - 1)
12268 {
12269 num5 += lines[i].leading;
12270 }
12271 for (; i < ((ICollection<UILineInfo>)(object)lines).Count - 1; i++)
12272 {
12273 num5 = lines[i + 1].topY - (float)lines[i + 1].height;
12274 if (i + 1 == ((ICollection<UILineInfo>)(object)lines).Count - 1)
12275 {
12276 num5 += lines[i + 1].leading;
12277 }
12278 if (topY - num5 > size.y)
12279 {
12280 break;
12281 }
12282 }
12284 while (num4 > 0)
12285 {
12286 topY = lines[num4 - 1].topY;
12287 if (topY - num5 > size.y)
12288 {
12289 break;
12290 }
12291 num4--;
12292 }
12294 return;
12295 }
12296 IList<UICharInfo> characters = cachedInputTextGenerator.characters;
12297 if (m_DrawEnd > cachedInputTextGenerator.characterCountVisible)
12298 {
12299 m_DrawEnd = cachedInputTextGenerator.characterCountVisible;
12300 }
12301 float num6 = 0f;
12302 if (caretPos > m_DrawEnd || (caretPos == m_DrawEnd && m_DrawStart > 0))
12303 {
12304 m_DrawEnd = caretPos;
12305 m_DrawStart = m_DrawEnd - 1;
12306 while (m_DrawStart >= 0 && !(num6 + characters[m_DrawStart].charWidth > size.x))
12307 {
12308 num6 += characters[m_DrawStart].charWidth;
12309 m_DrawStart--;
12310 }
12311 m_DrawStart++;
12312 }
12313 else
12314 {
12315 if (caretPos < m_DrawStart)
12316 {
12317 m_DrawStart = caretPos;
12318 }
12320 }
12321 while (m_DrawEnd < cachedInputTextGenerator.characterCountVisible)
12322 {
12323 num6 += characters[m_DrawEnd].charWidth;
12324 if (!(num6 > size.x))
12325 {
12326 m_DrawEnd++;
12327 continue;
12328 }
12329 break;
12330 }
12331 }
12332
12333 public void ForceLabelUpdate()
12334 {
12335 UpdateLabel();
12336 }
12337
12338 private void MarkGeometryAsDirty()
12339 {
12340 CanvasUpdateRegistry.RegisterCanvasElementForGraphicRebuild((ICanvasElement)(object)this);
12341 }
12342
12343 public virtual void Rebuild(CanvasUpdate update)
12344 {
12345 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
12346 //IL_0002: Invalid comparison between Unknown and I4
12347 if ((int)update == 4)
12348 {
12350 }
12351 }
12352
12353 public virtual void LayoutComplete()
12354 {
12355 }
12356
12357 public virtual void GraphicUpdateComplete()
12358 {
12359 }
12360
12361 private void UpdateGeometry()
12362 {
12363 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
12364 //IL_0066: Expected O, but got Unknown
12366 {
12367 if ((Object)(object)m_CachedInputRenderer == (Object)null && (Object)(object)m_TextComponent != (Object)null)
12368 {
12369 GameObject val = new GameObject(String.Concat(((Object)((Component)this).transform).name, " Input Caret"), (Type[])(object)new Type[2]
12370 {
12371 typeof(RectTransform),
12372 typeof(CanvasRenderer)
12373 });
12374 ((Object)val).hideFlags = (HideFlags)52;
12375 val.transform.SetParent(((Component)m_TextComponent).transform.parent);
12376 val.transform.SetAsFirstSibling();
12377 val.layer = ((Component)this).gameObject.layer;
12378 caretRectTrans = val.GetComponent<RectTransform>();
12379 m_CachedInputRenderer = val.GetComponent<CanvasRenderer>();
12380 m_CachedInputRenderer.SetMaterial(((MaskableGraphic)m_TextComponent).GetModifiedMaterial(Graphic.defaultGraphicMaterial), (Texture)(object)Texture2D.whiteTexture);
12381 val.AddComponent<LayoutElement>().ignoreLayout = true;
12383 }
12384 if (!((Object)(object)m_CachedInputRenderer == (Object)null))
12385 {
12386 OnFillVBO(mesh);
12387 m_CachedInputRenderer.SetMesh(mesh);
12388 }
12389 }
12390 }
12391
12393 {
12394 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
12395 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
12396 //IL_0152: Unknown result type (might be due to invalid IL or missing references)
12397 //IL_016d: Unknown result type (might be due to invalid IL or missing references)
12398 //IL_0188: Unknown result type (might be due to invalid IL or missing references)
12399 //IL_01a3: Unknown result type (might be due to invalid IL or missing references)
12400 //IL_01be: Unknown result type (might be due to invalid IL or missing references)
12401 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)
12402 //IL_01f4: Unknown result type (might be due to invalid IL or missing references)
12403 //IL_020f: Unknown result type (might be due to invalid IL or missing references)
12404 //IL_004d: Unknown result type (might be due to invalid IL or missing references)
12405 //IL_005d: Unknown result type (might be due to invalid IL or missing references)
12406 //IL_0072: Unknown result type (might be due to invalid IL or missing references)
12407 //IL_0082: Unknown result type (might be due to invalid IL or missing references)
12408 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
12409 //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
12410 //IL_00bc: Unknown result type (might be due to invalid IL or missing references)
12411 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
12412 //IL_00de: Unknown result type (might be due to invalid IL or missing references)
12413 //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
12414 //IL_0100: Unknown result type (might be due to invalid IL or missing references)
12415 //IL_0110: Unknown result type (might be due to invalid IL or missing references)
12416 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
12417 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
12418 if ((Object)(object)m_TextComponent != (Object)null && (Object)(object)caretRectTrans != (Object)null && (((Transform)caretRectTrans).localPosition != ((Transform)((Graphic)m_TextComponent).rectTransform).localPosition || ((Transform)caretRectTrans).localRotation != ((Transform)((Graphic)m_TextComponent).rectTransform).localRotation || ((Transform)caretRectTrans).localScale != ((Transform)((Graphic)m_TextComponent).rectTransform).localScale || caretRectTrans.anchorMin != ((Graphic)m_TextComponent).rectTransform.anchorMin || caretRectTrans.anchorMax != ((Graphic)m_TextComponent).rectTransform.anchorMax || caretRectTrans.anchoredPosition != ((Graphic)m_TextComponent).rectTransform.anchoredPosition || caretRectTrans.sizeDelta != ((Graphic)m_TextComponent).rectTransform.sizeDelta || caretRectTrans.pivot != ((Graphic)m_TextComponent).rectTransform.pivot))
12419 {
12420 ((Transform)caretRectTrans).localPosition = ((Transform)((Graphic)m_TextComponent).rectTransform).localPosition;
12421 ((Transform)caretRectTrans).localRotation = ((Transform)((Graphic)m_TextComponent).rectTransform).localRotation;
12422 ((Transform)caretRectTrans).localScale = ((Transform)((Graphic)m_TextComponent).rectTransform).localScale;
12423 caretRectTrans.anchorMin = ((Graphic)m_TextComponent).rectTransform.anchorMin;
12424 caretRectTrans.anchorMax = ((Graphic)m_TextComponent).rectTransform.anchorMax;
12425 caretRectTrans.anchoredPosition = ((Graphic)m_TextComponent).rectTransform.anchoredPosition;
12426 caretRectTrans.sizeDelta = ((Graphic)m_TextComponent).rectTransform.sizeDelta;
12427 caretRectTrans.pivot = ((Graphic)m_TextComponent).rectTransform.pivot;
12428 }
12429 }
12430
12431 private void OnFillVBO(Mesh vbo)
12432 {
12433 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
12434 //IL_0006: Expected O, but got Unknown
12435 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
12436 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
12437 //IL_0027: Unknown result type (might be due to invalid IL or missing references)
12438 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
12439 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
12440 VertexHelper val = new VertexHelper();
12441 try
12442 {
12443 if (!isFocused)
12444 {
12445 val.FillMesh(vbo);
12446 return;
12447 }
12448 Vector2 roundingOffset = ((Graphic)m_TextComponent).PixelAdjustPoint(Vector2.zero);
12449 if (!hasSelection)
12450 {
12451 GenerateCaret(val, roundingOffset);
12452 }
12453 else
12454 {
12455 GenerateHighlight(val, roundingOffset);
12456 }
12457 val.FillMesh(vbo);
12458 }
12459 finally
12460 {
12461 if (val != null)
12462 {
12463 ((IDisposable)val).Dispose();
12464 }
12465 }
12466 }
12467
12468 private void GenerateCaret(VertexHelper vbo, Vector2 roundingOffset)
12469 {
12470 //IL_004c: Unknown result type (might be due to invalid IL or missing references)
12471 //IL_0051: Unknown result type (might be due to invalid IL or missing references)
12472 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
12473 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
12474 //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
12475 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
12476 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
12477 //IL_0070: Unknown result type (might be due to invalid IL or missing references)
12478 //IL_0072: Unknown result type (might be due to invalid IL or missing references)
12479 //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
12480 //IL_010f: Unknown result type (might be due to invalid IL or missing references)
12481 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
12482 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
12483 //IL_013b: Unknown result type (might be due to invalid IL or missing references)
12484 //IL_0140: Unknown result type (might be due to invalid IL or missing references)
12485 //IL_0145: Unknown result type (might be due to invalid IL or missing references)
12486 //IL_0168: Unknown result type (might be due to invalid IL or missing references)
12487 //IL_016e: Unknown result type (might be due to invalid IL or missing references)
12488 //IL_017c: Unknown result type (might be due to invalid IL or missing references)
12489 //IL_0181: Unknown result type (might be due to invalid IL or missing references)
12490 //IL_0192: Unknown result type (might be due to invalid IL or missing references)
12491 //IL_019a: Unknown result type (might be due to invalid IL or missing references)
12492 //IL_01a8: Unknown result type (might be due to invalid IL or missing references)
12493 //IL_01ad: Unknown result type (might be due to invalid IL or missing references)
12494 //IL_01be: Unknown result type (might be due to invalid IL or missing references)
12495 //IL_01c6: Unknown result type (might be due to invalid IL or missing references)
12496 //IL_01d1: Unknown result type (might be due to invalid IL or missing references)
12497 //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
12498 //IL_01e7: Unknown result type (might be due to invalid IL or missing references)
12499 //IL_01ed: Unknown result type (might be due to invalid IL or missing references)
12500 //IL_01f8: Unknown result type (might be due to invalid IL or missing references)
12501 //IL_01fd: Unknown result type (might be due to invalid IL or missing references)
12502 //IL_0202: Unknown result type (might be due to invalid IL or missing references)
12503 //IL_0203: Unknown result type (might be due to invalid IL or missing references)
12504 //IL_02b0: Unknown result type (might be due to invalid IL or missing references)
12505 //IL_021c: Unknown result type (might be due to invalid IL or missing references)
12506 //IL_0221: Unknown result type (might be due to invalid IL or missing references)
12507 //IL_0231: Unknown result type (might be due to invalid IL or missing references)
12508 //IL_0247: Unknown result type (might be due to invalid IL or missing references)
12509 //IL_02ea: Unknown result type (might be due to invalid IL or missing references)
12510 //IL_02ef: Unknown result type (might be due to invalid IL or missing references)
12511 //IL_02f4: Unknown result type (might be due to invalid IL or missing references)
12512 //IL_02f8: Unknown result type (might be due to invalid IL or missing references)
12513 //IL_02fa: Unknown result type (might be due to invalid IL or missing references)
12514 //IL_02ff: Unknown result type (might be due to invalid IL or missing references)
12515 //IL_0306: Unknown result type (might be due to invalid IL or missing references)
12516 //IL_0327: Unknown result type (might be due to invalid IL or missing references)
12517 if (!m_CaretVisible)
12518 {
12519 return;
12520 }
12521 if (m_CursorVerts == null)
12522 {
12524 }
12525 float num = m_CaretWidth;
12526 int num2 = Mathf.Max(0, caretPositionInternal - m_DrawStart);
12527 TextGenerator cachedTextGenerator = m_TextComponent.cachedTextGenerator;
12528 if (cachedTextGenerator == null || cachedTextGenerator.lineCount == 0)
12529 {
12530 return;
12531 }
12532 Vector2 zero = Vector2.zero;
12533 if (num2 < ((ICollection<UICharInfo>)(object)cachedTextGenerator.characters).Count)
12534 {
12535 UICharInfo val = cachedTextGenerator.characters[num2];
12536 zero.x = val.cursorPos.x;
12537 }
12538 zero.x /= m_TextComponent.pixelsPerUnit;
12539 float x = zero.x;
12540 Rect rect = ((Graphic)m_TextComponent).rectTransform.rect;
12541 if (x > ((Rect)(ref rect)).xMax)
12542 {
12543 rect = ((Graphic)m_TextComponent).rectTransform.rect;
12544 zero.x = ((Rect)(ref rect)).xMax;
12545 }
12546 int num3 = DetermineCharacterLine(num2, cachedTextGenerator);
12547 zero.y = cachedTextGenerator.lines[num3].topY / m_TextComponent.pixelsPerUnit;
12548 float num4 = (float)cachedTextGenerator.lines[num3].height / m_TextComponent.pixelsPerUnit;
12549 for (int i = 0; i < m_CursorVerts.Length; i++)
12550 {
12551 m_CursorVerts[i].color = Color32.op_Implicit(caretColor);
12552 }
12553 m_CursorVerts[0].position = new Vector3(zero.x, zero.y - num4, 0f);
12554 m_CursorVerts[1].position = new Vector3(zero.x + num, zero.y - num4, 0f);
12555 m_CursorVerts[2].position = new Vector3(zero.x + num, zero.y, 0f);
12556 m_CursorVerts[3].position = new Vector3(zero.x, zero.y, 0f);
12557 if (roundingOffset != Vector2.zero)
12558 {
12559 for (int j = 0; j < m_CursorVerts.Length; j++)
12560 {
12561 UIVertex val2 = m_CursorVerts[j];
12562 val2.position.x += roundingOffset.x;
12563 val2.position.y += roundingOffset.y;
12564 }
12565 }
12566 vbo.AddUIVertexQuad(m_CursorVerts);
12567 int num5 = Screen.height;
12568 int targetDisplay = ((Graphic)m_TextComponent).canvas.targetDisplay;
12569 if (targetDisplay > 0 && targetDisplay < Display.displays.Length)
12570 {
12571 num5 = Display.displays[targetDisplay].renderingHeight;
12572 }
12573 Camera val3 = (((int)((Graphic)m_TextComponent).canvas.renderMode != 0) ? ((Graphic)m_TextComponent).canvas.worldCamera : null);
12574 Vector3 val4 = ((Component)m_CachedInputRenderer).gameObject.transform.TransformPoint(m_CursorVerts[0].position);
12575 Vector2 val5 = RectTransformUtility.WorldToScreenPoint(val3, val4);
12576 val5.y = (float)num5 - val5.y;
12577 if ((Object)(object)input != (Object)null)
12578 {
12579 input.compositionCursorPos = val5;
12580 }
12581 }
12582
12583 private void CreateCursorVerts()
12584 {
12585 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
12586 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
12587 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
12588 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
12589 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
12590 m_CursorVerts = (UIVertex[])(object)new UIVertex[4];
12591 for (int i = 0; i < m_CursorVerts.Length; i++)
12592 {
12593 m_CursorVerts[i] = UIVertex.simpleVert;
12594 m_CursorVerts[i].uv0 = Vector4.op_Implicit(Vector2.zero);
12595 }
12596 }
12597
12598 private void GenerateHighlight(VertexHelper vbo, Vector2 roundingOffset)
12599 {
12600 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
12601 //IL_0061: Unknown result type (might be due to invalid IL or missing references)
12602 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
12603 //IL_006a: Unknown result type (might be due to invalid IL or missing references)
12604 //IL_006f: Unknown result type (might be due to invalid IL or missing references)
12605 //IL_0077: Unknown result type (might be due to invalid IL or missing references)
12606 //IL_007c: Unknown result type (might be due to invalid IL or missing references)
12607 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
12608 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
12609 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
12610 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
12611 //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
12612 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
12613 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
12614 //IL_00da: Unknown result type (might be due to invalid IL or missing references)
12615 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
12616 //IL_00f9: Unknown result type (might be due to invalid IL or missing references)
12617 //IL_0103: Unknown result type (might be due to invalid IL or missing references)
12618 //IL_0117: Unknown result type (might be due to invalid IL or missing references)
12619 //IL_0125: Unknown result type (might be due to invalid IL or missing references)
12620 //IL_0142: Unknown result type (might be due to invalid IL or missing references)
12621 //IL_0154: Unknown result type (might be due to invalid IL or missing references)
12622 //IL_0159: Unknown result type (might be due to invalid IL or missing references)
12623 //IL_0193: Unknown result type (might be due to invalid IL or missing references)
12624 //IL_0198: Unknown result type (might be due to invalid IL or missing references)
12625 //IL_0164: Unknown result type (might be due to invalid IL or missing references)
12626 //IL_0176: Unknown result type (might be due to invalid IL or missing references)
12627 //IL_017b: Unknown result type (might be due to invalid IL or missing references)
12628 //IL_01b0: Unknown result type (might be due to invalid IL or missing references)
12629 //IL_01b7: Unknown result type (might be due to invalid IL or missing references)
12630 //IL_01c3: Unknown result type (might be due to invalid IL or missing references)
12631 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
12632 //IL_01c9: Unknown result type (might be due to invalid IL or missing references)
12633 //IL_01ce: Unknown result type (might be due to invalid IL or missing references)
12634 //IL_01d3: Unknown result type (might be due to invalid IL or missing references)
12635 //IL_01d9: Unknown result type (might be due to invalid IL or missing references)
12636 //IL_01e2: Unknown result type (might be due to invalid IL or missing references)
12637 //IL_01e9: Unknown result type (might be due to invalid IL or missing references)
12638 //IL_01f5: Unknown result type (might be due to invalid IL or missing references)
12639 //IL_01fa: Unknown result type (might be due to invalid IL or missing references)
12640 //IL_01fb: Unknown result type (might be due to invalid IL or missing references)
12641 //IL_0200: Unknown result type (might be due to invalid IL or missing references)
12642 //IL_0205: Unknown result type (might be due to invalid IL or missing references)
12643 //IL_020b: Unknown result type (might be due to invalid IL or missing references)
12644 //IL_0214: Unknown result type (might be due to invalid IL or missing references)
12645 //IL_021b: Unknown result type (might be due to invalid IL or missing references)
12646 //IL_0227: Unknown result type (might be due to invalid IL or missing references)
12647 //IL_022c: Unknown result type (might be due to invalid IL or missing references)
12648 //IL_022d: Unknown result type (might be due to invalid IL or missing references)
12649 //IL_0232: Unknown result type (might be due to invalid IL or missing references)
12650 //IL_0237: Unknown result type (might be due to invalid IL or missing references)
12651 //IL_023d: Unknown result type (might be due to invalid IL or missing references)
12652 //IL_0246: Unknown result type (might be due to invalid IL or missing references)
12653 //IL_024d: Unknown result type (might be due to invalid IL or missing references)
12654 //IL_0259: Unknown result type (might be due to invalid IL or missing references)
12655 //IL_025e: Unknown result type (might be due to invalid IL or missing references)
12656 //IL_025f: Unknown result type (might be due to invalid IL or missing references)
12657 //IL_0264: Unknown result type (might be due to invalid IL or missing references)
12658 //IL_0269: Unknown result type (might be due to invalid IL or missing references)
12659 //IL_026f: Unknown result type (might be due to invalid IL or missing references)
12660 int num = Mathf.Max(0, caretPositionInternal - m_DrawStart);
12661 int num2 = Mathf.Max(0, caretSelectPositionInternal - m_DrawStart);
12662 if (num > num2)
12663 {
12664 int num3 = num;
12665 num = num2;
12666 num2 = num3;
12667 }
12668 num2--;
12669 TextGenerator cachedTextGenerator = m_TextComponent.cachedTextGenerator;
12670 if (cachedTextGenerator.lineCount <= 0)
12671 {
12672 return;
12673 }
12674 int num4 = DetermineCharacterLine(num, cachedTextGenerator);
12675 int lineEndPosition = GetLineEndPosition(cachedTextGenerator, num4);
12676 UIVertex simpleVert = UIVertex.simpleVert;
12677 simpleVert.uv0 = Vector4.op_Implicit(Vector2.zero);
12678 simpleVert.color = Color32.op_Implicit(selectionColor);
12679 Vector2 val3 = default(Vector2);
12680 Vector2 val4 = default(Vector2);
12681 for (int i = num; i <= num2 && i < cachedTextGenerator.characterCount; i++)
12682 {
12683 if (i != lineEndPosition && i != num2)
12684 {
12685 continue;
12686 }
12687 UICharInfo val = cachedTextGenerator.characters[num];
12688 UICharInfo val2 = cachedTextGenerator.characters[i];
12689 ((Vector2)(ref val3))..ctor(val.cursorPos.x / m_TextComponent.pixelsPerUnit, cachedTextGenerator.lines[num4].topY / m_TextComponent.pixelsPerUnit);
12690 ((Vector2)(ref val4))..ctor((val2.cursorPos.x + val2.charWidth) / m_TextComponent.pixelsPerUnit, val3.y - (float)cachedTextGenerator.lines[num4].height / m_TextComponent.pixelsPerUnit);
12691 float x = val4.x;
12692 Rect rect = ((Graphic)m_TextComponent).rectTransform.rect;
12693 if (!(x > ((Rect)(ref rect)).xMax))
12694 {
12695 float x2 = val4.x;
12696 rect = ((Graphic)m_TextComponent).rectTransform.rect;
12697 if (!(x2 < ((Rect)(ref rect)).xMin))
12698 {
12699 goto IL_01a6;
12700 }
12701 }
12702 rect = ((Graphic)m_TextComponent).rectTransform.rect;
12703 val4.x = ((Rect)(ref rect)).xMax;
12704 goto IL_01a6;
12705 IL_01a6:
12706 int currentVertCount = vbo.currentVertCount;
12707 simpleVert.position = new Vector3(val3.x, val4.y, 0f) + Vector2.op_Implicit(roundingOffset);
12708 vbo.AddVert(simpleVert);
12709 simpleVert.position = new Vector3(val4.x, val4.y, 0f) + Vector2.op_Implicit(roundingOffset);
12710 vbo.AddVert(simpleVert);
12711 simpleVert.position = new Vector3(val4.x, val3.y, 0f) + Vector2.op_Implicit(roundingOffset);
12712 vbo.AddVert(simpleVert);
12713 simpleVert.position = new Vector3(val3.x, val3.y, 0f) + Vector2.op_Implicit(roundingOffset);
12714 vbo.AddVert(simpleVert);
12715 vbo.AddTriangle(currentVertCount, currentVertCount + 1, currentVertCount + 2);
12716 vbo.AddTriangle(currentVertCount + 2, currentVertCount + 3, currentVertCount);
12717 num = i + 1;
12718 num4++;
12719 lineEndPosition = GetLineEndPosition(cachedTextGenerator, num4);
12720 }
12721 }
12722
12723 protected char Validate(string text, int pos, char ch)
12724 {
12725 if (characterValidation == CharacterValidation.None || !((Behaviour)this).enabled)
12726 {
12727 return ch;
12728 }
12730 {
12731 bool num = pos == 0 && text.Length > 0 && text[0] == '-';
12732 bool flag = text.Length > 0 && text[0] == '-' && ((caretPositionInternal == 0 && caretSelectPositionInternal > 0) || (caretSelectPositionInternal == 0 && caretPositionInternal > 0));
12733 bool flag2 = caretPositionInternal == 0 || caretSelectPositionInternal == 0;
12734 if (!num || flag)
12735 {
12736 if (ch >= '0' && ch <= '9')
12737 {
12738 return ch;
12739 }
12740 if (ch == '-' && (pos == 0 || flag2))
12741 {
12742 return ch;
12743 }
12744 if ((ch == '.' || ch == ',') && characterValidation == CharacterValidation.Decimal && text.IndexOfAny((char[])(object)new Char[2]
12745 {
12746 (Char)46,
12747 (Char)44
12748 }) == -1)
12749 {
12750 return ch;
12751 }
12752 }
12753 }
12754 else if (characterValidation == CharacterValidation.Alphanumeric)
12755 {
12756 if (ch >= 'A' && ch <= 'Z')
12757 {
12758 return ch;
12759 }
12760 if (ch >= 'a' && ch <= 'z')
12761 {
12762 return ch;
12763 }
12764 if (ch >= '0' && ch <= '9')
12765 {
12766 return ch;
12767 }
12768 }
12770 {
12771 if (Char.IsLetter(ch))
12772 {
12773 if (Char.IsLower(ch) && (pos == 0 || text[pos - 1] == ' '))
12774 {
12775 return Char.ToUpper(ch);
12776 }
12777 if (Char.IsUpper(ch) && pos > 0 && text[pos - 1] != ' ' && text[pos - 1] != '\'')
12778 {
12779 return Char.ToLower(ch);
12780 }
12781 return ch;
12782 }
12783 if (ch == '\'' && !text.Contains("'") && (pos <= 0 || (text[pos - 1] != ' ' && text[pos - 1] != '\'')) && (pos >= text.Length || (text[pos] != ' ' && text[pos] != '\'')))
12784 {
12785 return ch;
12786 }
12787 if (ch == ' ' && pos != 0 && (pos <= 0 || (text[pos - 1] != ' ' && text[pos - 1] != '\'')) && (pos >= text.Length || (text[pos] != ' ' && text[pos] != '\'')))
12788 {
12789 return ch;
12790 }
12791 }
12792 else if (characterValidation == CharacterValidation.EmailAddress)
12793 {
12794 if (ch >= 'A' && ch <= 'Z')
12795 {
12796 return ch;
12797 }
12798 if (ch >= 'a' && ch <= 'z')
12799 {
12800 return ch;
12801 }
12802 if (ch >= '0' && ch <= '9')
12803 {
12804 return ch;
12805 }
12806 if (ch == '@' && text.IndexOf('@') == -1)
12807 {
12808 return ch;
12809 }
12810 if ("!#$%&'*+-/=?^_`{|}~".IndexOf(ch) != -1)
12811 {
12812 return ch;
12813 }
12814 if (ch == '.')
12815 {
12816 char num2 = ((text.Length > 0) ? text[Mathf.Clamp(pos, 0, text.Length - 1)] : ' ');
12817 char c = ((text.Length > 0) ? text[Mathf.Clamp(pos + 1, 0, text.Length - 1)] : '\n');
12818 if (num2 != '.' && c != '.')
12819 {
12820 return ch;
12821 }
12822 }
12823 }
12824 return '\0';
12825 }
12826
12828 {
12829 if ((Object)(object)m_TextComponent == (Object)null || (Object)(object)m_TextComponent.font == (Object)null || !((UIBehaviour)this).IsActive() || !((Selectable)this).IsInteractable())
12830 {
12831 return;
12832 }
12833 if (isFocused)
12834 {
12835 if (m_Keyboard != null && !m_Keyboard.active)
12836 {
12837 m_Keyboard.active = true;
12838 m_Keyboard.text = m_Text;
12839 }
12840 Action obj = this.onSelected;
12841 if (obj != null)
12842 {
12843 obj.Invoke();
12844 }
12845 }
12847 }
12848
12850 {
12851 //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
12852 //IL_0093: Unknown result type (might be due to invalid IL or missing references)
12853 if ((Object)(object)EventSystem.current == (Object)null)
12854 {
12855 return;
12856 }
12857 if ((Object)(object)EventSystem.current.currentSelectedGameObject != (Object)(object)((Component)this).gameObject)
12858 {
12859 EventSystem.current.SetSelectedGameObject(((Component)this).gameObject);
12860 }
12861 m_TouchKeyboardAllowsInPlaceEditing = !s_IsQuestDevice && !s_IsPicoDevice && TouchScreenKeyboard.isInPlaceEditingAllowed;
12863 {
12864 if ((Object)(object)input != (Object)null && input.touchSupported)
12865 {
12866 TouchScreenKeyboard.hideInput = shouldHideMobileInput;
12867 }
12868 m_Keyboard = ((inputType == InputType.Password) ? TouchScreenKeyboard.Open(m_Text, keyboardType, false, multiLine, true, false, "", characterLimit) : TouchScreenKeyboard.Open(m_Text, keyboardType, inputType == InputType.AutoCorrect, multiLine, false, false, "", characterLimit));
12870 {
12871 MoveTextEnd(shift: false);
12872 }
12873 }
12874 if (!TouchScreenKeyboard.isSupported || m_TouchKeyboardAllowsInPlaceEditing)
12875 {
12876 if ((Object)(object)input != (Object)null)
12877 {
12878 input.imeCompositionMode = (IMECompositionMode)1;
12879 }
12880 OnFocus();
12881 }
12882 m_AllowInput = true;
12884 m_WasCanceled = false;
12886 UpdateLabel();
12887 }
12888
12889 public override void OnSelect(BaseEventData eventData)
12890 {
12891 ((Selectable)this).OnSelect(eventData);
12893 {
12895 }
12896 }
12897
12898 public virtual void OnPointerClick(PointerEventData eventData)
12899 {
12900 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
12901 if ((int)eventData.button == 0)
12902 {
12904 }
12905 }
12906
12908 {
12909 if (!m_AllowInput)
12910 {
12911 return;
12912 }
12914 m_AllowInput = false;
12915 if ((Object)(object)m_Placeholder != (Object)null)
12916 {
12917 ((Behaviour)m_Placeholder).enabled = String.IsNullOrEmpty(m_Text);
12918 }
12919 if ((Object)(object)m_TextComponent != (Object)null && ((Selectable)this).IsInteractable())
12920 {
12921 if (m_WasCanceled)
12922 {
12924 }
12926 {
12927 SendOnSubmit();
12928 }
12929 if (m_Keyboard != null)
12930 {
12931 m_Keyboard.active = false;
12932 m_Keyboard = null;
12933 }
12935 if ((Object)(object)input != (Object)null)
12936 {
12937 input.imeCompositionMode = (IMECompositionMode)0;
12938 }
12939 }
12941 }
12942
12943 public override void OnDeselect(BaseEventData eventData)
12944 {
12946 ((Selectable)this).OnDeselect(eventData);
12947 }
12948
12949 public virtual void OnSubmit(BaseEventData eventData)
12950 {
12951 if (((UIBehaviour)this).IsActive() && ((Selectable)this).IsInteractable() && !isFocused)
12952 {
12954 }
12955 }
12956
12957 private void EnforceContentType()
12958 {
12959 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
12960 //IL_0059: Unknown result type (might be due to invalid IL or missing references)
12961 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
12962 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
12963 //IL_00bc: Unknown result type (might be due to invalid IL or missing references)
12964 //IL_00da: Unknown result type (might be due to invalid IL or missing references)
12965 //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
12966 //IL_0116: Unknown result type (might be due to invalid IL or missing references)
12967 //IL_0134: Unknown result type (might be due to invalid IL or missing references)
12968 switch (contentType)
12969 {
12970 case ContentType.Standard:
12971 m_InputType = InputType.Standard;
12972 m_KeyboardType = (TouchScreenKeyboardType)0;
12974 break;
12975 case ContentType.Autocorrected:
12976 m_InputType = InputType.AutoCorrect;
12977 m_KeyboardType = (TouchScreenKeyboardType)0;
12979 break;
12980 case ContentType.IntegerNumber:
12981 m_LineType = LineType.SingleLine;
12982 m_InputType = InputType.Standard;
12983 m_KeyboardType = (TouchScreenKeyboardType)4;
12985 break;
12986 case ContentType.DecimalNumber:
12987 m_LineType = LineType.SingleLine;
12988 m_InputType = InputType.Standard;
12989 m_KeyboardType = (TouchScreenKeyboardType)2;
12991 break;
12992 case ContentType.Alphanumeric:
12993 m_LineType = LineType.SingleLine;
12994 m_InputType = InputType.Standard;
12995 m_KeyboardType = (TouchScreenKeyboardType)1;
12997 break;
12998 case ContentType.Name:
12999 m_LineType = LineType.SingleLine;
13000 m_InputType = InputType.Standard;
13001 m_KeyboardType = (TouchScreenKeyboardType)6;
13003 break;
13004 case ContentType.EmailAddress:
13005 m_LineType = LineType.SingleLine;
13006 m_InputType = InputType.Standard;
13007 m_KeyboardType = (TouchScreenKeyboardType)7;
13009 break;
13010 case ContentType.Password:
13011 m_LineType = LineType.SingleLine;
13012 m_InputType = InputType.Password;
13013 m_KeyboardType = (TouchScreenKeyboardType)0;
13015 break;
13016 case ContentType.Pin:
13017 m_LineType = LineType.SingleLine;
13018 m_InputType = InputType.Password;
13019 m_KeyboardType = (TouchScreenKeyboardType)4;
13021 break;
13022 }
13024 }
13025
13027 {
13028 if ((Object)(object)m_TextComponent != (Object)null)
13029 {
13030 if (multiLine)
13031 {
13032 m_TextComponent.horizontalOverflow = (HorizontalWrapMode)0;
13033 }
13034 else
13035 {
13036 m_TextComponent.horizontalOverflow = (HorizontalWrapMode)1;
13037 }
13038 }
13039 }
13040
13041 private void SetToCustomIfContentTypeIsNot(params ContentType[] allowedContentTypes)
13042 {
13043 if (contentType == ContentType.Custom)
13044 {
13045 return;
13046 }
13047 for (int i = 0; i < allowedContentTypes.Length; i++)
13048 {
13049 if (contentType == allowedContentTypes[i])
13050 {
13051 return;
13052 }
13053 }
13054 contentType = ContentType.Custom;
13055 }
13056
13057 private void SetToCustom()
13058 {
13059 if (contentType != ContentType.Custom)
13060 {
13061 contentType = ContentType.Custom;
13062 }
13063 }
13064
13065 protected override void DoStateTransition(SelectionState state, bool instant)
13066 {
13067 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
13068 //IL_000f: Invalid comparison between Unknown and I4
13069 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
13070 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
13072 {
13073 state = (SelectionState)3;
13074 }
13075 else if ((int)state == 2)
13076 {
13078 }
13079 ((Selectable)this).DoStateTransition(state, instant);
13080 }
13081
13083 {
13084 }
13085
13086 public virtual void CalculateLayoutInputVertical()
13087 {
13088 }
13089
13091 {
13092 Char[] array = new Char[6];
13093 RuntimeHelpers.InitializeArray((Array)(object)array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
13094 kSeparators = (char[])(object)array;
13095 s_AreDevicesEvaluated = false;
13096 s_IsQuestDevice = false;
13097 s_IsPicoDevice = false;
13098 }
13099
13100 Transform ICanvasElement.get_transform()
13101 {
13102 return ((Component)this).transform;
13103 }
13104 }
13105}
13107{
13113 [PublicAPI]
13114 public enum VideoError : Enum
13115 {
13121 Unknown,
13127 InvalidURL,
13133 AccessDenied,
13139 PlayerError,
13145 RateLimited
13146 }
13147}
static void GenerateDPIDMipmapsFast(Texture2D texture, bool alphaIsTransparency, bool sRGB, bool conservative=false, bool normalMap=false)
Definition: VRCSDKBase.cs:134
static int ReadVarInt(byte[] data, ref int i)
Definition: VRCSDK3.cs:118
static int Read16(byte[] data, ref int i)
Definition: VRCSDK3.cs:72
static string ReadString(byte[] data, ref int i, int length)
Definition: VRCSDK3.cs:111
static byte[] ReadAllBytesFromStream(Stream input)
Definition: VRCSDK3.cs:87
static byte Read8(byte[] data, ref int i)
Definition: VRCSDK3.cs:82
static int Read32(byte[] data, ref int i)
Definition: VRCSDK3.cs:77
ParsedMidiFile(Stream stream)
Definition: VRCSDK3.cs:147
readonly int TracksCount
Definition: VRCSDK3.cs:145
static bool ParseMetaEvent(byte[] data, ref int position, byte metaEventType, ref byte data1, ref byte data2)
Definition: VRCSDK3.cs:185
readonly int Format
Definition: VRCSDK3.cs:139
readonly MidiRawData.MidiRawTrack[] Tracks
Definition: VRCSDK3.cs:143
readonly int TicksPerQuarterNote
Definition: VRCSDK3.cs:141
static MidiRawData.MidiRawTrack ParseTrack(int index, byte[] data, ref int position)
Definition: VRCSDK3.cs:215
ParsedMidiFile(byte[] data)
Definition: VRCSDK3.cs:157
ParsedMidiFile(string path)
Definition: VRCSDK3.cs:152
abstract void RunInputEvent(string eventName, UdonInputEventArgs args)
abstract void SetProgramVariable< T >(string symbolName, T value)
abstract bool RunEvent< T0 >(string eventName, ValueTuple< string, T0 > parameter0)
abstract bool RunEvent< T0, T1 >(string eventName, ValueTuple< string, T0 > parameter0, ValueTuple< string, T1 > parameter1)
abstract Type GetProgramVariableType(string symbolName)
abstract bool TryGetProgramVariable(string symbolName, out object value)
abstract object GetProgramVariable(string symbolName)
abstract bool RunEvent(string eventName, params ValueTuple< string, object >[] programVariables)
abstract bool TryGetProgramVariable< T >(string symbolName, out T value)
abstract void RunProgram(string eventName)
abstract void SendCustomEventDelayedSeconds(string eventName, float delaySeconds, EventTiming eventTiming=0)
abstract bool RunEvent< T0, T1, T2 >(string eventName, ValueTuple< string, T0 > parameter0, ValueTuple< string, T1 > parameter1, ValueTuple< string, T2 > parameter2)
abstract void SendCustomEvent(string eventName)
abstract bool RunEvent(string eventName)
abstract void SetProgramVariable(string symbolName, object value)
abstract T GetProgramVariable< T >(string symbolName)
abstract void SendCustomNetworkEvent(NetworkEventTarget target, string eventName)
abstract IUdonSyncMetadataTable SyncMetadataTable
Definition: VRCSDK3.cs:9354
abstract void SendCustomEventDelayedFrames(string eventName, int delayFrames, EventTiming eventTiming=0)
static bool GetRelativeMousePositionForDrag(PointerEventData eventData, ref Vector2 position)
Definition: VRCSDK3.cs:9871
static Vector2 GetMousePositionRelativeToMainDisplayResolution()
Definition: VRCSDK3.cs:9893
static bool SetColor(ref Color currentValue, Color newValue)
Definition: VRCSDK3.cs:9915
static bool SetStruct< T >(ref T currentValue, T newValue)
Definition: VRCSDK3.cs:9931
static bool SetClass< T >(ref T currentValue, T newValue)
Definition: VRCSDK3.cs:9941
override void SwitchAvatar(string id, VRCPlayerApi instigator)
Definition: VRCSDK3.cs:9621
override void SwitchAvatar(string id)
Definition: VRCSDK3.cs:9629
override void UpdateCameraClearing(Camera src, Camera mirrorCamera, Skybox mirrorSkybox)
Definition: VRCSDK3.cs:9768
override void NetworkConfigure()
Definition: VRCSDK3.cs:9505
void Return(GameObject obj)
Definition: VRCSDK3.cs:9584
static Action< VRCObjectPool > OnInit
Definition: VRCSDK3.cs:9480
static Action< VRCObjectPool, int > OnSpawn
Definition: VRCSDK3.cs:9483
static Action< VRCObjectPool, int > OnReturn
Definition: VRCSDK3.cs:9486
static void EditorSetKinematic(VRCObjectSync target, bool value)
Definition: VRCSDK3.cs:9691
static Action< VRCObjectSync > FlagDiscontinuityHook
Definition: VRCSDK3.cs:9678
void TeleportTo(Transform targetLocation)
Definition: VRCSDK3.cs:9719
static Action< VRCObjectSync, bool > SetKinematicHook
Definition: VRCSDK3.cs:9656
static Action< VRCObjectSync, Vector3, Quaternion > TeleportHandler
Definition: VRCSDK3.cs:9643
delegate void AwakeDelegate(VRCObjectSync obj)
void SetKinematic(bool value)
Definition: VRCSDK3.cs:9686
override void NetworkConfigure()
Definition: VRCSDK3.cs:9732
static AwakeDelegate OnAwake
Definition: VRCSDK3.cs:9649
static Action< VRCObjectSync > RespawnHandler
Definition: VRCSDK3.cs:9646
static void EditorSetGravity(VRCObjectSync target, bool value)
Definition: VRCSDK3.cs:9705
static Action< VRCObjectSync, bool > SetGravityHook
Definition: VRCSDK3.cs:9667
readonly string OnLocalPlayerEnterStation
Definition: VRCSDK3.cs:9863
readonly string OnRemotePlayerExitStation
Definition: VRCSDK3.cs:9865
readonly string OnLocalPlayerExitStation
Definition: VRCSDK3.cs:9867
readonly string OnRemotePlayerEnterStation
Definition: VRCSDK3.cs:9861
static void AddOptions(this TMP_Dropdown dropdown, Sprite[] options)
Definition: VRCSDK3.cs:9978
static void AddOptions(this TMP_Dropdown dropdown, OptionData[] options)
Definition: VRCSDK3.cs:9973
static void AddOptions(this TMP_Dropdown dropdown, string[] options)
Definition: VRCSDK3.cs:9968
char Validate(string text, int pos, char ch)
Definition: VRCSDK3.cs:12723
static int GetLineEndPosition(TextGenerator gen, int line)
Definition: VRCSDK3.cs:12196
int LineUpCharacterPosition(int originalPos, bool goToFirstChar)
Definition: VRCSDK3.cs:11876
virtual void OnDrag(PointerEventData eventData)
Definition: VRCSDK3.cs:11429
CharacterValidation m_CharacterValidation
Definition: VRCSDK3.cs:10092
static int GetLineStartPosition(TextGenerator gen, int line)
Definition: VRCSDK3.cs:12189
void SetDrawRangeToContainCaretPosition(int caretPos)
Definition: VRCSDK3.cs:12207
static readonly char[] kSeparators
Definition: VRCSDK3.cs:10053
Vector2 ScreenToLocal(Vector2 screen)
Definition: VRCSDK3.cs:11284
TouchScreenKeyboardType m_KeyboardType
Definition: VRCSDK3.cs:10081
virtual void OnEndDrag(PointerEventData eventData)
Definition: VRCSDK3.cs:11503
virtual void CalculateLayoutInputHorizontal()
Definition: VRCSDK3.cs:13082
virtual void OnSubmit(BaseEventData eventData)
Definition: VRCSDK3.cs:12949
void MoveRight(bool shift, bool ctrl)
Definition: VRCSDK3.cs:11811
override void OnSelect(BaseEventData eventData)
Definition: VRCSDK3.cs:12889
EditState KeyPressed(Event evt)
Definition: VRCSDK3.cs:11539
WaitForSecondsRealtime m_WaitForSecondsRealtime
Definition: VRCSDK3.cs:10188
override void OnPointerDown(PointerEventData eventData)
Definition: VRCSDK3.cs:11511
virtual void CalculateLayoutInputVertical()
Definition: VRCSDK3.cs:13086
int GetUnclampedCharacterLineFromPosition(Vector2 pos, TextGenerator generator)
Definition: VRCSDK3.cs:11329
bool MayDrag(PointerEventData eventData)
Definition: VRCSDK3.cs:11407
override void OnDeselect(BaseEventData eventData)
Definition: VRCSDK3.cs:12943
TouchScreenKeyboardType keyboardType
Definition: VRCSDK3.cs:10566
int GetCharacterIndexFromPosition(Vector2 pos)
Definition: VRCSDK3.cs:11362
virtual void OnUpdateSelected(BaseEventData eventData)
Definition: VRCSDK3.cs:11741
override void DoStateTransition(SelectionState state, bool instant)
Definition: VRCSDK3.cs:13065
virtual void Rebuild(CanvasUpdate update)
Definition: VRCSDK3.cs:12343
virtual void OnPointerClick(PointerEventData eventData)
Definition: VRCSDK3.cs:12898
void MoveLeft(bool shift, bool ctrl)
Definition: VRCSDK3.cs:11844
void MoveDown(bool shift, bool goToLastChar)
Definition: VRCSDK3.cs:11950
void GenerateHighlight(VertexHelper vbo, Vector2 roundingOffset)
Definition: VRCSDK3.cs:12598
virtual void OnBeginDrag(PointerEventData eventData)
Definition: VRCSDK3.cs:11421
int DetermineCharacterLine(int charPos, TextGenerator generator)
Definition: VRCSDK3.cs:11863
delegate char OnValidateInput(string text, int charIndex, char addedChar)
void GenerateCaret(VertexHelper vbo, Vector2 roundingOffset)
Definition: VRCSDK3.cs:12468
int LineDownCharacterPosition(int originalPos, bool goToLastChar)
Definition: VRCSDK3.cs:11911
virtual void Append(char input)
Definition: VRCSDK3.cs:12112
void MoveUp(bool shift, bool goToFirstChar)
Definition: VRCSDK3.cs:11973
void SetText(string value, bool sendCallback=true)
Definition: VRCSDK3.cs:10855
IEnumerator MouseDragOutsideRect(PointerEventData eventData)
Definition: VRCSDK3.cs:11457
void Append(string input, bool secure=true)
Definition: VRCSDK3.cs:12095
TouchScreenKeyboard touchScreenKeyboard
Definition: VRCSDK3.cs:10563
TouchScreenKeyboard m_Keyboard
Definition: VRCSDK3.cs:10051
void SetToCustomIfContentTypeIsNot(params ContentType[] allowedContentTypes)
Definition: VRCSDK3.cs:13041
CharacterValidation characterValidation
Definition: VRCSDK3.cs:10583
Data Dictionaries store Data Tokens by key-value pair, similarly to C# Dictionaries....
Definition: VRCSDK3.cs:5402
virtual bool ContainsKey(DataToken key)
Returns true if the specified key exists on this dictionary.
Definition: VRCSDK3.cs:5591
IEnumerator< KeyValuePair< DataToken, DataToken > > GetEnumerator()
This is not documented properly yet
Definition: VRCSDK3.cs:5646
virtual void Add(DataToken key, DataToken value)
Adds the value at the specified key. The entire purpose of this function that sets it apart from SetV...
Definition: VRCSDK3.cs:5680
DataDictionary DeepClone()
Clones the DataDictionary into a new DataDictionary that contains all the same values....
Definition: VRCSDK3.cs:5527
bool TryGetValue(DataToken key, TokenType type, out DataToken value)
This is not documented properly yet
Definition: VRCSDK3.cs:5469
virtual DataToken GetValue(DataToken key, out bool success)
Definition: VRCSDK3.cs:5493
virtual DataList GetKeys()
This is not documented properly yet
Definition: VRCSDK3.cs:5614
virtual void SetValue(DataToken key, DataToken value)
Sets the value at the specified key. If that key does not exist, a new one will be added.
Definition: VRCSDK3.cs:5450
bool TryGetValue(DataToken key, out DataToken value)
This is not documented properly yet
Definition: VRCSDK3.cs:5487
DataDictionary ShallowClone()
Clones the DataDictionary into a new DataDictionary that contains all the same values....
Definition: VRCSDK3.cs:5509
virtual bool ContainsValue(DataToken value)
Returns true if the specified value exists on this dictionary.
Definition: VRCSDK3.cs:5600
virtual bool Remove(DataToken key)
Removes a specific key from this dictionary. Returns true if anything was successfully removed.
Definition: VRCSDK3.cs:5565
void Add(KeyValuePair< DataToken, DataToken > item)
Definition: VRCSDK3.cs:5660
DataList GetValues()
This is not documented properly yet
Definition: VRCSDK3.cs:5629
bool IsReadOnly
This is not documented properly yet
Definition: VRCSDK3.cs:5426
virtual void Clear()
Removes all keys and values from this dictionary
Definition: VRCSDK3.cs:5553
virtual int Count
Get the number of elements in the dictionary
Definition: VRCSDK3.cs:5417
bool Contains(KeyValuePair< DataToken, DataToken > item)
Definition: VRCSDK3.cs:5693
void CopyTo(KeyValuePair< DataToken, DataToken >[] array, int arrayIndex)
Definition: VRCSDK3.cs:5710
bool Remove(DataToken key, out DataToken value)
Removes a specific key from this dictionary. Returns true if anything was successfully removed....
Definition: VRCSDK3.cs:5578
bool Remove(KeyValuePair< DataToken, DataToken > item)
Definition: VRCSDK3.cs:5717
virtual void ParseAll()
Definition: VRCSDK3.cs:5606
virtual void ParseAll()
Definition: VRCSDK3.cs:6042
DataList(params DataToken[] array)
Definition: VRCSDK3.cs:5773
DataList ShallowClone()
Definition: VRCSDK3.cs:5864
int LastIndexOf(DataToken item, int index)
Definition: VRCSDK3.cs:5964
int IndexOf(DataToken item, int index)
Definition: VRCSDK3.cs:5946
int BinarySearch(int index, int count, DataToken token)
Definition: VRCSDK3.cs:6036
bool Remove(DataToken value)
Definition: VRCSDK3.cs:5976
virtual bool TryGetValue(int index, out DataToken value)
Definition: VRCSDK3.cs:5831
void AddRange(IEnumerable< DataToken > values)
Definition: VRCSDK3.cs:5913
int BinarySearch(DataToken token)
Definition: VRCSDK3.cs:6030
virtual DataToken GetValue(int index, out bool success)
Definition: VRCSDK3.cs:5837
DataToken[] ToArray()
Definition: VRCSDK3.cs:5896
virtual void Reverse()
Definition: VRCSDK3.cs:6008
int LastIndexOf(DataToken item, int index, int count)
Definition: VRCSDK3.cs:5970
virtual void RemoveRange(int index, int count)
Definition: VRCSDK3.cs:6003
virtual bool TryGetValue(int index, TokenType type, out DataToken value)
Definition: VRCSDK3.cs:5817
DataList(List< DataToken > list)
Definition: VRCSDK3.cs:5801
int IndexOf(DataToken value)
Definition: VRCSDK3.cs:5940
virtual void RemoveAt(int index)
Definition: VRCSDK3.cs:5998
void CopyTo(DataToken[] array, int arrayIndex)
Definition: VRCSDK3.cs:6057
virtual void Reverse(int index, int count)
Definition: VRCSDK3.cs:6013
DataList GetRange(int index, int count)
Definition: VRCSDK3.cs:5858
virtual void Add(DataToken value)
Definition: VRCSDK3.cs:5902
virtual void ParseInRange(int startIndex, int stopIndex)
Definition: VRCSDK3.cs:6052
virtual void Clear()
Definition: VRCSDK3.cs:5993
bool RemoveAll(DataToken value)
Definition: VRCSDK3.cs:5982
void Sort(int index, int count)
Definition: VRCSDK3.cs:6024
virtual bool SetValue(int index, DataToken value)
Definition: VRCSDK3.cs:5811
int LastIndexOf(DataToken item)
Definition: VRCSDK3.cs:5958
virtual void InsertRange(int index, DataList input)
Definition: VRCSDK3.cs:5853
int IndexOf(DataToken item, int index, int count)
Definition: VRCSDK3.cs:5952
IEnumerator< DataToken > GetEnumerator()
Definition: VRCSDK3.cs:6063
bool Contains(DataToken value)
Definition: VRCSDK3.cs:5934
void AddRange(DataList list)
Definition: VRCSDK3.cs:5907
DataList(IEnumerable< DataToken > values)
Definition: VRCSDK3.cs:5781
virtual void ParseInRange(int startIndex)
Definition: VRCSDK3.cs:6047
DataList DeepClone()
Definition: VRCSDK3.cs:5873
virtual void Insert(int index, DataToken value)
Definition: VRCSDK3.cs:5848
override void ParseAll()
Definition: VRCSDK3.cs:7916
void AddLazyValue(DataToken key, JsonType type, int index)
Definition: VRCSDK3.cs:7969
override DataList GetKeys()
This is not documented properly yet
Definition: VRCSDK3.cs:7947
override bool ContainsKey(DataToken key)
Returns true if the specified key exists on this dictionary.
Definition: VRCSDK3.cs:7898
override void Clear()
Removes all keys and values from this dictionary
Definition: VRCSDK3.cs:7892
override DataToken GetValue(DataToken key, out bool success)
Definition: VRCSDK3.cs:7866
override void Add(DataToken key, DataToken value)
Adds the value at the specified key. The entire purpose of this function that sets it apart from SetV...
Definition: VRCSDK3.cs:7959
override bool Remove(DataToken key)
Removes a specific key from this dictionary. Returns true if anything was successfully removed.
Definition: VRCSDK3.cs:7907
override void SetValue(DataToken key, DataToken value)
Sets the value at the specified key. If that key does not exist, a new one will be added.
Definition: VRCSDK3.cs:7857
JsonDictionary(string source)
Definition: VRCSDK3.cs:7852
void ClearLazyValue(int index)
Definition: VRCSDK3.cs:8084
override DataToken GetValue(int index, out bool success)
Definition: VRCSDK3.cs:7983
override void ParseInRange(int startIndex, int stopIndex)
Definition: VRCSDK3.cs:8062
override void RemoveRange(int index, int count)
Definition: VRCSDK3.cs:8044
override void Add(DataToken value)
Definition: VRCSDK3.cs:8025
override void Clear()
Definition: VRCSDK3.cs:8038
void AddLazyValue(JsonType type, string source)
Definition: VRCSDK3.cs:8077
override void Reverse(int index, int count)
Definition: VRCSDK3.cs:8056
override void Insert(int index, DataToken value)
Definition: VRCSDK3.cs:8012
override void InsertRange(int index, DataList input)
Definition: VRCSDK3.cs:8019
override void RemoveAt(int index)
Definition: VRCSDK3.cs:8032
override void Reverse()
Definition: VRCSDK3.cs:8050
static readonly char[] scanObjectChars
Definition: VRCSDK3.cs:8116
static bool SkipToAnyCharacter(string source, ref int index, char[] characters)
Definition: VRCSDK3.cs:9155
static readonly char[] scanStringChars
Definition: VRCSDK3.cs:8120
static bool TryParseObject(string source, int index, out DataToken result)
Definition: VRCSDK3.cs:8477
static bool TryParseBool(string source, int index, out DataToken result)
Definition: VRCSDK3.cs:8859
static HashSet< DataToken > seenContainers
Definition: VRCSDK3.cs:8128
static readonly char[] scanWordChars
Definition: VRCSDK3.cs:8122
static void SkipWhitespace(string source, ref int index)
Definition: VRCSDK3.cs:9088
static bool SerializeArray(DataList dataList, JsonExportType jsonExportType, StringBuilder builder, int indent, out DataToken error)
Definition: VRCSDK3.cs:8341
static bool SerializeObject(DataDictionary dataDictionary, JsonExportType jsonExportType, StringBuilder builder, int indent, out DataToken error)
Definition: VRCSDK3.cs:8231
static void ScanObject(out bool success, string source, ref int index)
Definition: VRCSDK3.cs:8878
static string TrimWhitespace(string input)
Definition: VRCSDK3.cs:9252
static bool IsComplexObject(string source, int index)
Definition: VRCSDK3.cs:9096
static string UnEscapeCharacter(out bool success, string source, ref int index)
Definition: VRCSDK3.cs:9169
static bool TryParseArray(string source, int index, out DataToken result)
Definition: VRCSDK3.cs:8631
static readonly char[] whitespaceChars
Definition: VRCSDK3.cs:8124
static void ScanNumber(out bool success, string source, ref int index)
Definition: VRCSDK3.cs:9041
static bool TrySerializeToJson(DataToken input, JsonExportType jsonExportType, out DataToken result)
Attempts to convert a DataDictionary or DataList into JSON string output. If successful,...
Definition: VRCSDK3.cs:8196
static void ScanArray(out bool success, string source, ref int index)
Definition: VRCSDK3.cs:8936
static void AppendIndent(StringBuilder builder, int indent)
Definition: VRCSDK3.cs:8446
static bool TryParseNumber(string source, int index, out DataToken result)
Definition: VRCSDK3.cs:8788
static bool TryIdentifyType(string source, int index, out JsonType result)
Definition: VRCSDK3.cs:9259
static string EscapeString(string input)
Definition: VRCSDK3.cs:9246
static void ScanBool(out bool success, string source, ref int index)
Definition: VRCSDK3.cs:9060
static readonly char[] numberChars
Definition: VRCSDK3.cs:8126
static int GetStringEnd(string source, int index)
Definition: VRCSDK3.cs:9113
static bool TryParseString(string source, ref int index, out DataToken result)
Definition: VRCSDK3.cs:8740
static void SkipToCharacter(string source, ref int index, char character)
Definition: VRCSDK3.cs:9147
static void ScanNull(out bool success, string source, ref int index)
Definition: VRCSDK3.cs:9072
static void ScanString(out bool success, string source, ref int index)
Definition: VRCSDK3.cs:8998
static bool IsComplexArray(string source, int index)
Definition: VRCSDK3.cs:9130
static readonly char[] scanArrayChars
Definition: VRCSDK3.cs:8118
static bool TryParseToken(string source, JsonType type, int index, out DataToken result)
Definition: VRCSDK3.cs:8454
static void ScanUnknown(string source, ref int index)
Definition: VRCSDK3.cs:9083
static readonly char[] parseArrayChars
Definition: VRCSDK3.cs:8114
static bool TryDeserializeFromJson(string source, out DataToken result)
Creates a DataList or DataDictionary from JSON string input. If successful, this returns true and the...
Definition: VRCSDK3.cs:8149
static void DownloadImage(string imageUrl, int imageSize, Action< Texture2D > onImageDownload=null, Action< ImageLoadError > onImageDownloadFailed=null, string fallbackImageUrl="", bool isRetry=false)
Definition: VRCSDKBase.cs:937
TextureWrapMode WrapModeU
Definition: VRCSDK3.cs:2830
TextureWrapMode WrapModeW
Definition: VRCSDK3.cs:2834
TextureWrapMode WrapModeV
Definition: VRCSDK3.cs:2832
UniTask RunUdonEventOnMainThreadAndRemoveFromQueue(string eventName, ValueTuple< string, object > argument)
Definition: VRCSDK3.cs:4378
static ImageResult LoadImage(System.IntPtr inputBytes, uint inputBytesLength, System.IntPtr outputBuffer, uint outputBufferLength, ImageLoadSettings settings)
static UniTask< DownloadImage > g__SlicedTextureUpload(int width, int height, int bytesPerPixel, TextureFormat format, int mipLevel, NativeSlice< byte > outputBuffer, Texture2D outputTexture)
Definition: VRCSDK3.cs:4456
ImageDownloader(VRCUrl url, Material material, IUdonEventReceiver udonBehaviour=null, TextureInfo textureInfo=null)
Definition: VRCSDK3.cs:4297
UniTask DownloadImage(Uri uri, CancellationToken cancellationToken)
Definition: VRCSDK3.cs:4360
static IVRCImageDownload DownloadImage(VRCUrl url, Material material, IUdonEventReceiver udonBehaviour, TextureInfo textureInfo)
Definition: VRCSDK3.cs:4292
static Func< VRCUrl, Material, IUdonEventReceiver, TextureInfo, IVRCImageDownload > StartDownload
Definition: VRCSDK3.cs:4493
static void RemoveImageDownloadFromQueue(IVRCImageDownload imageDownload)
Definition: VRCSDK3.cs:4566
static Func< bool > CanBypassDelay
Definition: VRCSDK3.cs:4487
static bool AddImageDownloadToQueue(IVRCImageDownload imageDownload)
Definition: VRCSDK3.cs:4555
IVRCImageDownload DownloadImage(VRCUrl url, Material material, IUdonEventReceiver udonBehaviour, TextureInfo textureInfo=null)
Definition: VRCSDK3.cs:4504
override string ToString()
Definition: VRCSDK3.cs:1209
void SetBlocks(List< MidiBlock > blocks)
Definition: VRCSDK3.cs:1235
MidiTrack[] tracks
Definition: VRCSDK3.cs:1259
static MidiFile Create(string filePath, MidiImportSettings midiImportSettings)
Definition: VRCSDK3.cs:1271
MidiRawData rawData
Definition: VRCSDK3.cs:1265
readonly List< MidiData.MidiBlock > allBlocks
Definition: VRCSDK3.cs:1804
readonly List< MidiData.MidiTrack > tracks
Definition: VRCSDK3.cs:1806
MidiRawDataProcessor(ParsedMidiFile midiFile, MidiImportSettings midiImportSettings)
Definition: VRCSDK3.cs:1820
MidiRawTrack[] Tracks
Definition: VRCSDK3.cs:1779
static float MidiTimeToMs(int bpm, int ppq, int time)
Definition: VRCSDK3.cs:1962
void SendMidiMessage(object sender, MidiVoiceEventArgs args)
Definition: VRCSDK3.cs:2164
MidiVoiceMessageDelegate m_OnControlChange
Definition: VRCSDK3.cs:1985
MidiVoiceMessageDelegate m_OnNoteOff
Definition: VRCSDK3.cs:1982
static IVRCMidiInput OpenMidiInput< T >(string deviceName=null)
Definition: VRCSDK3.cs:2150
MidiVoiceMessageDelegate m_OnNoteOn
Definition: VRCSDK3.cs:1979
static Func< IVRCMidiInput > Initialize
Definition: VRCSDK3.cs:2010
MidiVoiceMessageDelegate OnNoteOff
Definition: VRCSDK3.cs:2083
static void Log(string message)
Definition: VRCSDK3.cs:2220
MidiVoiceMessageDelegate OnControlChange
Definition: VRCSDK3.cs:2117
static Action< string > OnLog
Definition: VRCSDK3.cs:2020
static VRCMidiHandler Instance
Definition: VRCSDK3.cs:2028
MidiVoiceMessageDelegate OnNoteOn
Definition: VRCSDK3.cs:2049
void ControlChange(object sender, MidiVoiceEventArgs args)
Definition: VRCSDK3.cs:2309
void NoteOff(object sender, MidiVoiceEventArgs args)
Definition: VRCSDK3.cs:2289
void NoteOn(object sender, MidiVoiceEventArgs args)
Definition: VRCSDK3.cs:2269
readonly ValueTuple< string, object >[] argsArray
Definition: VRCSDK3.cs:2238
AbstractUdonBehaviour behaviour
Definition: VRCSDK3.cs:2241
List< MidiData.MidiBlock > activeBlocks
Definition: VRCSDK3.cs:1361
static Action< bool ><> void< get_OnBlockStarted > b__14_0(MidiData.MidiBlock midiBlock)
Definition: VRCSDK3.cs:1380
void< get_OnPlayingStarted > b__18_0()
Definition: VRCSDK3.cs:1388
void< get_OnBlockCompleted > b__16_0(MidiData.MidiBlock midiBlock)
Definition: VRCSDK3.cs:1384
void< get_OnPlayingStopped > b__20_0(bool completed)
Definition: VRCSDK3.cs:1392
readonly List< TrackProgress > activeTracks
Definition: VRCSDK3.cs:1403
Action< MidiData.MidiBlock > OnBlockStarted
Definition: VRCSDK3.cs:1427
IEnumerator MidiEnumerator(MidiFile midiAsset)
Definition: VRCSDK3.cs:1498
AbstractUdonBehaviour[] targetBehaviours
Definition: VRCSDK3.cs:1401
readonly ValueTuple< string, object >[] argsArray
Definition: VRCSDK3.cs:1409
Action< MidiData.MidiBlock > OnBlockCompleted
Definition: VRCSDK3.cs:1431
void OnBlockStart(MidiData.MidiBlock block)
Definition: VRCSDK3.cs:1620
Action< bool > OnPlayingStopped
Definition: VRCSDK3.cs:1455
void OnBlockEnd(MidiData.MidiBlock block)
Definition: VRCSDK3.cs:1642
static Action< VRCNetworkBehaviour > m_OnNetworkBehaviourAwake
Definition: VRCSDK3.cs:5347
static Action< VRCNetworkBehaviour > OnNetworkBehaviourAwake
Definition: VRCSDK3.cs:5350
static bool TryGetColor32(VRCPlayerApi player, string key, out Color32 value)
Definition: VRCSDK3.cs:5322
static void SetQuaternion(string key, Quaternion value)
Definition: VRCSDK3.cs:5168
static Type GetType(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:4879
static void SetColor(string key, Color value)
Definition: VRCSDK3.cs:5280
static bool TryGetSByte(VRCPlayerApi player, string key, out sbyte value)
Definition: VRCSDK3.cs:4947
static void SetBool(string key, bool value)
Definition: VRCSDK3.cs:4916
static Vector4 GetVector4(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5202
static short GetShort(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5005
static void SetInt(string key, int value)
Definition: VRCSDK3.cs:5042
static void SetULong(string key, ulong value)
Definition: VRCSDK3.cs:5105
static bool TryGetType(VRCPlayerApi player, string key, out Type t)
Definition: VRCSDK3.cs:4884
static Vector2 GetVector2(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5258
static bool TryGetByte(VRCPlayerApi player, string key, out byte value)
Definition: VRCSDK3.cs:4968
static bool TryGetVector2(VRCPlayerApi player, string key, out Vector2 value)
Definition: VRCSDK3.cs:5266
static float GetFloat(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5131
static ulong GetULong(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5110
static Quaternion GetQuaternion(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5174
static double GetDouble(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5141
static bool TryGetString(VRCPlayerApi player, string key, out string value)
Definition: VRCSDK3.cs:4905
static void SetByte(string key, byte value)
Definition: VRCSDK3.cs:4958
static Vector3 GetVector3(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5230
static byte[] GetBytes(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:4984
static bool TryGetULong(VRCPlayerApi player, string key, out ulong value)
Definition: VRCSDK3.cs:5115
static Color32 GetColor32(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5314
static void SetDouble(string key, double value)
Definition: VRCSDK3.cs:5136
static bool TryGetLong(VRCPlayerApi player, string key, out long value)
Definition: VRCSDK3.cs:5094
static void SetColor32(string key, Color32 value)
Definition: VRCSDK3.cs:5308
static int GetInt(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5047
static string GetString(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:4900
static sbyte GetSByte(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:4942
static bool TryGetBytes(VRCPlayerApi player, string key, out byte[] value)
Definition: VRCSDK3.cs:4989
static long GetLong(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5089
static void SetFloat(string key, float value)
Definition: VRCSDK3.cs:5126
static void SetBytes(string key, byte[] value)
Definition: VRCSDK3.cs:4979
static bool TryGetFloat(VRCPlayerApi player, string key, out float value)
Definition: VRCSDK3.cs:5157
static bool TryGetUInt(VRCPlayerApi player, string key, out uint value)
Definition: VRCSDK3.cs:5073
static void SetString(string key, string value)
Definition: VRCSDK3.cs:4895
static void SetUInt(string key, uint value)
Definition: VRCSDK3.cs:5063
static bool TryGetInt(VRCPlayerApi player, string key, out int value)
Definition: VRCSDK3.cs:5052
static void SetVector3(string key, Vector3 value)
Definition: VRCSDK3.cs:5224
static bool TryGetVector4(VRCPlayerApi player, string key, out Vector4 value)
Definition: VRCSDK3.cs:5210
static Color GetColor(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5286
static bool TryGetBool(VRCPlayerApi player, string key, out bool value)
Definition: VRCSDK3.cs:4926
static bool TryGetQuaternion(VRCPlayerApi player, string key, out Quaternion value)
Definition: VRCSDK3.cs:5182
static void SetLong(string key, long value)
Definition: VRCSDK3.cs:5084
static IEnumerable< string > GetKeys(VRCPlayerApi player)
Definition: VRCSDK3.cs:5336
static void SetUShort(string key, ushort value)
Definition: VRCSDK3.cs:5021
static void SetShort(string key, short value)
Definition: VRCSDK3.cs:5000
static bool HasKey(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:4874
static bool TryGetUShort(VRCPlayerApi player, string key, out ushort value)
Definition: VRCSDK3.cs:5031
static void SetSByte(string key, sbyte value)
Definition: VRCSDK3.cs:4937
static uint GetUInt(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5068
static bool TryGetShort(VRCPlayerApi player, string key, out short value)
Definition: VRCSDK3.cs:5010
static ushort GetUShort(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:5026
static bool GetBool(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:4921
static bool TryGetVector3(VRCPlayerApi player, string key, out Vector3 value)
Definition: VRCSDK3.cs:5238
static bool TryGetColor(VRCPlayerApi player, string key, out Color value)
Definition: VRCSDK3.cs:5294
static bool IsType(VRCPlayerApi player, string key, Type t)
Definition: VRCSDK3.cs:4890
static void SetVector2(string key, Vector2 value)
Definition: VRCSDK3.cs:5252
static void SetVector4(string key, Vector4 value)
Definition: VRCSDK3.cs:5196
static byte GetByte(VRCPlayerApi player, string key)
Definition: VRCSDK3.cs:4963
static bool TryGetDouble(VRCPlayerApi player, string key, out double value)
Definition: VRCSDK3.cs:5146
bool TryGetData(float[] data, int layer=0)
Definition: VRCSDK3.cs:4701
bool TryGetData(Color32[] data, int layer=0)
Definition: VRCSDK3.cs:4706
bool TryGetData(Color[] data, int layer=0)
Definition: VRCSDK3.cs:4711
void HandleCallback(AsyncGPUReadbackRequest request)
Definition: VRCSDK3.cs:4686
bool TryGetData(byte[] data, int layer=0)
Definition: VRCSDK3.cs:4696
bool TryGetData< T >(T[] data, int layer=0)
Definition: VRCSDK3.cs:4716
static VRCAsyncGPUReadbackRequest Request(Texture src, int mipIndex, TextureFormat dstFormat, IUdonEventReceiver udonBehaviour)
Definition: VRCSDK3.cs:4620
static VRCAsyncGPUReadbackRequest Request(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, TextureFormat dstFormat, IUdonEventReceiver udonBehaviour)
Definition: VRCSDK3.cs:4647
static VRCAsyncGPUReadbackRequest Request(Texture src, int mipIndex, IUdonEventReceiver udonBehaviour)
Definition: VRCSDK3.cs:4607
static VRCAsyncGPUReadbackRequest Request(Texture src, int mipIndex, int x, int width, int y, int height, int z, int depth, IUdonEventReceiver udonBehaviour)
Definition: VRCSDK3.cs:4634
MaxBufferDownloadHandler(int max, byte[] buffer)
Definition: VRCSDK3.cs:2395
override bool ReceiveData(byte[] data, int dataLength)
Definition: VRCSDK3.cs:2410
override void ReceiveContentLengthHeader(ulong contentLength)
Definition: VRCSDK3.cs:2401
VRCStringDownload(VRCUrl url, IUdonEventReceiver udonbehavior)
Definition: VRCSDK3.cs:2591
UniTask StartAtCorrectTime(CancellationToken cancellationToken)
Definition: VRCSDK3.cs:2649
static void RemoveFromManager(IVRCStringDownload download)
Definition: VRCSDK3.cs:2779
static bool AddToManager(IVRCStringDownload download)
Definition: VRCSDK3.cs:2768
static void LoadUrl(VRCUrl url, IUdonEventReceiver udonBehaviour=null)
Definition: VRCSDK3.cs:2756
static Action< VRCUrl, IUdonEventReceiver > StartDownload
Definition: VRCSDK3.cs:2748
static void LoadUrlInternal(VRCUrl url, IUdonEventReceiver udonBehaviour)
Definition: VRCSDK3.cs:2762
static Func< VRCAVProVideoPlayer, IAVProVideoPlayerInternal > Initialize
Definition: VRCSDK3.cs:775
static Action< VRCAVProVideoScreen > Initialize
Definition: VRCSDK3.cs:913
static Action< VRCAVProVideoSpeaker > Initialize
Definition: VRCSDK3.cs:969
void OnVideoError(VideoError videoError)
Definition: VRCSDK3.cs:1107
static Action< BaseVRCVideoPlayer > InitializeBase
Definition: VRCSDK3.cs:1003
override void SetTime(float value)
Definition: VRCSDK3.cs:680
void OnStarted(VideoPlayer source)
Definition: VRCSDK3.cs:719
void OnPrepared(VideoPlayer source)
Definition: VRCSDK3.cs:691
override void LoadURL(VRCUrl url)
Definition: VRCSDK3.cs:598
override void PlayURL(VRCUrl url)
Definition: VRCSDK3.cs:616
void OnError(VideoPlayer source, string message)
Definition: VRCSDK3.cs:713
static Action< VRCUrl, int, Object, Action< string >, Action< VideoError > > StartResolveURLCoroutine
Definition: VRCSDK3.cs:486
void OnLoopPointReached(VideoPlayer source)
Definition: VRCSDK3.cs:730
Networking is a class that provides a set of static methods relating to the networking of UdonBehavio...
static bool IsOwner(VRCPlayerApi player, GameObject obj)
Tells you whether a Player is the Owner of a given GameObject, important for Sync.
static bool IsValid(object obj)
static void ShuffleArray(int[] array)
You can interact with Players in your world through the VRCPlayerApi. Each Player has a VRCPlayerApi ...
Definition: VRCSDKBase.cs:1297
bool isLocal
Tells you whether the given Player is the local one.
Definition: VRCSDKBase.cs:1398
Represents a URL that can be used to load at runtime. Cannot be constructed at runtime,...
Definition: VRCSDKBase.cs:9186
VRCImageDownloadError Error
Definition: VRCSDK3.cs:2803
IUdonEventReceiver UdonBehaviour
Definition: VRCSDK3.cs:2817
VRCImageDownloadState State
Definition: VRCSDK3.cs:2801
void OnVideoError(VideoError videoError)
Definition: VRCSDK3.cs:67
VideoError
An enum representing the different types of errors that can occur when trying to play a video.
Definition: VRCSDK3.cs:13115
delegate void MidiVoiceMessageDelegate(object sender, MidiVoiceEventArgs args)
VRCOrientation
the orientation of the player's device.
bool Equals(DataList other)
Definition: VRCSDK3.cs:7226
DataToken(sbyte number)
Definition: VRCSDK3.cs:6610
bool Equals(ulong other)
Definition: VRCSDK3.cs:7520
bool Equals(sbyte other)
Definition: VRCSDK3.cs:7322
bool Equals(DataDictionary other)
Definition: VRCSDK3.cs:7255
bool Equals(long other)
Definition: VRCSDK3.cs:7553
DataToken(string str)
Definition: VRCSDK3.cs:6680
bool Equals(bool other)
Definition: VRCSDK3.cs:7264
bool Equals(DataToken other)
Definition: VRCSDK3.cs:7136
DataToken(float number)
Definition: VRCSDK3.cs:6666
DataDictionary DataDictionary
Definition: VRCSDK3.cs:6515
DataToken(double number)
Definition: VRCSDK3.cs:6673
DataToken(uint number)
Definition: VRCSDK3.cs:6645
DataToken(SerializationInfo info, StreamingContext context)
Definition: VRCSDK3.cs:7763
bool Equals(ushort other)
Definition: VRCSDK3.cs:7421
DataToken(DataError error)
Definition: VRCSDK3.cs:6730
static bool operator==(in DataToken lhs, in DataToken rhs)
Definition: VRCSDK3.cs:7126
DataToken(short number)
Definition: VRCSDK3.cs:6624
override string ToString()
Definition: VRCSDK3.cs:6900
int CompareTo(DataToken other)
Definition: VRCSDK3.cs:7051
DataToken(byte number)
Definition: VRCSDK3.cs:6617
int CompareTo(object obj)
Definition: VRCSDK3.cs:7042
override bool Equals(object obj)
Definition: VRCSDK3.cs:7185
readonly DataToken Bitcast(TokenType targetType)
Definition: VRCSDK3.cs:7661
void GetObjectData(SerializationInfo info, StreamingContext context)
Definition: VRCSDK3.cs:7707
DataToken(object reference)
Definition: VRCSDK3.cs:6716
bool Equals(float other)
Definition: VRCSDK3.cs:7586
DataToken(Object reference)
Definition: VRCSDK3.cs:6723
DataToken(int number)
Definition: VRCSDK3.cs:6638
DataToken(ushort number)
Definition: VRCSDK3.cs:6631
DataToken(DataList list)
Definition: VRCSDK3.cs:6692
bool Equals(DataError other)
Definition: VRCSDK3.cs:7652
bool Equals(short other)
Definition: VRCSDK3.cs:7388
static bool operator!=(in DataToken lhs, in DataToken rhs)
Definition: VRCSDK3.cs:7131
bool Equals(byte other)
Definition: VRCSDK3.cs:7355
bool Equals(int other)
Definition: VRCSDK3.cs:7454
DataToken(ulong number)
Definition: VRCSDK3.cs:6659
DataToken(long number)
Definition: VRCSDK3.cs:6652
DataToken(DataDictionary obj)
Definition: VRCSDK3.cs:6704
bool Equals(string other)
Definition: VRCSDK3.cs:7293
bool Equals(uint other)
Definition: VRCSDK3.cs:7487
DataToken(DataError error, string errorMessage)
Definition: VRCSDK3.cs:6737
override int GetHashCode()
Definition: VRCSDK3.cs:6992
bool Equals(double other)
Definition: VRCSDK3.cs:7619
ImageLoadSettings SetResolutionLimit(Nullable< uint > resolutionLimit)
Definition: VRCSDK3.cs:2969
ImageLoadSettings(ImageLoadSettingsFlags flags, uint allocationLimit, uint resolutionLimit, uint targetWidth, uint targetHeight, ImageFormat outputFormatOverride)
Definition: VRCSDK3.cs:2930
ImageLoadSettings SetOutputFormatOverride(Nullable< ImageFormat > outputFormatOverride)
Definition: VRCSDK3.cs:3026
ImageLoadSettings SetResizeResolution(Nullable< ValueTuple< uint, uint > > targetResolution)
Definition: VRCSDK3.cs:2997
ImageLoadSettings SetAllocationLimit(Nullable< uint > allocationLimit)
Definition: VRCSDK3.cs:2952
Nullable< ValueTuple< uint, uint > > GetResizeResolution()
Definition: VRCSDK3.cs:2984
NativeSlice< byte >< outputSlice > Awaiter u__1
Definition: VRCSDK3.cs:3378
void SetStateMachine(IAsyncStateMachine stateMachine)
Definition: VRCSDK3.cs:4097
void SetStateMachine(IAsyncStateMachine stateMachine)
Definition: VRCSDK3.cs:4174
void SetStateMachine(IAsyncStateMachine stateMachine)
Definition: VRCSDK3.cs:3120
AsyncUniTaskVoidMethodBuilder t__builder
Definition: VRCSDK3.cs:3053
ControlChangeType ControlChangeType
Definition: VRCSDK3.cs:1700
Info(string key, State state)
Definition: VRCSDK3.cs:4785
void SetStateMachine(IAsyncStateMachine stateMachine)
Definition: VRCSDK3.cs:2517
AsyncUniTaskMethodBuilder t__builder
Definition: VRCSDK3.cs:2432