VRC SDK
This project aims to completely document the VRChat Unity SDK
Loading...
Searching...
No Matches
VRCSDKBase.cs
Go to the documentation of this file.
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Collections.Immutable;
5using System.ComponentModel;
6using System.Diagnostics;
7using System.IO;
8using System.Linq;
9using System.Reflection;
10using System.Runtime.CompilerServices;
11using System.Runtime.Serialization;
12using System.Runtime.Serialization.Formatters.Binary;
13using System.Runtime.Versioning;
14using System.Security;
15using System.Text;
16using System.Threading;
17using JetBrains.Annotations;
18using Unity.Collections;
19using Unity.Jobs;
20using Unity.Profiling;
21using UnityEngine;
22using UnityEngine.Animations;
23using UnityEngine.Networking;
24using UnityEngine.Rendering;
25using UnityEngine.SceneManagement;
26using UnityEngine.Serialization;
27using UnityEngine.UI;
28using UnityEngine.Video;
29using UnityEngine.XR;
38
39[assembly: CompilationRelaxations(8)]
40[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
41[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
42[assembly: PerformanceScanner(/*Could not decode attribute arguments.*/)]
43[assembly: PerformanceScanner(/*Could not decode attribute arguments.*/)]
44[assembly: PerformanceScanner(/*Could not decode attribute arguments.*/)]
45[assembly: PerformanceScanner(/*Could not decode attribute arguments.*/)]
46[assembly: PerformanceScanner(/*Could not decode attribute arguments.*/)]
47[assembly: PerformanceScanner(/*Could not decode attribute arguments.*/)]
48[assembly: PerformanceScanner(/*Could not decode attribute arguments.*/)]
49[assembly: PerformanceScanner(/*Could not decode attribute arguments.*/)]
50[assembly: PerformanceScanner(/*Could not decode attribute arguments.*/)]
51[assembly: PerformanceScanner(/*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("VRCSDKBase")]
55[assembly: AssemblyConfiguration("Release")]
56[assembly: AssemblyFileVersion("1.0.0.0")]
57[assembly: AssemblyInformationalVersion("1.0.0+77370df7b4055abf7cc0fb1da3c3d290108e9941")]
58[assembly: AssemblyProduct("VRCSDKBase")]
59[assembly: AssemblyTitle("VRCSDKBase")]
60[assembly: AssemblyVersion("1.0.0.0")]
61public class DPIDMipmapper : Object
62{
63 [CompilerGenerated]
64 private sealed class <>c__DisplayClass15_0 : Object
65 {
66 public Texture2D output;
67 }
68
69 [CompilerGenerated]
70 private sealed class <>c__DisplayClass15_1 : Object
71 {
72 public int mipCopy;
73
74 public <>c__DisplayClass15_0 CS$<>8__locals1;
75
76 internal void <ExecuteComputeShader>b__0(AsyncGPUReadbackRequest req)
77 {
78 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
79 if (((AsyncGPUReadbackRequest)(ref req)).hasError)
80 {
81 Debug.LogError((object)"GPU readback error detected.");
82 }
83 else if (((AsyncGPUReadbackRequest)(ref req)).done)
84 {
85 CS$<>8__locals1.output.SetPixelData<byte>(((AsyncGPUReadbackRequest)(ref req)).GetData<byte>(0), mipCopy, 0);
86 }
87 }
88 }
89
90 private static DPIDMipmapper _instance;
91
92 private ComputeShader computeShader;
93
94 private int kernelDownsampling;
95
96 private int kernelGuidance;
97
98 private const int THREADS = 64;
99
100 private static int TmpGuidanceProperty = Shader.PropertyToID("_TmpGuidance");
101
102 private static int OutputProperty = Shader.PropertyToID("_Output");
103
104 private static DPIDMipmapper Instance => _instance ?? (_instance = new DPIDMipmapper());
105
106 public static bool ComputeShaderReady => (Object)(object)Instance.computeShader != (Object)null;
107
109 {
110 if (Application.isBatchMode)
111 {
112 Debug.Log((object)"DPIDMipmapper is not supported in batch mode.");
113 return;
114 }
115 computeShader = Resources.Load<ComputeShader>("PerceptualMipmapping/PerceptualPostProcessor");
116 if (!((Object)(object)computeShader == (Object)null))
117 {
118 kernelGuidance = computeShader.FindKernel("KernelGuidance");
119 kernelDownsampling = computeShader.FindKernel("KernelDownsampling");
120 }
121 }
122
123 public static void GenerateDPIDMipmaps(Texture2D input, Texture2D output, bool alphaIsTransparency, bool sRGB, bool asyncOnGPU = false, bool inPlace = true, bool inputIsGuidance = false, bool conservative = false, uint minimumSize = 4u, bool normalMap = false)
124 {
125 Instance.ExecuteComputeShader(input, output, alphaIsTransparency, sRGB, asyncOnGPU, inPlace, inputIsGuidance, conservative, minimumSize, normalMap);
126 }
127
128 public static void GenerateDPIDMipmapsQuality(Texture2D input, Texture2D output, bool alphaIsTransparency, bool sRGB, bool conservative = false, bool normalMap = false)
129 {
130 bool inPlace = ((Texture)input).width == ((Texture)output).width && ((Texture)input).height == ((Texture)output).height;
131 Instance.ExecuteComputeShader(input, output, alphaIsTransparency, sRGB, asyncOnGPU: false, inPlace, inputIsGuidance: false, conservative, 4u, normalMap);
132 }
133
134 public static void GenerateDPIDMipmapsFast(Texture2D texture, bool alphaIsTransparency, bool sRGB, bool conservative = false, bool normalMap = false)
135 {
136 Instance.ExecuteComputeShader(texture, texture, alphaIsTransparency, sRGB, asyncOnGPU: true, inPlace: true, inputIsGuidance: true, conservative, 4u, normalMap);
137 }
138
139 private void ExecuteComputeShader(Texture2D input, Texture2D output, bool alphaIsTransparency, bool sRGB, bool asyncOnGPU = false, bool inPlace = true, bool inputIsGuidance = false, bool conservative = false, uint minimumSize = 4u, bool normalMap = false)
140 {
141 //IL_0039: Unknown result type (might be due to invalid IL or missing references)
142 //IL_003f: Invalid comparison between Unknown and I4
143 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
144 //IL_004d: Invalid comparison between Unknown and I4
145 //IL_007d: Unknown result type (might be due to invalid IL or missing references)
146 //IL_0083: Invalid comparison between Unknown and I4
147 //IL_0074: Unknown result type (might be due to invalid IL or missing references)
148 //IL_007a: Invalid comparison between Unknown and I4
149 //IL_0086: Unknown result type (might be due to invalid IL or missing references)
150 //IL_008d: Invalid comparison between Unknown and I4
151 //IL_0090: Unknown result type (might be due to invalid IL or missing references)
152 //IL_0097: Invalid comparison between Unknown and I4
153 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
154 //IL_00cf: Invalid comparison between Unknown and I4
155 //IL_009a: Unknown result type (might be due to invalid IL or missing references)
156 //IL_00a1: Invalid comparison between Unknown and I4
157 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
158 //IL_00d9: Invalid comparison between Unknown and I4
159 //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
160 //IL_00ab: Invalid comparison between Unknown and I4
161 //IL_0197: Unknown result type (might be due to invalid IL or missing references)
162 //IL_019d: Expected O, but got Unknown
163 //IL_0159: Unknown result type (might be due to invalid IL or missing references)
164 //IL_0163: Expected O, but got Unknown
165 //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
166 //IL_00e3: Invalid comparison between Unknown and I4
167 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
168 //IL_00b4: Invalid comparison between Unknown and I4
169 //IL_01c1: Unknown result type (might be due to invalid IL or missing references)
170 //IL_01de: Unknown result type (might be due to invalid IL or missing references)
171 //IL_00e6: Unknown result type (might be due to invalid IL or missing references)
172 //IL_00ed: Invalid comparison between Unknown and I4
173 //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
174 //IL_00be: Invalid comparison between Unknown and I4
175 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
176 //IL_00f7: Invalid comparison between Unknown and I4
177 //IL_029d: Unknown result type (might be due to invalid IL or missing references)
178 //IL_02a0: Unknown result type (might be due to invalid IL or missing references)
179 //IL_02a5: Unknown result type (might be due to invalid IL or missing references)
180 //IL_02a7: Unknown result type (might be due to invalid IL or missing references)
181 //IL_02aa: Unknown result type (might be due to invalid IL or missing references)
182 //IL_02f8: Expected I4, but got Unknown
183 //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
184 //IL_0101: Invalid comparison between Unknown and I4
185 //IL_0307: Unknown result type (might be due to invalid IL or missing references)
186 //IL_033d: Unknown result type (might be due to invalid IL or missing references)
187 //IL_036b: Unknown result type (might be due to invalid IL or missing references)
188 //IL_0335: Unknown result type (might be due to invalid IL or missing references)
189 //IL_0311: Unknown result type (might be due to invalid IL or missing references)
190 //IL_0323: Unknown result type (might be due to invalid IL or missing references)
191 //IL_0329: Unknown result type (might be due to invalid IL or missing references)
192 //IL_030c: Unknown result type (might be due to invalid IL or missing references)
193 //IL_0317: Unknown result type (might be due to invalid IL or missing references)
194 //IL_031d: Unknown result type (might be due to invalid IL or missing references)
195 //IL_0302: Unknown result type (might be due to invalid IL or missing references)
196 //IL_02f8: Unknown result type (might be due to invalid IL or missing references)
197 //IL_02fc: Invalid comparison between Unknown and I4
198 //IL_0104: Unknown result type (might be due to invalid IL or missing references)
199 //IL_010b: Invalid comparison between Unknown and I4
200 //IL_032f: Unknown result type (might be due to invalid IL or missing references)
201 //IL_010e: Unknown result type (might be due to invalid IL or missing references)
202 //IL_0115: Invalid comparison between Unknown and I4
203 //IL_0118: Unknown result type (might be due to invalid IL or missing references)
204 //IL_011f: Invalid comparison between Unknown and I4
205 //IL_0446: Unknown result type (might be due to invalid IL or missing references)
206 //IL_0478: Unknown result type (might be due to invalid IL or missing references)
207 //IL_057a: Unknown result type (might be due to invalid IL or missing references)
208 //IL_057c: Unknown result type (might be due to invalid IL or missing references)
209 //IL_0583: Expected O, but got Unknown
210 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
211 //IL_0129: Invalid comparison between Unknown and I4
212 //IL_04b2: Unknown result type (might be due to invalid IL or missing references)
213 //IL_0490: Unknown result type (might be due to invalid IL or missing references)
214 //IL_0495: Unknown result type (might be due to invalid IL or missing references)
215 //IL_012c: Unknown result type (might be due to invalid IL or missing references)
216 //IL_0132: Invalid comparison between Unknown and I4
217 //IL_04ee: Unknown result type (might be due to invalid IL or missing references)
218 //IL_0507: Unknown result type (might be due to invalid IL or missing references)
219 //IL_0135: Unknown result type (might be due to invalid IL or missing references)
220 //IL_013b: Invalid comparison between Unknown and I4
221 //IL_0538: Unknown result type (might be due to invalid IL or missing references)
222 //IL_0543: Unknown result type (might be due to invalid IL or missing references)
223 //IL_05f0: Unknown result type (might be due to invalid IL or missing references)
224 //IL_05f7: Unknown result type (might be due to invalid IL or missing references)
225 //IL_061e: Unknown result type (might be due to invalid IL or missing references)
226 <>c__DisplayClass15_0 <>c__DisplayClass15_ = new <>c__DisplayClass15_0();
227 <>c__DisplayClass15_.output = output;
228 if ((Object)(object)input == (Object)null || (Object)(object)<>c__DisplayClass15_.output == (Object)null)
229 {
230 Debug.LogError((object)"Input and output textures must be non-null, input: {input != null}, output: {output != null}");
231 }
232 else
233 {
234 if (asyncOnGPU && (int)<>c__DisplayClass15_.output.format != 4 && (int)<>c__DisplayClass15_.output.format != 5)
235 {
236 return;
237 }
238 if (Application.isBatchMode)
239 {
240 Debug.LogError((object)"DPIDMipmapper is not supported in batch mode.");
241 return;
242 }
243 if (inputIsGuidance && (alphaIsTransparency || sRGB))
244 {
245 inputIsGuidance = false;
246 }
247 if ((inputIsGuidance && (int)input.format == 3) || (int)input.format == 7 || (int)input.format == 13 || (int)input.format == 63 || (int)input.format == 9 || (int)input.format == 62 || (int)input.format == 2 || (int)input.format == 74)
248 {
249 inputIsGuidance = false;
250 }
251 if (sRGB && ((int)input.format == 9 || (int)input.format == 62 || (int)input.format == 19 || (int)input.format == 18 || (int)input.format == 15 || (int)input.format == 74 || (int)input.format == 20 || (int)input.format == 17 || (int)input.format == 63 || (int)input.format == 13 || (int)input.format == 7 || (int)input.format == 2))
252 {
253 sRGB = false;
254 }
255 if (normalMap)
256 {
257 alphaIsTransparency = false;
258 }
260 {
261 computeShader = (ComputeShader)Resources.Load("PerceptualMipmapping/PerceptualPostProcessor");
263 {
264 return;
265 }
266 kernelGuidance = computeShader.FindKernel("KernelGuidance");
267 kernelDownsampling = computeShader.FindKernel("KernelDownsampling");
268 }
269 CommandBuffer val = new CommandBuffer();
270 if (asyncOnGPU)
271 {
272 val.SetExecutionFlags((CommandBufferExecutionFlags)2);
273 }
274 int num = (inPlace ? 1 : 0);
275 val.SetComputeTextureParam(computeShader, kernelDownsampling, "_Input", RenderTargetIdentifier.op_Implicit((Texture)(object)input));
276 val.SetComputeTextureParam(computeShader, kernelGuidance, "_Input", RenderTargetIdentifier.op_Implicit((Texture)(object)input));
277 int width = ((Texture)input).width;
278 int height = ((Texture)input).height;
279 float num2 = (conservative ? 0.5f : 1f);
280 val.SetComputeIntParam(computeShader, "iWidth", width);
281 val.SetComputeIntParam(computeShader, "iHeight", height);
282 val.SetComputeFloatParam(computeShader, "lambda", num2);
283 val.SetComputeIntParam(computeShader, "premultiplyAlpha", alphaIsTransparency ? 1 : 0);
284 val.SetComputeIntParam(computeShader, "sRGB", sRGB ? 1 : 0);
285 val.SetComputeIntParam(computeShader, "normalMap", normalMap ? 1 : 0);
286 int width2 = ((Texture)<>c__DisplayClass15_.output).width;
287 int height2 = ((Texture)<>c__DisplayClass15_.output).height;
288 RenderTextureFormat val2 = (RenderTextureFormat)0;
289 TextureFormat format = input.format;
290 switch (format - 3)
291 {
292 default:
293 if ((int)format == 63)
294 {
295 val2 = (RenderTextureFormat)16;
296 }
297 break;
298 case 17:
299 val2 = (RenderTextureFormat)11;
300 break;
301 case 0:
302 case 1:
303 case 2:
304 case 4:
305 val2 = (RenderTextureFormat)0;
306 break;
307 case 14:
308 val2 = (RenderTextureFormat)2;
309 break;
310 case 10:
311 val2 = (RenderTextureFormat)5;
312 break;
313 case 15:
314 val2 = (RenderTextureFormat)14;
315 break;
316 case 16:
317 val2 = (RenderTextureFormat)12;
318 break;
319 case 12:
320 val2 = (RenderTextureFormat)15;
321 break;
322 case 13:
323 val2 = (RenderTextureFormat)13;
324 break;
325 case 6:
326 val2 = (RenderTextureFormat)28;
327 break;
328 case 3:
329 case 5:
330 case 7:
331 case 8:
332 case 9:
333 case 11:
334 break;
335 }
336 RenderTextureDescriptor val3 = default(RenderTextureDescriptor);
337 ((RenderTextureDescriptor)(ref val3))..ctor(width2, height2, val2, 0);
338 ((RenderTextureDescriptor)(ref val3)).sRGB = false;
339 ((RenderTextureDescriptor)(ref val3)).autoGenerateMips = false;
340 ((RenderTextureDescriptor)(ref val3)).enableRandomWrite = true;
341 ((RenderTextureDescriptor)(ref val3)).useMipMap = true;
342 val.GetTemporaryRT(OutputProperty, val3);
343 RenderTargetIdentifier val4 = default(RenderTargetIdentifier);
344 ((RenderTargetIdentifier)(ref val4))..ctor(OutputProperty);
345 RenderTargetIdentifier val5 = default(RenderTargetIdentifier);
346 ((RenderTargetIdentifier)(ref val5))..ctor((Texture)(object)input);
347 RenderTextureDescriptor val6 = default(RenderTextureDescriptor);
348 RenderTargetIdentifier val7 = default(RenderTargetIdentifier);
349 for (int i = num; i < ((Texture)<>c__DisplayClass15_.output).mipmapCount; i++)
350 {
351 int num3 = 1 << i;
352 int num4 = Math.Max(((Texture)<>c__DisplayClass15_.output).width / num3, 1);
353 int num5 = Math.Max(((Texture)<>c__DisplayClass15_.output).height / num3, 1);
354 if (asyncOnGPU && num4 <= minimumSize && num5 <= minimumSize)
355 {
356 break;
357 }
358 float num6 = (float)((Texture)input).width / (float)num4;
359 float num7 = (float)((Texture)input).height / (float)num5;
360 val.SetComputeIntParam(computeShader, "oWidth", num4);
361 val.SetComputeIntParam(computeShader, "oHeight", num5);
362 val.SetComputeFloatParam(computeShader, "pWidth", num6);
363 val.SetComputeFloatParam(computeShader, "pHeight", num7);
364 ((RenderTextureDescriptor)(ref val6))..ctor(num4, num5, val2, 0);
365 ((RenderTextureDescriptor)(ref val6)).sRGB = false;
366 ((RenderTextureDescriptor)(ref val6)).autoGenerateMips = false;
367 ((RenderTextureDescriptor)(ref val6)).enableRandomWrite = !inputIsGuidance;
368 ((RenderTextureDescriptor)(ref val6)).useMipMap = false;
369 val.GetTemporaryRT(TmpGuidanceProperty, val6);
370 ((RenderTargetIdentifier)(ref val7))..ctor(TmpGuidanceProperty);
371 if (inputIsGuidance)
372 {
373 val.CopyTexture(val5, 0, i, val7, 0, 0);
374 }
375 else
376 {
377 val.SetComputeTextureParam(computeShader, kernelGuidance, "_Output", val7);
378 val.DispatchCompute(computeShader, kernelGuidance, Math.Max(num4, 1), Math.Max(num5, 1), 1);
379 }
380 val.SetComputeTextureParam(computeShader, kernelDownsampling, "_Guidance", val7);
381 val.SetComputeTextureParam(computeShader, kernelDownsampling, "_Output", val4, i);
382 val.DispatchCompute(computeShader, kernelDownsampling, Math.Max(num4, 1), Math.Max(num5, 1), 1);
383 if (asyncOnGPU)
384 {
385 val.CopyTexture(val4, 0, i, RenderTargetIdentifier.op_Implicit((Texture)(object)<>c__DisplayClass15_.output), 0, i);
386 }
387 val.ReleaseTemporaryRT(TmpGuidanceProperty);
388 }
389 if (!asyncOnGPU)
390 {
391 RenderTexture val8 = new RenderTexture(val3);
392 for (int j = num; j < ((Texture)<>c__DisplayClass15_.output).mipmapCount; j++)
393 {
394 <>c__DisplayClass15_1 CS$<>8__locals0 = new <>c__DisplayClass15_1();
395 CS$<>8__locals0.CS$<>8__locals1 = <>c__DisplayClass15_;
396 int num8 = 1 << j;
397 int num9 = Math.Max(((Texture)CS$<>8__locals0.CS$<>8__locals1.output).width / num8, 1);
398 int num10 = Math.Max(((Texture)CS$<>8__locals0.CS$<>8__locals1.output).height / num8, 1);
399 if (asyncOnGPU && num9 <= minimumSize && num10 <= minimumSize)
400 {
401 break;
402 }
403 val.CopyTexture(val4, 0, j, RenderTargetIdentifier.op_Implicit((Texture)(object)val8), 0, j);
404 CS$<>8__locals0.mipCopy = j;
405 val.RequestAsyncReadback((Texture)(object)val8, j, ((Texture)CS$<>8__locals0.CS$<>8__locals1.output).graphicsFormat, (Action<AsyncGPUReadbackRequest>)delegate(AsyncGPUReadbackRequest req)
406 {
407 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
408 if (((AsyncGPUReadbackRequest)(ref req)).hasError)
409 {
410 Debug.LogError((object)"GPU readback error detected.");
411 }
412 else if (((AsyncGPUReadbackRequest)(ref req)).done)
413 {
414 CS$<>8__locals0.CS$<>8__locals1.output.SetPixelData<byte>(((AsyncGPUReadbackRequest)(ref req)).GetData<byte>(0), CS$<>8__locals0.mipCopy, 0);
415 }
416 });
417 }
418 val.WaitAllAsyncReadbackRequests();
419 val.ReleaseTemporaryRT(OutputProperty);
420 Graphics.ExecuteCommandBuffer(val);
421 val8.Release();
422 }
423 else
424 {
425 val.ReleaseTemporaryRT(OutputProperty);
426 Graphics.ExecuteCommandBufferAsync(val, (ComputeQueueType)1);
427 }
428 }
429 }
430}
431public enum ControllerHand : Enum
432{
433 None,
434 Left,
435 Right
436}
437public enum ControllerInputUI : Enum
438{
439 None,
440 Trigger,
441 Grip,
442 ButtonOne,
443 ButtonTwo,
444 Analog,
454 Count
455}
456public enum ControllerActionUI : Enum
457{
458 None,
459 Use,
460 Drop,
462 Move,
463 UIMenu,
464 UISelect,
465 Mic,
466 Scroll
467}
468public enum TutorialLabelType : Enum
469{
470 Unknown,
471 Pickup,
475 Popup,
477 UI
478}
479public enum AttachMode : Enum
480{
483}
484namespace VRC
485{
486 public enum FileSizeUnit : Enum
487 {
488 Bytes,
489 KiloBytes,
490 MegaBytes,
491 GigaBytes,
492 TeraBytes
493 }
494 public static class FileSizeUnitExtensions : Object
495 {
496 private const string UnitPostfixB = "B";
497
498 private const string UnitPostfixKB = "KB";
499
500 private const string UnitPostfixMB = "MB";
501
502 private const string UnitPostfixGB = "GB";
503
504 private const string UnitPostfixTB = "TB";
505
506 [PublicAPI]
507 public const ulong KBInBytes = 1024uL;
508
509 [PublicAPI]
510 public const ulong MBInBytes = 1048576uL;
511
512 [PublicAPI]
513 public const ulong GBInBytes = 1073741824uL;
514
515 [PublicAPI]
516 public const ulong TBInBytes = 1099511627776uL;
517
518 public static bool TryParse(string unitText, out FileSizeUnit unitLiteral)
519 {
520 if (!String.IsNullOrEmpty(unitText))
521 {
522 string text = unitText.ToUpperInvariant();
523 if (text == "B")
524 {
525 unitLiteral = FileSizeUnit.Bytes;
526 return true;
527 }
528 if (text == "KB")
529 {
530 unitLiteral = FileSizeUnit.KiloBytes;
531 return true;
532 }
533 if (text == "MB")
534 {
535 unitLiteral = FileSizeUnit.MegaBytes;
536 return true;
537 }
538 if (text == "GB")
539 {
540 unitLiteral = FileSizeUnit.GigaBytes;
541 return true;
542 }
543 if (text == "TB")
544 {
545 unitLiteral = FileSizeUnit.TeraBytes;
546 return true;
547 }
548 }
549 unitLiteral = FileSizeUnit.Bytes;
550 return false;
551 }
552
553 public static ulong GetUnitSize(this FileSizeUnit unit)
554 {
555 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
556 return unit switch
557 {
558 FileSizeUnit.Bytes => 1uL,
559 FileSizeUnit.KiloBytes => 1024uL,
560 FileSizeUnit.MegaBytes => 1048576uL,
561 FileSizeUnit.GigaBytes => 1073741824uL,
562 FileSizeUnit.TeraBytes => 1099511627776uL,
563 _ => throw new NotImplementedException(String.Format("Could not find size for unknown unit {0}", (object)unit)),
564 };
565 }
566
567 public static string GetPostfix(this FileSizeUnit unit)
568 {
569 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
570 return unit switch
571 {
572 FileSizeUnit.Bytes => "B",
573 FileSizeUnit.KiloBytes => "KB",
574 FileSizeUnit.MegaBytes => "MB",
575 FileSizeUnit.GigaBytes => "GB",
576 FileSizeUnit.TeraBytes => "TB",
577 _ => throw new NotImplementedException(String.Format("Could not convert unknown unit {0}", (object)unit)),
578 };
579 }
580 }
581 public enum ContentType : Enum
582 {
583 World,
584 Avatar
585 }
586 public static class ValidationHelpers : Object
587 {
588 private const int BYTES_TO_MB = 1048576;
589
591
593
594 private const int CONTENT_AVATAR_ASSET_BUNDLE_SIZE_LIMIT_PC = 209715200;
595
597
598 private const int CONTENT_WORLD_ASSET_BUNDLE_SIZE_LIMIT_MOBILE = 104857600;
599
601
603
605
606 [PublicAPI]
607 public static int GetAssetBundleSizeLimit(ContentType contentType, bool mobilePlatform, bool compressed = true)
608 {
609 if (mobilePlatform)
610 {
611 if (compressed)
612 {
613 switch (contentType)
614 {
615 case ContentType.World:
616 return 104857600;
617 case ContentType.Avatar:
618 return 10485760;
619 }
620 }
621 else
622 {
623 switch (contentType)
624 {
625 case ContentType.World:
626 return -1;
627 case ContentType.Avatar:
628 return 41943040;
629 }
630 }
631 }
632 else if (compressed)
633 {
634 switch (contentType)
635 {
636 case ContentType.World:
637 return -1;
638 case ContentType.Avatar:
639 return 209715200;
640 }
641 }
642 else
643 {
644 switch (contentType)
645 {
646 case ContentType.World:
647 return -1;
648 case ContentType.Avatar:
649 return 524288000;
650 }
651 }
652 return -1;
653 }
654
655 [PublicAPI]
656 public static string GetAssetBundleOverSizeLimitMessage(ContentType contentType, bool mobilePlatform, bool compressed = true)
657 {
658 return GetAssetBundleOverSizeLimitMessage(contentType, -1, mobilePlatform, compressed);
659 }
660
661 [PublicAPI]
662 public static string GetAssetBundleOverSizeLimitMessage(ContentType contentType, int contentSize, bool mobilePlatform, bool compressed = true)
663 {
664 string text = (compressed ? "download size" : "uncompressed size");
665 return String.Format("{0} {1} is too large for VRChat to load on this platform. The maximum {2} is {3}. {4}", (object[])(object)new Object[5]
666 {
667 (object)contentType,
668 (Object)text,
669 (Object)text,
670 (Object)FormatFileSize(GetAssetBundleSizeLimit(contentType, mobilePlatform, compressed)),
671 (Object)((contentSize > 0) ? String.Concat("Current ", text, ": ", FormatFileSize(contentSize)) : "")
672 });
673 }
674
675 [PublicAPI]
676 public static string GetAssetBundleOverSizeLimitMessageSDKWarning(ContentType contentType, int contentSize, bool mobilePlatform, bool compressed = true)
677 {
678 string text = (compressed ? "download size" : "uncompressed size");
679 return String.Concat((string[])(object)new String[10]
680 {
681 "The most recent ",
682 ((Object)contentType).ToString().ToLower(),
683 " build's ",
684 text,
685 " was too large for VRChat to load on this platform. Please reduce the number or size of assets in the scene. The maximum ",
686 text,
687 " is ",
688 FormatFileSize(GetAssetBundleSizeLimit(contentType, mobilePlatform, compressed)),
689 ". ",
690 (contentSize > 0) ? String.Concat("Current ", text, ": ", FormatFileSize(contentSize)) : ""
691 });
692 }
693
694 [PublicAPI]
695 public static string FormatFileSize(long filesize, bool includeUnitPostfix = true, int precision = -1, string requiredUnit = null)
696 {
697 if (filesize < 0)
698 {
699 return String.Empty;
700 }
701 FileSizeUnit unitLiteral;
702 FileSizeUnit fileSizeUnit = (FileSizeUnitExtensions.TryParse(requiredUnit, out unitLiteral) ? unitLiteral : (((ulong)filesize > FileSizeUnit.TeraBytes.GetUnitSize()) ? FileSizeUnit.TeraBytes : (((ulong)filesize > FileSizeUnit.GigaBytes.GetUnitSize()) ? FileSizeUnit.GigaBytes : (((ulong)filesize > FileSizeUnit.MegaBytes.GetUnitSize()) ? FileSizeUnit.MegaBytes : (((ulong)filesize > FileSizeUnit.KiloBytes.GetUnitSize()) ? FileSizeUnit.KiloBytes : FileSizeUnit.Bytes)))));
703 ulong unitSize = fileSizeUnit.GetUnitSize();
704 string text = ((precision < 0) ? ((fileSizeUnit == FileSizeUnit.Bytes) ? "F0" : "F2") : String.Format("F{0}", (object)precision));
705 float num = (float)filesize / (float)unitSize;
706 string text2 = ((Single)(ref num)).ToString(text);
707 if (includeUnitPostfix)
708 {
709 string postfix = fileSizeUnit.GetPostfix();
710 return String.Concat(text2, " ", postfix);
711 }
712 return text2;
713 }
714 }
715}
716namespace VRC.SDK3
717{
718 public class VRCTestMarker : MonoBehaviour
719 {
720 }
721}
723{
725 {
726 [CompilerGenerated]
727 private sealed class <>c__DisplayClass0_0 : Object
728 {
729 public AvatarPerformance.IgnoreDelegate shouldIgnoreComponent;
730
731 internal bool <RunPerformanceScanEnumerator>b__0(IConstraint c)
732 {
733 return shouldIgnoreComponent((Component)(object)((c is Component) ? c : null));
734 }
735
736 internal bool <RunPerformanceScanEnumerator>b__1(IVRCConstraint c)
737 {
738 return shouldIgnoreComponent((Component)((c is Component) ? c : null));
739 }
740 }
741
742 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
743 public override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
744 {
745 <>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0
746 {
747 shouldIgnoreComponent = shouldIgnoreComponent
748 };
749 List<IConstraint> engineConstraintBuffer = new List<IConstraint>();
750 yield return ScanAvatarForComponentsOfType<IConstraint>(avatarObject, engineConstraintBuffer);
751 if (CS$<>8__locals0.shouldIgnoreComponent != null)
752 {
753 engineConstraintBuffer.RemoveAll((Predicate<IConstraint>)((IConstraint c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(object)((c is Component) ? c : null))));
754 }
755 List<IVRCConstraint> vrcConstraintBuffer = new List<IVRCConstraint>();
756 yield return ScanAvatarForComponentsOfType<IVRCConstraint>(avatarObject, vrcConstraintBuffer);
757 if (CS$<>8__locals0.shouldIgnoreComponent != null)
758 {
759 vrcConstraintBuffer.RemoveAll((Predicate<IVRCConstraint>)((IVRCConstraint c) => CS$<>8__locals0.shouldIgnoreComponent((Component)((c is Component) ? c : null))));
760 }
761 int count = engineConstraintBuffer.Count;
762 int count2 = vrcConstraintBuffer.Count;
763 int num = count + count2;
764 perfStats.constraintsCount = new Nullable<int>(num);
765 int num2 = 0;
766 if (num > 0)
767 {
768 num2 = GetGroupDepth(vrcConstraintBuffer, out var vrcCachedConstraintsCount);
769 int num3 = count2 - vrcCachedConstraintsCount;
770 num3 += count;
771 if (num3 > 0)
772 {
773 num2 += num3;
774 }
775 }
776 perfStats.constraintDepth = new Nullable<int>(num2);
777 }
778
779 private int GetGroupDepth(List<IVRCConstraint> vrcConstraints, out int vrcCachedConstraintsCount)
780 {
781 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
782 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
783 int num = 0;
784 vrcCachedConstraintsCount = 0;
785 Enumerator<IVRCConstraint> enumerator = vrcConstraints.GetEnumerator();
786 try
787 {
788 while (enumerator.MoveNext())
789 {
790 int latestValidExecutionGroupIndex = enumerator.Current.LatestValidExecutionGroupIndex;
791 if (latestValidExecutionGroupIndex >= 0)
792 {
793 vrcCachedConstraintsCount++;
794 if (latestValidExecutionGroupIndex >= num)
795 {
796 num = latestValidExecutionGroupIndex + 1;
797 }
798 }
799 }
800 return num;
801 }
802 finally
803 {
804 ((IDisposable)enumerator).Dispose();
805 }
806 }
807 }
808}
809namespace VRC.SDK3.Image
810{
811 public enum ImageLoadError : Enum
812 {
813 None,
814 Unknown,
815 AccessDenied,
816 InvalidUrl
817 }
818 public class ImageDownloader : Object
819 {
820 [CompilerGenerated]
821 private sealed class <>c__DisplayClass11_0 : Object
822 {
823 public ImageDownloader <>4__this;
824
825 public string cacheRef;
826
827 public bool isRetry;
828
829 public string imageUrl;
830
831 public int imageSize;
832
833 public Action<Texture2D> onImageDownload;
834
835 public Action<ImageLoadError> onImageDownloadFailed;
836
837 public string fallbackImageUrl;
838
839 public UnityWebRequest imageRequest;
840
841 public string finalUrl;
842
843 internal void <DownloadImageInternal>b__0(AsyncOperation _)
844 {
845 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
846 //IL_000c: Invalid comparison between Unknown and I4
847 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
848 //IL_001a: Invalid comparison between Unknown and I4
849 //IL_0115: Unknown result type (might be due to invalid IL or missing references)
850 //IL_011b: Unknown result type (might be due to invalid IL or missing references)
851 //IL_0121: Expected O, but got Unknown
852 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
853 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
854 //IL_0129: Unknown result type (might be due to invalid IL or missing references)
855 //IL_01ab: Unknown result type (might be due to invalid IL or missing references)
856 //IL_01b0: Unknown result type (might be due to invalid IL or missing references)
857 if ((int)imageRequest.result == 2 || (int)imageRequest.result == 3)
858 {
859 <>4__this._downloadingImages.Remove(cacheRef);
860 if (!isRetry)
861 {
862 <>4__this.DownloadImageInternal(imageUrl, imageSize, onImageDownload, onImageDownloadFailed, fallbackImageUrl, isRetry: true);
863 return;
864 }
865 Debug.LogWarning((object)String.Concat("An error occurred downloading an image: ", imageRequest.error));
866 onImageDownloadFailed?.Invoke(ImageLoadError.Unknown);
867 <>4__this.DownloadFallbackOrUseErrorImage(fallbackImageUrl, onImageDownload);
868 return;
869 }
870 Texture2D content = DownloadHandlerTexture.GetContent(imageRequest);
871 if ((Object)(object)content == (Object)null || ((Texture)content).GetNativeTexturePtr() == IntPtr.Zero)
872 {
873 Debug.LogError((object)"An error occurred downloading an image: Data was null");
874 onImageDownloadFailed?.Invoke(ImageLoadError.Unknown);
875 <>4__this.DownloadFallbackOrUseErrorImage(fallbackImageUrl, onImageDownload);
876 return;
877 }
878 Texture2D val = new Texture2D(((Texture)content).width, ((Texture)content).height, content.format, true);
879 NativeArray<byte> rawTextureData = content.GetRawTextureData<byte>();
880 val.SetPixelData<byte>(rawTextureData, 0, 0);
881 val.Apply(true, true);
882 ((Texture)val).wrapMode = (TextureWrapMode)1;
883 ((Object)val).name = String.Concat("ImageFrom:", finalUrl);
884 DPIDMipmapper.GenerateDPIDMipmapsFast(val, alphaIsTransparency: true, sRGB: true);
885 imageRequest.Dispose();
886 Object.Destroy((Object)(object)content);
887 <>4__this.CacheTexture(cacheRef, val);
888 onImageDownload?.Invoke(val);
889 Enumerator<Action<Texture2D>> enumerator = <>4__this._downloadingImages[cacheRef].GetEnumerator();
890 try
891 {
892 while (enumerator.MoveNext())
893 {
894 enumerator.Current?.Invoke(val);
895 }
896 }
897 finally
898 {
899 ((IDisposable)enumerator).Dispose();
900 }
901 <>4__this._downloadingImages.Remove(cacheRef);
902 }
903 }
904
905 private static ImageDownloader _instance;
906
907 private const int MAX_CACHED_IMAGES = 200;
908
909 private const int MIN_CACHED_IMAGES = 100;
910
911 private readonly List<string> cachedImageQueue = new List<string>();
912
913 private readonly Dictionary<string, Texture2D> _downloadedImages = new Dictionary<string, Texture2D>();
914
915 private readonly Dictionary<string, List<Action<Texture2D>>> _downloadingImages = new Dictionary<string, List<Action<Texture2D>>>();
916
918 {
919 get
920 {
921 if (_instance != null)
922 {
923 return _instance;
924 }
925 _instance = new ImageDownloader();
926 return _instance;
927 }
928 }
929
930 [PublicAPI]
931 public static void TrimCache(int size)
932 {
934 }
935
936 [PublicAPI]
937 public static void DownloadImage(string imageUrl, int imageSize, Action<Texture2D> onImageDownload = null, Action<ImageLoadError> onImageDownloadFailed = null, string fallbackImageUrl = "", bool isRetry = false)
938 {
939 Instance.DownloadImageInternal(imageUrl, imageSize, onImageDownload, onImageDownloadFailed, fallbackImageUrl, isRetry);
940 }
941
942 private void TrimCacheInternal(int size)
943 {
944 if (size == 0)
945 {
946 _downloadedImages.Clear();
947 cachedImageQueue.Clear();
948 Resources.UnloadUnusedAssets();
949 return;
950 }
951 int num = cachedImageQueue.Count - size;
952 if (num > 0)
953 {
954 for (int i = 0; i < num; i++)
955 {
956 _downloadedImages.Remove(cachedImageQueue[i]);
957 }
958 cachedImageQueue.RemoveRange(0, num);
959 Resources.UnloadUnusedAssets();
960 }
961 }
962
963 private void DownloadImageInternal(string imageUrl, int imageSize, Action<Texture2D> onImageDownload, Action<ImageLoadError> onImageDownloadFailed, string fallbackImageUrl = "", bool isRetry = false)
964 {
965 //IL_0132: Expected O, but got Unknown
966 <>c__DisplayClass11_0 CS$<>8__locals0 = new <>c__DisplayClass11_0();
967 CS$<>8__locals0.<>4__this = this;
968 CS$<>8__locals0.isRetry = isRetry;
969 CS$<>8__locals0.imageUrl = imageUrl;
970 CS$<>8__locals0.imageSize = imageSize;
971 CS$<>8__locals0.onImageDownload = onImageDownload;
972 CS$<>8__locals0.onImageDownloadFailed = onImageDownloadFailed;
973 CS$<>8__locals0.fallbackImageUrl = fallbackImageUrl;
974 if (String.IsNullOrEmpty(CS$<>8__locals0.imageUrl))
975 {
976 return;
977 }
978 CS$<>8__locals0.cacheRef = String.Format("{0}:{1}", (object)CS$<>8__locals0.imageUrl, (object)CS$<>8__locals0.imageSize);
979 if (_downloadedImages.ContainsKey(CS$<>8__locals0.cacheRef))
980 {
981 CS$<>8__locals0.onImageDownload?.Invoke(_downloadedImages[CS$<>8__locals0.cacheRef]);
982 return;
983 }
984 if (_downloadingImages.ContainsKey(CS$<>8__locals0.cacheRef))
985 {
986 _downloadingImages[CS$<>8__locals0.cacheRef].Add(CS$<>8__locals0.onImageDownload);
987 return;
988 }
989 try
990 {
991 CS$<>8__locals0.finalUrl = CS$<>8__locals0.imageUrl;
992 _downloadingImages[CS$<>8__locals0.cacheRef] = new List<Action<Texture2D>>();
993 CS$<>8__locals0.imageRequest = UnityWebRequestTexture.GetTexture(CS$<>8__locals0.finalUrl, false);
994 UnityWebRequest.ClearCookieCache(CS$<>8__locals0.imageRequest.uri);
995 ((AsyncOperation)CS$<>8__locals0.imageRequest.SendWebRequest()).completed += delegate
996 {
997 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
998 //IL_000c: Invalid comparison between Unknown and I4
999 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
1000 //IL_001a: Invalid comparison between Unknown and I4
1001 //IL_0115: Unknown result type (might be due to invalid IL or missing references)
1002 //IL_011b: Unknown result type (might be due to invalid IL or missing references)
1003 //IL_0121: Expected O, but got Unknown
1004 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
1005 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
1006 //IL_0129: Unknown result type (might be due to invalid IL or missing references)
1007 //IL_01ab: Unknown result type (might be due to invalid IL or missing references)
1008 //IL_01b0: Unknown result type (might be due to invalid IL or missing references)
1009 if ((int)CS$<>8__locals0.imageRequest.result == 2 || (int)CS$<>8__locals0.imageRequest.result == 3)
1010 {
1011 CS$<>8__locals0.<>4__this._downloadingImages.Remove(CS$<>8__locals0.cacheRef);
1012 if (!CS$<>8__locals0.isRetry)
1013 {
1014 CS$<>8__locals0.<>4__this.DownloadImageInternal(CS$<>8__locals0.imageUrl, CS$<>8__locals0.imageSize, CS$<>8__locals0.onImageDownload, CS$<>8__locals0.onImageDownloadFailed, CS$<>8__locals0.fallbackImageUrl, isRetry: true);
1015 }
1016 else
1017 {
1018 Debug.LogWarning((object)String.Concat("An error occurred downloading an image: ", CS$<>8__locals0.imageRequest.error));
1019 CS$<>8__locals0.onImageDownloadFailed?.Invoke(ImageLoadError.Unknown);
1020 CS$<>8__locals0.<>4__this.DownloadFallbackOrUseErrorImage(CS$<>8__locals0.fallbackImageUrl, CS$<>8__locals0.onImageDownload);
1021 }
1022 }
1023 else
1024 {
1025 Texture2D content = DownloadHandlerTexture.GetContent(CS$<>8__locals0.imageRequest);
1026 if ((Object)(object)content == (Object)null || ((Texture)content).GetNativeTexturePtr() == IntPtr.Zero)
1027 {
1028 Debug.LogError((object)"An error occurred downloading an image: Data was null");
1029 CS$<>8__locals0.onImageDownloadFailed?.Invoke(ImageLoadError.Unknown);
1030 CS$<>8__locals0.<>4__this.DownloadFallbackOrUseErrorImage(CS$<>8__locals0.fallbackImageUrl, CS$<>8__locals0.onImageDownload);
1031 }
1032 else
1033 {
1034 Texture2D val3 = new Texture2D(((Texture)content).width, ((Texture)content).height, content.format, true);
1035 NativeArray<byte> rawTextureData = content.GetRawTextureData<byte>();
1036 val3.SetPixelData<byte>(rawTextureData, 0, 0);
1037 val3.Apply(true, true);
1038 ((Texture)val3).wrapMode = (TextureWrapMode)1;
1039 ((Object)val3).name = String.Concat("ImageFrom:", CS$<>8__locals0.finalUrl);
1040 DPIDMipmapper.GenerateDPIDMipmapsFast(val3, alphaIsTransparency: true, sRGB: true);
1041 CS$<>8__locals0.imageRequest.Dispose();
1042 Object.Destroy((Object)(object)content);
1043 CS$<>8__locals0.<>4__this.CacheTexture(CS$<>8__locals0.cacheRef, val3);
1044 CS$<>8__locals0.onImageDownload?.Invoke(val3);
1045 Enumerator<Action<Texture2D>> enumerator = CS$<>8__locals0.<>4__this._downloadingImages[CS$<>8__locals0.cacheRef].GetEnumerator();
1046 try
1047 {
1048 while (enumerator.MoveNext())
1049 {
1050 enumerator.Current?.Invoke(val3);
1051 }
1052 }
1053 finally
1054 {
1055 ((IDisposable)enumerator).Dispose();
1056 }
1057 CS$<>8__locals0.<>4__this._downloadingImages.Remove(CS$<>8__locals0.cacheRef);
1058 }
1059 }
1060 };
1061 }
1062 catch (Exception val)
1063 {
1064 Exception val2 = val;
1065 Debug.Log((object)String.Concat("Could not download image ", CS$<>8__locals0.imageUrl, " - ", val2.Message));
1066 CS$<>8__locals0.onImageDownloadFailed?.Invoke(ImageLoadError.Unknown);
1067 DownloadFallbackOrUseErrorImage(CS$<>8__locals0.fallbackImageUrl, CS$<>8__locals0.onImageDownload);
1068 }
1069 }
1070
1071 private void CacheTexture(string cacheRef, Texture2D tex)
1072 {
1073 if (cachedImageQueue.Contains(cacheRef))
1074 {
1075 cachedImageQueue.Remove(cacheRef);
1076 cachedImageQueue.Add(cacheRef);
1077 return;
1078 }
1079 _downloadedImages[cacheRef] = tex;
1080 cachedImageQueue.Add(cacheRef);
1081 if (cachedImageQueue.Count > 200)
1082 {
1083 TrimCache(100);
1084 }
1085 }
1086
1087 private void DownloadFallbackOrUseErrorImage(string fallbackImageUrl, Action<Texture2D> onImageDownload)
1088 {
1089 if (String.IsNullOrEmpty(fallbackImageUrl))
1090 {
1091 Object obj = Resources.Load("no_image", typeof(Texture2D));
1092 Texture2D val = (Texture2D)(object)((obj is Texture2D) ? obj : null);
1093 onImageDownload.Invoke(val);
1094 }
1095 else
1096 {
1097 DownloadImageInternal(fallbackImageUrl, 0, onImageDownload, null);
1098 }
1099 }
1100 }
1101}
1103{
1104 public struct DisposableJobHandle : ValueType, IDisposable, IEquatable<DisposableJobHandle>
1105 {
1106 private JobHandle _jobHandle;
1107
1108 private static readonly List<DisposableJobHandle> _knownDisposableJobHandles = new List<DisposableJobHandle>(32);
1109
1110 [PublicAPI]
1111 public bool IsCompleted => ((JobHandle)(ref _jobHandle)).IsCompleted;
1112
1113 [PublicAPI]
1114 public DisposableJobHandle(JobHandle jobHandle)
1115 {
1116 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
1117 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
1118 _jobHandle = jobHandle;
1120 _knownDisposableJobHandles.Add(this);
1121 }
1122
1123 [PublicAPI]
1124 public static IList<DisposableJobHandle> GetIncompleteDisposableJobs()
1125 {
1127 return (IList<DisposableJobHandle>)(object)_knownDisposableJobHandles;
1128 }
1129
1130 private static void CullCompleteJobs()
1131 {
1132 for (int num = _knownDisposableJobHandles.Count - 1; num >= 0; num--)
1133 {
1134 if (_knownDisposableJobHandles[num].IsCompleted)
1135 {
1136 _knownDisposableJobHandles.RemoveAt(num);
1137 }
1138 }
1139 }
1140
1141 [PublicAPI]
1142 public void Complete()
1143 {
1144 ((JobHandle)(ref _jobHandle)).Complete();
1145 }
1146
1147 [PublicAPI]
1148 public void Dispose()
1149 {
1150 if (!IsCompleted)
1151 {
1152 Complete();
1153 }
1154 }
1155
1156 public bool Equals(DisposableJobHandle other)
1157 {
1158 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
1159 return ((JobHandle)(ref _jobHandle)).Equals(other._jobHandle);
1160 }
1161
1162 public override bool Equals(object obj)
1163 {
1164 if (obj is DisposableJobHandle other)
1165 {
1166 return Equals(other);
1167 }
1168 return false;
1169 }
1170
1172 {
1173 return a.Equals(b);
1174 }
1175
1177 {
1178 return !(a == b);
1179 }
1180
1181 public static implicit operator JobHandle(DisposableJobHandle disposableJobHandle)
1182 {
1183 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
1184 return disposableJobHandle._jobHandle;
1185 }
1186
1187 public override int GetHashCode()
1188 {
1189 return ((Object)(JobHandle)(ref _jobHandle)).GetHashCode();
1190 }
1191 }
1192}
1193namespace VRC.SDKBase
1194{
1195 [ExecuteInEditMode]
1196 [RequireComponent(/*Could not decode attribute arguments.*/)]
1197 [DisallowMultipleComponent]
1198 public abstract class VRC_SpatialAudioSource : MonoBehaviour
1199 {
1201
1202 [Tooltip("Loudness increase in decibels, can be negative.")]
1203 public float Gain = 10f;
1204
1205 [Tooltip("Distance where loudness falls off to zero, in meters.")]
1206 public float Far = 40f;
1207
1208 [Tooltip("Distance where loudness begins to falloff, in meters. Default of 0 ensures accurate spatialization.")]
1209 public float Near;
1210
1211 [Tooltip("Radius in meters of a spherical shaped sound source. Default of 0 simulates a point-source (recommended).")]
1212 public float VolumetricRadius;
1213
1214 [Tooltip("Enable Spatialization. Uncheck only for directionless audio.")]
1215 public bool EnableSpatialization = true;
1216
1217 [Tooltip("Use the AudioSource '3D Sound Settings' volume curve. If unchecked, use Inverse Square falloff.")]
1219
1221
1222 private AudioSource _source;
1223
1224 private void Awake()
1225 {
1226 _source = ((Component)this).GetComponent<AudioSource>();
1227 if ((Object)(object)_source == (Object)null)
1228 {
1229 Debug.LogErrorFormat("[{0}:VRC_SpatialAudioSource without an AudioSource component!", (object[])(object)new Object[1] { (Object)((Object)((Component)this).gameObject).name });
1230 }
1231 else if (Initialize != null)
1232 {
1233 Initialize(this);
1235 {
1236 _source.spatialize = false;
1237 }
1238 }
1239 }
1240
1242 {
1243 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
1244 //IL_0050: Unknown result type (might be due to invalid IL or missing references)
1245 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
1246 //IL_0078: Unknown result type (might be due to invalid IL or missing references)
1247 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
1248 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
1249 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
1250 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
1251 //IL_0130: Unknown result type (might be due to invalid IL or missing references)
1252 //IL_013c: Unknown result type (might be due to invalid IL or missing references)
1253 //IL_0158: Unknown result type (might be due to invalid IL or missing references)
1254 //IL_0164: Unknown result type (might be due to invalid IL or missing references)
1256 {
1257 Color color = default(Color);
1258 color.r = 1f;
1259 color.g = 0.5f;
1260 color.b = 0f;
1261 color.a = 1f;
1262 Gizmos.color = color;
1263 Gizmos.DrawWireSphere(((Component)this).transform.position, Near);
1264 color.a = 0.1f;
1265 Gizmos.color = color;
1266 Gizmos.DrawSphere(((Component)this).transform.position, Near);
1267 color.r = 1f;
1268 color.g = 0f;
1269 color.b = 0f;
1270 color.a = 1f;
1271 Gizmos.color = Color.red;
1272 Gizmos.DrawWireSphere(((Component)this).transform.position, Far);
1273 color.a = 0.1f;
1274 Gizmos.color = color;
1275 Gizmos.DrawSphere(((Component)this).transform.position, Far);
1276 color.r = 1f;
1277 color.g = 0f;
1278 color.b = 1f;
1279 color.a = 1f;
1280 Gizmos.color = color;
1281 Gizmos.DrawWireSphere(((Component)this).transform.position, VolumetricRadius);
1282 color.a = 0.1f;
1283 Gizmos.color = color;
1284 Gizmos.DrawSphere(((Component)this).transform.position, VolumetricRadius);
1285 }
1286 }
1287 }
1296 public class VRCPlayerApi : Object, IValidChecker
1297 {
1298 public delegate void SetAnimatorBoolDelegate(VRCPlayerApi player, string name, bool value);
1299
1300 public delegate void ClaimNetworkControlDelegate(VRCPlayerApi player, VRC_ObjectApi obj);
1301
1302 public delegate Ray GetLookRayDelegate(VRCPlayerApi player);
1303
1304 public delegate bool BoolDelegate(VRCPlayerApi player);
1305
1311 public enum TrackingDataType : Enum
1312 {
1318 Head,
1324 LeftHand,
1330 RightHand,
1337 Origin,
1346 AvatarRoot
1347 }
1348
1354 public struct TrackingData : ValueType
1355 {
1361 public Vector3 position;
1362
1368 public Quaternion rotation;
1369
1370 public TrackingData(Vector3 pos, Quaternion rot)
1371 {
1372 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
1373 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
1374 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
1375 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
1376 position = pos;
1377 rotation = rot;
1378 }
1379 }
1380
1381 public delegate void Action<T1, T2, T3, T4, T5>(T1 p1, T2 p2, T3 p3, T4 p4, T5 p5);
1382
1383 public static Func<VRCPlayerApi, bool> _isMasterDelegate = null;
1384
1385 public static Func<VRCPlayerApi, bool> _isInstanceOwnerDelegate = null;
1386
1387 public static Func<VRCPlayerApi, bool> _isModeratorDelegate = null;
1388
1389 public static Func<VRCPlayerApi, bool> _isSuperDelegate = null;
1390
1391 public static Func<VRCPlayerApi, bool> _isSuspendedDelegate = null;
1392
1398 public bool isLocal = true;
1399
1405 public string displayName = "<uninitialized>";
1406
1408
1410
1412
1414
1415 public static List<VRCPlayerApi> sPlayers = new List<VRCPlayerApi>();
1416
1417 private int mPlayerId = -1;
1418
1419 public static Func<VRCPlayerApi, int> _GetPlayerId = null;
1420
1421 public static Func<GameObject, VRCPlayerApi> _GetPlayerByGameObject = null;
1422
1423 public static Func<int, VRCPlayerApi> _GetPlayerById = null;
1424
1425 public static Func<VRCPlayerApi, GameObject, bool> _IsOwner = null;
1426
1427 public static Action<VRCPlayerApi, GameObject> _TakeOwnership = null;
1428
1429 public static Func<VRCPlayerApi, TrackingDataType, TrackingData> _GetTrackingData = null;
1430
1431 public static Func<VRCPlayerApi, HumanBodyBones, Transform> _GetBoneTransform = null;
1432
1433 public static Func<VRCPlayerApi, HumanBodyBones, Vector3> _GetBonePosition = null;
1434
1435 public static Func<VRCPlayerApi, HumanBodyBones, Quaternion> _GetBoneRotation = null;
1436
1437 public static Func<VRCPlayerApi, VRC_Pickup.PickupHand, VRC_Pickup> _GetPickupInHand = null;
1438
1439 public static Action<VRCPlayerApi, VRC_Pickup.PickupHand, float, float, float> _PlayHapticEventInHand = null;
1440
1441 public static Action<VRCPlayerApi, Vector3, Quaternion> _TeleportTo = null;
1442
1443 public static Action<VRCPlayerApi, Vector3, Quaternion, VRC_SceneDescriptor.SpawnOrientation> _TeleportToOrientation = null;
1444
1445 public static Action<VRCPlayerApi, Vector3, Quaternion, VRC_SceneDescriptor.SpawnOrientation, bool> _TeleportToOrientationLerp = null;
1446
1447 public static Action<VRCPlayerApi> _Respawn = null;
1448
1449 public static Action<VRCPlayerApi, int> _RespawnWithIndex = null;
1450
1451 public static Action<VRCPlayerApi, bool> _EnablePickups = null;
1452
1453 public static Func<string[]> _GetAvailableLanguages = null;
1454
1455 public static Func<string> _GetCurrentLanguage = null;
1456
1457 public static Action<VRCPlayerApi, Color> _SetNamePlateColor = null;
1458
1459 public static Action<VRCPlayerApi> _RestoreNamePlateColor = null;
1460
1461 public static Action<VRCPlayerApi, bool> _SetNamePlateVisibility = null;
1462
1463 public static Action<VRCPlayerApi> _RestoreNamePlateVisibility = null;
1464
1465 public static Action<VRCPlayerApi, string, string> _SetPlayerTag = null;
1466
1467 public static Func<VRCPlayerApi, string, string> _GetPlayerTag = null;
1468
1469 public static Func<string, string, List<int>> _GetPlayersWithTag = null;
1470
1471 public static Action<VRCPlayerApi> _ClearPlayerTags = null;
1472
1473 public static Action<VRCPlayerApi, bool, string, string> _SetInvisibleToTagged = null;
1474
1475 public static Action<VRCPlayerApi, bool, string, string> _SetInvisibleToUntagged = null;
1476
1477 public static Action<VRCPlayerApi, int, string, string> _SetSilencedToTagged = null;
1478
1479 public static Action<VRCPlayerApi, int, string, string> _SetSilencedToUntagged = null;
1480
1481 public static Action<VRCPlayerApi> _ClearInvisible = null;
1482
1483 public static Action<VRCPlayerApi> _ClearSilence = null;
1484
1485 public static Action<VRCPlayerApi, float> _SetRunSpeed = null;
1486
1487 public static Action<VRCPlayerApi, float> _SetWalkSpeed = null;
1488
1489 public static Action<VRCPlayerApi, float> _SetStrafeSpeed = null;
1490
1491 public static Action<VRCPlayerApi, float> _SetJumpImpulse = null;
1492
1493 public static Action<VRCPlayerApi, float> _SetGravityStrength = null;
1494
1495 public static Func<VRCPlayerApi, float> _GetRunSpeed = null;
1496
1497 public static Func<VRCPlayerApi, float> _GetWalkSpeed = null;
1498
1499 public static Func<VRCPlayerApi, float> _GetStrafeSpeed = null;
1500
1501 public static Func<VRCPlayerApi, float> _GetJumpImpulse = null;
1502
1503 public static Func<VRCPlayerApi, float> _GetGravityStrength = null;
1504
1505 public static Action<VRCPlayerApi, float> _SetVoiceGain = null;
1506
1507 public static Action<VRCPlayerApi, float> _SetVoiceDistanceNear = null;
1508
1509 public static Action<VRCPlayerApi, float> _SetVoiceDistanceFar = null;
1510
1511 public static Action<VRCPlayerApi, float> _SetVoiceVolumetricRadius = null;
1512
1513 public static Action<VRCPlayerApi, bool> _SetVoiceLowpass = null;
1514
1515 public static Func<VRCPlayerApi, float> _GetVoiceGain = null;
1516
1517 public static Func<VRCPlayerApi, float> _GetVoiceDistanceNear = null;
1518
1519 public static Func<VRCPlayerApi, float> _GetVoiceDistanceFar = null;
1520
1521 public static Func<VRCPlayerApi, float> _GetVoiceVolumetricRadius = null;
1522
1523 public static Func<VRCPlayerApi, bool> _GetVoiceLowpass = null;
1524
1525 public static Action<VRCPlayerApi, float> _SetAvatarAudioGain = null;
1526
1527 public static Action<VRCPlayerApi, float> _SetAvatarAudioFarRadius = null;
1528
1529 public static Action<VRCPlayerApi, float> _SetAvatarAudioNearRadius = null;
1530
1531 public static Action<VRCPlayerApi, float> _SetAvatarAudioVolumetricRadius = null;
1532
1533 public static Action<VRCPlayerApi, bool> _SetAvatarAudioForceSpatial = null;
1534
1535 public static Action<VRCPlayerApi, bool> _SetAvatarAudioCustomCurve = null;
1536
1537 public static Action<VRCPlayerApi> _CombatSetup = null;
1538
1539 public static Action<VRCPlayerApi, float> _CombatSetMaxHitpoints = null;
1540
1541 public static Action<VRCPlayerApi, float> _CombatSetCurrentHitpoints = null;
1542
1543 public static Func<VRCPlayerApi, float> _CombatGetCurrentHitpoints = null;
1544
1545 public static Action<VRCPlayerApi, bool, float, Transform> _CombatSetRespawn = null;
1546
1547 public static Action<VRCPlayerApi, GameObject> _CombatSetDamageGraphic = null;
1548
1549 public static Func<VRCPlayerApi, IVRC_Destructible> _CombatGetDestructible = null;
1550
1551 public static Func<VRCPlayerApi, bool> _IsUserInVR = null;
1552
1553 public static Action<VRCPlayerApi> _UseLegacyLocomotion = null;
1554
1555 public static Action<VRCPlayerApi> _UseAttachedStation = null;
1556
1557 public static Action<VRCPlayerApi, RuntimeAnimatorController> _PushAnimations = null;
1558
1559 public static Action<VRCPlayerApi> _PopAnimations = null;
1560
1561 public static Action<VRCPlayerApi, bool> _Immobilize = null;
1562
1563 public static Action<VRCPlayerApi, Vector3> _SetVelocity = null;
1564
1565 public static Func<VRCPlayerApi, Vector3> _GetVelocity = null;
1566
1567 public static Func<VRCPlayerApi, Vector3> _GetPosition = null;
1568
1569 public static Func<VRCPlayerApi, Quaternion> _GetRotation = null;
1570
1571 public GameObject gameObject;
1572
1573 private bool _isValid;
1574
1575 public static Func<VRCPlayerApi, float> _GetAvatarEyeHeightAsMeters = null;
1576
1577 public static Func<VRCPlayerApi, float> _GetAvatarEyeHeightMaximumAsMeters = null;
1578
1579 public static Func<VRCPlayerApi, float> _GetAvatarEyeHeightMinimumAsMeters = null;
1580
1581 public static Func<VRCPlayerApi, bool> _GetManualAvatarScalingAllowed = null;
1582
1583 public static Action<VRCPlayerApi, float> _SetAvatarEyeHeightByMeters = null;
1584
1585 public static Action<VRCPlayerApi, float> _SetAvatarEyeHeightByMultiplier = null;
1586
1587 public static Action<VRCPlayerApi, float> _SetAvatarEyeHeightMaximumByMeters = null;
1588
1589 public static Action<VRCPlayerApi, float> _SetAvatarEyeHeightMinimumByMeters = null;
1590
1591 public static Action<VRCPlayerApi, bool> _SetManualAvatarScalingAllowed = null;
1592
1598 public bool isMaster => _isMasterDelegate.Invoke(this);
1599
1607 public bool isInstanceOwner => _isInstanceOwnerDelegate.Invoke(this);
1608
1614 public bool isModerator => _isModeratorDelegate.Invoke(this);
1615
1621 public bool isSuper => _isSuperDelegate.Invoke(this);
1622
1623 public bool isSuspended => _isSuspendedDelegate.Invoke(this);
1624
1630 public static List<VRCPlayerApi> AllPlayers => sPlayers;
1631
1640 public int playerId
1641 {
1642 get
1643 {
1644 if (mPlayerId == -1)
1645 {
1646 mPlayerId = GetPlayerId(this);
1647 }
1648 return mPlayerId;
1649 }
1650 }
1651
1659 public bool IsPlayerGrounded()
1660 {
1661 if (IsGrounded != null)
1662 {
1663 return IsGrounded(this);
1664 }
1665 return false;
1666 }
1667
1679 public static VRCPlayerApi[] GetPlayers(VRCPlayerApi[] players)
1680 {
1681 sPlayers.CopyTo(players);
1682 return players;
1683 }
1684
1693 public static int GetPlayerCount()
1694 {
1695 return sPlayers.Count;
1696 }
1697
1710 public static int GetPlayerId(VRCPlayerApi player)
1711 {
1712 return _GetPlayerId.Invoke(player);
1713 }
1714
1715 public static VRCPlayerApi GetPlayerByGameObject(GameObject playerGameObject)
1716 {
1717 return _GetPlayerByGameObject?.Invoke(playerGameObject);
1718 }
1719
1732 {
1733 return _GetPlayerById.Invoke(playerId);
1734 }
1735
1744 public bool IsValid()
1745 {
1746 return _isValid;
1747 }
1748
1760 public bool IsOwner(GameObject obj)
1761 {
1762 return _IsOwner.Invoke(this, obj);
1763 }
1764
1765 public void TakeOwnership(GameObject obj)
1766 {
1767 _TakeOwnership.Invoke(this, obj);
1768 }
1769
1792 {
1793 return _GetTrackingData.Invoke(this, tt);
1794 }
1795
1801 public Transform GetBoneTransform(HumanBodyBones tt)
1802 {
1803 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
1804 return _GetBoneTransform.Invoke(this, tt);
1805 }
1806
1821 public Vector3 GetBonePosition(HumanBodyBones tt)
1822 {
1823 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
1824 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
1825 return _GetBonePosition.Invoke(this, tt);
1826 }
1827
1845 public Quaternion GetBoneRotation(HumanBodyBones tt)
1846 {
1847 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
1848 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
1849 return _GetBoneRotation.Invoke(this, tt);
1850 }
1851
1862 {
1863 return _GetPickupInHand.Invoke(this, hand);
1864 }
1865
1867 {
1868 }
1869
1885 public void PlayHapticEventInHand(VRC_Pickup.PickupHand hand, float duration, float amplitude, float frequency)
1886 {
1887 if (!(duration < 0f) && !(amplitude < 0f) && !(frequency < 0f))
1888 {
1889 _PlayHapticEventInHand(this, hand, duration, amplitude, frequency);
1890 }
1891 }
1892
1904 public void TeleportTo(Vector3 teleportPos, Quaternion teleportRot)
1905 {
1906 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
1907 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
1908 if (_TeleportTo != null)
1909 {
1910 _TeleportTo.Invoke(this, teleportPos, teleportRot);
1911 }
1912 }
1913
1927 public void TeleportTo(Vector3 teleportPos, Quaternion teleportRot, VRC_SceneDescriptor.SpawnOrientation teleportOrientation)
1928 {
1929 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
1930 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
1931 if (_TeleportToOrientation != null)
1932 {
1933 _TeleportToOrientation.Invoke(this, teleportPos, teleportRot, teleportOrientation);
1934 }
1935 }
1936
1957 public void TeleportTo(Vector3 teleportPos, Quaternion teleportRot, VRC_SceneDescriptor.SpawnOrientation teleportOrientation, bool lerpOnRemote)
1958 {
1959 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
1960 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
1961 if (_TeleportToOrientationLerp != null)
1962 {
1963 _TeleportToOrientationLerp(this, teleportPos, teleportRot, teleportOrientation, lerpOnRemote);
1964 }
1965 }
1966
1972 public void Respawn()
1973 {
1974 _Respawn.Invoke(this);
1975 }
1976
1985 public void Respawn(int spawnsIndex)
1986 {
1987 _RespawnWithIndex.Invoke(this, spawnsIndex);
1988 }
1989
1998 public void EnablePickups(bool enable)
1999 {
2000 _EnablePickups.Invoke(this, enable);
2001 }
2002
2003 public void SetNamePlateColor(Color col)
2004 {
2005 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
2006 _SetNamePlateColor.Invoke(this, col);
2007 }
2008
2010 {
2011 _RestoreNamePlateColor.Invoke(this);
2012 }
2013
2014 public void SetNamePlateVisibility(bool flag)
2015 {
2016 _SetNamePlateVisibility.Invoke(this, flag);
2017 }
2018
2020 {
2021 _RestoreNamePlateVisibility.Invoke(this);
2022 }
2023
2037 public void SetPlayerTag(string tagName, string tagValue = "")
2038 {
2039 _SetPlayerTag.Invoke(this, tagName, tagValue);
2040 }
2041
2053 public string GetPlayerTag(string tagName)
2054 {
2055 return _GetPlayerTag.Invoke(this, tagName);
2056 }
2057
2071 public List<int> GetPlayersWithTag(string tagName, string tagValue = "")
2072 {
2073 return null;
2074 }
2075
2081 public void ClearPlayerTags()
2082 {
2083 _ClearPlayerTags.Invoke(this);
2084 }
2085
2086 public void SetInvisibleToTagged(bool invisible, string tagName, string tagValue = "")
2087 {
2088 _SetInvisibleToTagged.Invoke(this, invisible, tagName, tagValue);
2089 }
2090
2091 public void SetInvisibleToUntagged(bool invisible, string tagName, string tagValue = "")
2092 {
2093 _SetInvisibleToUntagged.Invoke(this, invisible, tagName, tagValue);
2094 }
2095
2096 public void SetSilencedToTagged(int level, string tagName, string tagValue = "")
2097 {
2098 _SetSilencedToTagged.Invoke(this, level, tagName, tagValue);
2099 }
2100
2101 public void SetSilencedToUntagged(int level, string tagName, string tagValue = "")
2102 {
2103 _SetSilencedToUntagged.Invoke(this, level, tagName, tagValue);
2104 }
2105
2114 public void SetRunSpeed(float speed = 4f)
2115 {
2116 _SetRunSpeed.Invoke(this, speed);
2117 }
2118
2127 public void SetWalkSpeed(float speed = 2f)
2128 {
2129 _SetWalkSpeed.Invoke(this, speed);
2130 }
2131
2142 public void SetStrafeSpeed(float speed = 2f)
2143 {
2144 _SetStrafeSpeed.Invoke(this, speed);
2145 }
2146
2156 public void SetJumpImpulse(float impulse = 3f)
2157 {
2158 _SetJumpImpulse.Invoke(this, impulse);
2159 }
2160
2169 public float GetGravityStrength()
2170 {
2171 return _GetGravityStrength.Invoke(this);
2172 }
2173
2182 public float GetRunSpeed()
2183 {
2184 return _GetRunSpeed.Invoke(this);
2185 }
2186
2195 public float GetWalkSpeed()
2196 {
2197 return _GetWalkSpeed.Invoke(this);
2198 }
2199
2208 public float GetStrafeSpeed()
2209 {
2210 return _GetStrafeSpeed.Invoke(this);
2211 }
2212
2221 public float GetJumpImpulse()
2222 {
2223 return _GetJumpImpulse.Invoke(this);
2224 }
2225
2234 public bool IsUserInVR()
2235 {
2236 return _IsUserInVR.Invoke(this);
2237 }
2238
2247 public void SetGravityStrength(float strength = 1f)
2248 {
2249 _SetGravityStrength.Invoke(this, strength);
2250 }
2251
2257 {
2258 _UseLegacyLocomotion.Invoke(this);
2259 }
2260
2268 {
2269 _UseAttachedStation.Invoke(this);
2270 }
2271
2272 public void ClearInvisible()
2273 {
2274 _ClearInvisible.Invoke(this);
2275 }
2276
2277 public void ClearSilence()
2278 {
2279 _ClearSilence.Invoke(this);
2280 }
2281
2282 public void AddToList()
2283 {
2284 sPlayers.Add(this);
2285 _isValid = true;
2286 }
2287
2288 public void RemoveFromList()
2289 {
2290 sPlayers.Remove(this);
2291 _isValid = false;
2292 }
2293
2298 public void CombatSetup()
2299 {
2300 _CombatSetup.Invoke(this);
2301 }
2302
2307 public void CombatSetMaxHitpoints(float maxHp)
2308 {
2309 _CombatSetMaxHitpoints.Invoke(this, maxHp);
2310 }
2311
2316 public void CombatSetCurrentHitpoints(float hp)
2317 {
2318 _CombatSetCurrentHitpoints.Invoke(this, hp);
2319 }
2320
2327 {
2328 return _CombatGetCurrentHitpoints.Invoke(this);
2329 }
2330
2335 public void CombatSetRespawn(bool respawnOnDeath, float respawnTimer, Transform respawnLocation)
2336 {
2337 _CombatSetRespawn.Invoke(this, respawnOnDeath, respawnTimer, respawnLocation);
2338 }
2339
2344 public void CombatSetDamageGraphic(GameObject prefab)
2345 {
2346 _CombatSetDamageGraphic.Invoke(this, prefab);
2347 }
2348
2354 {
2355 return _CombatGetDestructible.Invoke(this);
2356 }
2357
2366 public void SetVoiceGain(float gain)
2367 {
2368 _SetVoiceGain.Invoke(this, gain);
2369 }
2370
2371 public float GetVoiceGain()
2372 {
2373 return _GetVoiceGain.Invoke(this);
2374 }
2375
2386 public void SetVoiceDistanceNear(float near)
2387 {
2388 _SetVoiceDistanceNear.Invoke(this, near);
2389 }
2390
2392 {
2393 return _GetVoiceDistanceNear.Invoke(this);
2394 }
2395
2406 public void SetVoiceDistanceFar(float far)
2407 {
2408 _SetVoiceDistanceFar.Invoke(this, far);
2409 }
2410
2411 public float GetVoiceDistanceFar()
2412 {
2413 return _GetVoiceDistanceFar.Invoke(this);
2414 }
2415
2430 public void SetVoiceVolumetricRadius(float radius)
2431 {
2432 _SetVoiceVolumetricRadius.Invoke(this, radius);
2433 }
2434
2436 {
2437 return _GetVoiceVolumetricRadius.Invoke(this);
2438 }
2439
2450 public void SetVoiceLowpass(bool enabled)
2451 {
2452 _SetVoiceLowpass.Invoke(this, enabled);
2453 }
2454
2455 public bool GetVoiceLowpass()
2456 {
2457 return _GetVoiceLowpass.Invoke(this);
2458 }
2459
2468 public void SetAvatarAudioGain(float gain)
2469 {
2470 _SetAvatarAudioGain.Invoke(this, gain);
2471 }
2472
2482 public void SetAvatarAudioFarRadius(float distance)
2483 {
2484 _SetAvatarAudioFarRadius.Invoke(this, distance);
2485 }
2486
2499 public void SetAvatarAudioNearRadius(float distance)
2500 {
2501 _SetAvatarAudioNearRadius.Invoke(this, distance);
2502 }
2503
2514 public void SetAvatarAudioVolumetricRadius(float radius)
2515 {
2516 _SetAvatarAudioVolumetricRadius.Invoke(this, radius);
2517 }
2518
2528 public void SetAvatarAudioForceSpatial(bool force)
2529 {
2530 _SetAvatarAudioForceSpatial.Invoke(this, force);
2531 }
2532
2541 public void SetAvatarAudioCustomCurve(bool allow)
2542 {
2543 _SetAvatarAudioCustomCurve.Invoke(this, allow);
2544 }
2545
2554 public static string[] GetAvailableLanguages()
2555 {
2556 return _GetAvailableLanguages.Invoke();
2557 }
2558
2567 public static string GetCurrentLanguage()
2568 {
2569 return _GetCurrentLanguage.Invoke();
2570 }
2571
2572 public GameObject[] GetPlayerObjects()
2573 {
2574 return Networking.GetPlayerObjects(this);
2575 }
2576
2577 public Component FindComponentInPlayerObjects(Component referenceComponent)
2578 {
2579 return Networking.FindComponentInPlayerObjects(this, referenceComponent);
2580 }
2581
2582 public void PushAnimations(RuntimeAnimatorController animations)
2583 {
2584 _PushAnimations.Invoke(this, animations);
2585 }
2586
2587 public void PopAnimations()
2588 {
2589 _PopAnimations.Invoke(this);
2590 }
2591
2600 public void Immobilize(bool immobile)
2601 {
2602 _Immobilize.Invoke(this, immobile);
2603 }
2604
2614 public void SetVelocity(Vector3 velocity)
2615 {
2616 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
2617 _SetVelocity.Invoke(this, velocity);
2618 }
2619
2628 public Vector3 GetVelocity()
2629 {
2630 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
2631 return _GetVelocity.Invoke(this);
2632 }
2633
2642 public Vector3 GetPosition()
2643 {
2644 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
2645 return _GetPosition.Invoke(this);
2646 }
2647
2656 public Quaternion GetRotation()
2657 {
2658 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
2659 return _GetRotation.Invoke(this);
2660 }
2661
2672 {
2673 return _GetAvatarEyeHeightAsMeters.Invoke(this);
2674 }
2675
2686 {
2687 return _GetAvatarEyeHeightMaximumAsMeters.Invoke(this);
2688 }
2689
2700 {
2701 return _GetAvatarEyeHeightMinimumAsMeters.Invoke(this);
2702 }
2703
2714 {
2715 return _GetManualAvatarScalingAllowed.Invoke(this);
2716 }
2717
2727 public void SetAvatarEyeHeightByMeters(float scaleMeters)
2728 {
2729 _SetAvatarEyeHeightByMeters.Invoke(this, scaleMeters);
2730 }
2731
2742 public void SetAvatarEyeHeightByMultiplier(float scaleMultiplier)
2743 {
2744 _SetAvatarEyeHeightByMultiplier.Invoke(this, scaleMultiplier);
2745 }
2746
2756 public void SetAvatarEyeHeightMaximumByMeters(float scaleMeters)
2757 {
2758 _SetAvatarEyeHeightMaximumByMeters.Invoke(this, scaleMeters);
2759 }
2760
2770 public void SetAvatarEyeHeightMinimumByMeters(float scaleMeters)
2771 {
2772 _SetAvatarEyeHeightMinimumByMeters.Invoke(this, scaleMeters);
2773 }
2774
2783 public void SetManualAvatarScalingAllowed(bool enabled)
2784 {
2785 _SetManualAvatarScalingAllowed.Invoke(this, enabled);
2786 }
2787 }
2788 [HelpURL("https://creators.vrchat.com/avatars/state-behaviors#animator-layer-controller")]
2789 public abstract class VRC_AnimatorLayerControl : StateMachineBehaviour
2790 {
2791 [Serializable]
2792 public enum BlendableLayer : Enum
2793 {
2794 Action,
2795 FX,
2796 Gesture,
2797 Additive
2798 }
2799
2800 [HideInInspector]
2802
2803 [HideInInspector]
2804 public delegate void ApplySettingsDelegate(VRC_AnimatorLayerControl control, Animator animator);
2805
2806 [Tooltip("Playable layer to affect")]
2808
2809 [Tooltip("Index of sub-layer to affect")]
2810 public int layer = 1;
2811
2812 [Tooltip("Goal weight 0-1")]
2813 [Range(0f, 1f)]
2814 public float goalWeight;
2815
2816 [Tooltip("Time to reach goal weight, should be less than animation length")]
2817 public float blendDuration;
2818
2819 [Tooltip("Message for debugging")]
2820 public string debugString;
2821
2822 [HideInInspector]
2824
2825 [HideInInspector]
2827
2828 private void Awake()
2829 {
2830 if (Initialize != null)
2831 {
2832 Initialize(this);
2833 }
2834 }
2835
2836 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
2837 {
2838 ApplySettings?.Invoke(this, animator);
2839 }
2840 }
2841 [HelpURL("https://creators.vrchat.com/avatars/state-behaviors#animator-locomotion-control")]
2842 public abstract class VRC_AnimatorLocomotionControl : StateMachineBehaviour
2843 {
2844 [HideInInspector]
2846
2847 [HideInInspector]
2848 public delegate void ApplySettingsDelegate(VRC_AnimatorLocomotionControl control, Animator animator);
2849
2850 [Tooltip("Disable player locomotion.")]
2852
2853 [Tooltip("Message for debugging")]
2854 public string debugString;
2855
2856 [HideInInspector]
2858
2859 [HideInInspector]
2861
2862 private void Awake()
2863 {
2864 if (Initialize != null)
2865 {
2866 Initialize(this);
2867 }
2868 }
2869
2870 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
2871 {
2872 ApplySettings?.Invoke(this, animator);
2873 }
2874 }
2880 [HelpURL("https://creators.vrchat.com/avatars/state-behaviors#animator-play-audio")]
2881 public abstract class VRC_AnimatorPlayAudio : StateMachineBehaviour
2882 {
2888 public enum Order : Enum
2889 {
2895 Random,
2901 UniqueRandom,
2908 Roundabout,
2915 Parameter
2916 }
2917
2923 public enum ApplySettings : Enum
2924 {
2930 AlwaysApply,
2936 ApplyIfStopped,
2942 NeverApply
2943 }
2944
2945 [HideInInspector]
2947
2948 [HideInInspector]
2949 public delegate void EnterStateDelegate(VRC_AnimatorPlayAudio control, Animator animator);
2950
2951 public delegate void ExitStateDelegate(VRC_AnimatorPlayAudio control, Animator animator);
2952
2958 [HideInInspector]
2959 public AudioSource Source;
2960
2968 public string SourcePath;
2969
2976
2981 public string ParameterName;
2982
2988 public Vector2 Volume = new Vector2(1f, 1f);
2989
2994
3000 public Vector2 Pitch = new Vector2(1f, 1f);
3001
3006
3010 public AudioClip[] Clips;
3011
3016
3021 public bool Loop;
3022
3027
3031 public float DelayInSeconds;
3032
3036 public bool PlayOnEnter = true;
3037
3041 public bool StopOnEnter = true;
3042
3047 public bool PlayOnExit;
3048
3052 public bool StopOnExit;
3053
3058 [HideInInspector]
3059 public int playbackIndex;
3060
3065 [HideInInspector]
3066 public object destParam;
3067
3068 [HideInInspector]
3070
3071 [HideInInspector]
3073
3074 [HideInInspector]
3076
3082
3088
3094
3100
3106 {
3107 return setting switch
3108 {
3109 ApplySettings.ApplyIfStopped => !Source.isPlaying,
3110 ApplySettings.AlwaysApply => true,
3111 _ => false,
3112 };
3113 }
3114
3115 private void Awake()
3116 {
3117 if (Initialize != null)
3118 {
3119 Initialize(this);
3120 }
3121 }
3122
3127 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
3128 {
3129 EnterState?.Invoke(this, animator);
3130 }
3131
3136 public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
3137 {
3138 ExitState?.Invoke(this, animator);
3139 }
3140 }
3141 [HelpURL("https://creators.vrchat.com/avatars/state-behaviors#animator-temporary-pose-space")]
3142 public abstract class VRC_AnimatorTemporaryPoseSpace : StateMachineBehaviour
3143 {
3144 [HideInInspector]
3146
3147 [HideInInspector]
3148 public delegate void ApplySettingsDelegate(VRC_AnimatorTemporaryPoseSpace view, Animator animator);
3149
3150 [Tooltip("Enter or exit a pose space based on the avatar's current pose.")]
3151 public bool enterPoseSpace;
3152
3153 [Tooltip("Is the delay fixed or normalized.")]
3154 public bool fixedDelay = true;
3155
3156 [Tooltip("Delay before applying.")]
3157 public float delayTime;
3158
3159 [Tooltip("Message for debugging")]
3160 public string debugString;
3161
3162 [HideInInspector]
3164
3165 [HideInInspector]
3167
3168 [HideInInspector]
3169 private bool applied;
3170
3171 private float enterTime;
3172
3173 private void Awake()
3174 {
3175 if (Initialize != null)
3176 {
3177 Initialize(this);
3178 }
3179 }
3180
3181 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
3182 {
3183 applied = false;
3184 enterTime = Time.time;
3185 if (delayTime <= 0f)
3186 {
3187 ApplySettings?.Invoke(this, animator);
3188 applied = true;
3189 }
3190 }
3191
3192 public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
3193 {
3194 if (!applied && (fixedDelay ? (Time.time - enterTime) : ((AnimatorStateInfo)(ref stateInfo)).normalizedTime) >= delayTime)
3195 {
3196 ApplySettings?.Invoke(this, animator);
3197 applied = true;
3198 }
3199 }
3200 }
3201 [HelpURL("https://creators.vrchat.com/avatars/state-behaviors#animator-tracking-control")]
3202 public abstract class VRC_AnimatorTrackingControl : StateMachineBehaviour
3203 {
3204 public enum TrackingType : Enum
3205 {
3206 NoChange,
3207 Tracking,
3208 Animation
3209 }
3210
3211 [HideInInspector]
3213
3214 [HideInInspector]
3215 public delegate void ApplySettingsDelegate(VRC_AnimatorTrackingControl control, Animator animator);
3216
3217 [Tooltip("Disable tracking of user's head and follow animation instead.")]
3219
3220 [Tooltip("Disable tracking of user's left hand and follow animation instead.")]
3222
3223 [Tooltip("Disable tracking of user's right hand and follow animation instead.")]
3225
3226 [Tooltip("Disable tracking of user's hip and follow animation instead")]
3228
3229 [Tooltip("Disable tracking of user's left foot and follow animation instead. Also disables procedural footsteps.")]
3231
3232 [Tooltip("Disable tracking of user's right foot and follow animation instead. Also disables procedural footsteps.")]
3234
3235 [Tooltip("Disable tracking of user's left fingers and follow animation instead.")]
3237
3238 [Tooltip("Disable tracking of user's right fingers and follow animation instead.")]
3240
3241 [Tooltip("Disable EyeLook and use animated eye positions")]
3243
3244 [Tooltip("Disable Jawflap or Visemes and use animated jaw and mouth positions")]
3246
3247 [Tooltip("Message for debugging")]
3248 public string debugString;
3249
3250 [HideInInspector]
3252
3253 [HideInInspector]
3255
3256 private void Awake()
3257 {
3258 if (Initialize != null)
3259 {
3260 Initialize(this);
3261 }
3262 }
3263
3264 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
3265 {
3266 ApplySettings?.Invoke(this, animator);
3267 }
3268 }
3269 public abstract class VRC_AvatarDescriptor : MonoBehaviour, INetworkIDContainer
3270 {
3271 public enum AnimationSet : Enum
3272 {
3273 Male,
3274 Female,
3275 None
3276 }
3277
3278 public enum LipSyncStyle : Enum
3279 {
3280 Default,
3281 JawFlapBone,
3282 JawFlapBlendShape,
3283 VisemeBlendShape,
3284 VisemeParameterOnly
3285 }
3286
3287 public enum Viseme : Enum
3288 {
3289 sil,
3290 PP,
3291 FF,
3292 TH,
3293 DD,
3294 kk,
3295 CH,
3296 SS,
3297 nn,
3298 RR,
3299 aa,
3300 E,
3301 ih,
3302 oh,
3303 ou,
3304 Count
3305 }
3306
3307 public string Name;
3308
3309 public Vector3 ViewPosition = new Vector3(0f, 1.6f, 0.2f);
3310
3312
3313 public bool ScaleIPD = true;
3314
3316
3317 public Transform lipSyncJawBone;
3318
3319 public Quaternion lipSyncJawClosed = Quaternion.identity;
3320
3321 public Quaternion lipSyncJawOpen = Quaternion.identity;
3322
3323 public SkinnedMeshRenderer VisemeSkinnedMesh;
3324
3325 public string MouthOpenBlendShapeName = "Facial_Blends.Jaw_Down";
3326
3327 public string[] VisemeBlendShapes;
3328
3329 [HideInInspector]
3330 public object apiAvatar;
3331
3332 public string unityVersion;
3333
3334 public Vector3 portraitCameraPositionOffset = new Vector3(0f, 0f, 0f);
3335
3336 public Quaternion portraitCameraRotationOffset = Quaternion.AngleAxis(180f, Vector3.up);
3337
3338 [SerializeField]
3339 private List<NetworkIDPair> networkIDs = new List<NetworkIDPair>();
3340
3341 public List<NetworkIDPair> NetworkIDCollection
3342 {
3343 get
3344 {
3345 return networkIDs;
3346 }
3347 set
3348 {
3349 networkIDs = value;
3350 }
3351 }
3352
3354 {
3355 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
3356 //IL_002c: Unknown result type (might be due to invalid IL or missing references)
3357 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
3358 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
3359 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
3360 float num = ((Vector3)(ref ViewPosition)).magnitude / 1.6f;
3361 if (num < 1f)
3362 {
3363 num = 1f;
3364 }
3365 Vector3 val = ((Component)this).transform.position + ViewPosition;
3366 Gizmos.DrawRay(((Component)this).transform.position, Vector3.forward);
3367 Gizmos.DrawSphere(val, 0.01f * num);
3368 }
3369
3370 public void PositionPortraitCamera(Transform cam)
3371 {
3372 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
3373 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
3374 //IL_0046: Unknown result type (might be due to invalid IL or missing references)
3375 //IL_004b: Unknown result type (might be due to invalid IL or missing references)
3376 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
3377 //IL_0062: Unknown result type (might be due to invalid IL or missing references)
3378 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
3379 //IL_0034: Unknown result type (might be due to invalid IL or missing references)
3380 //IL_0039: Unknown result type (might be due to invalid IL or missing references)
3381 if (portraitCameraPositionOffset == Vector3.zero)
3382 {
3383 float y = ViewPosition.y;
3384 float num = y * 0.8f;
3385 float num2 = y * 0.7f;
3386 portraitCameraPositionOffset = new Vector3(0f, num, num2);
3387 }
3388 cam.position = ((Component)this).transform.TransformPoint(portraitCameraPositionOffset);
3389 cam.rotation = ((Component)this).transform.rotation * portraitCameraRotationOffset;
3390 }
3391
3392 public void GetNetworkIDObjects(List<INetworkID> netIds)
3393 {
3394 ((Component)this).gameObject.GetComponentsInChildren<INetworkID>(true, netIds);
3395 }
3396
3397 public GameObject FindNetworkIDGameObject(string path)
3398 {
3399 if (path.StartsWith("/"))
3400 {
3401 path = path.Substring(1);
3402 }
3403 Transform obj = ((Component)this).transform.Find(path);
3404 if (obj == null)
3405 {
3406 return null;
3407 }
3408 return ((Component)obj).gameObject;
3409 }
3410
3411 public string GetNetworkIDGameObjectPath(GameObject obj)
3412 {
3413 return NetworkIDAssignment.GetNetworkIDGameObjectPath(obj.transform);
3414 }
3415 }
3416 [HelpURL("https://creators.vrchat.com/avatars/state-behaviors#avatar-parameter-driver")]
3417 public abstract class VRC_AvatarParameterDriver : StateMachineBehaviour
3418 {
3419 public enum ChangeType : Enum
3420 {
3421 Set,
3422 Add,
3423 Random,
3424 Copy
3425 }
3426
3427 [Serializable]
3428 public class Parameter : Object
3429 {
3430 [Tooltip("The type of operation to be executed")]
3432
3433 [Tooltip("Parameter that will be written to")]
3434 public string name;
3435
3436 [Tooltip("Source parameter that will be read")]
3437 public string source;
3438
3439 [Tooltip("The value used for this operation")]
3440 public float value;
3441
3442 [Tooltip("Minimum value to be set")]
3443 public float valueMin;
3444
3445 [Tooltip("Maximum value to be set")]
3446 public float valueMax = 1f;
3447
3448 [Tooltip("Chance the value will be set. When used with a Bool type, defines the chance the value is set to 1, otherwise it's set to 0.")]
3449 [Range(0f, 1f)]
3450 public float chance = 1f;
3451
3452 [Tooltip("If true, we convert the range of the source and destination values according to the ranges given.")]
3453 public bool convertRange;
3454
3455 public float sourceMin;
3456
3457 public float sourceMax;
3458
3459 public float destMin;
3460
3461 public float destMax;
3462
3463 public object sourceParam;
3464
3465 public object destParam;
3466 }
3467
3468 public List<Parameter> parameters = new List<Parameter>();
3469
3470 [Tooltip("When true, only the client who is wearing this avatar will use this ParameterDriver. This option is useful to avoid conflicts from non-deterministic operations like Random or Add across multiple clients.")]
3471 public bool localOnly;
3472
3473 [Tooltip("Custom debug message that will be written to the client logs when the ParameterDriver is used. Be careful to remove these before your final upload as this can spam your log files.")]
3474 public string debugString;
3475
3476 [NonSerialized]
3477 public bool isLocalPlayer;
3478
3479 [NonSerialized]
3480 public bool isEnabled;
3481
3482 [NonSerialized]
3483 public bool initialized;
3484
3485 public static Action<VRC_AvatarParameterDriver, Animator> OnApplySettings;
3486
3487 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
3488 {
3489 OnApplySettings?.Invoke(this, animator);
3490 }
3491 }
3492 [Obsolete("Please use VRC_Trigger instead", false)]
3493 public abstract class VRC_KeyEvents : MonoBehaviour
3494 {
3495 public delegate void InitializationDelegate(VRC_KeyEvents obj);
3496
3497 public KeyCode Key;
3498
3499 public string DownEventName;
3500
3501 public string UpEventName;
3502
3503 private bool LocalOnly;
3504
3506
3508
3510
3511 private void Start()
3512 {
3513 if (((Component)this).GetComponentInParent<VRCPlayerApi>() != null || ((Component)this).GetComponent<VRCPlayerApi>() != null)
3514 {
3515 Object.Destroy((Object)(object)this);
3516 }
3517 if (Initialize != null)
3518 {
3519 Initialize(this);
3520 }
3521 Handler = ((Component)this).GetComponent<VRC_EventHandler>();
3522 if ((Object)(object)Handler == (Object)null)
3523 {
3524 Handler = ((Component)this).GetComponentInParent<VRC_EventHandler>();
3525 }
3526 }
3527
3528 private void Update()
3529 {
3530 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
3531 //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
3532 if (LocalOnly)
3533 {
3535 }
3536 IEnumerator<VRC_EventHandler.VrcEvent> enumerator;
3537 if (Input.GetKeyDown(Key) && DownEventName != "" && Enumerable.FirstOrDefault<VRC_EventHandler.VrcEvent>((IEnumerable<VRC_EventHandler.VrcEvent>)(object)Handler.Events, (Func<VRC_EventHandler.VrcEvent, bool>)([CompilerGenerated] (VRC_EventHandler.VrcEvent e) => e.Name == DownEventName)) != null)
3538 {
3539 enumerator = Enumerable.Where<VRC_EventHandler.VrcEvent>((IEnumerable<VRC_EventHandler.VrcEvent>)(object)Handler.Events, (Func<VRC_EventHandler.VrcEvent, bool>)([CompilerGenerated] (VRC_EventHandler.VrcEvent e) => e.Name == DownEventName)).GetEnumerator();
3540 try
3541 {
3542 while (((IEnumerator)enumerator).MoveNext())
3543 {
3544 VRC_EventHandler.VrcEvent current = enumerator.Current;
3546 }
3547 }
3548 finally
3549 {
3550 if (enumerator != null)
3551 {
3552 ((IDisposable)enumerator).Dispose();
3553 }
3554 }
3555 }
3556 if (!Input.GetKeyUp(Key) || !(UpEventName != "") || Enumerable.FirstOrDefault<VRC_EventHandler.VrcEvent>((IEnumerable<VRC_EventHandler.VrcEvent>)(object)Handler.Events, (Func<VRC_EventHandler.VrcEvent, bool>)([CompilerGenerated] (VRC_EventHandler.VrcEvent e) => e.Name == UpEventName)) == null)
3557 {
3558 return;
3559 }
3560 enumerator = Enumerable.Where<VRC_EventHandler.VrcEvent>((IEnumerable<VRC_EventHandler.VrcEvent>)(object)Handler.Events, (Func<VRC_EventHandler.VrcEvent, bool>)([CompilerGenerated] (VRC_EventHandler.VrcEvent e) => e.Name == UpEventName)).GetEnumerator();
3561 try
3562 {
3563 while (((IEnumerator)enumerator).MoveNext())
3564 {
3565 VRC_EventHandler.VrcEvent current2 = enumerator.Current;
3567 }
3568 }
3569 finally
3570 {
3571 if (enumerator != null)
3572 {
3573 ((IDisposable)enumerator).Dispose();
3574 }
3575 }
3576 }
3577 }
3578 public abstract class VRC_NpcApi : MonoBehaviour
3579 {
3580 public delegate void InitializeDelegate(VRC_NpcApi obj);
3581
3583
3584 public static Func<GameObject, VRC_NpcApi> _GetApiByGameObject;
3585
3586 public static Action<VRC_NpcApi, bool, string, string> _SetNamePlate;
3587
3588 public static Action<VRC_NpcApi, bool, bool, bool> _SetSocialStatus;
3589
3590 public static Action<VRC_NpcApi, bool, bool> _SetMuteStatus;
3591
3592 public static Action<VRC_NpcApi, int, bool> _ActThis;
3593
3594 public static Action<VRC_NpcApi, AudioClip, float> _SayThis;
3595
3596 private void Start()
3597 {
3598 if (Initialize != null)
3599 {
3600 Initialize(this);
3601 }
3602 }
3603
3604 public static VRC_NpcApi GetApiByGameObject(GameObject npcGameObject)
3605 {
3606 if ((Object)(object)npcGameObject != (Object)null)
3607 {
3608 return _GetApiByGameObject.Invoke(npcGameObject);
3609 }
3610 return null;
3611 }
3612
3613 public void ActThis(int number, bool loop)
3614 {
3615 _ActThis.Invoke(this, number, loop);
3616 }
3617
3618 public void SayThis(AudioClip clip, float volume)
3619 {
3620 _SayThis.Invoke(this, clip, volume);
3621 }
3622
3623 public void SetNamePlate(bool visible, string playerName, string vipTag)
3624 {
3625 _SetNamePlate.Invoke(this, visible, playerName, vipTag);
3626 }
3627
3628 public void SetSocialStatus(bool friend, bool vip, bool blocked)
3629 {
3630 _SetSocialStatus.Invoke(this, friend, vip, blocked);
3631 }
3632
3633 public void SetMuteStatus(bool canSpeak, bool canHear)
3634 {
3635 _SetMuteStatus.Invoke(this, canSpeak, canHear);
3636 }
3637 }
3638 public abstract class VRC_PhysicsRoot : MonoBehaviour
3639 {
3640 private GameObject PhysicsRoot;
3641
3642 private GameObject[] PhysicsObjects;
3643
3644 private void Start()
3645 {
3646 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
3647 //IL_0029: Expected O, but got Unknown
3648 PhysicsRoot = GameObject.Find("_PhysicsRoot");
3649 if ((Object)(object)PhysicsRoot == (Object)null)
3650 {
3651 PhysicsRoot = new GameObject();
3652 ((Object)PhysicsRoot).name = "_PhysicsRoot";
3653 }
3654 PhysicsObjects = (GameObject[])(object)new GameObject[((Component)this).transform.childCount];
3655 for (int i = 0; i < ((Component)this).transform.childCount; i++)
3656 {
3657 PhysicsObjects[i] = ((Component)((Component)this).transform.GetChild(i)).gameObject;
3658 }
3659 GameObject[] physicsObjects = PhysicsObjects;
3660 for (int j = 0; j < physicsObjects.Length; j++)
3661 {
3662 physicsObjects[j].transform.parent = PhysicsRoot.transform;
3663 }
3664 }
3665
3666 private void OnDestroy()
3667 {
3668 GameObject[] physicsObjects = PhysicsObjects;
3669 for (int i = 0; i < physicsObjects.Length; i++)
3670 {
3671 Object.Destroy((Object)(object)physicsObjects[i]);
3672 }
3673 }
3674 }
3675 public abstract class VRC_PlayableLayerControl : StateMachineBehaviour
3676 {
3677 [Serializable]
3678 public enum BlendableLayer : Enum
3679 {
3680 Action,
3681 FX,
3682 Gesture,
3683 Additive
3684 }
3685
3686 [HideInInspector]
3688
3689 [HideInInspector]
3690 public delegate void ApplySettingsDelegate(VRC_PlayableLayerControl control, Animator animator);
3691
3692 [Tooltip("Layer to affect")]
3694
3695 [Tooltip("Goal weight 0-1")]
3696 [Range(0f, 1f)]
3697 public float goalWeight;
3698
3699 [Tooltip("Time to reach goal weight")]
3700 public float blendDuration;
3701
3702 [Tooltip("Message for debugging")]
3703 public string debugString;
3704
3705 [HideInInspector]
3707
3708 [HideInInspector]
3710
3711 [HideInInspector]
3713
3714 private void Awake()
3715 {
3716 if (Initialize != null)
3717 {
3718 Initialize(this);
3719 }
3720 }
3721
3722 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
3723 {
3724 if (!String.IsNullOrEmpty(debugString))
3725 {
3726 Debug.Log((object)String.Concat("VRCPlayableLayerControl:", debugString));
3727 }
3728 ApplySettings?.Invoke(this, animator);
3729 }
3730 }
3731 public interface IVRC_Destructible
3732 {
3733 object[] GetState();
3734
3735 void SetState(object[] state);
3736
3738
3740
3741 void ApplyDamage(float damage);
3742
3743 void ApplyHealing(float healing);
3744 }
3745 [RequireComponent(/*Could not decode attribute arguments.*/)]
3746 public abstract class VRC_DestructibleStandard : MonoBehaviour, IVRC_Destructible
3747 {
3748 public float maxHealth = 100f;
3749
3750 public float currentHealth = 100f;
3751
3752 public bool healable;
3753
3754 public string damageEvent;
3755
3756 public string destroyEvent;
3757
3758 public string healEvent;
3759
3760 public string fullHealthEvent;
3761
3763
3765
3767
3769
3771
3773
3775
3777
3779
3781
3783
3785
3787
3789
3791
3793
3795
3796 public float GetMaxHealth()
3797 {
3798 return maxHealth;
3799 }
3800
3801 public float GetCurrentHealth()
3802 {
3803 return currentHealth;
3804 }
3805
3806 private void Awake()
3807 {
3808 eventHandler = ((Component)this).GetComponent<VRC_EventHandler>();
3809 if ((Object)(object)eventHandler == (Object)null)
3810 {
3811 eventHandler = ((Component)this).GetComponentInParent<VRC_EventHandler>();
3812 }
3813 }
3814
3815 public void ApplyDamage(float damage)
3816 {
3817 if (!(currentHealth > 0f))
3818 {
3819 return;
3820 }
3821 currentHealth -= damage;
3822 if (currentHealth <= 0f)
3823 {
3824 currentHealth = 0f;
3825 }
3826 if (!String.IsNullOrEmpty(damageEvent) && (Object)(object)eventHandler != (Object)null)
3827 {
3828 IEnumerator<VRC_EventHandler.VrcEvent> enumerator = Enumerable.Where<VRC_EventHandler.VrcEvent>((IEnumerable<VRC_EventHandler.VrcEvent>)(object)eventHandler.Events, (Func<VRC_EventHandler.VrcEvent, bool>)([CompilerGenerated] (VRC_EventHandler.VrcEvent e) => e.Name == damageEvent)).GetEnumerator();
3829 try
3830 {
3831 while (((IEnumerator)enumerator).MoveNext())
3832 {
3833 VRC_EventHandler.VrcEvent current = enumerator.Current;
3835 }
3836 }
3837 finally
3838 {
3839 if (enumerator != null)
3840 {
3841 ((IDisposable)enumerator).Dispose();
3842 }
3843 }
3844 }
3847 if (currentHealth != 0f)
3848 {
3849 return;
3850 }
3851 if (!String.IsNullOrEmpty(destroyEvent) && (Object)(object)eventHandler != (Object)null)
3852 {
3853 IEnumerator<VRC_EventHandler.VrcEvent> enumerator = Enumerable.Where<VRC_EventHandler.VrcEvent>((IEnumerable<VRC_EventHandler.VrcEvent>)(object)eventHandler.Events, (Func<VRC_EventHandler.VrcEvent, bool>)([CompilerGenerated] (VRC_EventHandler.VrcEvent e) => e.Name == destroyEvent)).GetEnumerator();
3854 try
3855 {
3856 while (((IEnumerator)enumerator).MoveNext())
3857 {
3858 VRC_EventHandler.VrcEvent current2 = enumerator.Current;
3859 eventHandler.TriggerEvent(current2, VRC_EventHandler.VrcBroadcastType.AlwaysUnbuffered);
3860 }
3861 }
3862 finally
3863 {
3864 if (enumerator != null)
3865 {
3866 ((IDisposable)enumerator).Dispose();
3867 }
3868 }
3869 }
3872 }
3873
3874 public void ApplyHealing(float healing)
3875 {
3876 Debug.Log((object)"ApplyHealing");
3877 if (!healable || !(currentHealth < maxHealth))
3878 {
3879 return;
3880 }
3881 currentHealth += healing;
3882 if (currentHealth >= maxHealth)
3883 {
3885 }
3886 if (!String.IsNullOrEmpty(healEvent) && (Object)(object)eventHandler != (Object)null)
3887 {
3888 IEnumerator<VRC_EventHandler.VrcEvent> enumerator = Enumerable.Where<VRC_EventHandler.VrcEvent>((IEnumerable<VRC_EventHandler.VrcEvent>)(object)eventHandler.Events, (Func<VRC_EventHandler.VrcEvent, bool>)([CompilerGenerated] (VRC_EventHandler.VrcEvent e) => e.Name == destroyEvent)).GetEnumerator();
3889 try
3890 {
3891 while (((IEnumerator)enumerator).MoveNext())
3892 {
3893 VRC_EventHandler.VrcEvent current = enumerator.Current;
3895 }
3896 }
3897 finally
3898 {
3899 if (enumerator != null)
3900 {
3901 ((IDisposable)enumerator).Dispose();
3902 }
3903 }
3904 }
3907 if (currentHealth != maxHealth)
3908 {
3909 return;
3910 }
3911 if (!String.IsNullOrEmpty(fullHealthEvent) && (Object)(object)eventHandler != (Object)null)
3912 {
3913 IEnumerator<VRC_EventHandler.VrcEvent> enumerator = Enumerable.Where<VRC_EventHandler.VrcEvent>((IEnumerable<VRC_EventHandler.VrcEvent>)(object)eventHandler.Events, (Func<VRC_EventHandler.VrcEvent, bool>)([CompilerGenerated] (VRC_EventHandler.VrcEvent e) => e.Name == fullHealthEvent)).GetEnumerator();
3914 try
3915 {
3916 while (((IEnumerator)enumerator).MoveNext())
3917 {
3918 VRC_EventHandler.VrcEvent current2 = enumerator.Current;
3919 eventHandler.TriggerEvent(current2, VRC_EventHandler.VrcBroadcastType.AlwaysUnbuffered);
3920 }
3921 }
3922 finally
3923 {
3924 if (enumerator != null)
3925 {
3926 ((IDisposable)enumerator).Dispose();
3927 }
3928 }
3929 }
3932 }
3933
3934 public object[] GetState()
3935 {
3936 return (object[])(object)new Object[1] { (object)currentHealth };
3937 }
3938
3939 public void SetState(object[] state)
3940 {
3941 //IL_0004: Unknown result type (might be due to invalid IL or missing references)
3942 //IL_000e: Expected F4, but got Unknown
3943 currentHealth = (float)(Single)state[0];
3944 }
3945
3947 {
3948 if ((Object)(object)trigger != (Object)null && !String.IsNullOrEmpty(e.ParameterString))
3949 {
3950 VRC_Trigger.TriggerCustom(((Component)trigger).gameObject, e.ParameterString);
3951 }
3952 }
3953 }
3954 public abstract class VRC_VisualDamage : MonoBehaviour
3955 {
3956 [Tooltip("the scale of the damage indicator when at full damage")]
3957 public float fullDamageScale = 1f;
3958
3959 [Tooltip("the scale of the damage indicator when at minimum damage")]
3960 public float minDamageScale = 2f;
3961
3962 [Tooltip("the distance in front of the player's head for the damage indicator")]
3963 public float offset = 0.5f;
3964
3965 private AnimationCurve curve = new AnimationCurve();
3966
3967 private float currentTime;
3968
3969 private Renderer renderer;
3970
3971 private Vector3 initScale;
3972
3973 private void Awake()
3974 {
3975 renderer = ((Component)this).GetComponent<Renderer>();
3976 }
3977
3978 private void Start()
3979 {
3980 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
3981 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
3982 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
3983 //IL_003e: Unknown result type (might be due to invalid IL or missing references)
3984 initScale = ((Component)this).transform.localScale;
3985 curve.AddKey(new Keyframe(0f, fullDamageScale));
3986 curve.AddKey(new Keyframe(1f, minDamageScale));
3987 }
3988
3989 private void OnSceneWasLoaded()
3990 {
3991 Object.Destroy((Object)(object)((Component)this).gameObject);
3992 }
3993
3994 private void Update()
3995 {
3996 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
3997 //IL_005f: Unknown result type (might be due to invalid IL or missing references)
3998 if ((Object)(object)renderer != (Object)null && curve != null && renderer.enabled)
3999 {
4000 if (currentTime < 1f)
4001 {
4002 currentTime += Time.deltaTime;
4003 }
4004 ((Component)this).transform.localScale = initScale * curve.Evaluate(currentTime);
4005 }
4006 }
4007
4008 private void HideDamageIndicator()
4009 {
4010 if ((Object)(object)renderer != (Object)null)
4011 {
4012 renderer.enabled = false;
4013 }
4014 }
4015
4016 private void ShowDamageIndicator()
4017 {
4018 if ((Object)(object)renderer != (Object)null)
4019 {
4020 renderer.enabled = true;
4021 }
4022 }
4023
4024 public void SetDamagePercent(float damagePercent)
4025 {
4026 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
4027 if (damagePercent > 0f)
4028 {
4030 currentTime = 0f;
4031 float num = fullDamageScale - minDamageScale;
4032 float num2 = minDamageScale + num * damagePercent;
4033 curve.MoveKey(1, new Keyframe(1f, num2));
4034 }
4035 else
4036 {
4038 }
4039 }
4040 }
4041 public interface IAnimParameterAccess
4042 {
4043 bool boolVal { get; set; }
4044
4045 int intVal { get; set; }
4046
4047 float floatVal { get; set; }
4048 }
4049 public interface IEditorOnly
4050 {
4051 }
4053 {
4054 int PreprocessOrder { get; }
4055
4057 }
4058 public interface IVRCEventProvider
4059 {
4061 }
4062 public interface IVRCEventReceiver
4063 {
4064 }
4065 public interface IVRCEventSender
4066 {
4067 }
4068 public interface INetworkID
4069 {
4070 }
4071 public interface INetworkIDContainer
4072 {
4073 List<NetworkIDPair> NetworkIDCollection { get; set; }
4074
4075 void GetNetworkIDObjects(List<INetworkID> netIds);
4076
4077 GameObject FindNetworkIDGameObject(string path);
4078
4079 string GetNetworkIDGameObjectPath(GameObject obj);
4080 }
4085 public abstract class VRC_MidiNoteIn : MonoBehaviour
4086 {
4092 [Serializable]
4093 public enum Channel : Enum
4094 {
4100 Any,
4106 Ch_1,
4111 Ch_2,
4116 Ch_3,
4121 Ch_4,
4126 Ch_5,
4131 Ch_6,
4136 Ch_7,
4141 Ch_8,
4146 Ch_9,
4151 Ch_10,
4156 Ch_11,
4161 Ch_12,
4166 Ch_13,
4171 Ch_14,
4176 Ch_15,
4181 Ch_16
4182 }
4183
4189 [Serializable]
4190 public enum Note : Enum
4191 {
4197 A0 = 21,
4202 Bb0,
4207 B0,
4212 C1,
4217 Db1,
4222 D1,
4227 Eb1,
4232 E1,
4237 F1,
4242 Gb1,
4247 G1,
4252 Ab1,
4257 A1,
4262 Bb1,
4267 B1,
4272 C2,
4277 Db2,
4282 D2,
4287 Eb2,
4292 E2,
4297 F2,
4302 Gb2,
4307 G2,
4312 Ab2,
4317 A2,
4322 Bb2,
4327 B2,
4332 C3,
4337 Db3,
4342 D3,
4347 Eb3,
4352 E3,
4357 F3,
4362 Gb3,
4367 G3,
4372 Ab3,
4377 A3,
4382 Bb3,
4387 B3,
4392 C4,
4397 Db4,
4402 D4,
4407 Eb4,
4412 E4,
4417 F4,
4422 Gb4,
4427 G4,
4432 Ab4,
4437 A4,
4442 Bb4,
4447 B4,
4452 C5,
4457 Db5,
4462 D5,
4467 Eb5,
4472 E5,
4477 F5,
4482 Gb5,
4487 G5,
4492 Ab5,
4497 A5,
4502 Bb5,
4507 B5,
4512 C6,
4517 Db6,
4522 D6,
4527 Eb6,
4532 E6,
4537 F6,
4542 Gb6,
4547 G6,
4552 Ab6,
4557 A6,
4562 Bb6,
4567 B6,
4572 C7,
4577 Db7,
4582 D7,
4587 Eb7,
4592 E7,
4597 F7,
4602 Gb7,
4607 G7,
4612 Ab7,
4617 A7,
4622 Bb7,
4627 B7,
4632 C8
4633 }
4634
4635 public delegate void InitializationDelegate(VRC_MidiNoteIn obj);
4636
4642
4647 public Note note;
4648
4654
4660
4662
4663 private void Awake()
4664 {
4665 if (Initialize != null)
4666 {
4667 Initialize(this);
4668 }
4669 }
4670
4671 private void Start()
4672 {
4673 }
4674
4675 private void Update()
4676 {
4677 }
4678 }
4679 public abstract class VRC_OscButtonIn : MonoBehaviour
4680 {
4681 public delegate void InitializationDelegate(VRC_OscButtonIn obj);
4682
4683 public string address;
4684
4686
4688
4690
4691 private void Awake()
4692 {
4693 if (Initialize != null)
4694 {
4695 Initialize(this);
4696 }
4697 }
4698
4699 private void Start()
4700 {
4701 }
4702
4703 private void Update()
4704 {
4705 }
4706 }
4707 internal class MathUtil : Object
4708 {
4709 public static float PI = (float)Math.PI;
4710
4711 public static float TWO_PI = PI * 2f;
4712
4713 public static float HALF_PI = (float)Math.PI / 2f;
4714
4715 public static float QUARTER_PI = 0.785398f;
4716
4717 public static float AngleBetweenTwoUnitVectors(Vector3 planeNormal, Vector3 vectorA, Vector3 vectorB)
4718 {
4719 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
4720 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
4721 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
4722 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
4723 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
4724 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
4725 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
4726 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
4727 if (Vector3.Dot(Vector3.Cross(vectorA, planeNormal), vectorB) > 0f)
4728 {
4729 return (TWO_PI - Mathf.Acos(Mathf.Clamp(Vector3.Dot(vectorA, vectorB), -1f, 1f))) * 57.29578f;
4730 }
4731 return Mathf.Acos(Mathf.Clamp(Vector3.Dot(vectorA, vectorB), -1f, 1f)) * 57.29578f;
4732 }
4733
4734 public static float AngleClosestBetweenTwoUnitVectors(Vector3 planeNormal, Vector3 vectorA, Vector3 vectorB)
4735 {
4736 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
4737 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
4738 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
4739 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
4740 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
4741 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
4742 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
4743 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
4744 if (Vector3.Dot(Vector3.Cross(vectorA, planeNormal), vectorB) > 0f)
4745 {
4746 return (0f - Mathf.Acos(Mathf.Clamp(Vector3.Dot(vectorA, vectorB), -1f, 1f))) * 57.29578f;
4747 }
4748 return Mathf.Acos(Mathf.Clamp(Vector3.Dot(vectorA, vectorB), -1f, 1f)) * 57.29578f;
4749 }
4750
4751 public static float ClosestPointOnLineSegment_Value(Vector3 lineA, Vector3 lineB, Vector3 point)
4752 {
4753 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
4754 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
4755 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
4756 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
4757 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
4758 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
4759 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
4760 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
4761 //IL_0024: Unknown result type (might be due to invalid IL or missing references)
4762 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
4763 Vector3 val = lineB - lineA;
4764 float num = Vector3.Dot(point - lineA, val);
4765 if (num <= 0f)
4766 {
4767 return 0f;
4768 }
4769 float num2 = Vector3.Dot(val, val);
4770 if (num2 <= num)
4771 {
4772 return 1f;
4773 }
4774 return num / num2;
4775 }
4776
4777 public static Vector3 ClosestPointOnLineSegment(Vector3 lineA, Vector3 lineB, Vector3 point)
4778 {
4779 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
4780 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
4781 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
4782 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
4783 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
4784 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
4785 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
4786 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
4787 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
4788 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
4789 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
4790 //IL_002e: Unknown result type (might be due to invalid IL or missing references)
4791 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
4792 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
4793 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
4794 //IL_002c: Unknown result type (might be due to invalid IL or missing references)
4795 Vector3 val = lineB - lineA;
4796 float num = Vector3.Dot(point - lineA, val);
4797 if (num <= 0f)
4798 {
4799 return lineA;
4800 }
4801 float num2 = Vector3.Dot(val, val);
4802 if (num2 <= num)
4803 {
4804 return lineB;
4805 }
4806 return lineA + val * (num / num2);
4807 }
4808
4809 public static Vector3 ClosestPointOnPlane(Vector3 planeOrigin, Vector3 planeNormal, Vector3 point)
4810 {
4811 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
4812 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
4813 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
4814 //IL_0003: Unknown result type (might be due to invalid IL or missing references)
4815 //IL_0004: Unknown result type (might be due to invalid IL or missing references)
4816 //IL_0005: Unknown result type (might be due to invalid IL or missing references)
4817 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
4818 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
4819 return point + planeNormal * Vector3.Dot(planeNormal, planeOrigin - point);
4820 }
4821 }
4823 {
4824 public delegate Object InstantiationDelegate(Object prefab);
4825
4826 public string blueprintId = "";
4827
4828 [HideInInspector]
4830
4831 public Transform Placement;
4832
4834
4835 public float scale = 1f;
4836
4837 [HideInInspector]
4839
4840 [HideInInspector]
4841 public Texture2D avatarImage;
4842
4843 private GameObject Instance;
4844
4846
4847 private void Awake()
4848 {
4849 //IL_0092: Unknown result type (might be due to invalid IL or missing references)
4850 //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
4851 //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
4852 GameObject val = Resources.Load<GameObject>("AvatarPedestal");
4853 if ((Object)(object)val != (Object)null && Instantiate != null)
4854 {
4855 ref GameObject instance = ref Instance;
4856 Object obj = Instantiate((Object)(object)val);
4857 instance = (GameObject)(object)((obj is GameObject) ? obj : null);
4858 if ((Object)(object)Placement != (Object)null)
4859 {
4860 Instance.transform.parent = ((Component)Placement).transform;
4861 }
4862 else
4863 {
4864 Instance.transform.parent = ((Component)this).transform;
4865 }
4866 Instance.transform.localPosition = new Vector3(0f, 0f, 0f);
4867 Instance.transform.localRotation = Quaternion.identity;
4868 Instance.transform.localScale = new Vector3(1f, 1f, 1f);
4869 }
4870 }
4871
4872 [RPC(new RPC.Destination[] { })]
4873 public virtual void SwitchAvatar(string id, VRCPlayerApi instigator)
4874 {
4875 SwitchAvatar(id);
4876 }
4877
4878 public virtual void SwitchAvatar(string id)
4879 {
4880 blueprintId = id;
4881 if ((Object)(object)Instance != (Object)null)
4882 {
4883 Networking.RPC(RPC.Destination.All, Instance, "RefreshAvatar");
4884 }
4885 }
4886
4887 [RPC(new RPC.Destination[]
4888 {
4889 RPC.Destination.All,
4890 RPC.Destination.Local
4891 })]
4892 public void SetAvatarUse(VRCPlayerApi instigator)
4893 {
4894 if ((Object)(object)Instance != (Object)null && instigator != null && instigator.isLocal)
4895 {
4896 Networking.RPC(RPC.Destination.Local, Instance, "SetAvatarUse");
4897 }
4898 }
4899 }
4900 public abstract class VRC_GunStats : MonoBehaviour
4901 {
4902 public float rateOfFire = 10f;
4903
4904 public float damage = 10f;
4905
4906 public bool fullAuto = true;
4907
4908 public GameObject muzzleEffect;
4909
4910 public AudioSource muzzleAudio;
4911
4912 public AudioClip[] fireAudio;
4913
4914 public AudioSource reloadAudio;
4915
4916 public GameObject[] hitEffects;
4917
4918 public GameObject leftHandContact;
4919
4921
4922 public int clipSize;
4923
4924 public AudioClip EmptyClipFire;
4925 }
4926 public abstract class VRC_NPCSpawn : MonoBehaviour
4927 {
4928 public delegate void InstantiationDelegate(VRC_NPCSpawn obj);
4929
4930 public string npcName = "";
4931
4932 public string blueprintId = "";
4933
4934 public RuntimeAnimatorController customAnimation;
4935
4936 public float scale = 1f;
4937
4939
4940 public GameObject npcGameObject;
4941
4942 private void Awake()
4943 {
4944 if (Initialize != null)
4945 {
4946 Initialize(this);
4947 }
4948 }
4949 }
4950 public abstract class VRC_ObjectApi : MonoBehaviour
4951 {
4952 public void ClaimControl(VRCPlayerApi player)
4953 {
4954 }
4955 }
4956 public abstract class VRC_ObjectSpawn : MonoBehaviour, IVRCEventProvider
4957 {
4958 public delegate void InitializationDelegate(VRC_ObjectSpawn obj);
4959
4960 public delegate void InstantiationDelegate(Vector3 position, Quaternion rotation);
4961
4962 public delegate void ObjectReaperDelegate();
4963
4964 public GameObject ObjectPrefab;
4965
4967
4969
4971
4972 [RPC(new RPC.Destination[] { })]
4973 public void SpawnObject()
4974 {
4975 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
4976 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
4977 SpawnObject(((Component)this).transform.position, ((Component)this).transform.rotation);
4978 }
4979
4980 [RPC(new RPC.Destination[] { })]
4981 public void SpawnObject(Vector3 position, Quaternion rotation)
4982 {
4983 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
4984 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
4985 if (Instantiate != null)
4986 {
4987 Instantiate(position, rotation);
4988 }
4989 else
4990 {
4991 Debug.LogError((object)"Spawner not initialized.", (Object)(object)((Component)this).gameObject);
4992 }
4993 }
4994
4995 [RPC(new RPC.Destination[] { })]
4997 {
4998 if (ReapObjects != null)
4999 {
5000 ReapObjects();
5001 }
5002 }
5003
5004 private void Start()
5005 {
5006 if (Initialize != null)
5007 {
5008 Initialize(this);
5009 }
5010 }
5011
5013 {
5014 List<VRC_EventHandler.VrcEvent> val = new List<VRC_EventHandler.VrcEvent>();
5016 vrcEvent.Name = "SpawnObject";
5017 vrcEvent.EventType = VRC_EventHandler.VrcEventType.SendRPC;
5018 vrcEvent.ParameterInt = 3;
5019 vrcEvent.ParameterString = "SpawnObject";
5020 vrcEvent.ParameterObjects = (GameObject[])(object)new GameObject[1] { ((Component)this).gameObject };
5021 val.Add(vrcEvent);
5022 vrcEvent = new VRC_EventHandler.VrcEvent();
5023 vrcEvent.Name = "DestroySpawnedObjects";
5024 vrcEvent.EventType = VRC_EventHandler.VrcEventType.SendRPC;
5025 vrcEvent.ParameterInt = 0;
5026 vrcEvent.ParameterString = "DestroySpawnedObjects";
5027 vrcEvent.ParameterObjects = (GameObject[])(object)new GameObject[1] { ((Component)this).gameObject };
5028 val.Add(vrcEvent);
5029 return (IEnumerable<VRC_EventHandler.VrcEvent>)(object)val;
5030 }
5031 }
5032 [RequireComponent(/*Could not decode attribute arguments.*/)]
5034 {
5035 public enum PickupOrientation : Enum
5036 {
5037 Any,
5038 Grip,
5039 Gun
5040 }
5041
5042 public enum AutoHoldMode : Enum
5043 {
5044 AutoDetect,
5045 Yes,
5046 No
5047 }
5048
5049 public enum PickupHand : Enum
5050 {
5051 None,
5052 Left,
5053 Right
5054 }
5055
5056 public delegate void AwakeDelegate(VRC_Pickup obj);
5057
5058 public delegate void ForceDropDelegate(VRC_Pickup obj);
5059
5060 public delegate void OnDestroyedDelegate(VRC_Pickup obj);
5061
5062 public delegate void HapticEventDelegate(VRC_Pickup obj, float duration, float amplitude, float frequency);
5063
5064 public ForceMode MomentumTransferMethod;
5065
5066 public bool DisallowTheft;
5067
5068 public Transform ExactGun;
5069
5070 public Transform ExactGrip;
5071
5073
5075
5077
5078 public string InteractionText = "";
5079
5080 public string UseText = "Use";
5081
5082 [HideInInspector]
5083 [Obsolete("Please use a VRC_Trigger", false)]
5085
5086 [HideInInspector]
5087 [Obsolete("Please use a VRC_Trigger", false)]
5088 public string UseDownEventName;
5089
5090 [HideInInspector]
5091 [Obsolete("Please use a VRC_Trigger", false)]
5092 public string UseUpEventName;
5093
5094 [HideInInspector]
5095 [Obsolete("Please use a VRC_Trigger", false)]
5097
5098 [HideInInspector]
5099 [Obsolete("Please use a VRC_Trigger", false)]
5100 public string PickupEventName;
5101
5102 [HideInInspector]
5103 [Obsolete("Please use a VRC_Trigger", false)]
5104 public string DropEventName;
5105
5107
5108 public float ThrowVelocityBoostScale = 1f;
5109
5110 [HideInInspector]
5111 public Component currentlyHeldBy;
5112
5113 [HideInInspector]
5115
5116 public bool pickupable = true;
5117
5118 [Range(0f, 100f)]
5119 public float proximity = 2f;
5120
5121 public static AwakeDelegate OnAwake;
5122
5124
5126
5128
5129 public static Func<VRC_Pickup, PickupHand> _GetPickupHand;
5130
5131 public static Func<VRC_Pickup, VRCPlayerApi> _GetCurrentPlayer;
5132
5134 {
5135 get
5136 {
5137 if (_GetCurrentPlayer == null)
5138 {
5139 return null;
5140 }
5141 return _GetCurrentPlayer.Invoke(this);
5142 }
5143 }
5144
5145 public bool IsHeld
5146 {
5147 get
5148 {
5149 if (currentPlayer != null)
5150 {
5151 return currentHand != PickupHand.None;
5152 }
5153 return false;
5154 }
5155 }
5156
5157 public PickupHand currentHand => _GetPickupHand.Invoke(this);
5158
5159 public float Proximity => proximity;
5160
5161 private void Awake()
5162 {
5163 if (OnAwake != null)
5164 {
5165 OnAwake(this);
5166 }
5167 }
5168
5169 private void Reset()
5170 {
5171 ((Component)this).gameObject.layer = LayerMask.NameToLayer("Pickup");
5172 }
5173
5174 public void Drop()
5175 {
5177 }
5178
5179 [RPC(new RPC.Destination[]
5180 {
5181 RPC.Destination.Local,
5182 RPC.Destination.Owner
5183 })]
5184 public void Drop(VRCPlayerApi instigator)
5185 {
5186 //IL_0048: Unknown result type (might be due to invalid IL or missing references)
5187 //IL_0039: Unknown result type (might be due to invalid IL or missing references)
5188 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
5189 //IL_006f: Unknown result type (might be due to invalid IL or missing references)
5190 //IL_0061: Unknown result type (might be due to invalid IL or missing references)
5191 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
5192 if (ForceDrop != null && currentPlayer != null)
5193 {
5194 if (instigator != null && instigator == currentPlayer)
5195 {
5196 ForceDrop(this);
5197 return;
5198 }
5199 Object[] obj = new Object[2]
5200 {
5201 (object)((instigator != null) ? new Nullable<int>(instigator.playerId) : default(Nullable<int>)),
5202 default(Object)
5203 };
5204 VRCPlayerApi vRCPlayerApi = currentPlayer;
5205 obj[1] = (object)((vRCPlayerApi != null) ? new Nullable<int>(vRCPlayerApi.playerId) : default(Nullable<int>));
5206 Debug.LogErrorFormat("Cannot Drop. Instigator {0} != Owner {1}", (object[])(object)obj);
5207 }
5208 }
5209
5210 public void GenerateHapticEvent(float duration = 0.25f, float amplitude = 0.5f, float frequency = 0.5f)
5211 {
5212 if (HapticEvent != null)
5213 {
5214 HapticEvent(this, duration, amplitude, frequency);
5215 }
5216 }
5217
5218 private void OnDestroy()
5219 {
5220 if (OnDestroyed != null)
5221 {
5222 OnDestroyed(this);
5223 }
5224 }
5225
5226 [RPC(new RPC.Destination[] { })]
5227 public void PlayHaptics()
5228 {
5230 }
5231
5233 {
5234 List<VRC_EventHandler.VrcEvent> val = new List<VRC_EventHandler.VrcEvent>();
5235 val.Add(new VRC_EventHandler.VrcEvent
5236 {
5237 Name = "PlayHaptics",
5238 EventType = VRC_EventHandler.VrcEventType.SendRPC,
5239 ParameterInt = 0,
5240 ParameterObjects = (GameObject[])(object)new GameObject[1] { ((Component)this).gameObject },
5241 ParameterString = "PlayHaptics"
5242 });
5243 val.Add(new VRC_EventHandler.VrcEvent
5244 {
5245 Name = "Drop",
5246 EventType = VRC_EventHandler.VrcEventType.SendRPC,
5247 ParameterInt = 0,
5248 ParameterObjects = (GameObject[])(object)new GameObject[1] { ((Component)this).gameObject },
5249 ParameterString = "Drop"
5250 });
5251 return (IEnumerable<VRC_EventHandler.VrcEvent>)(object)val;
5252 }
5253 }
5254 public abstract class VRC_PortalMarker : MonoBehaviour
5255 {
5256 public enum SortHeading : Enum
5257 {
5258 Featured,
5259 Trending,
5260 Updated,
5261 Created,
5262 Active,
5263 None
5264 }
5265
5266 public enum SortOrder : Enum
5267 {
5268 Ascending,
5269 Descending
5270 }
5271
5272 public enum VRChatWorld : Enum
5273 {
5274 None,
5275 Hub,
5276 Home
5277 }
5278
5279 public delegate void InitializationDelegate(VRC_PortalMarker obj);
5280
5281 [Tooltip("Contains a specific VRChat location such as the Hub or Home, if one is selected portal will go there.")]
5283
5284 [Tooltip("Id of the destination world, like `wrld_f995a2eb-7ddc-4558-aef1-815c3b23df6c`.")]
5285 public string roomId;
5286
5287 [Tooltip("Overrides the name shown above the Portal.")]
5288 public string customPortalName;
5289
5290 [Tooltip("How to sort the search results if they're used instead of a roomId.")]
5292
5293 [Tooltip("Whether to sort the results in Ascending or Descending order. Descending order would have the 'Most Trending' worlds appear first, for example, while Ascending would have the 'Least Trending' worlds first.")]
5295
5296 [Tooltip("The offset to use for choosing the portal to visit. Useful if you want to make 5 portals to the top 5 worlds in a category, for example, by using Offsets of zero through four.")]
5297 public int offset;
5298
5299 [Tooltip("The words to use when searching for worlds")]
5300 public string searchTerm;
5301
5302 [Tooltip("A comma-separated list of tags to search for, if `Room Id` is not set, and `Sort Heading` is set to `None`.")]
5303 public string tag;
5304
5305 [HideInInspector]
5307
5308 [HideInInspector]
5309 public string effectPrefabName;
5310
5311 public static InitializationDelegate Initialize;
5312
5313 [HideInInspector]
5314 public string roomName;
5315
5316 [HideInInspector]
5317 public bool updateFlag;
5318
5320
5321 public void RefreshPortal()
5322 {
5323 updateFlag = true;
5324 }
5325
5326 private void Awake()
5327 {
5328 if (!String.IsNullOrEmpty(roomId) || world == VRChatWorld.Home || world == VRChatWorld.Hub)
5329 {
5330 initializedWithRoomId = true;
5331 if (Initialize != null)
5332 {
5333 Initialize(this);
5334 }
5335 }
5336 }
5337
5338 private void Update()
5339 {
5340 if (!initializedWithRoomId && !String.IsNullOrEmpty(roomId))
5341 {
5342 initializedWithRoomId = true;
5343 if (Initialize != null)
5344 {
5345 Initialize(this);
5346 }
5347 }
5348 }
5349 }
5350 public abstract class VRC_PropApi : MonoBehaviour
5351 {
5352 public HumanBodyBones mountPoint;
5353 }
5354 public abstract class VRC_PropController : MonoBehaviour
5355 {
5356 public delegate void UpdateDelegate(VRC_PropController obj);
5357
5358 public delegate void InitializeDelegate(VRC_PropController obj);
5359
5360 [Serializable]
5361 public class InputPairing : Object
5362 {
5363 public string name;
5364
5365 public KeyCode[] unityKeys;
5366
5367 public string[] cInputKeys;
5368
5369 [HideInInspector]
5370 public bool value;
5371
5372 [HideInInspector]
5373 public bool lastValue;
5374
5375 public bool GetKeyDown()
5376 {
5377 if (value)
5378 {
5379 return !lastValue;
5380 }
5381 return false;
5382 }
5383 }
5384
5386
5387 public Vector2 inputLeftAnalog;
5388
5389 public Vector2 inputRightAnalog;
5390
5391 public bool inputUseButton;
5392
5393 public static UpdateDelegate UpdateInputs;
5394
5395 public static InitializeDelegate Initialize;
5396
5397 public List<InputPairing> Inputs = new List<InputPairing>();
5398
5399 private void Awake()
5400 {
5401 if (Initialize != null)
5402 {
5403 Initialize(this);
5404 }
5405 }
5406
5407 private void Update()
5408 {
5409 if (controllingPlayer != null && controllingPlayer.isLocal && UpdateInputs != null)
5410 {
5411 UpdateInputs(this);
5412 }
5413 }
5414
5415 public int GetInputIndex(string inputName)
5416 {
5417 for (int i = 0; i < Inputs.Count; i++)
5418 {
5419 if (Inputs[i].name == inputName)
5420 {
5421 return i;
5422 }
5423 }
5424 return -1;
5425 }
5426 }
5427 public abstract class VRC_SlideShow : MonoBehaviour
5428 {
5429 public bool autoplay;
5430
5431 public bool shuffle;
5432
5433 public Texture2D[] images;
5434
5435 public float displayDuration = -1f;
5436
5437 public Material imageMaterial;
5438
5439 private int showingImage;
5440
5441 private void Start()
5442 {
5443 if (images.Length != 0)
5444 {
5445 imageMaterial.mainTexture = (Texture)(object)images[0];
5446 }
5447 if (autoplay && displayDuration > 0f)
5448 {
5449 ((MonoBehaviour)this).StartCoroutine("StartAutoplayWithDuration", (object)displayDuration);
5450 }
5451 }
5452
5453 private void ShowNextImage(int Instigator = 0)
5454 {
5455 Texture2D val = null;
5456 if (images.Length != 0)
5457 {
5458 if (shuffle)
5459 {
5460 showingImage = Random.Range(0, images.Length - 1);
5461 }
5462 else
5463 {
5464 showingImage = ++showingImage % images.Length;
5465 }
5466 val = images[showingImage];
5467 if ((Object)(object)val == (Object)null)
5468 {
5469 Debug.LogError((object)"Loaded image is null. Did you add the image to the array in the inspector?");
5470 }
5471 imageMaterial.mainTexture = (Texture)(object)val;
5472 }
5473 else
5474 {
5475 Debug.LogError((object)"Image array length is zero.");
5476 }
5477 }
5478
5479 private void ShowPreviousImage(int Instigator = 0)
5480 {
5481 Texture2D val = null;
5482 showingImage = --showingImage % images.Length;
5483 if (showingImage < 0)
5484 {
5485 showingImage = images.Length + showingImage;
5486 }
5487 Debug.Log((object)String.Concat("showing prev image: ", ((Int32)(ref showingImage)).ToString()));
5488 val = images[showingImage];
5489 if ((Object)(object)val == (Object)null)
5490 {
5491 Debug.LogError((object)"Loaded image is null. Did you add the image to the array in the inspector?");
5492 }
5493 imageMaterial.mainTexture = (Texture)(object)val;
5494 }
5495
5496 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
5497 private IEnumerator StartAutoplayWithDuration(float duration)
5498 {
5499 while (autoplay)
5500 {
5501 yield return new WaitForSeconds(duration);
5502 ShowNextImage();
5503 }
5504 }
5505
5506 private void StopAutoplayWithDuration(float duration)
5507 {
5508 ((MonoBehaviour)this).StopCoroutine("StartAutoplayWithDuration");
5509 }
5510 }
5511 public static class VRCGraphics : Object
5512 {
5513 private static readonly Lazy<LayerMask> _uiLayerMaskLazy = new Lazy<LayerMask>((Func<LayerMask>)GetLayerMask);
5514
5515 private static LayerMask UiLayerMask => _uiLayerMaskLazy.Value;
5516
5517 public static void Blit(Texture source, RenderTexture dest)
5518 {
5519 CheckBlitTarget(dest);
5520 Graphics.Blit(source, dest);
5521 }
5522
5523 public static void Blit(Texture source, RenderTexture dest, Material mat, int pass = -1)
5524 {
5525 CheckBlitTarget(dest);
5526 Graphics.Blit(source, dest, mat, pass);
5527 }
5528
5529 public static void Blit(Texture source, RenderTexture dest, Material mat)
5530 {
5531 CheckBlitTarget(dest);
5532 Graphics.Blit(source, dest, mat);
5533 }
5534
5535 public static void Blit(Texture source, RenderTexture dest, Vector2 scale, Vector2 offset)
5536 {
5537 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
5538 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
5539 CheckBlitTarget(dest);
5540 Graphics.Blit(source, dest, scale, offset);
5541 }
5542
5543 public static void Blit(Texture source, RenderTexture dest, int sourceDepthSlice, int destDepthSlice)
5544 {
5545 CheckBlitTarget(dest);
5546 Graphics.Blit(source, dest, sourceDepthSlice, destDepthSlice);
5547 }
5548
5549 public static void Blit(Texture source, RenderTexture dest, Vector2 scale, Vector2 offset, int sourceDepthSlice, int destDepthSlice)
5550 {
5551 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
5552 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
5553 CheckBlitTarget(dest);
5554 Graphics.Blit(source, dest, scale, offset, sourceDepthSlice, destDepthSlice);
5555 }
5556
5557 public static void Blit(Texture source, Material mat, int pass, int destDepthSlice)
5558 {
5559 Graphics.Blit(source, mat, pass, destDepthSlice);
5560 }
5561
5562 public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices)
5563 {
5564 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, matrices.Length, (MaterialPropertyBlock)null, (ShadowCastingMode)1, true, 0, (Camera)null, (LightProbeUsage)1, (LightProbeProxyVolume)null);
5565 }
5566
5567 public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count)
5568 {
5569 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, (MaterialPropertyBlock)null, (ShadowCastingMode)1, true, 0, (Camera)null, (LightProbeUsage)1, (LightProbeProxyVolume)null);
5570 }
5571
5572 public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties)
5573 {
5574 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, (ShadowCastingMode)1, true, 0, (Camera)null, (LightProbeUsage)1, (LightProbeProxyVolume)null);
5575 }
5576
5577 public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows)
5578 {
5579 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
5580 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, true, 0, (Camera)null, (LightProbeUsage)1, (LightProbeProxyVolume)null);
5581 }
5582
5583 public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows)
5584 {
5585 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
5586 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, 0, (Camera)null, (LightProbeUsage)1, (LightProbeProxyVolume)null);
5587 }
5588
5589 public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer)
5590 {
5591 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
5592 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
5593 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
5594 if ((LayerMask.op_Implicit(UiLayerMask) & layer) != 0)
5595 {
5596 throw new InvalidOperationException(String.Concat("VRCGraphics cannot render to ", LayerMask.LayerToName(layer), "."));
5597 }
5598 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, (Camera)null, (LightProbeUsage)1, (LightProbeProxyVolume)null);
5599 }
5600
5601 public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera)
5602 {
5603 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
5604 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
5605 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
5606 if ((LayerMask.op_Implicit(UiLayerMask) & layer) != 0)
5607 {
5608 throw new InvalidOperationException(String.Concat("VRCGraphics cannot render to ", LayerMask.LayerToName(layer), "."));
5609 }
5610 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, camera, (LightProbeUsage)1, (LightProbeProxyVolume)null);
5611 }
5612
5613 public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera, LightProbeUsage lightProbeUsage)
5614 {
5615 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
5616 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
5617 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
5618 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
5619 if ((LayerMask.op_Implicit(UiLayerMask) & layer) != 0)
5620 {
5621 throw new InvalidOperationException(String.Concat("VRCGraphics cannot render to ", LayerMask.LayerToName(layer), "."));
5622 }
5623 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, (LightProbeProxyVolume)null);
5624 }
5625
5626 public static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera, LightProbeUsage lightProbeUsage, LightProbeProxyVolume lightProbeProxyVolume)
5627 {
5628 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
5629 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
5630 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
5631 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
5632 if ((LayerMask.op_Implicit(UiLayerMask) & layer) != 0)
5633 {
5634 throw new InvalidOperationException(String.Concat("VRCGraphics cannot render to ", LayerMask.LayerToName(layer), "."));
5635 }
5636 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
5637 }
5638
5639 private static LayerMask GetLayerMask()
5640 {
5641 //IL_0005: Unknown result type (might be due to invalid IL or missing references)
5642 return LayerMask.op_Implicit(3670016);
5643 }
5644
5645 [AssertionMethod]
5646 private static void CheckBlitTarget(RenderTexture dest)
5647 {
5648 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
5649 if (!Object.op_Implicit((Object)(object)dest))
5650 {
5651 throw new ArgumentException("Dest cannot be null with Graphics Blit.");
5652 }
5653 }
5654 }
5655 public static class VRCRenderTexture : Object
5656 {
5657 [CompilerGenerated]
5658 private static Action<RenderTexture> m_OnGetTemporaryRenderTexture;
5659
5660 [CompilerGenerated]
5661 private static Action<RenderTexture> m_OnReleaseTemporaryRenderTexture;
5662
5663 [PublicAPI]
5664 public static event Action<RenderTexture> OnGetTemporaryRenderTexture
5665 {
5666 [CompilerGenerated]
5667 add
5668 {
5669 Action<RenderTexture> val = VRCRenderTexture.m_OnGetTemporaryRenderTexture;
5670 Action<RenderTexture> val2;
5671 do
5672 {
5673 val2 = val;
5674 Action<RenderTexture> val3 = (Action<RenderTexture>)(object)Delegate.Combine((Delegate)(object)val2, (Delegate)(object)value);
5675 val = Interlocked.CompareExchange<Action<RenderTexture>>(ref VRCRenderTexture.m_OnGetTemporaryRenderTexture, val3, val2);
5676 }
5677 while (val != val2);
5678 }
5679 [CompilerGenerated]
5680 remove
5681 {
5682 Action<RenderTexture> val = VRCRenderTexture.m_OnGetTemporaryRenderTexture;
5683 Action<RenderTexture> val2;
5684 do
5685 {
5686 val2 = val;
5687 Action<RenderTexture> val3 = (Action<RenderTexture>)(object)Delegate.Remove((Delegate)(object)val2, (Delegate)(object)value);
5688 val = Interlocked.CompareExchange<Action<RenderTexture>>(ref VRCRenderTexture.m_OnGetTemporaryRenderTexture, val3, val2);
5689 }
5690 while (val != val2);
5691 }
5692 }
5693
5694 public static event Action<RenderTexture> OnReleaseTemporaryRenderTexture
5695 {
5696 [CompilerGenerated]
5697 add
5698 {
5699 Action<RenderTexture> val = VRCRenderTexture.m_OnReleaseTemporaryRenderTexture;
5700 Action<RenderTexture> val2;
5701 do
5702 {
5703 val2 = val;
5704 Action<RenderTexture> val3 = (Action<RenderTexture>)(object)Delegate.Combine((Delegate)(object)val2, (Delegate)(object)value);
5705 val = Interlocked.CompareExchange<Action<RenderTexture>>(ref VRCRenderTexture.m_OnReleaseTemporaryRenderTexture, val3, val2);
5706 }
5707 while (val != val2);
5708 }
5709 [CompilerGenerated]
5710 remove
5711 {
5712 Action<RenderTexture> val = VRCRenderTexture.m_OnReleaseTemporaryRenderTexture;
5713 Action<RenderTexture> val2;
5714 do
5715 {
5716 val2 = val;
5717 Action<RenderTexture> val3 = (Action<RenderTexture>)(object)Delegate.Remove((Delegate)(object)val2, (Delegate)(object)value);
5718 val = Interlocked.CompareExchange<Action<RenderTexture>>(ref VRCRenderTexture.m_OnReleaseTemporaryRenderTexture, val3, val2);
5719 }
5720 while (val != val2);
5721 }
5722 }
5723
5724 public static RenderTexture GetTemporary(int width, int height, int depthBuffer = 0, RenderTextureFormat format = 7, RenderTextureReadWrite readWrite = 0, int antiAliasing = 0, RenderTextureMemoryless memorylessMode = 0, VRTextureUsage vrUsage = 0, bool useDynamicScale = false)
5725 {
5726 //IL_0003: Unknown result type (might be due to invalid IL or missing references)
5727 //IL_0004: Unknown result type (might be due to invalid IL or missing references)
5728 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
5729 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
5730 RenderTexture temporary = RenderTexture.GetTemporary(width, height, depthBuffer, format, readWrite, antiAliasing, memorylessMode, vrUsage, useDynamicScale);
5732 return temporary;
5733 }
5734
5735 public static RenderTexture GetTemporary(RenderTextureDescriptor renderTextureDescriptor)
5736 {
5737 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
5738 RenderTexture temporary = RenderTexture.GetTemporary(renderTextureDescriptor);
5740 return temporary;
5741 }
5742
5743 public static void ReleaseTemporary(RenderTexture renderTexture)
5744 {
5746 RenderTexture.ReleaseTemporary(renderTexture);
5747 }
5748 }
5749 public static class VRCShader : Object
5750 {
5751 public enum ShaderVariableType : Enum
5752 {
5753 Integer,
5754 Float,
5755 Texture,
5756 Color,
5757 Vector,
5758 Matrix,
5759 FloatArray,
5760 VectorArray,
5761 MatrixArray
5762 }
5763
5764 [CompilerGenerated]
5765 private static Action<int, ShaderVariableType> m_OnSetGlobalShaderVariable;
5766
5767 private static HashSet<int> _globalVariableIDWhitelist = new HashSet<int>();
5768
5769 private static List<string> _variableNameWhitelist;
5770
5771 [PublicAPI]
5772 public static event Action<int, ShaderVariableType> OnSetGlobalShaderVariable
5773 {
5774 [CompilerGenerated]
5775 add
5776 {
5777 Action<int, ShaderVariableType> val = VRCShader.m_OnSetGlobalShaderVariable;
5778 Action<int, ShaderVariableType> val2;
5779 do
5780 {
5781 val2 = val;
5782 Action<int, ShaderVariableType> val3 = (Action<int, ShaderVariableType>)(object)Delegate.Combine((Delegate)(object)val2, (Delegate)(object)value);
5783 val = Interlocked.CompareExchange<Action<int, ShaderVariableType>>(ref VRCShader.m_OnSetGlobalShaderVariable, val3, val2);
5784 }
5785 while (val != val2);
5786 }
5787 [CompilerGenerated]
5788 remove
5789 {
5790 Action<int, ShaderVariableType> val = VRCShader.m_OnSetGlobalShaderVariable;
5791 Action<int, ShaderVariableType> val2;
5792 do
5793 {
5794 val2 = val;
5795 Action<int, ShaderVariableType> val3 = (Action<int, ShaderVariableType>)(object)Delegate.Remove((Delegate)(object)val2, (Delegate)(object)value);
5796 val = Interlocked.CompareExchange<Action<int, ShaderVariableType>>(ref VRCShader.m_OnSetGlobalShaderVariable, val3, val2);
5797 }
5798 while (val != val2);
5799 }
5800 }
5801
5802 public static int PropertyToID(string name)
5803 {
5804 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
5805 if (String.IsNullOrWhiteSpace("name"))
5806 {
5807 throw new InvalidOperationException("Property name is null or empty.");
5808 }
5809 int num = Shader.PropertyToID(name);
5810 if (name.StartsWith("_Udon", (StringComparison)5) || _variableNameWhitelist.Contains(name))
5811 {
5812 _globalVariableIDWhitelist.Add(num);
5813 }
5814 return num;
5815 }
5816
5817 public static void SetGlobalInteger(int nameID, int value)
5818 {
5819 ValidateAgainstPropertyIDWhitelist(nameID);
5821 Shader.SetGlobalInt(nameID, value);
5822 }
5823
5824 public static void SetGlobalFloat(int nameID, float value)
5825 {
5826 ValidateAgainstPropertyIDWhitelist(nameID);
5828 Shader.SetGlobalFloat(nameID, value);
5829 }
5830
5831 public static void SetGlobalTexture(int nameID, Texture value)
5832 {
5833 ValidateAgainstPropertyIDWhitelist(nameID);
5835 Shader.SetGlobalTexture(nameID, value);
5836 }
5837
5838 public static void SetGlobalColor(int nameID, Color value)
5839 {
5840 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
5841 ValidateAgainstPropertyIDWhitelist(nameID);
5843 Shader.SetGlobalColor(nameID, value);
5844 }
5845
5846 public static void SetGlobalVector(int nameID, Vector4 value)
5847 {
5848 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
5849 ValidateAgainstPropertyIDWhitelist(nameID);
5851 Shader.SetGlobalVector(nameID, value);
5852 }
5853
5854 public static void SetGlobalMatrix(int nameID, Matrix4x4 value)
5855 {
5856 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
5857 ValidateAgainstPropertyIDWhitelist(nameID);
5859 Shader.SetGlobalMatrix(nameID, value);
5860 }
5861
5862 public static void SetGlobalFloatArray(int nameID, float[] value)
5863 {
5864 ValidateAgainstPropertyIDWhitelist(nameID);
5865 VRCShader.OnSetGlobalShaderVariable?.Invoke(nameID, ShaderVariableType.FloatArray);
5866 Shader.SetGlobalFloatArray(nameID, value);
5867 }
5868
5869 public static void SetGlobalVectorArray(int nameID, Vector4[] value)
5870 {
5871 ValidateAgainstPropertyIDWhitelist(nameID);
5872 VRCShader.OnSetGlobalShaderVariable?.Invoke(nameID, ShaderVariableType.VectorArray);
5873 Shader.SetGlobalVectorArray(nameID, value);
5874 }
5875
5876 public static void SetGlobalMatrixArray(int nameID, Matrix4x4[] value)
5877 {
5878 ValidateAgainstPropertyIDWhitelist(nameID);
5879 VRCShader.OnSetGlobalShaderVariable?.Invoke(nameID, ShaderVariableType.MatrixArray);
5880 Shader.SetGlobalMatrixArray(nameID, value);
5881 }
5882
5883 private static void ValidateAgainstPropertyIDWhitelist(int nameID)
5884 {
5885 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
5886 if (!_globalVariableIDWhitelist.Contains(nameID))
5887 {
5888 throw new InvalidOperationException(String.Format("Cannot set a global property with the ID {0}. This is likely due to this property not starting with _Udon, or not being on the whitelist.", (object)nameID));
5889 }
5890 }
5891
5892 public static void ClearGlobalVariableWhitelist()
5893 {
5894 _globalVariableIDWhitelist.Clear();
5895 }
5896
5897 static VRCShader()
5898 {
5899 List<string> obj = new List<string>();
5900 obj.Add("_AudioTexture");
5901 _variableNameWhitelist = obj;
5902 }
5903 }
5904 public class VRCCustomAction : MonoBehaviour
5905 {
5906 public virtual void Execute(string parameter)
5907 {
5908 if (!String.IsNullOrEmpty(parameter))
5909 {
5910 Debug.Log((object)String.Concat("Custom Action Execute: ", parameter));
5911 }
5912 }
5913
5914 public virtual void Execute(int parameter)
5915 {
5916 Debug.Log((object)String.Format("Custom Action Execute: {0}", (object)parameter));
5917 }
5918
5919 public virtual void Execute(VRCUrl parameter)
5920 {
5921 Debug.Log((object)String.Format("Custom Action Execute: {0}", (object)parameter));
5922 }
5923 }
5924 public abstract class VRCStation : MonoBehaviour
5925 {
5926 public enum Mobility : Enum
5927 {
5928 Mobile,
5929 Immobilize,
5930 ImmobilizeForVehicle
5931 }
5932
5933 public delegate void InitializationDelegate(VRCStation obj);
5934
5935 public Mobility PlayerMobility = Mobility.Immobilize;
5936
5937 public bool canUseStationFromStation = true;
5938
5939 public RuntimeAnimatorController animatorController;
5940
5942
5943 public bool seated = true;
5944
5946
5948
5950
5951 public static InitializationDelegate Initialize;
5952
5953 public static Action<VRCStation, VRCPlayerApi> useStationDelegate;
5954
5955 public static Action<VRCStation, VRCPlayerApi> exitStationDelegate;
5956
5957 private void Awake()
5958 {
5959 if (Initialize != null)
5960 {
5961 Initialize(this);
5962 }
5963 }
5964
5965 public void UseStation(VRCPlayerApi player)
5966 {
5967 useStationDelegate.Invoke(this, player);
5968 }
5969
5970 public void ExitStation(VRCPlayerApi player)
5971 {
5972 exitStationDelegate.Invoke(this, player);
5973 }
5974 }
5975 public abstract class VRC_MetadataListener : MonoBehaviour
5976 {
5977 public delegate void MetadataCallback(Dictionary<string, object> data);
5978
5979 private static MetadataCallback callbacks;
5980
5981 public MetadataCallback metadataUpdate;
5982
5983 public static Func<Dictionary<string, object>> _GetCurrentMetadata;
5984
5985 public static Dictionary<string, object> currentMetadata
5986 {
5987 get
5988 {
5989 if (_GetCurrentMetadata == null)
5990 {
5991 return null;
5992 }
5993 return _GetCurrentMetadata.Invoke();
5994 }
5995 }
5996
5997 private void Awake()
5998 {
5999 callbacks = (MetadataCallback)(object)Delegate.Combine((Delegate)(object)callbacks, (Delegate)(object)new MetadataCallback(MetadataChangedInternal));
6000 }
6001
6002 private void OnDestroy()
6003 {
6004 callbacks = (MetadataCallback)(object)Delegate.Remove((Delegate)(object)callbacks, (Delegate)(object)new MetadataCallback(MetadataChangedInternal));
6005 }
6006
6007 public static void TriggerUpdate(Dictionary<string, object> data)
6008 {
6009 if (callbacks != null)
6010 {
6011 callbacks(data);
6012 }
6013 }
6014
6015 private void MetadataChangedInternal(Dictionary<string, object> data)
6016 {
6017 if (metadataUpdate != null)
6018 {
6019 metadataUpdate(data);
6020 }
6021 }
6022 }
6023 [ExecuteInEditMode]
6024 public abstract class VRC_MirrorReflection : MonoBehaviour
6025 {
6026 private enum Dimension : Enum
6027 {
6028 Auto = 0,
6029 X256 = 0x100,
6030 X512 = 0x200,
6031 X1024 = 0x400
6032 }
6033
6034 private enum AntialiasingSamples : Enum
6035 {
6036 X1 = 1,
6037 X2 = 2,
6038 X4 = 4,
6039 X8 = 8
6040 }
6041
6042 private enum ShaderMirrorMode : Enum
6043 {
6044 None,
6045 VR,
6046 Desktop
6047 }
6048
6049 public enum MirrorQualitySetting : Enum
6050 {
6051 Full,
6052 Half,
6053 Quarter,
6054 Unlimited
6055 }
6056
6058
6059 private class ReflectionData : Object
6060 {
6061 public readonly RenderTexture[] texture = (RenderTexture[])(object)new RenderTexture[2];
6062
6063 public MaterialPropertyBlock propertyBlock;
6064 }
6065
6066 private const string VRC_MIRROR_CAMERA_POS_PROPERTY = "_VRChatMirrorCameraPos";
6067
6068 private const string VRC_MIRROR_MODE_PROPERTY = "_VRChatMirrorMode";
6069
6070 [Tooltip("Disables real-time pixel shaded point and spot lighting. Pixel shaded lights will fall-back to vertex lighting when this is enabled.")]
6071 public bool m_DisablePixelLights = true;
6072
6073 [Tooltip("Disables occlusion culling on the mirror. Enable this if you see objects flickering in the mirror.")]
6074 public bool TurnOffMirrorOcclusion = true;
6075
6076 [Tooltip("Only objects on the selected layers will be rendered in the mirror. Objects on the Water layer are never rendered in mirrors.")]
6077 public LayerMask m_ReflectLayers = LayerMask.op_Implicit(-1);
6078
6079 [SerializeField]
6080 [Tooltip("Rendering resolution of the mirror (per eye in VR). Auto renders at the same resolution as the user's HMD or monitor up to the maximum.")]
6082
6083 [SerializeField]
6084 [Tooltip("The maximum number of MSAA samples to use when rendering the mirror. Setting this to a higher value will increase the amount of video memory used by mirrors and may cause hitching when the mirror starts rendering.")]
6085 private AntialiasingSamples maximumAntialiasing = AntialiasingSamples.X4;
6086
6087 [SerializeField]
6088 [Tooltip("The mirror will use this shader instead of the default shader if one is provided.")]
6089 private Shader customShader;
6090
6091 public static MirrorQualitySetting MirrorQualityOverride = MirrorQualitySetting.Full;
6092
6093 [CompilerGenerated]
6094 private static RenderMirrorEventDelegate m_PreRenderMirror;
6095
6096 [CompilerGenerated]
6097 private static RenderMirrorEventDelegate m_PostRenderMirror;
6098
6099 private RenderTexture _temporaryRenderTexture;
6100
6101 private Dictionary<Camera, ReflectionData> _mReflections = new Dictionary<Camera, ReflectionData>();
6102
6103 private Renderer _mirrorRenderer;
6104
6105 private Camera _mirrorCamera;
6106
6107 private Skybox _mirrorSkybox;
6108
6109 private Matrix4x4 _parentTransform;
6110
6111 private Quaternion _parentRotation;
6112
6113 private int _playerLocalLayer = 10;
6114
6115 private static readonly int[] _texturePropertyId = (int[])(object)new Int32[2];
6116
6117 private const int MAX_AUTO_VR_RESOLUTION = 2048;
6118
6119 private const int MAX_AUTO_DESKTOP_RESOLUTION = 2048;
6120
6121 private const int MAX_AUTO_RESOLUTION_UNLIMITER = 32;
6122
6123 [field: CompilerGenerated]
6124 public static VRC_MirrorReflection CurrentlyRenderingMirror
6125 {
6126 [CompilerGenerated]
6127 get;
6128 [CompilerGenerated]
6129 private set;
6130 }
6131
6132 [field: CompilerGenerated]
6133 public static Vector3 CurrentMirrorCenterEyePos
6134 {
6135 [CompilerGenerated]
6136 get;
6137 [CompilerGenerated]
6138 private set;
6139 }
6140
6141 public static event RenderMirrorEventDelegate PreRenderMirror
6142 {
6143 [CompilerGenerated]
6144 add
6145 {
6146 RenderMirrorEventDelegate renderMirrorEventDelegate = VRC_MirrorReflection.m_PreRenderMirror;
6147 RenderMirrorEventDelegate renderMirrorEventDelegate2;
6148 do
6149 {
6150 renderMirrorEventDelegate2 = renderMirrorEventDelegate;
6151 RenderMirrorEventDelegate renderMirrorEventDelegate3 = (RenderMirrorEventDelegate)(object)Delegate.Combine((Delegate)(object)renderMirrorEventDelegate2, (Delegate)(object)value);
6152 renderMirrorEventDelegate = Interlocked.CompareExchange<RenderMirrorEventDelegate>(ref VRC_MirrorReflection.m_PreRenderMirror, renderMirrorEventDelegate3, renderMirrorEventDelegate2);
6153 }
6154 while (renderMirrorEventDelegate != renderMirrorEventDelegate2);
6155 }
6156 [CompilerGenerated]
6157 remove
6158 {
6159 RenderMirrorEventDelegate renderMirrorEventDelegate = VRC_MirrorReflection.m_PreRenderMirror;
6160 RenderMirrorEventDelegate renderMirrorEventDelegate2;
6161 do
6162 {
6163 renderMirrorEventDelegate2 = renderMirrorEventDelegate;
6164 RenderMirrorEventDelegate renderMirrorEventDelegate3 = (RenderMirrorEventDelegate)(object)Delegate.Remove((Delegate)(object)renderMirrorEventDelegate2, (Delegate)(object)value);
6165 renderMirrorEventDelegate = Interlocked.CompareExchange<RenderMirrorEventDelegate>(ref VRC_MirrorReflection.m_PreRenderMirror, renderMirrorEventDelegate3, renderMirrorEventDelegate2);
6166 }
6167 while (renderMirrorEventDelegate != renderMirrorEventDelegate2);
6168 }
6169 }
6170
6171 public static event RenderMirrorEventDelegate PostRenderMirror
6172 {
6173 [CompilerGenerated]
6174 add
6175 {
6176 RenderMirrorEventDelegate renderMirrorEventDelegate = VRC_MirrorReflection.m_PostRenderMirror;
6177 RenderMirrorEventDelegate renderMirrorEventDelegate2;
6178 do
6179 {
6180 renderMirrorEventDelegate2 = renderMirrorEventDelegate;
6181 RenderMirrorEventDelegate renderMirrorEventDelegate3 = (RenderMirrorEventDelegate)(object)Delegate.Combine((Delegate)(object)renderMirrorEventDelegate2, (Delegate)(object)value);
6182 renderMirrorEventDelegate = Interlocked.CompareExchange<RenderMirrorEventDelegate>(ref VRC_MirrorReflection.m_PostRenderMirror, renderMirrorEventDelegate3, renderMirrorEventDelegate2);
6183 }
6184 while (renderMirrorEventDelegate != renderMirrorEventDelegate2);
6185 }
6186 [CompilerGenerated]
6187 remove
6188 {
6189 RenderMirrorEventDelegate renderMirrorEventDelegate = VRC_MirrorReflection.m_PostRenderMirror;
6190 RenderMirrorEventDelegate renderMirrorEventDelegate2;
6191 do
6192 {
6193 renderMirrorEventDelegate2 = renderMirrorEventDelegate;
6194 RenderMirrorEventDelegate renderMirrorEventDelegate3 = (RenderMirrorEventDelegate)(object)Delegate.Remove((Delegate)(object)renderMirrorEventDelegate2, (Delegate)(object)value);
6195 renderMirrorEventDelegate = Interlocked.CompareExchange<RenderMirrorEventDelegate>(ref VRC_MirrorReflection.m_PostRenderMirror, renderMirrorEventDelegate3, renderMirrorEventDelegate2);
6196 }
6197 while (renderMirrorEventDelegate != renderMirrorEventDelegate2);
6198 }
6199 }
6200
6201 private void OnValidate()
6202 {
6203 CurrentlyRenderingMirror = null;
6204 _mirrorRenderer = ((Component)this).GetComponent<Renderer>();
6205 if ((Object)(object)_mirrorRenderer == (Object)null)
6206 {
6207 return;
6208 }
6209 Material sharedMaterial = _mirrorRenderer.sharedMaterial;
6210 if (!((Object)(object)sharedMaterial == (Object)null))
6211 {
6212 if ((Object)(object)customShader != (Object)null)
6213 {
6214 sharedMaterial.shader = customShader;
6215 }
6216 else
6217 {
6218 sharedMaterial.shader = Shader.Find("FX/MirrorReflection");
6219 }
6220 }
6221 }
6222
6223 private void Start()
6224 {
6225 //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
6226 //IL_00b3: Expected O, but got Unknown
6227 //IL_00b3: Unknown result type (might be due to invalid IL or missing references)
6228 //IL_00bd: Expected O, but got Unknown
6229 _mirrorRenderer = ((Component)this).GetComponent<Renderer>();
6230 if ((Object)(object)_mirrorRenderer == (Object)null)
6231 {
6232 ((Behaviour)this).enabled = false;
6233 return;
6234 }
6235 Material sharedMaterial = _mirrorRenderer.sharedMaterial;
6236 if ((Object)(object)sharedMaterial == (Object)null)
6237 {
6238 ((Behaviour)this).enabled = false;
6239 return;
6240 }
6241 if ((Object)(object)customShader != (Object)null)
6242 {
6243 sharedMaterial.shader = customShader;
6244 }
6245 else
6246 {
6247 sharedMaterial.shader = Shader.Find("FX/MirrorReflection");
6248 }
6249 _texturePropertyId[0] = Shader.PropertyToID("_ReflectionTex0");
6250 _texturePropertyId[1] = Shader.PropertyToID("_ReflectionTex1");
6251 _playerLocalLayer = LayerMask.NameToLayer("PlayerLocal");
6252 Camera.onPostRender = (CameraCallback)Delegate.Combine((Delegate)(object)Camera.onPostRender, (Delegate)new CameraCallback(CameraPostRender));
6253 Shader.SetGlobalFloat("_VRChatMirrorMode", 0f);
6254 ref LayerMask reflectLayers = ref m_ReflectLayers;
6255 ((LayerMask)(ref reflectLayers)).value = ((LayerMask)(ref reflectLayers)).value | (1 << LayerMask.NameToLayer("HardwareObjects"));
6256 }
6257
6259 {
6260 if (!((Behaviour)this).enabled || !Object.op_Implicit((Object)(object)_mirrorRenderer) || !_mirrorRenderer.enabled)
6261 {
6262 return;
6263 }
6264 Camera current = Camera.current;
6265 if (!Object.op_Implicit((Object)(object)current) || (Object)(object)current == (Object)(object)_mirrorCamera || (Object)(object)CurrentlyRenderingMirror != (Object)null)
6266 {
6267 return;
6268 }
6269 try
6270 {
6271 CurrentlyRenderingMirror = this;
6272 RenderMirrorCameras(current);
6273 }
6274 finally
6275 {
6276 CurrentlyRenderingMirror = null;
6277 }
6278 }
6279
6280 private void RenderMirrorCameras(Camera currentCamera)
6281 {
6282 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
6283 //IL_0035: Unknown result type (might be due to invalid IL or missing references)
6284 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
6285 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
6286 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
6287 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
6288 //IL_0048: Unknown result type (might be due to invalid IL or missing references)
6289 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
6290 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
6291 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
6292 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
6293 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
6294 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
6295 //IL_006f: Unknown result type (might be due to invalid IL or missing references)
6296 //IL_0074: Unknown result type (might be due to invalid IL or missing references)
6297 //IL_0299: Unknown result type (might be due to invalid IL or missing references)
6298 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
6299 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
6300 //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
6301 //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
6302 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
6303 //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
6304 //IL_026e: Unknown result type (might be due to invalid IL or missing references)
6305 //IL_0275: Unknown result type (might be due to invalid IL or missing references)
6306 //IL_027b: Unknown result type (might be due to invalid IL or missing references)
6307 //IL_0219: Unknown result type (might be due to invalid IL or missing references)
6308 //IL_0220: Unknown result type (might be due to invalid IL or missing references)
6309 //IL_0226: Unknown result type (might be due to invalid IL or missing references)
6310 //IL_0157: Unknown result type (might be due to invalid IL or missing references)
6311 //IL_015c: Unknown result type (might be due to invalid IL or missing references)
6312 //IL_0161: Unknown result type (might be due to invalid IL or missing references)
6313 //IL_0166: Unknown result type (might be due to invalid IL or missing references)
6314 //IL_016b: Unknown result type (might be due to invalid IL or missing references)
6315 //IL_0170: Unknown result type (might be due to invalid IL or missing references)
6316 //IL_012e: Unknown result type (might be due to invalid IL or missing references)
6317 //IL_0130: Unknown result type (might be due to invalid IL or missing references)
6318 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
6319 //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
6320 //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
6321 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
6322 //IL_01d0: Unknown result type (might be due to invalid IL or missing references)
6323 //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
6324 //IL_01d4: Unknown result type (might be due to invalid IL or missing references)
6325 //IL_0186: Unknown result type (might be due to invalid IL or missing references)
6326 //IL_0188: Unknown result type (might be due to invalid IL or missing references)
6327 //IL_018a: Unknown result type (might be due to invalid IL or missing references)
6328 ReflectionData reflectionData = GetReflectionData(currentCamera);
6329 int pixelLightCount = QualitySettings.pixelLightCount;
6330 if (m_DisablePixelLights)
6331 {
6332 QualitySettings.pixelLightCount = 0;
6333 }
6334 UpdateCameraModes(currentCamera);
6335 UpdateParentTransform(currentCamera);
6336 Vector3 position = ((Component)currentCamera).transform.position;
6337 Vector3 val = ((Component)this).transform.position - position;
6338 CurrentMirrorCenterEyePos = position + val - Vector3.Reflect(val, ((Component)this).transform.forward);
6339 Shader.SetGlobalVector("_VRChatMirrorCameraPos", Vector4.op_Implicit(CurrentMirrorCenterEyePos));
6341 if (currentCamera.stereoEnabled)
6342 {
6343 if (ShouldRenderLeftEye(currentCamera))
6344 {
6345 Shader.SetGlobalFloat("_VRChatMirrorMode", 1f);
6346 Vector3 worldEyePos = GetWorldEyePos(currentCamera, (XRNode)0);
6347 Quaternion worldEyeRot = GetWorldEyeRot(currentCamera, (XRNode)0);
6348 Matrix4x4 eyeProjectionMatrix = GetEyeProjectionMatrix(currentCamera, (XRNode)0);
6349 if (Object.op_Implicit((Object)(object)_temporaryRenderTexture))
6350 {
6351 RenderMirror(_temporaryRenderTexture, worldEyePos, worldEyeRot, eyeProjectionMatrix);
6352 Graphics.CopyTexture((Texture)(object)_temporaryRenderTexture, 0, 0, 0, 0, ((Texture)_temporaryRenderTexture).width, ((Texture)_temporaryRenderTexture).height, (Texture)(object)reflectionData.texture[0], 0, 0, 0, 0);
6353 }
6354 else
6355 {
6356 RenderMirror(reflectionData.texture[0], worldEyePos, worldEyeRot, eyeProjectionMatrix);
6357 }
6358 }
6359 if (ShouldRenderRightEye(currentCamera))
6360 {
6361 Shader.SetGlobalFloat("_VRChatMirrorMode", 1f);
6362 Vector3 worldEyePos2 = GetWorldEyePos(currentCamera, (XRNode)1);
6363 Quaternion worldEyeRot2 = GetWorldEyeRot(currentCamera, (XRNode)1);
6364 Matrix4x4 eyeProjectionMatrix2 = GetEyeProjectionMatrix(currentCamera, (XRNode)1);
6365 if (Object.op_Implicit((Object)(object)_temporaryRenderTexture))
6366 {
6367 RenderMirror(_temporaryRenderTexture, worldEyePos2, worldEyeRot2, eyeProjectionMatrix2);
6368 Graphics.CopyTexture((Texture)(object)_temporaryRenderTexture, 0, 0, 0, 0, ((Texture)_temporaryRenderTexture).width, ((Texture)_temporaryRenderTexture).height, (Texture)(object)reflectionData.texture[1], 0, 0, 0, 0);
6369 }
6370 else
6371 {
6372 RenderMirror(reflectionData.texture[1], worldEyePos2, worldEyeRot2, eyeProjectionMatrix2);
6373 }
6374 }
6375 }
6376 else if (ShouldRenderMonoscopic(currentCamera))
6377 {
6378 Shader.SetGlobalFloat("_VRChatMirrorMode", 2f);
6379 Transform transform = ((Component)currentCamera).transform;
6380 if (Object.op_Implicit((Object)(object)_temporaryRenderTexture))
6381 {
6382 RenderMirror(_temporaryRenderTexture, transform.position, transform.rotation, currentCamera.projectionMatrix);
6383 Graphics.CopyTexture((Texture)(object)_temporaryRenderTexture, 0, 0, 0, 0, ((Texture)_temporaryRenderTexture).width, ((Texture)_temporaryRenderTexture).height, (Texture)(object)reflectionData.texture[0], 0, 0, 0, 0);
6384 }
6385 else
6386 {
6387 RenderMirror(reflectionData.texture[0], transform.position, transform.rotation, currentCamera.projectionMatrix);
6388 }
6389 }
6390 Shader.SetGlobalFloat("_VRChatMirrorMode", 0f);
6391 Shader.SetGlobalVector("_VRChatMirrorCameraPos", Vector4.zero);
6392 if (Object.op_Implicit((Object)(object)_temporaryRenderTexture))
6393 {
6394 RenderTexture.ReleaseTemporary(_temporaryRenderTexture);
6395 _temporaryRenderTexture = null;
6396 }
6397 _mirrorRenderer.SetPropertyBlock(reflectionData.propertyBlock);
6398 if (m_DisablePixelLights)
6399 {
6400 QualitySettings.pixelLightCount = pixelLightCount;
6401 }
6403 }
6404
6405 private void CameraPostRender(Camera currentCamera)
6406 {
6407 if (_mReflections.ContainsKey(currentCamera))
6408 {
6409 ReflectionData reflectionData = _mReflections[currentCamera];
6410 if ((Object)(object)reflectionData.texture[0] != (Object)null)
6411 {
6412 RenderTexture.ReleaseTemporary(reflectionData.texture[0]);
6413 reflectionData.texture[0] = null;
6414 }
6415 if ((Object)(object)reflectionData.texture[1] != (Object)null)
6416 {
6417 RenderTexture.ReleaseTemporary(reflectionData.texture[1]);
6418 reflectionData.texture[1] = null;
6419 }
6420 }
6421 }
6422
6423 private void OnDisable()
6424 {
6425 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
6426 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
6427 Enumerator<Camera, ReflectionData> enumerator = _mReflections.Values.GetEnumerator();
6428 try
6429 {
6430 while (enumerator.MoveNext())
6431 {
6432 ReflectionData current = enumerator.Current;
6433 if ((Object)(object)current.texture[0] != (Object)null)
6434 {
6435 RenderTexture.ReleaseTemporary(current.texture[0]);
6436 current.texture[0] = null;
6437 }
6438 if ((Object)(object)current.texture[1] != (Object)null)
6439 {
6440 RenderTexture.ReleaseTemporary(current.texture[1]);
6441 current.texture[1] = null;
6442 }
6443 }
6444 }
6445 finally
6446 {
6447 ((IDisposable)enumerator).Dispose();
6448 }
6449 _mReflections.Clear();
6450 }
6451
6452 private void OnDestroy()
6453 {
6454 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
6455 //IL_005c: Expected O, but got Unknown
6456 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
6457 //IL_0066: Expected O, but got Unknown
6458 if (!((Object)(object)_mirrorCamera == (Object)null))
6459 {
6460 if (!Application.isEditor)
6461 {
6462 Object.Destroy((Object)(object)((Component)_mirrorCamera).gameObject);
6463 }
6464 else
6465 {
6466 Object.DestroyImmediate((Object)(object)((Component)_mirrorCamera).gameObject);
6467 }
6468 _mirrorCamera = null;
6469 _mirrorSkybox = null;
6470 Camera.onPostRender = (CameraCallback)Delegate.Remove((Delegate)(object)Camera.onPostRender, (Delegate)new CameraCallback(CameraPostRender));
6471 }
6472 }
6473
6474 private bool ShouldRenderLeftEye(Camera cam)
6475 {
6476 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
6477 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
6478 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
6479 //IL_0009: Invalid comparison between Unknown and I4
6480 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
6481 //IL_000d: Invalid comparison between Unknown and I4
6482 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
6483 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
6484 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
6485 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
6486 StereoTargetEyeMask stereoTargetEye = cam.stereoTargetEye;
6487 bool flag = (int)stereoTargetEye == 3 || (int)stereoTargetEye == 1;
6488 if (!flag)
6489 {
6490 return false;
6491 }
6492 if (Vector3.Dot(GetWorldEyePos(cam, (XRNode)0) - ((Component)this).transform.position, GetNormalDirection()) <= 0f)
6493 {
6494 flag = false;
6495 }
6496 return flag;
6497 }
6498
6499 private bool ShouldRenderRightEye(Camera cam)
6500 {
6501 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
6502 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
6503 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
6504 //IL_0009: Invalid comparison between Unknown and I4
6505 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
6506 //IL_000d: Invalid comparison between Unknown and I4
6507 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
6508 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
6509 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
6510 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
6511 StereoTargetEyeMask stereoTargetEye = cam.stereoTargetEye;
6512 bool flag = (int)stereoTargetEye == 3 || (int)stereoTargetEye == 2;
6513 if (!flag)
6514 {
6515 return false;
6516 }
6517 if (Vector3.Dot(GetWorldEyePos(cam, (XRNode)1) - ((Component)this).transform.position, GetNormalDirection()) <= 0f)
6518 {
6519 flag = false;
6520 }
6521 return flag;
6522 }
6523
6524 private bool ShouldRenderMonoscopic(Camera cam)
6525 {
6526 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
6527 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
6528 //IL_0016: Unknown result type (might be due to invalid IL or missing references)
6529 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
6530 return Vector3.Dot(((Component)cam).transform.position - ((Component)this).transform.position, GetNormalDirection()) > 0f;
6531 }
6532
6533 private Vector3 GetWorldEyePos(Camera cam, XRNode eye)
6534 {
6535 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
6536 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
6537 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
6538 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
6539 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
6540 Vector3 localPosition = InputTracking.GetLocalPosition(eye);
6541 return ((Matrix4x4)(ref _parentTransform)).MultiplyPoint3x4(localPosition);
6542 }
6543
6544 private Quaternion GetWorldEyeRot(Camera cam, XRNode eye)
6545 {
6546 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
6547 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
6548 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
6549 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
6550 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
6551 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
6552 Quaternion localRotation = InputTracking.GetLocalRotation(eye);
6553 return _parentRotation * localRotation;
6554 }
6555
6556 private Matrix4x4 GetEyeProjectionMatrix(Camera cam, XRNode eye)
6557 {
6558 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
6559 //IL_0003: Invalid comparison between Unknown and I4
6560 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
6561 return cam.GetStereoProjectionMatrix((StereoscopicEye)((int)eye == 1));
6562 }
6563
6564 private Vector3 GetNormalDirection()
6565 {
6566 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
6567 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
6568 return -((Component)this).transform.forward;
6569 }
6570
6571 private void RenderMirror(RenderTexture targetTexture, Vector3 camPosition, Quaternion camRotation, Matrix4x4 camProjectionMatrix)
6572 {
6573 //IL_0016: Unknown result type (might be due to invalid IL or missing references)
6574 //IL_0027: Unknown result type (might be due to invalid IL or missing references)
6575 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
6576 //IL_0076: Unknown result type (might be due to invalid IL or missing references)
6577 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
6578 //IL_007d: Unknown result type (might be due to invalid IL or missing references)
6579 //IL_0082: Unknown result type (might be due to invalid IL or missing references)
6580 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
6581 //IL_0084: Unknown result type (might be due to invalid IL or missing references)
6582 //IL_0085: Unknown result type (might be due to invalid IL or missing references)
6583 //IL_008a: Unknown result type (might be due to invalid IL or missing references)
6584 //IL_0092: Unknown result type (might be due to invalid IL or missing references)
6585 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
6586 //IL_0098: Unknown result type (might be due to invalid IL or missing references)
6587 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
6588 //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
6589 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
6590 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
6591 //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
6592 //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
6593 //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
6594 //IL_00df: Unknown result type (might be due to invalid IL or missing references)
6595 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
6596 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
6597 //IL_0104: Unknown result type (might be due to invalid IL or missing references)
6598 _mirrorCamera.ResetWorldToCameraMatrix();
6599 ((Component)_mirrorCamera).transform.position = camPosition;
6600 ((Component)_mirrorCamera).transform.rotation = camRotation;
6601 _mirrorCamera.projectionMatrix = camProjectionMatrix;
6602 int num = -17;
6603 num &= ~(1 << _playerLocalLayer);
6604 _mirrorCamera.cullingMask = num & ((LayerMask)(ref m_ReflectLayers)).value;
6605 _mirrorCamera.targetTexture = targetTexture;
6606 Vector3 position = ((Component)this).transform.position;
6607 Vector3 normalDirection = GetNormalDirection();
6608 Vector4 plane = Plane(position, normalDirection);
6609 Camera mirrorCamera = _mirrorCamera;
6610 mirrorCamera.worldToCameraMatrix *= CalculateReflectionMatrix(plane);
6611 Vector4 val = CameraSpacePlane(_mirrorCamera, position, normalDirection);
6612 _mirrorCamera.projectionMatrix = _mirrorCamera.CalculateObliqueMatrix(val);
6613 ((Component)_mirrorCamera).transform.position = GetPosition(_mirrorCamera.cameraToWorldMatrix);
6614 ((Component)_mirrorCamera).transform.rotation = GetRotation(_mirrorCamera.cameraToWorldMatrix);
6615 bool invertCulling = GL.invertCulling;
6616 GL.invertCulling = !invertCulling;
6617 _mirrorCamera.Render();
6618 GL.invertCulling = invertCulling;
6619 }
6620
6621 protected virtual void UpdateCameraClearing(Camera src, Camera mirrorCamera, Skybox mirrorSkybox)
6622 {
6623 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
6624 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
6625 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
6626 //IL_001f: Invalid comparison between Unknown and I4
6627 mirrorCamera.clearFlags = src.clearFlags;
6628 mirrorCamera.backgroundColor = src.backgroundColor;
6629 if ((int)src.clearFlags == 1)
6630 {
6631 Component component = ((Component)src).GetComponent(typeof(Skybox));
6632 Skybox val = (Skybox)(object)((component is Skybox) ? component : null);
6633 if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.material))
6634 {
6635 ((Behaviour)mirrorSkybox).enabled = false;
6636 return;
6637 }
6638 ((Behaviour)mirrorSkybox).enabled = true;
6639 mirrorSkybox.material = val.material;
6640 }
6641 }
6642
6643 private void UpdateCameraModes(Camera src)
6644 {
6645 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
6646 //IL_0054: Unknown result type (might be due to invalid IL or missing references)
6647 //IL_005d: Expected O, but got Unknown
6648 if (!Object.op_Implicit((Object)(object)_mirrorCamera))
6649 {
6650 GameObject val = new GameObject(String.Concat("MirrorCam", ((Object)((Component)this).gameObject).name), (Type[])(object)new Type[3]
6651 {
6652 typeof(Camera),
6653 typeof(Skybox),
6654 typeof(FlareLayer)
6655 })
6656 {
6657 hideFlags = (HideFlags)61
6658 };
6659 _mirrorSkybox = val.GetComponent<Skybox>();
6660 _mirrorCamera = val.GetComponent<Camera>();
6661 ((Behaviour)_mirrorCamera).enabled = false;
6662 }
6663 UpdateCameraClearing(src, _mirrorCamera, _mirrorSkybox);
6664 _mirrorCamera.farClipPlane = src.farClipPlane;
6665 _mirrorCamera.nearClipPlane = src.nearClipPlane;
6666 _mirrorCamera.orthographic = src.orthographic;
6667 _mirrorCamera.aspect = src.aspect;
6668 _mirrorCamera.orthographicSize = src.orthographicSize;
6669 _mirrorCamera.useOcclusionCulling = !TurnOffMirrorOcclusion;
6670 _mirrorCamera.allowMSAA = src.allowMSAA;
6671 if (!src.stereoEnabled)
6672 {
6673 _mirrorCamera.fieldOfView = src.fieldOfView;
6674 }
6675 }
6676
6677 private void UpdateParentTransform(Camera cam)
6678 {
6679 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
6680 //IL_0046: Unknown result type (might be due to invalid IL or missing references)
6681 //IL_0048: Unknown result type (might be due to invalid IL or missing references)
6682 //IL_004d: Unknown result type (might be due to invalid IL or missing references)
6683 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
6684 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
6685 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
6686 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
6687 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
6688 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
6689 //IL_0071: Unknown result type (might be due to invalid IL or missing references)
6690 //IL_007d: Unknown result type (might be due to invalid IL or missing references)
6691 //IL_0082: Unknown result type (might be due to invalid IL or missing references)
6692 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
6693 //IL_0088: Unknown result type (might be due to invalid IL or missing references)
6694 //IL_008d: Unknown result type (might be due to invalid IL or missing references)
6695 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
6696 //IL_0024: Unknown result type (might be due to invalid IL or missing references)
6697 //IL_0035: Unknown result type (might be due to invalid IL or missing references)
6698 //IL_003a: Unknown result type (might be due to invalid IL or missing references)
6699 if ((Object)(object)((Component)cam).transform.parent != (Object)null)
6700 {
6701 _parentTransform = ((Component)cam).transform.parent.localToWorldMatrix;
6702 _parentRotation = ((Component)cam).transform.parent.rotation;
6703 return;
6704 }
6705 Quaternion localRotation = InputTracking.GetLocalRotation((XRNode)3);
6706 Matrix4x4 val = Matrix4x4.TRS(InputTracking.GetLocalPosition((XRNode)3), localRotation, Vector3.one);
6707 _parentTransform = ((Component)cam).transform.localToWorldMatrix * ((Matrix4x4)(ref val)).inverse;
6708 _parentRotation = ((Component)cam).transform.rotation * Quaternion.Inverse(localRotation);
6709 }
6710
6711 [PublicAPI]
6712 private ReflectionData GetReflectionData(Camera currentCamera)
6713 {
6714 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
6715 //IL_0033: Expected O, but got Unknown
6716 if (_mReflections == null)
6717 {
6718 _mReflections = new Dictionary<Camera, ReflectionData>();
6719 }
6720 ReflectionData reflectionData = default(ReflectionData);
6721 if (!_mReflections.TryGetValue(currentCamera, ref reflectionData))
6722 {
6723 reflectionData = new ReflectionData
6724 {
6725 propertyBlock = new MaterialPropertyBlock()
6726 };
6727 _mReflections[currentCamera] = reflectionData;
6728 }
6729 if (Object.op_Implicit((Object)(object)_temporaryRenderTexture))
6730 {
6731 RenderTexture.ReleaseTemporary(_temporaryRenderTexture);
6732 }
6733 if (Object.op_Implicit((Object)(object)reflectionData.texture[0]))
6734 {
6735 RenderTexture.ReleaseTemporary(reflectionData.texture[0]);
6736 }
6737 if (Object.op_Implicit((Object)(object)reflectionData.texture[1]))
6738 {
6739 RenderTexture.ReleaseTemporary(reflectionData.texture[1]);
6740 }
6741 int width;
6742 int height;
6743 if (mirrorResolution == Dimension.Auto)
6744 {
6745 GetAutoResolution(currentCamera, out width, out height);
6746 }
6747 else
6748 {
6749 width = (int)mirrorResolution;
6750 height = (int)mirrorResolution;
6751 }
6752 int antiAliasing = QualitySettings.antiAliasing;
6753 antiAliasing = Mathf.Clamp(1, antiAliasing, (int)maximumAntialiasing);
6754 if (antiAliasing > 1)
6755 {
6756 _temporaryRenderTexture = RenderTexture.GetTemporary(width, height, 24, (RenderTextureFormat)2, (RenderTextureReadWrite)0, antiAliasing);
6757 }
6758 if (currentCamera.stereoEnabled)
6759 {
6760 reflectionData.texture[0] = RenderTexture.GetTemporary(width, height, 24, (RenderTextureFormat)2, (RenderTextureReadWrite)0, 1);
6761 reflectionData.propertyBlock.SetTexture(_texturePropertyId[0], (Texture)(object)reflectionData.texture[0]);
6762 reflectionData.texture[1] = RenderTexture.GetTemporary(width, height, 24, (RenderTextureFormat)2, (RenderTextureReadWrite)0, 1);
6763 reflectionData.propertyBlock.SetTexture(_texturePropertyId[1], (Texture)(object)reflectionData.texture[1]);
6764 }
6765 else
6766 {
6767 reflectionData.texture[0] = RenderTexture.GetTemporary(width, height, 24, (RenderTextureFormat)2, (RenderTextureReadWrite)0, 1);
6768 reflectionData.propertyBlock.SetTexture(_texturePropertyId[0], (Texture)(object)reflectionData.texture[0]);
6769 }
6770 return reflectionData;
6771 }
6772
6773 private static void GetAutoResolution(Camera currentCamera, out int width, out int height)
6774 {
6775 int num = (currentCamera.stereoEnabled ? 2048 : 2048);
6776 if (MirrorQualityOverride == MirrorQualitySetting.Unlimited)
6777 {
6778 num *= 32;
6779 }
6780 width = Mathf.Min(currentCamera.pixelWidth, num);
6781 height = Mathf.Min(currentCamera.pixelHeight, num);
6782 if (MirrorQualityOverride == MirrorQualitySetting.Half)
6783 {
6784 width /= 2;
6785 height /= 2;
6786 }
6787 else if (MirrorQualityOverride == MirrorQualitySetting.Quarter)
6788 {
6789 width /= 4;
6790 height /= 4;
6791 }
6792 }
6793
6794 private static Vector4 Plane(Vector3 pos, Vector3 normal)
6795 {
6796 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
6797 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
6798 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
6799 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
6800 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
6801 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
6802 return new Vector4(normal.x, normal.y, normal.z, 0f - Vector3.Dot(pos, normal));
6803 }
6804
6805 private static Vector4 CameraSpacePlane(Camera cam, Vector3 pos, Vector3 normal)
6806 {
6807 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
6808 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
6809 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
6810 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
6811 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
6812 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
6813 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
6814 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
6815 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
6816 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
6817 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
6818 Matrix4x4 worldToCameraMatrix = cam.worldToCameraMatrix;
6819 Vector3 pos2 = ((Matrix4x4)(ref worldToCameraMatrix)).MultiplyPoint(pos);
6820 Vector3 val = ((Matrix4x4)(ref worldToCameraMatrix)).MultiplyVector(normal);
6821 Vector3 normalized = ((Vector3)(ref val)).normalized;
6822 return Plane(pos2, normalized);
6823 }
6824
6825 private static Matrix4x4 CalculateReflectionMatrix(Vector4 plane)
6826 {
6827 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
6828 //IL_0005: Unknown result type (might be due to invalid IL or missing references)
6829 //IL_01b0: Unknown result type (might be due to invalid IL or missing references)
6830 Matrix4x4 identity = Matrix4x4.identity;
6831 identity.m00 = 1f - 2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[0];
6832 identity.m01 = -2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[1];
6833 identity.m02 = -2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[2];
6834 identity.m03 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[0];
6835 identity.m10 = -2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[0];
6836 identity.m11 = 1f - 2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[1];
6837 identity.m12 = -2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[2];
6838 identity.m13 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[1];
6839 identity.m20 = -2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[0];
6840 identity.m21 = -2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[1];
6841 identity.m22 = 1f - 2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[2];
6842 identity.m23 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[2];
6843 identity.m30 = 0f;
6844 identity.m31 = 0f;
6845 identity.m32 = 0f;
6846 identity.m33 = 1f;
6847 return identity;
6848 }
6849
6850 private static float CopySign(float sizeValue, float signValue)
6851 {
6852 return Mathf.Sign(signValue) * Mathf.Abs(sizeValue);
6853 }
6854
6855 private static Quaternion GetRotation(Matrix4x4 matrix)
6856 {
6857 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
6858 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
6859 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
6860 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
6861 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
6862 //IL_0051: Unknown result type (might be due to invalid IL or missing references)
6863 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
6864 //IL_0080: Unknown result type (might be due to invalid IL or missing references)
6865 //IL_0087: Unknown result type (might be due to invalid IL or missing references)
6866 //IL_008e: Unknown result type (might be due to invalid IL or missing references)
6867 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
6868 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
6869 //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
6870 //IL_00e0: Unknown result type (might be due to invalid IL or missing references)
6871 //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
6872 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
6873 //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
6874 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
6875 //IL_0103: Unknown result type (might be due to invalid IL or missing references)
6876 //IL_0109: Unknown result type (might be due to invalid IL or missing references)
6877 //IL_010f: Unknown result type (might be due to invalid IL or missing references)
6878 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
6879 //IL_0128: Unknown result type (might be due to invalid IL or missing references)
6880 //IL_012e: Unknown result type (might be due to invalid IL or missing references)
6881 //IL_013f: Unknown result type (might be due to invalid IL or missing references)
6882 Quaternion val = default(Quaternion);
6883 val.w = Mathf.Sqrt(Mathf.Max(0f, 1f + matrix.m00 + matrix.m11 + matrix.m22)) / 2f;
6884 val.x = Mathf.Sqrt(Mathf.Max(0f, 1f + matrix.m00 - matrix.m11 - matrix.m22)) / 2f;
6885 val.y = Mathf.Sqrt(Mathf.Max(0f, 1f - matrix.m00 + matrix.m11 - matrix.m22)) / 2f;
6886 val.z = Mathf.Sqrt(Mathf.Max(0f, 1f - matrix.m00 - matrix.m11 + matrix.m22)) / 2f;
6887 Quaternion val2 = val;
6888 val2.x = CopySign(val2.x, matrix.m21 - matrix.m12);
6889 val2.y = CopySign(val2.y, matrix.m02 - matrix.m20);
6890 val2.z = CopySign(val2.z, matrix.m10 - matrix.m01);
6891 return val2;
6892 }
6893
6894 private static Vector3 GetPosition(Matrix4x4 matrix)
6895 {
6896 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
6897 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
6898 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
6899 //IL_0016: Unknown result type (might be due to invalid IL or missing references)
6900 float m = matrix.m03;
6901 float m2 = matrix.m13;
6902 float m3 = matrix.m23;
6903 return new Vector3(m, m2, m3);
6904 }
6905 }
6906 [RequireComponent(/*Could not decode attribute arguments.*/)]
6907 public abstract class VRC_Panorama : MonoBehaviour
6908 {
6909 public enum Layout : Enum
6910 {
6911 Mono,
6912 TopBottom,
6913 LeftRight
6914 }
6915
6916 [Serializable]
6917 public class PanoSpec : Object
6918 {
6919 public string url;
6920
6921 public Texture2D texture;
6922 }
6923
6924 public Renderer renderer;
6925
6926 public List<PanoSpec> panoramas;
6927
6928 private int currentlyShown = -1;
6929
6931
6932 private int dataIndex = -1;
6933
6934 private void Start()
6935 {
6936 renderer = ((Component)this).GetComponent<Renderer>();
6937 data = ((Component)this).GetComponent<VRC_DataStorage>();
6938 for (int i = 0; i < data.data.Length; i++)
6939 {
6940 if (data.data[i].name == "display")
6941 {
6942 dataIndex = i;
6943 }
6944 }
6945 }
6946
6947 private void Update()
6948 {
6949 //IL_0002: Unknown result type (might be due to invalid IL or missing references)
6950 //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
6951 //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
6952 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
6953 //IL_0090: Unknown result type (might be due to invalid IL or missing references)
6954 //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
6955 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
6956 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
6957 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
6958 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
6959 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
6960 //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
6961 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
6962 Nullable<int> val = default(Nullable<int>);
6963 if ((Object)(object)data != (Object)null && data.data != null && data.data.Length < dataIndex + 1)
6964 {
6965 VRC_DataStorage.VrcDataElement obj = data.data[dataIndex];
6966 val = ((obj != null) ? new Nullable<int>(obj.valueInt) : default(Nullable<int>));
6967 }
6968 Nullable<int> val2;
6969 if (!val.HasValue || val.Value < 0)
6970 {
6971 val..ctor(panoramas.Count - 1);
6972 }
6973 else
6974 {
6975 val2 = val;
6976 int count = panoramas.Count;
6977 val = (val2.HasValue ? new Nullable<int>(val2.GetValueOrDefault() % count) : default(Nullable<int>));
6978 }
6979 int num = currentlyShown;
6980 val2 = val;
6981 if (!((num == val2.GetValueOrDefault()) & val2.HasValue))
6982 {
6983 currentlyShown = val.Value;
6984 ((MonoBehaviour)this).StartCoroutine(ShowPano(val.Value));
6985 }
6986 }
6987
6988 public void NextPano()
6989 {
6990 data.data[dataIndex].valueInt++;
6991 if (data.data[dataIndex].valueInt >= panoramas.Count)
6992 {
6993 data.data[dataIndex].valueInt = 0;
6994 }
6995 }
6996
6997 public void PrevPano()
6998 {
6999 data.data[dataIndex].valueInt--;
7000 if (data.data[dataIndex].valueInt < 0)
7001 {
7002 data.data[dataIndex].valueInt = panoramas.Count - 1;
7003 }
7004 }
7005
7006 public void ShowPanoAt(int index)
7007 {
7008 index = ((index >= 0) ? ((index >= panoramas.Count) ? (panoramas.Count - 1) : index) : 0);
7009 data.data[dataIndex].valueInt = index;
7010 }
7011
7012 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
7013 private IEnumerator ShowPano(int index)
7014 {
7015 if ((Object)(object)panoramas[index].texture == (Object)null)
7016 {
7017 string url = panoramas[index].url;
7018 UnityWebRequest unityWebRequest = UnityWebRequestTexture.GetTexture(url);
7019 try
7020 {
7021 UnityWebRequest.ClearCookieCache(unityWebRequest.uri);
7022 yield return unityWebRequest.SendWebRequest();
7023 if ((int)unityWebRequest.result != 2 && (int)unityWebRequest.result != 3)
7024 {
7025 panoramas[index].texture = DownloadHandlerTexture.GetContent(unityWebRequest);
7026 }
7027 }
7028 finally
7029 {
7030 if (unityWebRequest != null)
7031 {
7032 ((IDisposable)unityWebRequest).Dispose();
7033 }
7034 }
7035 }
7036 if (currentlyShown == index)
7037 {
7038 renderer.material.mainTexture = (Texture)(object)panoramas[index].texture;
7039 }
7040 }
7041 }
7042 public abstract class VRC_SceneDescriptor : MonoBehaviour, INetworkIDContainer
7043 {
7044 public enum SpawnOrder : Enum
7045 {
7046 First,
7047 Sequential,
7048 Random,
7049 Demo
7050 }
7051
7052 public enum SpawnOrientation : Enum
7053 {
7054 Default,
7055 AlignPlayerWithSpawnPoint,
7056 AlignRoomWithSpawnPoint
7057 }
7058
7059 public enum RespawnHeightBehaviour : Enum
7060 {
7061 Respawn,
7062 Destroy
7063 }
7064
7065 public delegate void IntializationDelegate(VRC_SceneDescriptor sceneDescriptor);
7066
7067 public Transform[] spawns;
7068
7069 public SpawnOrder spawnOrder = SpawnOrder.Random;
7070
7072
7073 public GameObject ReferenceCamera;
7074
7075 public float RespawnHeightY = -100f;
7076
7078
7080
7081 [HideInInspector]
7083
7084 [HideInInspector]
7086
7087 [HideInInspector]
7088 public Vector3 gravity = new Vector3(0f, -9.81f, 0f);
7089
7090 [HideInInspector]
7091 public bool[] layerCollisionArr;
7092
7093 [HideInInspector]
7094 public int capacity;
7095
7096 [HideInInspector]
7097 public bool contentSex;
7098
7099 [HideInInspector]
7100 public bool contentViolence;
7101
7102 [HideInInspector]
7103 public bool contentGore;
7104
7105 [HideInInspector]
7106 public bool contentOther;
7107
7108 [HideInInspector]
7109 public bool releasePublic;
7110
7111 public string unityVersion;
7112
7113 public List<string> udonProducts;
7114
7115 [HideInInspector]
7116 [Obsolete("Property is not used.")]
7117 public string Name;
7118
7119 [HideInInspector]
7120 [Obsolete("Property is not used.")]
7121 public bool NSFW;
7122
7123 [HideInInspector]
7124 public Vector3 SpawnPosition = new Vector3(0f, 0f, 0f);
7125
7126 [HideInInspector]
7127 public Transform SpawnLocation;
7128
7129 [HideInInspector]
7130 public float DrawDistance;
7131
7132 [HideInInspector]
7134
7135 public List<GameObject> DynamicPrefabs = new List<GameObject>();
7136
7137 private static Dictionary<string, GameObject> sDynamicPrefabs;
7138
7139 public List<Material> DynamicMaterials = new List<Material>();
7140
7141 private static Dictionary<string, Material> sDynamicMaterials;
7142
7143 [HideInInspector]
7144 public Texture2D[] LightMapsNear;
7145
7146 [HideInInspector]
7147 public Texture2D[] LightMapsFar;
7148
7149 [HideInInspector]
7150 public LightmapsMode LightMode;
7151
7152 [HideInInspector]
7154
7155 [HideInInspector]
7157
7158 [HideInInspector]
7160
7161 [HideInInspector]
7163
7164 [HideInInspector]
7165 public AmbientMode RenderAmbientMode;
7166
7167 [HideInInspector]
7168 public SphericalHarmonicsL2 RenderAmbientProbe;
7169
7170 [HideInInspector]
7172
7173 [HideInInspector]
7174 public bool RenderFog;
7175
7176 [HideInInspector]
7177 public Color RenderFogColor;
7178
7179 [HideInInspector]
7180 public FogMode RenderFogMode;
7181
7182 [HideInInspector]
7183 public float RenderFogDensity;
7184
7185 [HideInInspector]
7187
7188 [HideInInspector]
7190
7191 [HideInInspector]
7193
7194 [HideInInspector]
7196
7197 [HideInInspector]
7199
7200 [HideInInspector]
7202
7203 [HideInInspector]
7204 public DefaultReflectionMode RenderDefaultReflectionMode;
7205
7206 [HideInInspector]
7208
7209 [HideInInspector]
7211
7212 [HideInInspector]
7214
7215 [HideInInspector]
7216 public Material RenderSkybox;
7217
7218 [SerializeField]
7219 private List<NetworkIDPair> NetworkIDs = new List<NetworkIDPair>();
7220
7221 public static IntializationDelegate Initialize;
7222
7223 [HideInInspector]
7224 public object apiWorld;
7225
7226 private static VRC_SceneDescriptor _instance;
7227
7228 public Vector3 portraitCameraPositionOffset = new Vector3(0f, 0f, 0f);
7229
7230 public Quaternion portraitCameraRotationOffset = Quaternion.AngleAxis(180f, Vector3.up);
7231
7232 public List<NetworkIDPair> NetworkIDCollection
7233 {
7234 get
7235 {
7236 return NetworkIDs;
7237 }
7238 set
7239 {
7240 NetworkIDs = value;
7241 }
7242 }
7243
7244 [field: CompilerGenerated]
7245 public Dictionary<GameObject, NetworkIDPair> NetworkIDLookup
7246 {
7247 [CompilerGenerated]
7248 get;
7249 [CompilerGenerated]
7250 private set;
7251 }
7252
7253 public static VRC_SceneDescriptor Instance
7254 {
7255 get
7256 {
7257 if ((Object)(object)_instance == (Object)null)
7258 {
7259 _instance = Object.FindObjectOfType<VRC_SceneDescriptor>(true);
7260 }
7261 return _instance;
7262 }
7263 }
7264
7265 public static GameObject GetPrefab(string name)
7266 {
7267 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
7268 //IL_0035: Unknown result type (might be due to invalid IL or missing references)
7269 if (sDynamicPrefabs.ContainsKey(name))
7270 {
7271 return sDynamicPrefabs[name];
7272 }
7273 if (name.StartsWith("Assets"))
7274 {
7275 Enumerator<string, GameObject> enumerator = sDynamicPrefabs.Keys.GetEnumerator();
7276 try
7277 {
7278 while (enumerator.MoveNext())
7279 {
7280 string current = enumerator.Current;
7281 if (name.Contains(String.Concat("/", current, ".prefab")))
7282 {
7283 return sDynamicPrefabs[current];
7284 }
7285 }
7286 }
7287 finally
7288 {
7289 ((IDisposable)enumerator).Dispose();
7290 }
7291 }
7292 return null;
7293 }
7294
7295 public static Material GetMaterial(string name)
7296 {
7297 //IL_0030: Unknown result type (might be due to invalid IL or missing references)
7298 //IL_0035: Unknown result type (might be due to invalid IL or missing references)
7299 if (sDynamicMaterials.ContainsKey(name))
7300 {
7301 return sDynamicMaterials[name];
7302 }
7303 if (name.StartsWith("Assets"))
7304 {
7305 Enumerator<string, Material> enumerator = sDynamicMaterials.Keys.GetEnumerator();
7306 try
7307 {
7308 while (enumerator.MoveNext())
7309 {
7310 string current = enumerator.Current;
7311 if (name.Contains(String.Concat("/", current, ".mat")))
7312 {
7313 return sDynamicMaterials[current];
7314 }
7315 }
7316 }
7317 finally
7318 {
7319 ((IDisposable)enumerator).Dispose();
7320 }
7321 }
7322 return null;
7323 }
7324
7325 public void GetNetworkIDObjects(List<INetworkID> netIds)
7326 {
7327 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
7328 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
7329 netIds.Clear();
7330 Scene scene = ((Component)this).gameObject.scene;
7331 GameObject[] rootGameObjects = ((Scene)(ref scene)).GetRootGameObjects();
7332 foreach (GameObject val in rootGameObjects)
7333 {
7334 netIds.AddRange((IEnumerable<INetworkID>)(object)val.GetComponentsInChildren<INetworkID>(true));
7335 }
7336 netIds.RemoveAll((Predicate<INetworkID>)((INetworkID id) => !(id is Component)));
7337 }
7338
7339 public GameObject FindNetworkIDGameObject(string path)
7340 {
7341 return GameObject.Find(path);
7342 }
7343
7344 public string GetNetworkIDGameObjectPath(GameObject obj)
7345 {
7346 return NetworkIDAssignment.GetNetworkIDGameObjectPath(obj.transform);
7347 }
7348
7349 public virtual void Awake()
7350 {
7351 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
7352 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
7353 //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
7354 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
7355 //IL_010f: Unknown result type (might be due to invalid IL or missing references)
7356 //IL_0114: Unknown result type (might be due to invalid IL or missing references)
7357 if ((Object)(object)_instance != (Object)null && (Object)(object)_instance != (Object)(object)this)
7358 {
7359 Debug.LogWarning((object)"Destroying existing Scene Descriptor");
7360 Object.Destroy((Object)(object)_instance);
7361 }
7362 _instance = this;
7363 sDynamicPrefabs = new Dictionary<string, GameObject>();
7364 Enumerator<GameObject> enumerator = DynamicPrefabs.GetEnumerator();
7365 try
7366 {
7367 while (enumerator.MoveNext())
7368 {
7369 GameObject current = enumerator.Current;
7370 if ((Object)(object)current != (Object)null && !sDynamicPrefabs.ContainsKey(((Object)current).name))
7371 {
7372 sDynamicPrefabs.Add(((Object)current).name, current);
7373 }
7374 }
7375 }
7376 finally
7377 {
7378 ((IDisposable)enumerator).Dispose();
7379 }
7380 sDynamicMaterials = new Dictionary<string, Material>();
7381 Enumerator<Material> enumerator2 = DynamicMaterials.GetEnumerator();
7382 try
7383 {
7384 while (enumerator2.MoveNext())
7385 {
7386 Material current2 = enumerator2.Current;
7387 if ((Object)(object)current2 != (Object)null && !sDynamicMaterials.ContainsKey(((Object)current2).name))
7388 {
7389 sDynamicMaterials.Add(((Object)current2).name, current2);
7390 }
7391 }
7392 }
7393 finally
7394 {
7395 ((IDisposable)enumerator2).Dispose();
7396 }
7397 NetworkIDLookup = new Dictionary<GameObject, NetworkIDPair>();
7398 Enumerator<NetworkIDPair> enumerator3 = NetworkIDs.GetEnumerator();
7399 try
7400 {
7401 while (enumerator3.MoveNext())
7402 {
7403 NetworkIDPair current3 = enumerator3.Current;
7404 if (!((Object)(object)current3?.gameObject == (Object)null))
7405 {
7406 NetworkIDLookup[current3.gameObject] = current3;
7407 }
7408 }
7409 }
7410 finally
7411 {
7412 ((IDisposable)enumerator3).Dispose();
7413 }
7414 if (Initialize != null)
7415 {
7416 Initialize(this);
7417 }
7418 }
7419
7420 private void OnDestroy()
7421 {
7422 _instance = null;
7423 }
7424
7425 public void PositionPortraitCamera(Transform cam)
7426 {
7427 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
7428 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
7429 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
7430 //IL_0024: Unknown result type (might be due to invalid IL or missing references)
7431 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
7432 cam.position = ((Component)this).transform.TransformPoint(portraitCameraPositionOffset);
7433 cam.rotation = ((Component)this).transform.rotation * portraitCameraRotationOffset;
7434 }
7435 }
7436 public abstract class VRC_SpecialLayer : MonoBehaviour
7437 {
7438 public enum VRCLayer : Enum
7439 {
7440 Environment,
7441 Interactive,
7442 Walkthrough,
7443 Pickup
7444 }
7445
7447
7448 public void Apply()
7449 {
7450 int num = -1;
7451 switch (specialLayer)
7452 {
7453 case VRCLayer.Environment:
7454 num = LayerMask.NameToLayer("Environment");
7455 break;
7456 case VRCLayer.Interactive:
7457 num = LayerMask.NameToLayer("Interactive");
7458 break;
7459 case VRCLayer.Walkthrough:
7460 num = ((!((Object)(object)((Component)this).gameObject.GetComponent<VRC_Pickup>() != (Object)null)) ? LayerMask.NameToLayer("Walkthrough") : LayerMask.NameToLayer("Pickup"));
7461 break;
7462 case VRCLayer.Pickup:
7463 num = LayerMask.NameToLayer("Pickup");
7464 break;
7465 }
7466 if (num > 0)
7467 {
7468 ((Component)this).gameObject.layer = num;
7469 }
7470 }
7471 }
7472 public abstract class VRC_StereoObject : MonoBehaviour
7473 {
7474 public enum Eye : Enum
7475 {
7476 Left,
7477 Right
7478 }
7479
7480 public Eye eye;
7481 }
7482 [Obsolete("Please use VRC_Trigger", false)]
7483 public abstract class VRC_TimedEvents : MonoBehaviour, IVRCEventSender
7484 {
7485 public bool Repeat = true;
7486
7487 public float LowPeriodTime = 5f;
7488
7489 public float HighPeriodTime = 10f;
7490
7491 public bool ResetOnEnable = true;
7492
7493 public string EventName;
7494
7496
7497 private bool EventFired;
7498
7499 private float Duration;
7500
7501 private float Timer;
7502
7504
7505 private void Start()
7506 {
7507 Handler = ((Component)this).GetComponent<VRC_EventHandler>();
7508 if ((Object)(object)Handler == (Object)null)
7509 {
7510 Handler = ((Component)this).GetComponentInParent<VRC_EventHandler>();
7511 }
7512 ResetClock();
7513 }
7514
7515 private void OnEnable()
7516 {
7517 if (ResetOnEnable)
7518 {
7519 ResetClock();
7520 }
7521 }
7522
7523 private void Update()
7524 {
7525 Timer += Time.deltaTime;
7526 if (Timer > Duration && !EventFired && (Object)(object)Handler != (Object)null)
7527 {
7528 Handler.TriggerEvent(EventName, BroadcastType);
7529 if (Repeat)
7530 {
7531 ResetClock();
7532 }
7533 else
7534 {
7535 EventFired = true;
7536 }
7537 }
7538 }
7539
7540 private void ResetClock()
7541 {
7542 Duration = LowPeriodTime + Random.value * (HighPeriodTime - LowPeriodTime);
7543 Timer = 0f;
7544 EventFired = false;
7545 }
7546 }
7547 [RequireComponent(/*Could not decode attribute arguments.*/)]
7549 {
7550 [Serializable]
7551 public class CustomTriggerTarget : Object
7552 {
7553 public GameObject TriggerObject;
7554
7555 public string CustomName = "";
7556 }
7557
7558 [Serializable]
7559 public enum TriggerType : Enum
7560 {
7561 Custom = 0,
7562 Relay = 1,
7563 OnEnable = 2,
7564 OnDestroy = 3,
7565 OnSpawn = 4,
7566 OnNetworkReady = 5,
7567 OnPlayerJoined = 6,
7568 OnPlayerLeft = 7,
7569 OnPickupUseDown = 8,
7570 OnPickupUseUp = 9,
7571 OnTimer = 10,
7572 OnEnterTrigger = 11,
7573 OnExitTrigger = 12,
7574 OnKeyDown = 13,
7575 OnKeyUp = 14,
7576 OnPickup = 15,
7577 OnDrop = 16,
7578 OnInteract = 17,
7579 OnEnterCollider = 18,
7580 OnExitCollider = 19,
7581 OnDataStorageChange = 20,
7582 OnAvatarHit = 23,
7583 OnStationEntered = 24,
7584 OnStationExited = 25,
7585 OnVideoStart = 26,
7586 OnVideoEnd = 27,
7587 OnVideoPlay = 28,
7588 OnVideoPause = 29,
7589 OnDisable = 30,
7590 OnOwnershipTransfer = 31,
7591 OnParticleCollision = 32
7592 }
7593
7594 public enum EditorTriggerLineMode : Enum
7595 {
7596 Enabled,
7597 Disabled,
7598 PerTrigger
7599 }
7600
7601 public static class TypeCollections : Object
7602 {
7603 public static TriggerType[] KeyTypes = new TriggerType[2]
7604 {
7605 TriggerType.OnKeyDown,
7606 TriggerType.OnKeyUp
7607 };
7608
7609 public static TriggerType[] TimerTypes = new TriggerType[1] { TriggerType.OnTimer };
7610
7611 public static TriggerType[] InteractiveTypes = new TriggerType[1] { TriggerType.OnInteract };
7612
7613 public static TriggerType[] ColliderTypes = new TriggerType[2]
7614 {
7615 TriggerType.OnEnterCollider,
7616 TriggerType.OnExitCollider
7617 };
7618
7619 public static TriggerType[] TriggerTypes = new TriggerType[2]
7620 {
7621 TriggerType.OnEnterTrigger,
7622 TriggerType.OnExitTrigger
7623 };
7624
7625 public static TriggerType[] PickupTypes;
7626
7628
7630 {
7631 TriggerType[] array = new TriggerType[4];
7632 RuntimeHelpers.InitializeArray((Array)(object)array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
7633 PickupTypes = array;
7634 DataStorageTypes = new TriggerType[1] { TriggerType.OnDataStorageChange };
7635 }
7636 }
7637
7638 [Serializable]
7639 public class DataStorageShadow : Object
7640 {
7641 public string ParameterString;
7642
7643 public string ParameterBoolOp;
7644
7645 public string ParameterFloat;
7646
7647 public string ParameterInt;
7648 }
7649
7650 [Serializable]
7651 public class TriggerEvent : Object
7652 {
7654
7656
7657 [SerializeField]
7658 public List<VRC_EventHandler.VrcEvent> Events = new List<VRC_EventHandler.VrcEvent>();
7659
7660 public string Name;
7661
7662 [SerializeField]
7663 public List<VRC_Trigger> Others = new List<VRC_Trigger>();
7664
7665 public KeyCode Key;
7666
7667 public bool TriggerIndividuals = true;
7668
7669 public LayerMask Layers = LayerMask.op_Implicit(0);
7670
7671 public bool Repeat = true;
7672
7673 public float LowPeriodTime = 5f;
7674
7675 public float HighPeriodTime = 10f;
7676
7677 public bool ResetOnEnable = true;
7678
7679 public bool EventFired;
7680
7681 public float Duration;
7682
7683 public float Timer;
7684
7685 public int DataElementIdx;
7686
7687 [SerializeField]
7688 public List<DataStorageShadow> DataStorageShadowValues = new List<DataStorageShadow>();
7689
7690 public float AfterSeconds;
7691
7692 [SerializeField]
7693 public bool[] ProbabilityLock = (bool[])(object)new Boolean[0];
7694
7695 [SerializeField]
7696 public float[] Probabilities = (float[])(object)new Single[0];
7697
7698 [Tooltip("Midi Channel [1-16], 0=any")]
7699 public int MidiChannel;
7700
7701 [Tooltip("Midi Note [0-127]")]
7702 public int MidiNote;
7703
7704 [Tooltip("OSC Address")]
7705 public string OscAddr;
7706 }
7707
7708 [CompilerGenerated]
7709 private sealed class <>c__DisplayClass40_0 : Object
7710 {
7712
7713 internal bool <ExecuteTriggerType>b__0(TriggerEvent t)
7714 {
7715 if (t != null)
7716 {
7717 return t.TriggerType == triggerType;
7718 }
7719 return false;
7720 }
7721 }
7722
7723 [CompilerGenerated]
7724 private sealed class <>c__DisplayClass41_0 : Object
7725 {
7726 public string name;
7727
7728 internal bool <ExecuteCustomTrigger>b__0(TriggerEvent t)
7729 {
7730 if (t != null && t.TriggerType == TriggerType.Custom)
7731 {
7732 return t.Name == name;
7733 }
7734 return false;
7735 }
7736 }
7737
7738 public static Action<VRC_Trigger> InitializeTrigger;
7739
7740 public bool isHidden;
7741
7742 [Obsolete("'Advanced Mode' is now the default behavior and this field no longer does anything.")]
7744
7746
7747 public bool DrawLines = true;
7748
7750
7751 [SerializeField]
7752 public List<TriggerEvent> Triggers = new List<TriggerEvent>();
7753
7754 public Action<TriggerEvent> ExecuteTrigger;
7755
7756 public bool HasKeyTriggers => Enumerable.Any<TriggerEvent>((IEnumerable<TriggerEvent>)(object)Triggers, (Func<TriggerEvent, bool>)((TriggerEvent t) => Enumerable.Contains<TriggerType>((IEnumerable<TriggerType>)(object)TypeCollections.KeyTypes, t.TriggerType)));
7757
7758 public bool HasTimerTriggers => Enumerable.Any<TriggerEvent>((IEnumerable<TriggerEvent>)(object)Triggers, (Func<TriggerEvent, bool>)((TriggerEvent t) => Enumerable.Contains<TriggerType>((IEnumerable<TriggerType>)(object)TypeCollections.TimerTypes, t.TriggerType)));
7759
7760 public bool HasColliderTriggers
7761 {
7762 get
7763 {
7764 if (!Enumerable.Any<TriggerEvent>((IEnumerable<TriggerEvent>)(object)Triggers, (Func<TriggerEvent, bool>)((TriggerEvent t) => Enumerable.Contains<TriggerType>((IEnumerable<TriggerType>)(object)TypeCollections.ColliderTypes, t.TriggerType))))
7765 {
7766 return Enumerable.Any<TriggerEvent>((IEnumerable<TriggerEvent>)(object)Triggers, (Func<TriggerEvent, bool>)((TriggerEvent t) => Enumerable.Contains<TriggerType>((IEnumerable<TriggerType>)(object)TypeCollections.TriggerTypes, t.TriggerType)));
7767 }
7768 return true;
7769 }
7770 }
7771
7772 public bool HasInteractiveTriggers => Enumerable.Any<TriggerEvent>((IEnumerable<TriggerEvent>)(object)Triggers, (Func<TriggerEvent, bool>)((TriggerEvent t) => Enumerable.Contains<TriggerType>((IEnumerable<TriggerType>)(object)TypeCollections.InteractiveTypes, t.TriggerType)));
7773
7774 public bool HasPickupTriggers => Enumerable.Any<TriggerEvent>((IEnumerable<TriggerEvent>)(object)Triggers, (Func<TriggerEvent, bool>)((TriggerEvent t) => Enumerable.Contains<TriggerType>((IEnumerable<TriggerType>)(object)TypeCollections.PickupTypes, t.TriggerType)));
7775
7776 public override bool IsInteractive
7777 {
7778 get
7779 {
7780 if (!HasInteractiveTriggers)
7781 {
7782 return HasPickupTriggers;
7783 }
7784 return true;
7785 }
7786 }
7787
7788 public static void TriggerCustom(CustomTriggerTarget target)
7789 {
7790 if (target != null && (Object)(object)target.TriggerObject != (Object)null && !String.IsNullOrEmpty(target.CustomName))
7791 {
7792 TriggerCustom(target.TriggerObject, target.CustomName);
7793 }
7794 }
7795
7796 public static void Trigger(GameObject obj, TriggerType type)
7797 {
7798 if (!((Object)(object)obj == (Object)null))
7799 {
7800 VRC_Trigger component = obj.GetComponent<VRC_Trigger>();
7801 if ((Object)(object)component != (Object)null)
7802 {
7803 component.ExecuteTriggerType(type);
7804 }
7805 }
7806 }
7807
7808 public static void TriggerCustom(GameObject obj, string name)
7809 {
7810 if (!((Object)(object)obj == (Object)null))
7811 {
7812 VRC_Trigger component = obj.GetComponent<VRC_Trigger>();
7813 if ((Object)(object)component != (Object)null)
7814 {
7815 component.ExecuteCustomTrigger(name);
7816 }
7817 }
7818 }
7819
7820 public override void Awake()
7821 {
7822 base.Awake();
7823 InitializeTrigger?.Invoke(this);
7824 }
7825
7826 private void OnDestroy()
7827 {
7828 ExecuteTriggerType(TriggerType.OnDestroy);
7829 }
7830
7831 private void OnEnable()
7832 {
7833 ExecuteTriggerType(TriggerType.OnEnable);
7834 ResetClocks();
7835 }
7836
7837 private void OnDisable()
7838 {
7839 ExecuteTriggerType(TriggerType.OnDisable);
7840 ResetClocks();
7841 }
7842
7844 {
7845 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
7846 //IL_006a: Unknown result type (might be due to invalid IL or missing references)
7847 //IL_0088: Unknown result type (might be due to invalid IL or missing references)
7848 //IL_008d: Unknown result type (might be due to invalid IL or missing references)
7849 if (EditorGlobalTriggerLineMode == EditorTriggerLineMode.Disabled || (EditorGlobalTriggerLineMode == EditorTriggerLineMode.PerTrigger && !DrawLines))
7850 {
7851 return;
7852 }
7853 List<VRC_Trigger> val = new List<VRC_Trigger>();
7854 List<VRC_Trigger> obj2 = new List<VRC_Trigger>();
7855 obj2.Add(this);
7856 List<VRC_Trigger> val2 = obj2;
7857 Action<GameObject> val3 = [CompilerGenerated] (GameObject obj) =>
7858 {
7859 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
7860 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
7861 if (!((Object)(object)obj == (Object)null))
7862 {
7863 Gizmos.DrawLine(((Component)this).transform.position, obj.transform.position);
7864 }
7865 };
7866 while (val2.Count > 0)
7867 {
7868 VRC_Trigger vRC_Trigger = Enumerable.First<VRC_Trigger>((IEnumerable<VRC_Trigger>)(object)val2);
7869 val2.RemoveAt(0);
7870 if ((Object)(object)vRC_Trigger == (Object)null)
7871 {
7872 continue;
7873 }
7874 val.Add(vRC_Trigger);
7875 Enumerator<TriggerEvent> enumerator = vRC_Trigger.Triggers.GetEnumerator();
7876 try
7877 {
7878 while (enumerator.MoveNext())
7879 {
7880 TriggerEvent current = enumerator.Current;
7881 if (current == null)
7882 {
7883 continue;
7884 }
7885 Enumerator<VRC_EventHandler.VrcEvent> enumerator2 = current.Events.GetEnumerator();
7886 try
7887 {
7888 while (enumerator2.MoveNext())
7889 {
7890 VRC_EventHandler.VrcEvent current2 = enumerator2.Current;
7891 if (current2 == null)
7892 {
7893 continue;
7894 }
7895 if (current2.ParameterObjects != null)
7896 {
7897 GameObject[] parameterObjects = current2.ParameterObjects;
7898 foreach (GameObject val4 in parameterObjects)
7899 {
7900 val3.Invoke(val4);
7901 }
7902 }
7903 if ((Object)(object)current2.ParameterObject != (Object)null)
7904 {
7905 val3.Invoke(current2.ParameterObject);
7906 }
7907 }
7908 }
7909 finally
7910 {
7911 ((IDisposable)enumerator2).Dispose();
7912 }
7913 }
7914 }
7915 finally
7916 {
7917 ((IDisposable)enumerator).Dispose();
7918 }
7919 }
7920 }
7921
7922 public override void Interact()
7923 {
7924 ExecuteTriggerType(TriggerType.OnInteract);
7925 }
7926
7927 public override void OnPickupUseUp()
7928 {
7929 ExecuteTriggerType(TriggerType.OnPickupUseUp);
7930 }
7931
7932 public override void OnPickupUseDown()
7933 {
7934 ExecuteTriggerType(TriggerType.OnPickupUseDown);
7935 }
7936
7937 public override void OnPickup()
7938 {
7939 ExecuteTriggerType(TriggerType.OnPickup);
7940 }
7941
7942 public override void OnDrop()
7943 {
7944 ExecuteTriggerType(TriggerType.OnDrop);
7945 }
7946
7947 public void ExecuteTriggers(IEnumerable<TriggerEvent> triggers)
7948 {
7949 if (ExecuteTrigger == null)
7950 {
7951 Debug.LogErrorFormat("Trigger on {0} was not initialized in time!", (object[])(object)new Object[1] { (Object)((Object)((Component)this).gameObject).name });
7952 return;
7953 }
7954 IEnumerator<TriggerEvent> enumerator = triggers.GetEnumerator();
7955 try
7956 {
7957 while (((IEnumerator)enumerator).MoveNext())
7958 {
7959 TriggerEvent current = enumerator.Current;
7960 ExecuteTrigger.Invoke(current);
7961 }
7962 }
7963 finally
7964 {
7965 if (enumerator != null)
7966 {
7967 ((IDisposable)enumerator).Dispose();
7968 }
7969 }
7970 }
7971
7972 public void ExecuteTriggerType(TriggerType triggerType)
7973 {
7974 <>c__DisplayClass40_0 CS$<>8__locals0 = new <>c__DisplayClass40_0();
7975 CS$<>8__locals0.triggerType = triggerType;
7976 if (Triggers == null)
7977 {
7978 return;
7979 }
7980 if (ExecuteTrigger == null)
7981 {
7982 Debug.LogErrorFormat("Trigger on {0} was not initialized in time!", (object[])(object)new Object[1] { (Object)((Object)((Component)this).gameObject).name });
7983 return;
7984 }
7985 IEnumerable<TriggerEvent> val = Enumerable.Where<TriggerEvent>((IEnumerable<TriggerEvent>)(object)Triggers, (Func<TriggerEvent, bool>)((TriggerEvent t) => t != null && t.TriggerType == CS$<>8__locals0.triggerType));
7986 if (Enumerable.FirstOrDefault<TriggerEvent>(val) == null)
7987 {
7988 return;
7989 }
7990 IEnumerator<TriggerEvent> enumerator = val.GetEnumerator();
7991 try
7992 {
7993 while (((IEnumerator)enumerator).MoveNext())
7994 {
7995 TriggerEvent current = enumerator.Current;
7996 ExecuteTrigger.Invoke(current);
7997 }
7998 }
7999 finally
8000 {
8001 if (enumerator != null)
8002 {
8003 ((IDisposable)enumerator).Dispose();
8004 }
8005 }
8006 }
8007
8008 public void ExecuteCustomTrigger(string name)
8009 {
8010 <>c__DisplayClass41_0 CS$<>8__locals0 = new <>c__DisplayClass41_0();
8011 CS$<>8__locals0.name = name;
8012 if (ExecuteTrigger == null)
8013 {
8014 Debug.LogErrorFormat("Trigger on {0} was not initialized in time!", (object[])(object)new Object[1] { (Object)((Object)((Component)this).gameObject).name });
8015 return;
8016 }
8017 IEnumerable<TriggerEvent> val = Enumerable.Where<TriggerEvent>((IEnumerable<TriggerEvent>)(object)Triggers, (Func<TriggerEvent, bool>)((TriggerEvent t) => t != null && t.TriggerType == TriggerType.Custom && t.Name == CS$<>8__locals0.name));
8018 if (Enumerable.FirstOrDefault<TriggerEvent>(val) == null)
8019 {
8020 return;
8021 }
8022 IEnumerator<TriggerEvent> enumerator = val.GetEnumerator();
8023 try
8024 {
8025 while (((IEnumerator)enumerator).MoveNext())
8026 {
8027 TriggerEvent current = enumerator.Current;
8028 ExecuteTrigger.Invoke(current);
8029 }
8030 }
8031 finally
8032 {
8033 if (enumerator != null)
8034 {
8035 ((IDisposable)enumerator).Dispose();
8036 }
8037 }
8038 }
8039
8040 private void ResetClocks()
8041 {
8042 IEnumerator<TriggerEvent> enumerator = Enumerable.Where<TriggerEvent>((IEnumerable<TriggerEvent>)(object)Triggers, (Func<TriggerEvent, bool>)((TriggerEvent t) => t.TriggerType == TriggerType.OnTimer && t.ResetOnEnable)).GetEnumerator();
8043 try
8044 {
8045 while (((IEnumerator)enumerator).MoveNext())
8046 {
8047 TriggerEvent current = enumerator.Current;
8048 ResetClock(current);
8049 }
8050 }
8051 finally
8052 {
8053 if (enumerator != null)
8054 {
8055 ((IDisposable)enumerator).Dispose();
8056 }
8057 }
8058 }
8059
8060 public void ResetClock(TriggerEvent timer)
8061 {
8062 timer.Duration = timer.LowPeriodTime + Random.value * (timer.HighPeriodTime - timer.LowPeriodTime);
8063 timer.Timer = 0f;
8064 timer.EventFired = false;
8065 }
8066 }
8067 [Obsolete("Please use VRC_Trigger", false)]
8068 public abstract class VRC_TriggerColliderEventTrigger : MonoBehaviour
8069 {
8070 public delegate void CollisionEnterDelegate(VRC_TriggerColliderEventTrigger obj, Collider other);
8071
8072 public delegate void CollisionExitDelegate(VRC_TriggerColliderEventTrigger obj, Collider other);
8073
8074 public string EnterEventName;
8075
8076 public string ExitEventName;
8077
8078 public bool TriggerIndividuals = true;
8079
8080 public LayerMask layers = LayerMask.op_Implicit(512);
8081
8082 [HideInInspector]
8084
8085 public static CollisionEnterDelegate CollisionEnter;
8086
8087 public static CollisionExitDelegate CollisionExit;
8088
8089 private int currentOccupants;
8090
8091 private void Start()
8092 {
8093 Handler = ((Component)this).GetComponent<VRC_EventHandler>();
8094 if ((Object)(object)Handler == (Object)null)
8095 {
8096 Handler = ((Component)this).GetComponentInParent<VRC_EventHandler>();
8097 }
8098 }
8099
8100 private void OnTriggerEnter(Collider other)
8101 {
8102 int num = 1 << ((Component)other).gameObject.layer;
8103 if ((((LayerMask)(ref layers)).value & num) != 0)
8104 {
8105 currentOccupants++;
8106 if ((currentOccupants == 1 || TriggerIndividuals) && CollisionEnter != null)
8107 {
8108 CollisionEnter(this, other);
8109 }
8110 }
8111 }
8112
8113 private void OnTriggerExit(Collider other)
8114 {
8115 int num = 1 << ((Component)other).gameObject.layer;
8116 if ((((LayerMask)(ref layers)).value & num) != 0)
8117 {
8118 if (currentOccupants > 0)
8119 {
8120 currentOccupants--;
8121 }
8122 if ((currentOccupants == 0 || TriggerIndividuals) && CollisionExit != null)
8123 {
8124 CollisionExit(this, other);
8125 }
8126 }
8127 }
8128 }
8129 [Obsolete("Please use VRC_Trigger", false)]
8131 {
8132 public delegate void UpdateDelegate(VRC_UseEvents obj);
8133
8134 public string EventName = "Use";
8135
8136 public bool isHidden;
8137
8139
8140 public static UpdateDelegate UpdateUse;
8141
8142 public override void Awake()
8143 {
8144 base.Awake();
8145 if (isHidden)
8146 {
8147 ((Component)this).gameObject.layer = LayerMask.NameToLayer("Default");
8148 }
8149 if (Enumerable.Any<VRC_UseEvents>((IEnumerable<VRC_UseEvents>)(object)((Component)this).GetComponents<VRC_UseEvents>(), (Func<VRC_UseEvents, bool>)([CompilerGenerated] (VRC_UseEvents u) => u.EventName == EventName && (Object)(object)u != (Object)(object)this)))
8150 {
8151 Object.Destroy((Object)(object)this);
8152 }
8153 }
8154
8155 public override void Start()
8156 {
8157 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
8158 if ((Object)(object)interactTextPlacement != (Object)null && (Object)(object)interactTextGO != (Object)null)
8159 {
8160 interactTextGO.transform.position = interactTextPlacement.position;
8161 }
8162 }
8163
8164 public override void Interact()
8165 {
8166 VRC_EventHandler vRC_EventHandler = ((Component)this).GetComponent<VRC_EventHandler>();
8167 if ((Object)(object)vRC_EventHandler == (Object)null)
8168 {
8169 vRC_EventHandler = ((Component)this).GetComponentInParent<VRC_EventHandler>();
8170 }
8171 if ((Object)(object)vRC_EventHandler != (Object)null)
8172 {
8173 vRC_EventHandler.TriggerEvent(EventName, BroadcastType, Networking.LocalPlayer.gameObject);
8174 }
8175 }
8176 }
8177 [ExecuteInEditMode]
8178 public abstract class VRC_Water : MonoBehaviour
8179 {
8180 public enum WaterMode : Enum
8181 {
8182 Simple,
8183 Reflective,
8184 Refractive
8185 }
8186
8187 public WaterMode waterMode = WaterMode.Refractive;
8188
8189 public bool disablePixelLights = true;
8190
8191 public int textureSize = 256;
8192
8193 public float clipPlaneOffset = 0.07f;
8194
8195 public LayerMask reflectLayers = LayerMask.op_Implicit(-1);
8196
8197 public LayerMask refractLayers = LayerMask.op_Implicit(-1);
8198
8199 public bool TurnOffWaterOcclusion = true;
8200
8201 private Dictionary<Camera, Camera> m_ReflectionCameras = new Dictionary<Camera, Camera>();
8202
8203 private Dictionary<Camera, Camera> m_RefractionCameras = new Dictionary<Camera, Camera>();
8204
8205 private RenderTexture m_ReflectionTexture;
8206
8207 private RenderTexture m_RefractionTexture;
8208
8209 private WaterMode m_HardwareWaterSupport = WaterMode.Refractive;
8210
8212
8214
8215 private static bool s_InsideWater;
8216
8218 {
8219 //IL_0076: Unknown result type (might be due to invalid IL or missing references)
8220 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
8221 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
8222 //IL_0088: Unknown result type (might be due to invalid IL or missing references)
8223 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
8224 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
8225 //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
8226 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
8227 //IL_00d9: Unknown result type (might be due to invalid IL or missing references)
8228 //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
8229 //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
8230 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
8231 //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
8232 //IL_0102: Unknown result type (might be due to invalid IL or missing references)
8233 //IL_0106: Unknown result type (might be due to invalid IL or missing references)
8234 //IL_0108: Unknown result type (might be due to invalid IL or missing references)
8235 //IL_010d: Unknown result type (might be due to invalid IL or missing references)
8236 //IL_0111: Unknown result type (might be due to invalid IL or missing references)
8237 //IL_0116: Unknown result type (might be due to invalid IL or missing references)
8238 //IL_0118: Unknown result type (might be due to invalid IL or missing references)
8239 //IL_0124: Unknown result type (might be due to invalid IL or missing references)
8240 //IL_0126: Unknown result type (might be due to invalid IL or missing references)
8241 //IL_012d: Unknown result type (might be due to invalid IL or missing references)
8242 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
8243 //IL_0136: Unknown result type (might be due to invalid IL or missing references)
8244 //IL_0138: Unknown result type (might be due to invalid IL or missing references)
8245 //IL_0176: Unknown result type (might be due to invalid IL or missing references)
8246 //IL_0183: Unknown result type (might be due to invalid IL or missing references)
8247 //IL_0188: Unknown result type (might be due to invalid IL or missing references)
8248 //IL_0190: Unknown result type (might be due to invalid IL or missing references)
8249 //IL_0198: Unknown result type (might be due to invalid IL or missing references)
8250 //IL_019f: Unknown result type (might be due to invalid IL or missing references)
8251 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
8252 //IL_01bc: Unknown result type (might be due to invalid IL or missing references)
8253 //IL_01ec: Unknown result type (might be due to invalid IL or missing references)
8254 //IL_01f8: Unknown result type (might be due to invalid IL or missing references)
8255 //IL_01fa: Unknown result type (might be due to invalid IL or missing references)
8256 //IL_0201: Unknown result type (might be due to invalid IL or missing references)
8257 //IL_0206: Unknown result type (might be due to invalid IL or missing references)
8258 //IL_020a: Unknown result type (might be due to invalid IL or missing references)
8259 //IL_020c: Unknown result type (might be due to invalid IL or missing references)
8260 //IL_0242: Unknown result type (might be due to invalid IL or missing references)
8261 //IL_0258: Unknown result type (might be due to invalid IL or missing references)
8262 if (!((Behaviour)this).enabled || !Object.op_Implicit((Object)(object)((Component)this).GetComponent<Renderer>()) || !Object.op_Implicit((Object)(object)((Component)this).GetComponent<Renderer>().sharedMaterial) || !((Component)this).GetComponent<Renderer>().enabled)
8263 {
8264 return;
8265 }
8266 Camera current = Camera.current;
8267 if (Object.op_Implicit((Object)(object)current) && !s_InsideWater)
8268 {
8269 s_InsideWater = true;
8270 m_HardwareWaterSupport = FindHardwareWaterSupport();
8271 WaterMode waterMode = GetWaterMode();
8272 CreateWaterObjects(current, out var reflectionCamera, out var refractionCamera);
8273 Vector3 position = ((Component)this).transform.position;
8274 Vector3 up = ((Component)this).transform.up;
8275 int pixelLightCount = QualitySettings.pixelLightCount;
8276 if (disablePixelLights)
8277 {
8278 QualitySettings.pixelLightCount = 0;
8279 }
8280 UpdateCameraModes(current, reflectionCamera);
8281 UpdateCameraModes(current, refractionCamera);
8282 if (waterMode >= WaterMode.Reflective)
8283 {
8284 float num = 0f - Vector3.Dot(up, position) - clipPlaneOffset;
8285 Vector4 plane = default(Vector4);
8286 ((Vector4)(ref plane))..ctor(up.x, up.y, up.z, num);
8287 Matrix4x4 reflectionMat = Matrix4x4.zero;
8288 CalculateReflectionMatrix(ref reflectionMat, plane);
8289 Vector3 position2 = ((Component)current).transform.position;
8290 Vector3 position3 = ((Matrix4x4)(ref reflectionMat)).MultiplyPoint(position2);
8291 reflectionCamera.worldToCameraMatrix = current.worldToCameraMatrix * reflectionMat;
8292 Vector4 val = CameraSpacePlane(reflectionCamera, position, up, 1f);
8293 reflectionCamera.projectionMatrix = current.CalculateObliqueMatrix(val);
8294 reflectionCamera.cullingMask = -17 & ((LayerMask)(ref reflectLayers)).value;
8295 reflectionCamera.targetTexture = m_ReflectionTexture;
8296 bool invertCulling = GL.invertCulling;
8297 GL.invertCulling = !invertCulling;
8298 ((Component)reflectionCamera).transform.position = position3;
8299 Vector3 eulerAngles = ((Component)current).transform.eulerAngles;
8300 ((Component)reflectionCamera).transform.eulerAngles = new Vector3(0f - eulerAngles.x, eulerAngles.y, eulerAngles.z);
8301 reflectionCamera.Render();
8302 ((Component)reflectionCamera).transform.position = position2;
8303 GL.invertCulling = invertCulling;
8304 ((Component)this).GetComponent<Renderer>().sharedMaterial.SetTexture("_ReflectionTex", (Texture)(object)m_ReflectionTexture);
8305 }
8306 if (waterMode >= WaterMode.Refractive)
8307 {
8308 refractionCamera.worldToCameraMatrix = current.worldToCameraMatrix;
8309 Vector4 val2 = CameraSpacePlane(refractionCamera, position, up, -1f);
8310 refractionCamera.projectionMatrix = current.CalculateObliqueMatrix(val2);
8311 refractionCamera.cullingMask = -17 & ((LayerMask)(ref refractLayers)).value;
8312 refractionCamera.targetTexture = m_RefractionTexture;
8313 ((Component)refractionCamera).transform.position = ((Component)current).transform.position;
8314 ((Component)refractionCamera).transform.rotation = ((Component)current).transform.rotation;
8315 refractionCamera.Render();
8316 ((Component)this).GetComponent<Renderer>().sharedMaterial.SetTexture("_RefractionTex", (Texture)(object)m_RefractionTexture);
8317 }
8318 if (disablePixelLights)
8319 {
8320 QualitySettings.pixelLightCount = pixelLightCount;
8321 }
8322 switch (waterMode)
8323 {
8324 case WaterMode.Simple:
8325 Shader.EnableKeyword("WATER_SIMPLE");
8326 Shader.DisableKeyword("WATER_REFLECTIVE");
8327 Shader.DisableKeyword("WATER_REFRACTIVE");
8328 break;
8329 case WaterMode.Reflective:
8330 Shader.DisableKeyword("WATER_SIMPLE");
8331 Shader.EnableKeyword("WATER_REFLECTIVE");
8332 Shader.DisableKeyword("WATER_REFRACTIVE");
8333 break;
8334 case WaterMode.Refractive:
8335 Shader.DisableKeyword("WATER_SIMPLE");
8336 Shader.DisableKeyword("WATER_REFLECTIVE");
8337 Shader.EnableKeyword("WATER_REFRACTIVE");
8338 break;
8339 }
8340 s_InsideWater = false;
8341 }
8342 }
8343
8344 private void OnDisable()
8345 {
8346 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
8347 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
8348 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
8349 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
8350 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
8351 //IL_0094: Unknown result type (might be due to invalid IL or missing references)
8352 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
8353 //IL_009e: Unknown result type (might be due to invalid IL or missing references)
8354 if (Object.op_Implicit((Object)(object)m_ReflectionTexture))
8355 {
8356 Object.DestroyImmediate((Object)(object)m_ReflectionTexture);
8357 m_ReflectionTexture = null;
8358 }
8359 if (Object.op_Implicit((Object)(object)m_RefractionTexture))
8360 {
8361 Object.DestroyImmediate((Object)(object)m_RefractionTexture);
8362 m_RefractionTexture = null;
8363 }
8364 Enumerator<Camera, Camera> enumerator = m_ReflectionCameras.GetEnumerator();
8365 try
8366 {
8367 while (enumerator.MoveNext())
8368 {
8369 Object.DestroyImmediate((Object)(object)((Component)enumerator.Current.Value).gameObject);
8370 }
8371 }
8372 finally
8373 {
8374 ((IDisposable)enumerator).Dispose();
8375 }
8376 m_ReflectionCameras.Clear();
8377 enumerator = m_RefractionCameras.GetEnumerator();
8378 try
8379 {
8380 while (enumerator.MoveNext())
8381 {
8382 Object.DestroyImmediate((Object)(object)((Component)enumerator.Current.Value).gameObject);
8383 }
8384 }
8385 finally
8386 {
8387 ((IDisposable)enumerator).Dispose();
8388 }
8389 m_RefractionCameras.Clear();
8390 }
8391
8392 private void Update()
8393 {
8394 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
8395 //IL_002e: Unknown result type (might be due to invalid IL or missing references)
8396 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
8397 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
8398 //IL_0086: Unknown result type (might be due to invalid IL or missing references)
8399 //IL_008c: Unknown result type (might be due to invalid IL or missing references)
8400 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
8401 //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
8402 //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
8403 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
8404 //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
8405 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
8406 if (Object.op_Implicit((Object)(object)((Component)this).GetComponent<Renderer>()))
8407 {
8408 Material sharedMaterial = ((Component)this).GetComponent<Renderer>().sharedMaterial;
8409 if (Object.op_Implicit((Object)(object)sharedMaterial))
8410 {
8411 Vector4 vector = sharedMaterial.GetVector("WaveSpeed");
8412 float @float = sharedMaterial.GetFloat("_WaveScale");
8413 Vector4 val = default(Vector4);
8414 ((Vector4)(ref val))..ctor(@float, @float, @float * 0.4f, @float * 0.45f);
8415 double num = (double)Time.timeSinceLevelLoad / 20.0;
8416 Vector4 val2 = default(Vector4);
8417 ((Vector4)(ref val2))..ctor((float)Math.IEEERemainder((double)(vector.x * val.x) * num, 1.0), (float)Math.IEEERemainder((double)(vector.y * val.y) * num, 1.0), (float)Math.IEEERemainder((double)(vector.z * val.z) * num, 1.0), (float)Math.IEEERemainder((double)(vector.w * val.w) * num, 1.0));
8418 sharedMaterial.SetVector("_WaveOffset", val2);
8419 sharedMaterial.SetVector("_WaveScale4", val);
8420 }
8421 }
8422 }
8423
8424 private void UpdateCameraModes(Camera src, Camera dest)
8425 {
8426 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
8427 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
8428 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
8429 //IL_0029: Invalid comparison between Unknown and I4
8430 if ((Object)(object)dest == (Object)null)
8431 {
8432 return;
8433 }
8434 dest.clearFlags = src.clearFlags;
8435 dest.backgroundColor = src.backgroundColor;
8436 if ((int)src.clearFlags == 1)
8437 {
8438 Skybox component = ((Component)src).GetComponent<Skybox>();
8439 Skybox component2 = ((Component)dest).GetComponent<Skybox>();
8440 if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.material))
8441 {
8442 ((Behaviour)component2).enabled = false;
8443 }
8444 else
8445 {
8446 ((Behaviour)component2).enabled = true;
8447 component2.material = component.material;
8448 }
8449 }
8450 dest.farClipPlane = src.farClipPlane;
8451 dest.nearClipPlane = src.nearClipPlane;
8452 dest.orthographic = src.orthographic;
8453 dest.fieldOfView = src.fieldOfView;
8454 dest.aspect = src.aspect;
8455 dest.orthographicSize = src.orthographicSize;
8456 }
8457
8458 private void CreateWaterObjects(Camera currentCamera, out Camera reflectionCamera, out Camera refractionCamera)
8459 {
8460 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
8461 //IL_0060: Expected O, but got Unknown
8462 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
8463 //IL_01d7: Expected O, but got Unknown
8464 //IL_010d: Unknown result type (might be due to invalid IL or missing references)
8465 //IL_0113: Expected O, but got Unknown
8466 //IL_0130: Unknown result type (might be due to invalid IL or missing references)
8467 //IL_0147: Unknown result type (might be due to invalid IL or missing references)
8468 //IL_0284: Unknown result type (might be due to invalid IL or missing references)
8469 //IL_028a: Expected O, but got Unknown
8470 //IL_02a7: Unknown result type (might be due to invalid IL or missing references)
8471 //IL_02be: Unknown result type (might be due to invalid IL or missing references)
8472 WaterMode waterMode = GetWaterMode();
8473 reflectionCamera = null;
8474 refractionCamera = null;
8475 int instanceID;
8476 if (waterMode >= WaterMode.Reflective)
8477 {
8478 if (!Object.op_Implicit((Object)(object)m_ReflectionTexture) || m_OldReflectionTextureSize != textureSize)
8479 {
8480 if (Object.op_Implicit((Object)(object)m_ReflectionTexture))
8481 {
8482 Object.DestroyImmediate((Object)(object)m_ReflectionTexture);
8483 }
8484 m_ReflectionTexture = new RenderTexture(textureSize, textureSize, 16);
8485 RenderTexture reflectionTexture = m_ReflectionTexture;
8486 instanceID = ((Object)this).GetInstanceID();
8487 ((Object)reflectionTexture).name = String.Concat("__WaterReflection", ((Int32)(ref instanceID)).ToString());
8488 m_ReflectionTexture.isPowerOfTwo = true;
8489 ((Object)m_ReflectionTexture).hideFlags = (HideFlags)52;
8490 m_OldReflectionTextureSize = textureSize;
8491 }
8492 m_ReflectionCameras.TryGetValue(currentCamera, ref reflectionCamera);
8493 if (!Object.op_Implicit((Object)(object)reflectionCamera))
8494 {
8495 instanceID = ((Object)this).GetInstanceID();
8496 string text = ((Int32)(ref instanceID)).ToString();
8497 instanceID = ((Object)currentCamera).GetInstanceID();
8498 GameObject val = new GameObject(String.Concat("Water Refl Camera id", text, " for ", ((Int32)(ref instanceID)).ToString()), (Type[])(object)new Type[2]
8499 {
8500 typeof(Camera),
8501 typeof(Skybox)
8502 });
8503 reflectionCamera = val.GetComponent<Camera>();
8504 ((Behaviour)reflectionCamera).enabled = false;
8505 ((Component)reflectionCamera).transform.position = ((Component)this).transform.position;
8506 ((Component)reflectionCamera).transform.rotation = ((Component)this).transform.rotation;
8507 ((Component)reflectionCamera).gameObject.AddComponent<FlareLayer>();
8508 ((Object)val).hideFlags = (HideFlags)61;
8509 m_ReflectionCameras[currentCamera] = reflectionCamera;
8510 if (TurnOffWaterOcclusion)
8511 {
8512 reflectionCamera.useOcclusionCulling = false;
8513 }
8514 }
8515 }
8516 if (waterMode < WaterMode.Refractive)
8517 {
8518 return;
8519 }
8520 if (!Object.op_Implicit((Object)(object)m_RefractionTexture) || m_OldRefractionTextureSize != textureSize)
8521 {
8522 if (Object.op_Implicit((Object)(object)m_RefractionTexture))
8523 {
8524 Object.DestroyImmediate((Object)(object)m_RefractionTexture);
8525 }
8526 m_RefractionTexture = new RenderTexture(textureSize, textureSize, 16);
8527 RenderTexture refractionTexture = m_RefractionTexture;
8528 instanceID = ((Object)this).GetInstanceID();
8529 ((Object)refractionTexture).name = String.Concat("__WaterRefraction", ((Int32)(ref instanceID)).ToString());
8530 m_RefractionTexture.isPowerOfTwo = true;
8531 ((Object)m_RefractionTexture).hideFlags = (HideFlags)52;
8532 m_OldRefractionTextureSize = textureSize;
8533 }
8534 m_RefractionCameras.TryGetValue(currentCamera, ref refractionCamera);
8535 if (!Object.op_Implicit((Object)(object)refractionCamera))
8536 {
8537 instanceID = ((Object)this).GetInstanceID();
8538 string text2 = ((Int32)(ref instanceID)).ToString();
8539 instanceID = ((Object)currentCamera).GetInstanceID();
8540 GameObject val2 = new GameObject(String.Concat("Water Refr Camera id", text2, " for ", ((Int32)(ref instanceID)).ToString()), (Type[])(object)new Type[2]
8541 {
8542 typeof(Camera),
8543 typeof(Skybox)
8544 });
8545 refractionCamera = val2.GetComponent<Camera>();
8546 ((Behaviour)refractionCamera).enabled = false;
8547 ((Component)refractionCamera).transform.position = ((Component)this).transform.position;
8548 ((Component)refractionCamera).transform.rotation = ((Component)this).transform.rotation;
8549 ((Component)refractionCamera).gameObject.AddComponent<FlareLayer>();
8550 ((Object)val2).hideFlags = (HideFlags)61;
8551 m_RefractionCameras[currentCamera] = refractionCamera;
8552 if (TurnOffWaterOcclusion)
8553 {
8554 reflectionCamera.useOcclusionCulling = false;
8555 }
8556 }
8557 }
8558
8560 {
8561 if (m_HardwareWaterSupport < waterMode)
8562 {
8563 return m_HardwareWaterSupport;
8564 }
8565 return waterMode;
8566 }
8567
8569 {
8570 if (!Object.op_Implicit((Object)(object)((Component)this).GetComponent<Renderer>()))
8571 {
8572 return WaterMode.Simple;
8573 }
8574 Material sharedMaterial = ((Component)this).GetComponent<Renderer>().sharedMaterial;
8575 if (!Object.op_Implicit((Object)(object)sharedMaterial))
8576 {
8577 return WaterMode.Simple;
8578 }
8579 string tag = sharedMaterial.GetTag("WATERMODE", false);
8580 if (tag == "Refractive")
8581 {
8582 return WaterMode.Refractive;
8583 }
8584 if (tag == "Reflective")
8585 {
8586 return WaterMode.Reflective;
8587 }
8588 return WaterMode.Simple;
8589 }
8590
8591 private Vector4 CameraSpacePlane(Camera cam, Vector3 pos, Vector3 normal, float sideSign)
8592 {
8593 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
8594 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
8595 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
8596 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
8597 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
8598 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
8599 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
8600 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
8601 //IL_001d: Unknown result type (might be due to invalid IL or missing references)
8602 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
8603 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
8604 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
8605 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
8606 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
8607 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
8608 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
8609 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
8610 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
8611 //IL_0048: Unknown result type (might be due to invalid IL or missing references)
8612 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
8613 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
8614 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
8615 Vector3 val = pos + normal * clipPlaneOffset;
8616 Matrix4x4 worldToCameraMatrix = cam.worldToCameraMatrix;
8617 Vector3 val2 = ((Matrix4x4)(ref worldToCameraMatrix)).MultiplyPoint(val);
8618 Vector3 val3 = ((Matrix4x4)(ref worldToCameraMatrix)).MultiplyVector(normal);
8619 Vector3 val4 = ((Vector3)(ref val3)).normalized * sideSign;
8620 return new Vector4(val4.x, val4.y, val4.z, 0f - Vector3.Dot(val2, val4));
8621 }
8622
8623 private static void CalculateReflectionMatrix(ref Matrix4x4 reflectionMat, Vector4 plane)
8624 {
8625 reflectionMat.m00 = 1f - 2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[0];
8626 reflectionMat.m01 = -2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[1];
8627 reflectionMat.m02 = -2f * ((Vector4)(ref plane))[0] * ((Vector4)(ref plane))[2];
8628 reflectionMat.m03 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[0];
8629 reflectionMat.m10 = -2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[0];
8630 reflectionMat.m11 = 1f - 2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[1];
8631 reflectionMat.m12 = -2f * ((Vector4)(ref plane))[1] * ((Vector4)(ref plane))[2];
8632 reflectionMat.m13 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[1];
8633 reflectionMat.m20 = -2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[0];
8634 reflectionMat.m21 = -2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[1];
8635 reflectionMat.m22 = 1f - 2f * ((Vector4)(ref plane))[2] * ((Vector4)(ref plane))[2];
8636 reflectionMat.m23 = -2f * ((Vector4)(ref plane))[3] * ((Vector4)(ref plane))[2];
8637 reflectionMat.m30 = 0f;
8638 reflectionMat.m31 = 0f;
8639 reflectionMat.m32 = 0f;
8640 reflectionMat.m33 = 1f;
8641 }
8642 }
8643 [ExecuteInEditMode]
8644 [RequireComponent(/*Could not decode attribute arguments.*/)]
8646 {
8647 public delegate void InitializeDelegate(VRC_WebPanel obj);
8648
8649 [Serializable]
8650 public class WebFile : Object
8651 {
8652 public byte[] data;
8653
8654 public string path;
8655 }
8656
8657 public string webRoot = "WebRoot";
8658
8659 public string defaultUrl = "http://api.vrchat.cloud/public/blank.html";
8660
8661 public int resolutionWidth = 1280;
8662
8663 public int resolutionHeight = 720;
8664
8665 public Rect displayRegion = new Rect(0f, 0f, 1f, 1f);
8666
8667 public bool interactive;
8668
8669 public Material[] extraVideoScreens;
8670
8671 public new static InitializeDelegate Initialize;
8672
8673 public bool localOnly;
8674
8675 public bool syncURI;
8676
8677 public bool syncInput;
8678
8680
8681 public GameObject cursor;
8682
8683 public bool transparent;
8684
8686
8687 public bool cookiesEnabled;
8688
8689 public bool autoFormSubmit = true;
8690
8691 [HideInInspector]
8692 public List<WebFile> webData;
8693
8694 public Action<string> _NavigateTo;
8695
8696 public Action _WebPanelForward;
8697
8698 public Action _WebPanelBackward;
8699
8700 public Action _WebPanelReload;
8701
8702 public Action<string> _ExecuteScript;
8703
8704 public Func<string, Delegate, bool> _BindCall;
8705
8706 private string WebRootPath
8707 {
8708 get
8709 {
8710 if (webRoot != null && !(webRoot.Trim() == ""))
8711 {
8712 return String.Concat(Application.dataPath, webRoot.Replace('/', Path.DirectorySeparatorChar));
8713 }
8714 return null;
8715 }
8716 }
8717
8718 [RPC(new RPC.Destination[] { })]
8719 public void WebPanelForward()
8720 {
8721 if (_WebPanelForward != null)
8722 {
8723 _WebPanelForward.Invoke();
8724 }
8725 }
8726
8727 [RPC(new RPC.Destination[] { })]
8728 public void WebPanelBackward()
8729 {
8730 if (_WebPanelBackward != null)
8731 {
8732 _WebPanelBackward.Invoke();
8733 }
8734 }
8735
8736 [RPC(new RPC.Destination[] { })]
8737 public void WebPanelReload()
8738 {
8739 if (_WebPanelReload != null)
8740 {
8741 _WebPanelReload.Invoke();
8742 }
8743 }
8744
8745 public bool BindCall(string function, Delegate handler)
8746 {
8747 if (_BindCall == null)
8748 {
8749 return false;
8750 }
8751 return _BindCall.Invoke(function, handler);
8752 }
8753
8754 public void NavigateTo(string uri)
8755 {
8756 if (_NavigateTo != null)
8757 {
8758 _NavigateTo.Invoke(uri);
8759 }
8760 }
8761
8762 public override void Awake()
8763 {
8764 base.Awake();
8765 if (Application.isPlaying && Initialize != null)
8766 {
8767 Initialize(this);
8768 }
8769 }
8770
8771 public override void Interact()
8772 {
8773 }
8774
8776 {
8777 List<VRC_EventHandler.VrcEvent> val = new List<VRC_EventHandler.VrcEvent>();
8779 vrcEvent.Name = "SetWebPanelURI";
8780 vrcEvent.ParameterInt = 7;
8781 vrcEvent.EventType = VRC_EventHandler.VrcEventType.SetWebPanelURI;
8782 vrcEvent.ParameterString = "http://example.com";
8783 vrcEvent.ParameterObjects = (GameObject[])(object)new GameObject[1] { ((Component)this).gameObject };
8784 val.Add(vrcEvent);
8785 vrcEvent = new VRC_EventHandler.VrcEvent();
8786 vrcEvent.Name = "SetWebPanelVolume";
8787 vrcEvent.ParameterInt = 7;
8788 vrcEvent.EventType = VRC_EventHandler.VrcEventType.SetWebPanelVolume;
8789 vrcEvent.ParameterFloat = 0.5f;
8790 vrcEvent.ParameterObjects = (GameObject[])(object)new GameObject[1] { ((Component)this).gameObject };
8791 val.Add(vrcEvent);
8792 vrcEvent = new VRC_EventHandler.VrcEvent();
8793 vrcEvent.Name = "WebPanelForward";
8794 vrcEvent.ParameterInt = 6;
8795 vrcEvent.EventType = VRC_EventHandler.VrcEventType.SendRPC;
8796 vrcEvent.ParameterString = "WebPanelForward";
8797 vrcEvent.ParameterObjects = (GameObject[])(object)new GameObject[1] { ((Component)this).gameObject };
8798 val.Add(vrcEvent);
8799 vrcEvent = new VRC_EventHandler.VrcEvent();
8800 vrcEvent.Name = "WebPanelBackward";
8801 vrcEvent.ParameterInt = 6;
8802 vrcEvent.EventType = VRC_EventHandler.VrcEventType.SendRPC;
8803 vrcEvent.ParameterString = "WebPanelBackward";
8804 vrcEvent.ParameterObjects = (GameObject[])(object)new GameObject[1] { ((Component)this).gameObject };
8805 val.Add(vrcEvent);
8806 vrcEvent = new VRC_EventHandler.VrcEvent();
8807 vrcEvent.Name = "WebPanelReload";
8808 vrcEvent.ParameterInt = 6;
8809 vrcEvent.EventType = VRC_EventHandler.VrcEventType.SendRPC;
8810 vrcEvent.ParameterString = "WebPanelReload";
8811 vrcEvent.ParameterObjects = (GameObject[])(object)new GameObject[1] { ((Component)this).gameObject };
8812 val.Add(vrcEvent);
8813 return (IEnumerable<VRC_EventHandler.VrcEvent>)(object)val;
8814 }
8815
8816 private void ReadData(string root, int junk)
8817 {
8818 string[] files = Directory.GetFiles(root);
8819 foreach (string text in files)
8820 {
8821 if (!text.EndsWith(".meta") && !text.EndsWith(".unity"))
8822 {
8823 webData.Add(new WebFile
8824 {
8825 path = text.Substring(Application.dataPath.Length + 1).Replace(Path.DirectorySeparatorChar, '/'),
8826 data = File.ReadAllBytes(text)
8827 });
8828 }
8829 }
8830 files = Directory.GetDirectories(root);
8831 foreach (string root2 in files)
8832 {
8833 ReadData(root2, 0);
8834 }
8835 }
8836
8837 public void ImportWebData()
8838 {
8839 webData = new List<WebFile>();
8840 string webRootPath = WebRootPath;
8841 if (!String.IsNullOrEmpty(webRootPath) && Directory.Exists(webRootPath) && (!webRootPath.StartsWith(String.Concat(Application.dataPath, ((Char)(ref Path.DirectorySeparatorChar)).ToString(), "VRCSDK")) || webRootPath == String.Concat((string[])(object)new String[9]
8842 {
8843 Application.dataPath,
8844 ((Char)(ref Path.DirectorySeparatorChar)).ToString(),
8845 "VRCSDK",
8846 ((Char)(ref Path.DirectorySeparatorChar)).ToString(),
8847 "Examples",
8848 ((Char)(ref Path.DirectorySeparatorChar)).ToString(),
8849 "Sample Assets",
8850 ((Char)(ref Path.DirectorySeparatorChar)).ToString(),
8851 "WebRoot"
8852 })))
8853 {
8854 ReadData(webRootPath, 0);
8855 string text = String.Join(", ", webData.ConvertAll<string>((Converter<WebFile, string>)delegate(WebFile item)
8856 {
8857 string path = item.path;
8858 int num = item.data.Length;
8859 return String.Concat(path, " [", ((Int32)(ref num)).ToString(), "]");
8860 }).ToArray());
8861 Debug.Log((object)String.Concat("Web Panel has files: \n", text));
8862 }
8863 }
8864 }
8865 public abstract class VRC_TutorialAction : MonoBehaviour
8866 {
8867 public void ActivateAreaMarkerLabel(Transform targetObject, string text)
8868 {
8869 Tutorial.ActivateObjectLabel(targetObject, TutorialLabelType.AreaMarker, ControllerHand.None, text, -1f, 0, AttachMode.PositionOnly, showOffscreen: true);
8870 }
8871
8872 public void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, float duration = 0.1f, int priority = 0, AttachMode attachMode = AttachMode.PositionOnly, bool showOffscreen = false)
8873 {
8874 Tutorial.ActivateObjectLabel(targetObject, type, hand, text, ControllerActionUI.None, "", ControllerActionUI.None, duration, priority, attachMode, showOffscreen);
8875 }
8876
8877 public void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, float duration = 0.1f, int priority = 0, AttachMode attachMode = AttachMode.PositionOnly, bool showOffscreen = false)
8878 {
8879 Tutorial.ActivateObjectLabel(targetObject, type, hand, text, action, "", ControllerActionUI.None, duration, priority, attachMode, showOffscreen);
8880 }
8881
8882 public void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, AttachMode attachMode, bool showOffscreen)
8883 {
8884 Tutorial.ActivateObjectLabel(targetObject, type, hand, text, action, textSecondary, actionSecondary, duration, priority, attachMode, showOffscreen);
8885 }
8886
8887 public void DeactivateObjectLabel(Transform targetObject)
8888 {
8889 Tutorial.DeactivateObjectLabel(targetObject);
8890 }
8891
8892 public void ActivateControllerLabel(ControllerHand hand, ControllerInputUI controllerPart, string text, float duration, int priority)
8893 {
8894 Tutorial.ActivateControllerLabel(hand, controllerPart, text, duration, priority);
8895 }
8896
8898 {
8899 Tutorial.DeactivateControllerLabel(hand, controllerPart);
8900 }
8901 }
8902 public abstract class VRC_TutorialAreaMarker : MonoBehaviour
8903 {
8904 public string Text;
8905
8906 public float EnableDistance = 3f;
8907
8908 public float MaxVisibleDistance = 15f;
8909
8911
8912 private bool _showingLabel;
8913
8914 private bool _enabled = true;
8915
8916 private float _timeStarted = -1f;
8917
8918 public void Enable(bool enable)
8919 {
8920 _enabled = enable;
8921 }
8922
8923 private void Update()
8924 {
8925 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
8926 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
8927 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
8928 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
8929 if (_enabled && Networking.LocalPlayer != null)
8930 {
8931 if (_timeStarted < 0f)
8932 {
8933 _timeStarted = Time.unscaledTime;
8934 }
8935 if (Time.unscaledTime < _timeStarted + 1f)
8936 {
8937 return;
8938 }
8939 Vector3 val = ((Component)this).transform.position - Networking.LocalPlayer.gameObject.transform.position;
8940 float magnitude = ((Vector3)(ref val)).magnitude;
8941 if (magnitude >= EnableDistance)
8942 {
8943 if (magnitude <= MaxVisibleDistance)
8944 {
8945 ShowLabel(show: true);
8946 }
8947 else
8948 {
8949 ShowLabel(show: false);
8950 }
8951 return;
8952 }
8953 ShowLabel(show: false);
8954 if (DisableWhenPlayerInRange)
8955 {
8956 Enable(enable: false);
8957 }
8958 }
8959 else
8960 {
8961 ShowLabel(show: false);
8962 }
8963 }
8964
8965 private void ShowLabel(bool show)
8966 {
8967 if (show == _showingLabel)
8968 {
8969 return;
8970 }
8971 if (show && _enabled && !String.IsNullOrEmpty(Text))
8972 {
8973 Tutorial.ActivateAreaMarkerLabel(((Component)this).transform, Text);
8974 _showingLabel = true;
8975 return;
8976 }
8977 if (_showingLabel)
8978 {
8979 Tutorial.DeactivateObjectLabel(((Component)this).transform);
8980 }
8981 _showingLabel = false;
8982 }
8983 }
8984 public class Tutorial : Object
8985 {
8986 public delegate void ActivateObjectLabelDelegate(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, AttachMode attachMode, bool showOffscreen);
8987
8988 public delegate void DeactivateObjectLabelDelegate(Transform targetObject);
8989
8990 public delegate void ActivateControllerLabelDelegate(ControllerHand hand, ControllerInputUI controllerPart, string text, float duration, int priority);
8991
8992 public delegate void DeactivateControllerLabelDelegate(ControllerHand hand, ControllerInputUI controllerPart);
8993
8994 public static ActivateObjectLabelDelegate _ActivateObjectLabel;
8995
8996 public static DeactivateObjectLabelDelegate _DeactivateObjectLabel;
8997
8998 public static ActivateControllerLabelDelegate _ActivateControllerLabel;
8999
9000 public static DeactivateControllerLabelDelegate _DeactivateControllerLabel;
9001
9002 public static void ActivateAreaMarkerLabel(Transform targetObject, string text)
9003 {
9004 ActivateObjectLabel(targetObject, TutorialLabelType.AreaMarker, ControllerHand.None, text, -1f, 0, AttachMode.PositionOnly, showOffscreen: true);
9005 }
9006
9007 public static void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, float duration = 0.1f, int priority = 0, AttachMode attachMode = AttachMode.PositionOnly, bool showOffscreen = false)
9008 {
9009 ActivateObjectLabel(targetObject, type, hand, text, ControllerActionUI.None, "", ControllerActionUI.None, duration, priority, attachMode, showOffscreen);
9010 }
9011
9012 public static void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, float duration = 0.1f, int priority = 0, AttachMode attachMode = AttachMode.PositionOnly, bool showOffscreen = false)
9013 {
9014 ActivateObjectLabel(targetObject, type, hand, text, action, "", ControllerActionUI.None, duration, priority, attachMode, showOffscreen);
9015 }
9016
9017 public static void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, AttachMode attachMode, bool showOffscreen)
9018 {
9019 if (_ActivateObjectLabel != null)
9020 {
9021 _ActivateObjectLabel(targetObject, type, hand, text, action, textSecondary, actionSecondary, duration, priority, attachMode, showOffscreen);
9022 }
9023 }
9024
9025 public static void DeactivateObjectLabel(Transform targetObject)
9026 {
9027 if (_DeactivateObjectLabel != null)
9028 {
9029 _DeactivateObjectLabel(targetObject);
9030 }
9031 }
9032
9033 public static void ActivateControllerLabel(ControllerHand hand, ControllerInputUI controllerPart, string text, float duration, int priority)
9034 {
9035 if (_ActivateControllerLabel != null)
9036 {
9037 _ActivateControllerLabel(hand, controllerPart, text, duration, priority);
9038 }
9039 }
9040
9041 public static void DeactivateControllerLabel(ControllerHand hand, ControllerInputUI controllerPart)
9042 {
9043 if (_DeactivateControllerLabel != null)
9044 {
9045 _DeactivateControllerLabel(hand, controllerPart);
9046 }
9047 }
9048 }
9049 public abstract class VRC_UiShape : MonoBehaviour
9050 {
9051 public delegate Camera GetEventCameraDelegate(GameObject obj);
9052
9053 public static GetEventCameraDelegate GetEventCamera;
9054
9055 public bool AllowFocusView = true;
9056
9057 private Canvas _uiCanvas;
9058
9059 private RectTransform _localRectTransform;
9060
9061 [field: CompilerGenerated]
9062 public Canvas RootCanvas
9063 {
9064 [CompilerGenerated]
9065 get;
9066 [CompilerGenerated]
9067 private set;
9068 }
9069
9070 [field: CompilerGenerated]
9071 public RectTransform RootCanvasRectTransform
9072 {
9073 [CompilerGenerated]
9074 get;
9075 [CompilerGenerated]
9076 private set;
9077 }
9078
9079 private void Awake()
9080 {
9081 _uiCanvas = ((Component)this).GetComponentInParent<Canvas>();
9082 ref RectTransform localRectTransform = ref _localRectTransform;
9083 Transform transform = ((Component)this).transform;
9084 localRectTransform = (RectTransform)(object)((transform is RectTransform) ? transform : null);
9085 SetupCollision();
9086 }
9087
9088 private void Start()
9089 {
9090 if ((Object)(object)_uiCanvas != (Object)null)
9091 {
9092 if (GetEventCamera != null)
9093 {
9094 _uiCanvas.worldCamera = GetEventCamera(((Component)this).gameObject);
9095 }
9096 Canvas[] componentsInParent = ((Component)this).GetComponentsInParent<Canvas>(true);
9097 RootCanvas = componentsInParent[componentsInParent.Length - 1];
9098 RootCanvasRectTransform = ((Component)RootCanvas).GetComponent<RectTransform>();
9099 GraphicRaycaster component = ((Component)_uiCanvas).GetComponent<GraphicRaycaster>();
9100 if ((Object)(object)component != (Object)null)
9101 {
9102 component.blockingObjects = (BlockingObjects)0;
9103 }
9104 }
9105 }
9106
9108 {
9109 SetupCollision();
9110 }
9111
9112 private void SetupCollision()
9113 {
9114 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
9115 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
9116 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
9117 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
9118 //IL_005a: Unknown result type (might be due to invalid IL or missing references)
9119 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
9120 //IL_0076: Unknown result type (might be due to invalid IL or missing references)
9121 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
9122 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
9123 //IL_008a: Unknown result type (might be due to invalid IL or missing references)
9124 //IL_0096: Unknown result type (might be due to invalid IL or missing references)
9125 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
9126 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
9127 //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
9128 if ((Object)(object)_localRectTransform != (Object)null && (Object)(object)_uiCanvas != (Object)null)
9129 {
9130 Rect rect = _localRectTransform.rect;
9131 Vector2 size = ((Rect)(ref rect)).size;
9132 BoxCollider val = ((Component)this).gameObject.GetComponent<BoxCollider>();
9133 if ((Object)(object)val == (Object)null)
9134 {
9135 val = ((Component)this).gameObject.AddComponent<BoxCollider>();
9136 }
9137 Vector3 val2 = default(Vector3);
9138 ((Vector3)(ref val2))..ctor(size.x, size.y, 1f);
9139 Vector2 pivot = _localRectTransform.pivot;
9140 Vector3 center = default(Vector3);
9141 ((Vector3)(ref center))..ctor((0.5f - pivot.x) * val2.x, (0.5f - pivot.y) * val2.y, 0f);
9142 val.center = center;
9143 val.size = val2;
9144 }
9145 }
9146 }
9147 public abstract class VRCTriggerRelay : MonoBehaviour
9148 {
9149 public static Action<VRCTriggerRelay> Initialize;
9150
9151 [HideInInspector]
9152 public HashSet<Collider>[] triggersInside = new HashSet<Collider>[2]
9153 {
9154 new HashSet<Collider>(),
9155 new HashSet<Collider>()
9156 };
9157
9158 [HideInInspector]
9159 public int currentIdx;
9160
9161 private void Awake()
9162 {
9163 if (Initialize != null)
9164 {
9165 Initialize.Invoke(this);
9166 }
9167 }
9168
9169 private void OnTriggerEnter(Collider col)
9170 {
9171 triggersInside[currentIdx].Add(col);
9172 }
9173
9174 private void OnTriggerExit(Collider col)
9175 {
9176 triggersInside[currentIdx].Remove(col);
9177 }
9178 }
9184 [Serializable]
9185 public class VRCUrl : Object, IEquatable<VRCUrl>
9186 {
9187 [CompilerGenerated]
9188 private sealed class <>c__DisplayClass13_0 : Object
9189 {
9190 public string dnsSafeHost;
9191
9192 internal bool <IsAllowlistedUri>b__0(string d)
9193 {
9194 return dnsSafeHost.EndsWith(d);
9195 }
9196 }
9197
9198 [SerializeField]
9199 [FormerlySerializedAs("_url")]
9200 private string url;
9201
9207 [PublicAPI]
9208 [field: CompilerGenerated]
9209 public static VRCUrl Empty
9210 {
9211 [CompilerGenerated]
9212 get;
9213 } = new VRCUrl("");
9214
9215
9216 [EditorBrowsable(/*Could not decode attribute arguments.*/)]
9217 [field: CompilerGenerated]
9218 public static Func<IEnumerable<string>> DomainExplicitAllowlistDelegate
9219 {
9220 [CompilerGenerated]
9221 get;
9222 [CompilerGenerated]
9223 set;
9224 } = () => (IEnumerable<string>)(object)Array.Empty<string>();
9225
9226
9227 [EditorBrowsable(/*Could not decode attribute arguments.*/)]
9228 [field: CompilerGenerated]
9229 public static Func<IEnumerable<string>> DomainWildcardAllowlistDelegate
9230 {
9231 [CompilerGenerated]
9232 get;
9233 [CompilerGenerated]
9234 set;
9235 } = () => (IEnumerable<string>)(object)Array.Empty<string>();
9236
9237
9238 [EditorBrowsable(/*Could not decode attribute arguments.*/)]
9239 public static bool TryCreateAllowlistedVRCUrl(string url, out VRCUrl vrcUrl)
9240 {
9241 Uri uri = default(Uri);
9242 if (!Uri.TryCreate(url, (UriKind)1, ref uri) || !IsAllowlistedUri(uri))
9243 {
9244 vrcUrl = Empty;
9245 return false;
9246 }
9247 vrcUrl = new VRCUrl(url);
9248 return true;
9249 }
9250
9251 [PublicAPI]
9252 public static bool IsNullOrEmpty(VRCUrl vrcUrl)
9253 {
9254 return vrcUrl?.Equals(Empty) ?? true;
9255 }
9256
9257 [EditorBrowsable(/*Could not decode attribute arguments.*/)]
9258 public static bool IsAllowlistedUri(Uri uri)
9259 {
9260 <>c__DisplayClass13_0 CS$<>8__locals0 = new <>c__DisplayClass13_0();
9261 CS$<>8__locals0.dnsSafeHost = uri.DnsSafeHost;
9262 if (!Enumerable.Contains<string>(DomainExplicitAllowlistDelegate.Invoke(), CS$<>8__locals0.dnsSafeHost))
9263 {
9264 return Enumerable.Any<string>(DomainWildcardAllowlistDelegate.Invoke(), (Func<string, bool>)((string d) => CS$<>8__locals0.dnsSafeHost.EndsWith(d)));
9265 }
9266 return true;
9267 }
9268
9269 public VRCUrl(string url)
9270 {
9271 this.url = url ?? String.Empty;
9272 }
9273
9274 public string Get()
9275 {
9276 return url;
9277 }
9278
9279 public override string ToString()
9280 {
9281 return url;
9282 }
9283
9284 public override bool Equals(object obj)
9285 {
9286 if (obj == null)
9287 {
9288 return false;
9289 }
9290 if (this == obj)
9291 {
9292 return true;
9293 }
9294 if (obj.GetType() != ((Object)this).GetType())
9295 {
9296 return false;
9297 }
9298 return Equals((VRCUrl)obj);
9299 }
9300
9301 public bool Equals(VRCUrl other)
9302 {
9303 if (other == null)
9304 {
9305 return false;
9306 }
9307 if (this == other)
9308 {
9309 return true;
9310 }
9311 return url == other.url;
9312 }
9313
9314 public override int GetHashCode()
9315 {
9316 if (url == null)
9317 {
9318 return 0;
9319 }
9320 return ((Object)url).GetHashCode();
9321 }
9322 }
9323 public abstract class VRC_DataStorage : VRCNetworkBehaviour
9324 {
9325 public enum VrcDataMirror : Enum
9326 {
9327 None,
9328 Animator,
9329 SerializeComponent
9330 }
9331
9332 public enum VrcDataType : Enum
9333 {
9334 None,
9335 Bool,
9336 Int,
9337 Float,
9338 String,
9339 SerializeBytes,
9340 SerializeObject,
9341 Other
9342 }
9343
9344 [Serializable]
9345 public class VrcDataElement : Object
9346 {
9347 public string name;
9348
9350
9352
9353 public MonoBehaviour serializeComponent;
9354
9355 public bool valueBool;
9356
9357 public int valueInt;
9358
9359 public float valueFloat;
9360
9361 public string valueString;
9362
9364
9365 public bool modified;
9366
9367 public bool added;
9368
9370
9371 public bool Serialize<T>(T objectToSerialize)
9372 {
9373 //IL_0015: Expected O, but got Unknown
9374 try
9375 {
9376 return VRC_DataStorage.Serialize(this, objectToSerialize);
9377 }
9378 catch (Exception val)
9379 {
9380 Exception val2 = val;
9381 Debug.LogError((object)String.Concat((string[])(object)new String[6]
9382 {
9383 "Could not serialize ",
9384 ((MemberInfo)typeof(T)).Name,
9385 ": ",
9386 val2.Message,
9387 "\n",
9388 val2.StackTrace
9389 }));
9390 return false;
9391 }
9392 }
9393
9394 public bool Deserialize<T>(out T objectToDeserialize)
9395 {
9396 //IL_0033: Expected O, but got Unknown
9397 objectToDeserialize = default(T);
9398 try
9399 {
9400 if (VRC_DataStorage.Deserialize(this, out var obj) && obj is T)
9401 {
9402 objectToDeserialize = (T)obj;
9403 return true;
9404 }
9405 return false;
9406 }
9407 catch (Exception val)
9408 {
9409 Exception val2 = val;
9410 Debug.LogError((object)String.Concat((string[])(object)new String[6]
9411 {
9412 "Could not deserialize ",
9413 ((MemberInfo)typeof(T)).Name,
9414 ": ",
9415 val2.Message,
9416 "\n",
9417 val2.StackTrace
9418 }));
9419 return false;
9420 }
9421 }
9422 }
9423
9424 public delegate void InitializationDelegate(VRC_DataStorage obj);
9425
9426 public delegate bool SerializationDelegate(VrcDataElement ds, object obj);
9427
9428 public delegate bool DeserializationDelegate(VrcDataElement ds, out object obj);
9429
9430 public delegate void DataElementDelegate(VRC_DataStorage obj, int idx);
9431
9433
9434 public static InitializationDelegate Initialize;
9435
9436 public static SerializationDelegate Serialize;
9437
9438 public static DeserializationDelegate Deserialize;
9439
9440 [CompilerGenerated]
9441 private DataElementDelegate m_ElementChanged;
9442
9443 public static Func<VRC_DataStorage, string, int> _GetElementIndex;
9444
9445 public event DataElementDelegate ElementChanged
9446 {
9447 [CompilerGenerated]
9448 add
9449 {
9450 DataElementDelegate dataElementDelegate = this.m_ElementChanged;
9451 DataElementDelegate dataElementDelegate2;
9452 do
9453 {
9454 dataElementDelegate2 = dataElementDelegate;
9455 DataElementDelegate dataElementDelegate3 = (DataElementDelegate)(object)Delegate.Combine((Delegate)(object)dataElementDelegate2, (Delegate)(object)value);
9456 dataElementDelegate = Interlocked.CompareExchange<DataElementDelegate>(ref this.m_ElementChanged, dataElementDelegate3, dataElementDelegate2);
9457 }
9458 while (dataElementDelegate != dataElementDelegate2);
9459 }
9460 [CompilerGenerated]
9461 remove
9462 {
9463 DataElementDelegate dataElementDelegate = this.m_ElementChanged;
9464 DataElementDelegate dataElementDelegate2;
9465 do
9466 {
9467 dataElementDelegate2 = dataElementDelegate;
9468 DataElementDelegate dataElementDelegate3 = (DataElementDelegate)(object)Delegate.Remove((Delegate)(object)dataElementDelegate2, (Delegate)(object)value);
9469 dataElementDelegate = Interlocked.CompareExchange<DataElementDelegate>(ref this.m_ElementChanged, dataElementDelegate3, dataElementDelegate2);
9470 }
9471 while (dataElementDelegate != dataElementDelegate2);
9472 }
9473 }
9474
9475 public int GetElementIndex(string name)
9476 {
9477 return _GetElementIndex.Invoke(this, name);
9478 }
9479
9480 public VrcDataElement GetElement(string name)
9481 {
9482 int elementIndex = GetElementIndex(name);
9483 VrcDataElement result = null;
9484 if (data != null && data.Length > elementIndex)
9485 {
9486 result = data[elementIndex];
9487 }
9488 return result;
9489 }
9490
9491 public void OnDataElementChanged(int idx)
9492 {
9493 if (this.ElementChanged != null)
9494 {
9495 this.ElementChanged(this, idx);
9496 }
9497 }
9498
9499 private void Awake()
9500 {
9501 if (Initialize != null)
9502 {
9503 Initialize(this);
9504 }
9505 }
9506 }
9507 public enum VRCLayers : Enum
9508 {
9509 Avatar,
9510 Environment,
9511 Interactive
9512 }
9513 public abstract class VRC_EventDispatcher : MonoBehaviour
9514 {
9515 public abstract void TriggerEvent(VRC_EventHandler handler, VRC_EventHandler.VrcEvent e, VRC_EventHandler.VrcBroadcastType broadcast, int instagatorId, float fastForward);
9516
9517 public abstract void RegisterEventHandler(VRC_EventHandler handler);
9518
9519 public abstract void UnregisterEventHandler(VRC_EventHandler handler);
9520
9521 public virtual GameObject FindGameObject(string path)
9522 {
9523 return FindGameObject(path, suppressErrors: false);
9524 }
9525
9526 public abstract GameObject FindGameObject(string path, bool suppressErrors);
9527
9528 public abstract string GetGameObjectPath(GameObject go);
9529 }
9531 {
9532 private void Start()
9533 {
9534 Object.Destroy((Object)(object)this);
9535 }
9536
9537 public override void TriggerEvent(VRC_EventHandler handler, VRC_EventHandler.VrcEvent e, VRC_EventHandler.VrcBroadcastType broadcast, int instagatorId, float fastForward)
9538 {
9539 }
9540
9541 public override void RegisterEventHandler(VRC_EventHandler handler)
9542 {
9543 }
9544
9545 public override void UnregisterEventHandler(VRC_EventHandler handler)
9546 {
9547 }
9548
9549 public override GameObject FindGameObject(string path, bool suppressErrors)
9550 {
9551 return GameObject.Find(path);
9552 }
9553
9554 public override string GetGameObjectPath(GameObject go)
9555 {
9556 string text = "";
9557 while ((Object)(object)go != (Object)null)
9558 {
9559 text = ((!(text == "")) ? String.Concat(((Object)go).name, "/", text) : ((Object)go).name);
9560 if ((Object)(object)go.transform.parent == (Object)null)
9561 {
9562 text = String.Concat("/", text);
9563 break;
9564 }
9565 go = ((Component)go.transform.parent).gameObject;
9566 }
9567 return text;
9568 }
9569 }
9570 [ExecuteInEditMode]
9572 {
9573 public enum VrcEventType : Enum
9574 {
9575 MeshVisibility = 0,
9576 AnimationFloat = 1,
9577 AnimationBool = 2,
9578 AnimationTrigger = 3,
9579 AudioTrigger = 4,
9580 PlayAnimation = 5,
9581 SendMessage = 6,
9582 SetParticlePlaying = 7,
9583 TeleportPlayer = 8,
9584 RunConsoleCommand = 9,
9585 SetGameObjectActive = 10,
9586 SetWebPanelURI = 11,
9587 SetWebPanelVolume = 12,
9588 SpawnObject = 13,
9589 SendRPC = 14,
9590 ActivateCustomTrigger = 15,
9591 DestroyObject = 16,
9592 SetLayer = 17,
9593 SetMaterial = 18,
9594 AddHealth = 19,
9595 AddDamage = 20,
9596 SetComponentActive = 21,
9597 AnimationInt = 22,
9598 AnimationIntAdd = 24,
9599 AnimationIntSubtract = 25,
9600 AnimationIntMultiply = 26,
9601 AnimationIntDivide = 27,
9602 AddVelocity = 28,
9603 SetVelocity = 29,
9604 AddAngularVelocity = 30,
9605 SetAngularVelocity = 31,
9606 AddForce = 32,
9607 SetUIText = 33,
9608 CallUdonMethod = 34
9609 }
9610
9611 public enum VrcBroadcastType : Enum
9612 {
9613 Always,
9614 Master,
9615 Local,
9616 Owner,
9617 AlwaysUnbuffered,
9618 MasterUnbuffered,
9619 OwnerUnbuffered,
9620 AlwaysBufferOne,
9621 MasterBufferOne,
9622 OwnerBufferOne
9623 }
9624
9625 public enum VrcTargetType : Enum
9626 {
9627 All,
9628 Others,
9629 Owner,
9630 Master,
9631 AllBuffered,
9632 OthersBuffered,
9633 Local,
9634 AllBufferOne,
9635 OthersBufferOne,
9636 TargetPlayer
9637 }
9638
9639 public enum VrcBooleanOp : Enum
9640 {
9641 Unused = -1,
9642 False,
9643 True,
9644 Toggle
9645 }
9646
9647 [Serializable]
9648 public class VrcEvent : Object
9649 {
9650 public string Name = "";
9651
9652 public VrcEventType EventType = VrcEventType.AudioTrigger;
9653
9654 public string ParameterString = "";
9655
9656 public VrcBooleanOp ParameterBoolOp = VrcBooleanOp.Unused;
9657
9658 [HideInInspector]
9659 public bool ParameterBool;
9660
9661 public float ParameterFloat;
9662
9663 public int ParameterInt = 1;
9664
9665 [HideInInspector]
9666 public GameObject ParameterObject;
9667
9668 [SerializeField]
9669 public GameObject[] ParameterObjects;
9670
9671 [HideInInspector]
9672 [SerializeField]
9673 public byte[] ParameterBytes;
9674
9675 [HideInInspector]
9676 [SerializeField]
9677 public Nullable<int> ParameterBytesVersion;
9678
9680 }
9681
9682 public delegate int GetNetworkIdDelegate(GameObject obj);
9683
9684 public delegate void LogEventDelegate(VRC_EventHandler eventHandler, VrcEvent vrcEvent, VrcBroadcastType broadcast, int instagatorId, float fastForward);
9685
9686 public class EventInfo : Object
9687 {
9689
9691
9692 public GameObject instagator;
9693
9694 public float fastForward;
9695 }
9696
9697 [SerializeField]
9698 public List<VrcEvent> Events = new List<VrcEvent>();
9699
9700 private VRC_EventDispatcher _dispatcher;
9701
9702 public static GetNetworkIdDelegate GetInstigatorId;
9703
9704 public static LogEventDelegate LogEvent;
9705
9706 public List<EventInfo> deferredEvents = new List<EventInfo>();
9707
9708 private Coroutine DeferredEventProcessor;
9709
9710 private VRC_EventDispatcher Dispatcher
9711 {
9712 get
9713 {
9714 if ((Object)(object)_dispatcher == (Object)null)
9715 {
9716 _dispatcher = Networking.GetEventDispatcher();
9717 }
9718 return _dispatcher;
9719 }
9720 }
9721
9722 public static GetNetworkIdDelegate GetInsitgatorId
9723 {
9724 get
9725 {
9726 return GetInstigatorId;
9727 }
9728 set
9729 {
9730 GetInstigatorId = value;
9731 }
9732 }
9733
9734 public static bool BooleanOp(VrcBooleanOp Op, bool Current)
9735 {
9736 return Op switch
9737 {
9738 VrcBooleanOp.False => false,
9739 VrcBooleanOp.True => true,
9740 VrcBooleanOp.Toggle => !Current,
9741 VrcBooleanOp.Unused => Current,
9742 _ => false,
9743 };
9744 }
9745
9746 private void Awake()
9747 {
9748 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
9749 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
9750 VRC_EventHandler[] components = ((Component)this).gameObject.GetComponents<VRC_EventHandler>();
9751 if (components.Length > 1 || (Object)(object)components[0] != (Object)(object)this)
9752 {
9753 Debug.LogError((object)String.Concat("Multiple event handlers found on ", ((Object)((Component)this).gameObject).name, ", bad things will happen."));
9754 }
9755 Enumerator<VrcEvent> enumerator = Events.GetEnumerator();
9756 try
9757 {
9758 while (enumerator.MoveNext())
9759 {
9760 VrcEvent current = enumerator.Current;
9761 if (current.ParameterBoolOp == VrcBooleanOp.Unused)
9762 {
9763 if (current.ParameterBool)
9764 {
9765 current.ParameterBoolOp = VrcBooleanOp.True;
9766 }
9767 else
9768 {
9769 current.ParameterBoolOp = VrcBooleanOp.False;
9770 }
9771 }
9772 }
9773 }
9774 finally
9775 {
9776 ((IDisposable)enumerator).Dispose();
9777 }
9778 }
9779
9780 public void VrcAnimationEvent(AnimationEvent aEvent)
9781 {
9782 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
9783 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
9784 Enumerator<VrcEvent> enumerator = Events.GetEnumerator();
9785 try
9786 {
9787 while (enumerator.MoveNext())
9788 {
9789 VrcEvent current = enumerator.Current;
9790 if (!(current.Name != aEvent.stringParameter))
9791 {
9792 TriggerEvent(current, VrcBroadcastType.Local);
9793 }
9794 }
9795 }
9796 finally
9797 {
9798 ((IDisposable)enumerator).Dispose();
9799 }
9800 }
9801
9802 public static bool IsReceiverRequiredForEventType(VrcEventType eventType)
9803 {
9804 if (eventType != VrcEventType.AddDamage)
9805 {
9806 return eventType != VrcEventType.AddHealth;
9807 }
9808 return false;
9809 }
9810
9811 public void TriggerEvent(VrcEvent e, VrcBroadcastType broadcast, GameObject instagator = null, float fastForward = 0f)
9812 {
9813 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
9814 if (e == null)
9815 {
9816 throw new ArgumentException("Event was null");
9817 }
9818 if ((Object)(object)instagator == (Object)null)
9819 {
9820 Debug.LogErrorFormat("Cancelling event {0} because the Instagator was null.", (object[])(object)new Object[1] { (Object)e.Name });
9821 return;
9822 }
9823 if ((Object)(object)Dispatcher == (Object)null)
9824 {
9825 Debug.LogFormat("Deferring event {0} of type {1} because dispatcher is unavailable.", (object[])(object)new Object[2]
9826 {
9827 (Object)e.Name,
9828 (object)e.EventType
9829 });
9830 DeferEvent(e, broadcast, instagator, fastForward);
9831 return;
9832 }
9833 if ((e.ParameterObjects == null || e.ParameterObjects.Length == 0) && (Object)(object)e.ParameterObject == (Object)null)
9834 {
9835 Debug.LogError((object)String.Concat("No object to receive event ", e.Name, " of type ", ((Object)e.EventType).ToString()));
9836 return;
9837 }
9838 int instagatorId = GetInstigatorId(instagator);
9839 if (e.ParameterObjects != null)
9840 {
9841 GameObject[] parameterObjects = e.ParameterObjects;
9842 foreach (GameObject parameterObject in parameterObjects)
9843 {
9844 GameObject parameterObject2 = e.ParameterObject;
9845 e.ParameterObject = parameterObject;
9846 try
9847 {
9848 if ((Object)null == (Object)(object)e.ParameterObject && IsReceiverRequiredForEventType(e.EventType))
9849 {
9850 Debug.LogWarning((object)String.Concat((string[])(object)new String[5]
9851 {
9852 "Null object in parameter objects to receive event ",
9853 e.Name,
9854 " of type ",
9855 ((Object)e.EventType).ToString(),
9856 ", trigger event ignored."
9857 }));
9858 }
9859 else
9860 {
9861 InternalTriggerEvent(e, broadcast, instagatorId, fastForward);
9862 }
9863 }
9864 finally
9865 {
9866 e.ParameterObject = parameterObject2;
9867 }
9868 }
9869 }
9870 if ((Object)(object)e.ParameterObject != (Object)null)
9871 {
9872 InternalTriggerEvent(e, broadcast, instagatorId, fastForward);
9873 }
9874 }
9875
9876 private void InternalTriggerEvent(VrcEvent e, VrcBroadcastType broadcast, int instagatorId, float fastForward)
9877 {
9878 if (instagatorId <= 0)
9879 {
9880 Debug.LogErrorFormat("Cancelling event because the Instigator was invalid: {0}/{1}", (object[])(object)new Object[2]
9881 {
9882 (object)e.EventType,
9883 (object)broadcast
9884 });
9885 }
9886 if (LogEvent != null)
9887 {
9888 LogEvent(this, e, broadcast, instagatorId, fastForward);
9889 }
9890 else
9891 {
9892 Dispatcher.TriggerEvent(this, e, broadcast, instagatorId, fastForward);
9893 }
9894 }
9895
9896 [Obsolete("Use the player object as the instigator", false)]
9897 public void TriggerEvent(VrcEvent e, VrcBroadcastType broadcast, int instagatorId, float fastForward)
9898 {
9899 if (e == null)
9900 {
9901 Debug.LogErrorFormat("Cancelling event because it was not valid", Array.Empty<object>());
9902 return;
9903 }
9904 VRCPlayerApi playerById = VRCPlayerApi.GetPlayerById(instagatorId);
9905 if (playerById == null)
9906 {
9907 Debug.LogErrorFormat("Cancelling event because instagator was not valid", Array.Empty<object>());
9908 }
9909 else
9910 {
9911 TriggerEvent(e, broadcast, playerById.gameObject, fastForward);
9912 }
9913 }
9914
9915 [Obsolete("Do not trigger events by name", false)]
9916 public void TriggerEvent(string eventName, VrcBroadcastType broadcast, GameObject instagator = null, int instagatorId = 0)
9917 {
9918 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
9919 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
9920 Enumerator<VrcEvent> enumerator = Events.GetEnumerator();
9921 try
9922 {
9923 while (enumerator.MoveNext())
9924 {
9925 VrcEvent current = enumerator.Current;
9926 if (!(current.Name != eventName))
9927 {
9928 TriggerEvent(current, broadcast, instagator);
9929 }
9930 }
9931 }
9932 finally
9933 {
9934 ((IDisposable)enumerator).Dispose();
9935 }
9936 }
9937
9938 [Obsolete("Do not trigger events by name", false)]
9939 public void TriggerEvent(string eventName, VrcBroadcastType broadcast, GameObject instagator, int instagatorId, float fastForward)
9940 {
9941 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
9942 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
9943 Enumerator<VrcEvent> enumerator = Events.GetEnumerator();
9944 try
9945 {
9946 while (enumerator.MoveNext())
9947 {
9948 VrcEvent current = enumerator.Current;
9949 if (!(current.Name != eventName))
9950 {
9951 TriggerEvent(current, broadcast, instagator, fastForward);
9952 }
9953 }
9954 }
9955 finally
9956 {
9957 ((IDisposable)enumerator).Dispose();
9958 }
9959 }
9960
9961 private void OnValidate()
9962 {
9963 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
9964 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
9965 Enumerator<VrcEvent> enumerator = Events.GetEnumerator();
9966 try
9967 {
9968 while (enumerator.MoveNext())
9969 {
9970 VrcEvent current = enumerator.Current;
9971 if (current.ParameterBoolOp == VrcBooleanOp.Unused)
9972 {
9973 if (current.ParameterBool)
9974 {
9975 current.ParameterBoolOp = VrcBooleanOp.True;
9976 }
9977 else
9978 {
9979 current.ParameterBoolOp = VrcBooleanOp.False;
9980 }
9981 }
9982 }
9983 }
9984 finally
9985 {
9986 ((IDisposable)enumerator).Dispose();
9987 }
9988 }
9989
9990 private void OnDestroy()
9991 {
9992 if (deferredEvents.Count > 0)
9993 {
9994 Debug.LogError((object)"Not all events were triggered prior to the handler being destroyed.");
9995 }
9996 if ((Object)(object)Dispatcher != (Object)null)
9997 {
9998 Dispatcher.UnregisterEventHandler(this);
9999 }
10000 }
10001
10002 [Obsolete("Event Handler Combined ID is no longer used")]
10004 {
10005 return 0L;
10006 }
10007
10008 public static bool HasEventTrigger(GameObject go)
10009 {
10010 return (Object)(object)go.GetComponent<VRC_Interactable>() != (Object)null;
10011 }
10012
10013 [Obsolete("They will defer.")]
10014 public bool IsReadyForEvents()
10015 {
10016 return true;
10017 }
10018
10019 public void DeferEvent(VrcEvent e, VrcBroadcastType broadcast, GameObject instagator, float fastForward)
10020 {
10021 if (deferredEvents == null)
10022 {
10023 deferredEvents = new List<EventInfo>();
10024 }
10025 deferredEvents.Add(new EventInfo
10026 {
10027 evt = e,
10028 broadcast = broadcast,
10029 instagator = instagator,
10030 fastForward = fastForward
10031 });
10032 if (DeferredEventProcessor == null)
10033 {
10034 DeferredEventProcessor = Networking.SafeStartCoroutine(ProcessDeferredEvents());
10035 }
10036 }
10037
10038 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
10039 private IEnumerator ProcessDeferredEvents()
10040 {
10041 yield return null;
10042 while ((Object)(object)this != (Object)null && deferredEvents != null && deferredEvents.Count > 0)
10043 {
10044 if ((Object)(object)Dispatcher == (Object)null)
10045 {
10046 yield return null;
10047 continue;
10048 }
10049 deferredEvents = new List<EventInfo>();
10050 Enumerator<EventInfo> enumerator = deferredEvents.GetEnumerator();
10051 try
10052 {
10053 while (enumerator.MoveNext())
10054 {
10055 EventInfo current = enumerator.Current;
10056 if (current != null)
10057 {
10058 if (GetInstigatorId(current.instagator) <= 0)
10059 {
10060 deferredEvents.Add(current);
10061 }
10062 else
10063 {
10064 TriggerEvent(current.evt, current.broadcast, current.instagator, current.fastForward);
10065 }
10066 }
10067 }
10068 }
10069 finally
10070 {
10071 ((IDisposable)enumerator).Dispose();
10072 }
10073 yield return null;
10074 }
10075 DeferredEventProcessor = null;
10076 }
10077 }
10078 public abstract class VRC_IKFollower : MonoBehaviour
10079 {
10080 public delegate void InitializationDelegate(VRC_IKFollower obj);
10081
10082 public static InitializationDelegate Initialize;
10083
10084 private void Awake()
10085 {
10086 if (Initialize != null)
10087 {
10088 Initialize(this);
10089 }
10090 }
10091 }
10092 public enum VRCInputSetting : Enum
10093 {
10094 GazeWithoutButton,
10095 ComfortTurning,
10096 HeadLookWalk,
10097 ToggleTalk,
10098 TalkDefaultOn,
10099 LegacyGrasp,
10100 ThirdPersonRotation,
10101 ShowTooltips,
10102 Locomotion3P,
10103 PersonalSpace,
10104 DefaultMute,
10105 VoicePrioritization
10106 }
10107 public enum VRCInputMethod : Enum
10108 {
10109 Keyboard = 0,
10110 Mouse = 1,
10111 Controller = 2,
10112 Gaze = 3,
10113 Vive = 5,
10114 Oculus = 6,
10115 ViveXr = 7,
10116 Index = 10,
10117 HPMotionController = 11,
10118 Osc = 12,
10119 QuestHands = 13,
10120 Generic = 14,
10121 Touch = 15,
10122 OpenXRGeneric = 16,
10123 Pico = 17,
10124 SteamVR2 = 18,
10125 Count = 19
10126 }
10127 public static class InputManager : Object
10128 {
10129 public static Func<bool> _IsUsingHandController;
10130
10131 public static Func<VRCInputMethod> _GetLastUsedInputMethod;
10132
10133 public static Func<VRCInputSetting, bool> _GetInputSetting;
10134
10135 public static Action<VRCInputSetting, bool> _SetInputSetting;
10136
10137 public static Action<Renderer, bool> _EnableObjectHighlight;
10138
10139 public static bool IsUsingHandController()
10140 {
10141 if (_IsUsingHandController != null)
10142 {
10143 return _IsUsingHandController.Invoke();
10144 }
10145 return false;
10146 }
10147
10149 {
10150 if (_GetLastUsedInputMethod != null)
10151 {
10152 VRCInputMethod vRCInputMethod = _GetLastUsedInputMethod.Invoke();
10153 if (vRCInputMethod == (VRCInputMethod)4)
10154 {
10155 vRCInputMethod = VRCInputMethod.Vive;
10156 }
10157 return vRCInputMethod;
10158 }
10159 return VRCInputMethod.Count;
10160 }
10161
10162 public static bool GetBoolInputSetting(VRCInputSetting setting)
10163 {
10164 if (_GetInputSetting != null)
10165 {
10166 return _GetInputSetting.Invoke(setting);
10167 }
10168 return false;
10169 }
10170
10171 public static void SetBoolInputSetting(VRCInputSetting setting, bool enabled)
10172 {
10173 if (_SetInputSetting != null)
10174 {
10175 _SetInputSetting.Invoke(setting, enabled);
10176 }
10177 }
10178
10179 public static void EnableObjectHighlight(GameObject obj, bool enable)
10180 {
10181 if ((Object)(object)obj != (Object)null)
10182 {
10183 EnableObjectHighlight(obj.GetComponent<Renderer>(), enable);
10184 }
10185 }
10186
10187 public static void EnableObjectHighlight(Renderer r, bool enable)
10188 {
10189 if (_EnableObjectHighlight != null)
10190 {
10191 _EnableObjectHighlight.Invoke(r, enable);
10192 }
10193 }
10194 }
10196 {
10197 public delegate void InitializationDelegate(VRC_Interactable obj);
10198
10199 public delegate bool ValidDelegate(VRC_Interactable obj, VRCPlayerApi player);
10200
10201 public Transform interactTextPlacement;
10202
10203 public string interactText = "Use";
10204
10205 [HideInInspector]
10206 public GameObject interactTextGO;
10207
10208 [Range(0f, 100f)]
10209 public float proximity = 2f;
10210
10211 public static InitializationDelegate Initialize;
10212
10213 public static ValidDelegate CheckValid;
10214
10215 public virtual bool IsInteractive => false;
10216
10217 public float Proximity => proximity;
10218
10219 public virtual void Start()
10220 {
10221 }
10222
10223 public virtual void Awake()
10224 {
10225 Initialize?.Invoke(this);
10226 }
10227
10228 public abstract void Interact();
10229
10230 public virtual void OnPickupUseUp()
10231 {
10232 }
10233
10234 public virtual void OnPickupUseDown()
10235 {
10236 }
10237
10238 public virtual void OnPickup()
10239 {
10240 }
10241
10242 public virtual void OnDrop()
10243 {
10244 }
10245
10247 {
10248 if (!IsInteractive)
10249 {
10250 return false;
10251 }
10252 if (CheckValid != null)
10253 {
10254 return CheckValid(this, player);
10255 }
10256 return true;
10257 }
10258 }
10259 public abstract class VRC_Label : MonoBehaviour
10260 {
10261 public string label = "";
10262 }
10263 [MeansImplicitUse]
10264 public class RPC : Attribute
10265 {
10266 public enum Destination : Enum
10267 {
10268 All,
10269 Others,
10270 Owner,
10271 Master,
10272 AllBuffered,
10273 OthersBuffered,
10274 Local,
10275 AllBufferOne,
10276 OthersBufferOne,
10277 TargetPlayer
10278 }
10279
10281
10282 public short shortCode;
10283
10284 public float playerRateLimit;
10285
10286 public float globalRateLimit;
10287
10288 public RPC(params Destination[] targets)
10289 {
10290 SetupTargets(targets);
10291 }
10292
10293 public RPC(short code, params Destination[] targets)
10294 {
10295 shortCode = code;
10296 SetupTargets(targets);
10297 }
10298
10299 public RPC(short code, float playerRateLimit, params Destination[] targets)
10300 {
10301 shortCode = code;
10302 this.playerRateLimit = playerRateLimit;
10303 SetupTargets(targets);
10304 }
10305
10306 public RPC(short code, float playerRateLimit, float globalRateLimit, params Destination[] targets)
10307 {
10308 shortCode = code;
10309 this.playerRateLimit = playerRateLimit;
10310 this.globalRateLimit = globalRateLimit;
10311 SetupTargets(targets);
10312 }
10313
10314 private void SetupTargets(Destination[] targets)
10315 {
10316 if (targets == null || targets.Length == 0)
10317 {
10318 allowedTargets = Enumerable.ToArray<Destination>(Enumerable.Cast<Destination>((IEnumerable)(object)Enum.GetValues(typeof(Destination))));
10319 return;
10320 }
10321 if (Enumerable.Contains<Destination>((IEnumerable<Destination>)(object)targets, Destination.Local))
10322 {
10323 allowedTargets = targets;
10324 return;
10325 }
10326 List<Destination> val = Enumerable.ToList<Destination>((IEnumerable<Destination>)(object)targets);
10327 val.Add(Destination.Local);
10328 allowedTargets = val.ToArray();
10329 }
10330 }
10331 [AttributeUsage(/*Could not decode attribute arguments.*/)]
10332 public class RPCIgnoredType : Attribute
10333 {
10334 }
10341 public static class Networking : Object
10342 {
10350 public enum SyncType : Enum
10351 {
10357 Unknown,
10363 None,
10373 Continuous,
10379 Manual
10380 }
10381
10382 public static Func<GameObject, float> _GetSimulationTime;
10383
10384 public static Func<GameObject, string> _GetUniqueName;
10385
10386 public static Action<RPC.Destination, GameObject, string, object[]> _RPC;
10387
10388 public static Action<VRCPlayerApi, GameObject, string, object[]> _RPCtoPlayer;
10389
10390 public static Func<bool> _IsNetworkSettled;
10391
10392 public static Func<bool> _IsMaster;
10393
10394 public static Func<bool> _IsSuffering;
10395
10396 public static Func<bool> _IsInstanceOwner;
10397
10398 public static Func<VRCPlayerApi> _LocalPlayer;
10399
10400 public static Func<VRCPlayerApi> _GetMaster;
10401
10402 public static Func<VRCPlayerApi> _GetInstanceOwner;
10403
10404 public static Func<VRCPlayerApi, GameObject, bool> _IsOwner;
10405
10406 public static Action<VRCPlayerApi, GameObject> _SetOwner;
10407
10408 public static Func<GameObject, bool> _IsObjectReady;
10409
10410 public static Func<VRC_EventHandler.VrcBroadcastType, string, Vector3, Quaternion, GameObject> _Instantiate;
10411
10412 public static Func<GameObject, VRCPlayerApi> _GetOwner;
10413
10414 public static Func<object[], byte[]> _ParameterEncoder;
10415
10416 public static Func<byte[], object[]> _ParameterDecoder;
10417
10418 public static Action<GameObject> _Destroy;
10419
10420 public static Func<VRC_EventHandler> _SceneEventHandler;
10421
10422 public static Func<string, bool> _GoToRoom;
10423
10424 public static Func<DateTime> _GetNetworkDateTime;
10425
10426 public static Func<double> _GetServerTimeInSeconds;
10427
10428 public static Func<int> _GetServerTimeInMilliseconds;
10429
10430 public static Func<double, double, double> _CalculateServerDeltaTime;
10431
10432 public static Func<IEnumerator, Coroutine> _SafeStartCoroutine;
10433
10434 public static Func<VRC_EventDispatcher> _GetEventDispatcher;
10435
10436 public static Func<VRCPlayerApi, GameObject[]> _GetPlayerPersistence;
10437
10438 public static Func<VRCPlayerApi, Component, Component> _FindComponentInPlayerObjects;
10439
10440 public static VRC_EventHandler SceneEventHandler
10441 {
10442 get
10443 {
10444 if (_SceneEventHandler != null)
10445 {
10446 return _SceneEventHandler.Invoke();
10447 }
10448 return null;
10449 }
10450 }
10451
10458 public static bool IsNetworkSettled
10459 {
10460 get
10461 {
10462 if (_IsNetworkSettled != null)
10463 {
10464 return _IsNetworkSettled.Invoke();
10465 }
10466 return true;
10467 }
10468 }
10469
10475 public static bool IsMaster
10476 {
10477 get
10478 {
10479 if (_IsMaster != null)
10480 {
10481 return _IsMaster.Invoke();
10482 }
10483 return true;
10484 }
10485 }
10486
10493 public static bool IsClogged
10494 {
10495 get
10496 {
10497 if (Application.isEditor)
10498 {
10499 return false;
10500 }
10501 if (_IsSuffering != null)
10502 {
10503 return _IsSuffering.Invoke();
10504 }
10505 return true;
10506 }
10507 }
10508
10516 public static bool IsInstanceOwner
10517 {
10518 get
10519 {
10520 if (_IsInstanceOwner != null)
10521 {
10522 return _IsInstanceOwner.Invoke();
10523 }
10524 return true;
10525 }
10526 }
10527
10532 public static VRCPlayerApi LocalPlayer
10533 {
10534 get
10535 {
10536 if (_LocalPlayer != null)
10537 {
10538 return _LocalPlayer.Invoke();
10539 }
10540 return null;
10541 }
10542 }
10543
10544 public static VRCPlayerApi Master
10545 {
10546 get
10547 {
10548 if (_GetMaster != null)
10549 {
10550 return _GetMaster.Invoke();
10551 }
10552 return null;
10553 }
10554 }
10555
10556 public static VRCPlayerApi InstanceOwner
10557 {
10558 get
10559 {
10560 if (_GetInstanceOwner != null)
10561 {
10562 return _GetInstanceOwner.Invoke();
10563 }
10564 return null;
10565 }
10566 }
10567
10582 public static bool IsOwner(VRCPlayerApi player, GameObject obj)
10583 {
10584 if (_IsOwner != null)
10585 {
10586 return _IsOwner.Invoke(player, obj);
10587 }
10588 return true;
10589 }
10590
10603 public static bool IsOwner(GameObject obj)
10604 {
10605 if (_IsOwner != null)
10606 {
10607 return _IsOwner.Invoke(LocalPlayer, obj);
10608 }
10609 return true;
10610 }
10611
10621 public static VRCPlayerApi GetOwner(GameObject obj)
10622 {
10623 if (_GetOwner != null)
10624 {
10625 return _GetOwner.Invoke(obj);
10626 }
10627 return null;
10628 }
10629
10641 public static void SetOwner(VRCPlayerApi player, GameObject obj)
10642 {
10643 if (_SetOwner != null)
10644 {
10645 _SetOwner.Invoke(player, obj);
10646 }
10647 }
10648
10660 public static bool IsObjectReady(GameObject obj)
10661 {
10662 if (_IsObjectReady != null)
10663 {
10664 return _IsObjectReady.Invoke(obj);
10665 }
10666 return true;
10667 }
10668
10669 public static GameObject Instantiate(VRC_EventHandler.VrcBroadcastType broadcast, string prefabPathOrDynamicPrefabName, Vector3 position, Quaternion rotation)
10670 {
10671 //IL_0010: Unknown result type (might be due to invalid IL or missing references)
10672 //IL_0011: Unknown result type (might be due to invalid IL or missing references)
10673 if (_Instantiate == null)
10674 {
10675 return null;
10676 }
10677 return _Instantiate.Invoke(broadcast, prefabPathOrDynamicPrefabName, position, rotation);
10678 }
10679
10680 public static void RPC(RPC.Destination targetClients, GameObject targetObject, string methodName, params object[] parameters)
10681 {
10682 if (_RPC != null)
10683 {
10684 _RPC.Invoke(targetClients, targetObject, methodName, parameters);
10685 }
10686 }
10687
10688 public static void RPC(VRCPlayerApi targetPlayer, GameObject targetObject, string methodName, params object[] parameters)
10689 {
10690 if (_RPCtoPlayer != null)
10691 {
10692 _RPCtoPlayer.Invoke(targetPlayer, targetObject, methodName, parameters);
10693 }
10694 }
10695
10696 public static byte[] EncodeParameters(params object[] parameters)
10697 {
10698 if (_ParameterEncoder != null)
10699 {
10700 return _ParameterEncoder.Invoke(parameters);
10701 }
10702 return null;
10703 }
10704
10705 public static object[] DecodeParameters(byte[] encodedData)
10706 {
10707 if (_ParameterDecoder != null)
10708 {
10709 return _ParameterDecoder.Invoke(encodedData);
10710 }
10711 return null;
10712 }
10713
10714 public static void Destroy(GameObject obj)
10715 {
10716 if (_Destroy != null)
10717 {
10718 _Destroy.Invoke(obj);
10719 }
10720 }
10721
10733 public static string GetUniqueName(GameObject obj)
10734 {
10735 if (_GetUniqueName != null)
10736 {
10737 return _GetUniqueName.Invoke(obj);
10738 }
10739 return null;
10740 }
10741
10742 public static bool GoToRoom(string roomID)
10743 {
10744 if (_GoToRoom != null)
10745 {
10746 return _GoToRoom.Invoke(roomID);
10747 }
10748 return false;
10749 }
10750
10755 public static DateTime GetNetworkDateTime()
10756 {
10757 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
10758 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
10759 if (_GetNetworkDateTime != null)
10760 {
10761 return _GetNetworkDateTime.Invoke();
10762 }
10763 return DateTime.UtcNow;
10764 }
10765
10774 public static double GetServerTimeInSeconds()
10775 {
10776 if (_GetServerTimeInSeconds != null)
10777 {
10778 return _GetServerTimeInSeconds.Invoke();
10779 }
10780 return Time.time;
10781 }
10782
10792 {
10793 if (_GetServerTimeInMilliseconds != null)
10794 {
10795 return _GetServerTimeInMilliseconds.Invoke();
10796 }
10797 return (int)(Time.time * 1000f);
10798 }
10799
10812 public static double CalculateServerDeltaTime(double timeInSeconds, double previousTimeInSeconds)
10813 {
10814 if (_CalculateServerDeltaTime != null)
10815 {
10816 return _CalculateServerDeltaTime.Invoke(timeInSeconds, previousTimeInSeconds);
10817 }
10818 return timeInSeconds - previousTimeInSeconds;
10819 }
10820
10821 public static Coroutine SafeStartCoroutine(IEnumerator target)
10822 {
10823 if (_SafeStartCoroutine != null)
10824 {
10825 return _SafeStartCoroutine.Invoke(target);
10826 }
10827 return null;
10828 }
10829
10831 {
10832 if (_GetEventDispatcher != null)
10833 {
10834 return _GetEventDispatcher.Invoke();
10835 }
10836 return null;
10837 }
10838
10862 public static float SimulationTime(GameObject target)
10863 {
10864 if (_GetSimulationTime != null)
10865 {
10866 return _GetSimulationTime.Invoke(target);
10867 }
10868 return Time.time;
10869 }
10870
10894 public static float SimulationTime(VRCPlayerApi target)
10895 {
10896 if (_GetSimulationTime != null && target != null)
10897 {
10898 return _GetSimulationTime.Invoke(target.gameObject);
10899 }
10900 return Time.time;
10901 }
10902
10903 public static GameObject[] GetPlayerObjects(VRCPlayerApi target)
10904 {
10905 if (_GetPlayerPersistence != null && target != null)
10906 {
10907 return _GetPlayerPersistence.Invoke(target);
10908 }
10909 return Array.Empty<GameObject>();
10910 }
10911
10912 public static Component FindComponentInPlayerObjects(VRCPlayerApi target, Component referenceComponent)
10913 {
10914 return _FindComponentInPlayerObjects?.Invoke(target, referenceComponent);
10915 }
10916 }
10917 public class VRC_Serialization : Object
10918 {
10919 private class NetworkSurrogateSelector : Object, ISurrogateSelector
10920 {
10921 [CompilerGenerated]
10922 private sealed class <>c__DisplayClass4_0 : Object
10923 {
10924 public Type type;
10925
10926 internal bool <IsAllowedType>b__0(Type t)
10927 {
10928 return t.IsAssignableFrom(type);
10929 }
10930
10931 internal bool <IsAllowedType>b__1(Type t)
10932 {
10933 return t.IsAssignableFrom(type);
10934 }
10935 }
10936
10937 private ISurrogateSelector _next;
10938
10939 public void ChainSelector(ISurrogateSelector selector)
10940 {
10941 //IL_0009: Unknown result type (might be due to invalid IL or missing references)
10942 if (selector == this)
10943 {
10944 throw new ArgumentException("Cannot allow Cyclical Surrogates");
10945 }
10946 if (_next == null)
10947 {
10948 _next = selector;
10949 }
10950 else
10951 {
10952 _next.ChainSelector(selector);
10953 }
10954 }
10955
10956 public ISurrogateSelector GetNextSelector()
10957 {
10958 return _next;
10959 }
10960
10961 public ISerializationSurrogate GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector)
10962 {
10963 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
10964 //IL_0123: Unknown result type (might be due to invalid IL or missing references)
10965 selector = (ISurrogateSelector)(object)this;
10966 if (!IsAllowedType(type))
10967 {
10968 throw new SecurityException(String.Concat("Unknown type: ", type.FullName));
10969 }
10970 if (type == typeof(Vector2))
10971 {
10972 return (ISerializationSurrogate)(object)new Vector2Surrogate();
10973 }
10974 if (type == typeof(Vector3))
10975 {
10976 return (ISerializationSurrogate)(object)new Vector3Surrogate();
10977 }
10978 if (type == typeof(Vector4))
10979 {
10980 return (ISerializationSurrogate)(object)new Vector4Surrogate();
10981 }
10982 if (type == typeof(Quaternion))
10983 {
10984 return (ISerializationSurrogate)(object)new QuaternionSurrogate();
10985 }
10986 if (type == typeof(Color))
10987 {
10988 return (ISerializationSurrogate)(object)new ColorSurrogate();
10989 }
10990 if (type == typeof(Color32))
10991 {
10992 return (ISerializationSurrogate)(object)new Color32Surrogate();
10993 }
10994 if (type == typeof(GameObject))
10995 {
10996 return (ISerializationSurrogate)(object)new GameObjectSurrogate();
10997 }
10998 if (type == typeof(Transform))
10999 {
11000 return (ISerializationSurrogate)(object)new TransformSurrogate();
11001 }
11002 if (type.IsSubclassOf(typeof(Object)))
11003 {
11004 return (ISerializationSurrogate)(object)new ObjectSurrogate();
11005 }
11006 if (type == typeof(Object))
11007 {
11008 return (ISerializationSurrogate)(object)new SystemObjectSurrogate();
11009 }
11010 selector = null;
11011 if (_next != null)
11012 {
11013 return _next.GetSurrogate(type, context, ref selector);
11014 }
11015 return null;
11016 }
11017
11018 private static bool IsAllowedType(Type type)
11019 {
11020 <>c__DisplayClass4_0 CS$<>8__locals0 = new <>c__DisplayClass4_0();
11021 CS$<>8__locals0.type = type;
11022 if (_allowedTypes.Contains(CS$<>8__locals0.type) || !Enumerable.Any<Type>((IEnumerable<Type>)(object)_allowedTypes, (Func<Type, bool>)((Type t) => t.IsAssignableFrom(CS$<>8__locals0.type))) || (CS$<>8__locals0.type.IsSubclassOf(typeof(Array)) && (_allowedTypes.Contains(CS$<>8__locals0.type.GetElementType()) || Enumerable.Any<Type>((IEnumerable<Type>)(object)_allowedTypes, (Func<Type, bool>)((Type t) => t.IsAssignableFrom(CS$<>8__locals0.type))))))
11023 {
11024 return true;
11025 }
11026 if (!AllowPluginTypes)
11027 {
11028 return false;
11029 }
11030 if (!_allowedPluginTypes.Contains(CS$<>8__locals0.type) && (!CS$<>8__locals0.type.IsSubclassOf(typeof(Array)) || !_allowedPluginTypes.Contains(CS$<>8__locals0.type.GetElementType())))
11031 {
11032 return false;
11033 }
11034 return true;
11035 }
11036 }
11037
11038 private class Vector2Surrogate : Object, ISerializationSurrogate
11039 {
11040 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11041 {
11042 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11043 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11044 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
11045 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
11046 Vector2 val = (Vector2)obj;
11047 info.AddValue("x", val.x);
11048 info.AddValue("y", val.y);
11049 }
11050
11051 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11052 {
11053 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11054 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11055 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
11056 Vector2 val = (Vector2)obj;
11057 val.x = info.GetSingle("x");
11058 val.y = info.GetSingle("y");
11059 return val;
11060 }
11061 }
11062
11063 private class Vector3Surrogate : Object, ISerializationSurrogate
11064 {
11065 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11066 {
11067 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11068 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11069 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
11070 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
11071 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
11072 Vector3 val = (Vector3)obj;
11073 info.AddValue("x", val.x);
11074 info.AddValue("y", val.y);
11075 info.AddValue("z", val.z);
11076 }
11077
11078 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11079 {
11080 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11081 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11082 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
11083 Vector3 val = (Vector3)obj;
11084 val.x = info.GetSingle("x");
11085 val.y = info.GetSingle("y");
11086 val.z = info.GetSingle("z");
11087 return val;
11088 }
11089 }
11090
11091 private class Vector4Surrogate : Object, ISerializationSurrogate
11092 {
11093 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11094 {
11095 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11096 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11097 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
11098 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
11099 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
11100 //IL_0040: Unknown result type (might be due to invalid IL or missing references)
11101 Vector4 val = (Vector4)obj;
11102 info.AddValue("x", val.x);
11103 info.AddValue("y", val.y);
11104 info.AddValue("z", val.z);
11105 info.AddValue("w", val.w);
11106 }
11107
11108 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11109 {
11110 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11111 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11112 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
11113 Vector4 val = (Vector4)obj;
11114 val.x = info.GetSingle("x");
11115 val.y = info.GetSingle("y");
11116 val.z = info.GetSingle("z");
11117 val.w = info.GetSingle("w");
11118 return val;
11119 }
11120 }
11121
11122 private class QuaternionSurrogate : Object, ISerializationSurrogate
11123 {
11124 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11125 {
11126 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11127 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11128 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
11129 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
11130 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
11131 //IL_0040: Unknown result type (might be due to invalid IL or missing references)
11132 Quaternion val = (Quaternion)obj;
11133 info.AddValue("x", val.x);
11134 info.AddValue("y", val.y);
11135 info.AddValue("z", val.z);
11136 info.AddValue("w", val.w);
11137 }
11138
11139 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11140 {
11141 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11142 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11143 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
11144 Quaternion val = (Quaternion)obj;
11145 val.x = info.GetSingle("x");
11146 val.y = info.GetSingle("y");
11147 val.z = info.GetSingle("z");
11148 val.w = info.GetSingle("w");
11149 return val;
11150 }
11151 }
11152
11153 private class TransformSurrogate : Object, ISerializationSurrogate
11154 {
11155 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11156 {
11157 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11158 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11159 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
11160 Transform val = (Transform)obj;
11161 if ((Object)(object)((Component)val).gameObject == (Object)null)
11162 {
11163 throw new ArgumentException("Transform must have an associated gameObject.");
11164 }
11165 string gameObjectPath = GetGameObjectPath(((Component)val).gameObject);
11166 info.AddValue("path", (object)gameObjectPath);
11167 }
11168
11169 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11170 {
11171 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
11172 string @string = info.GetString("path");
11173 GameObject obj2 = FindGameObject(@string);
11174 if ((Object)(object)obj2 == (Object)null)
11175 {
11176 throw new KeyNotFoundException(String.Concat("Could not locate Transform at path ", @string));
11177 }
11178 return obj2.transform;
11179 }
11180 }
11181
11182 private class ColorSurrogate : Object, ISerializationSurrogate
11183 {
11184 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11185 {
11186 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11187 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11188 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
11189 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
11190 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
11191 //IL_0040: Unknown result type (might be due to invalid IL or missing references)
11192 Color val = (Color)obj;
11193 info.AddValue("a", val.a);
11194 info.AddValue("r", val.r);
11195 info.AddValue("g", val.g);
11196 info.AddValue("b", val.b);
11197 }
11198
11199 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11200 {
11201 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11202 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11203 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
11204 Color val = (Color)obj;
11205 val.a = info.GetSingle("a");
11206 val.r = info.GetSingle("r");
11207 val.g = info.GetSingle("g");
11208 val.b = info.GetSingle("b");
11209 return val;
11210 }
11211 }
11212
11213 private class Color32Surrogate : Object, ISerializationSurrogate
11214 {
11215 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11216 {
11217 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11218 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11219 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
11220 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
11221 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
11222 //IL_0040: Unknown result type (might be due to invalid IL or missing references)
11223 Color32 val = (Color32)obj;
11224 info.AddValue("a", val.a);
11225 info.AddValue("r", val.r);
11226 info.AddValue("g", val.g);
11227 info.AddValue("b", val.b);
11228 }
11229
11230 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11231 {
11232 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
11233 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
11234 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
11235 Color32 val = (Color32)obj;
11236 val.a = info.GetByte("a");
11237 val.r = info.GetByte("r");
11238 val.g = info.GetByte("g");
11239 val.b = info.GetByte("b");
11240 return val;
11241 }
11242 }
11243
11244 private class GameObjectSurrogate : Object, ISerializationSurrogate
11245 {
11246 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11247 {
11248 string gameObjectPath = GetGameObjectPath((GameObject)((obj is GameObject) ? obj : null));
11249 info.AddValue("path", (object)gameObjectPath);
11250 }
11251
11252 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11253 {
11254 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
11255 string @string = info.GetString("path");
11256 GameObject obj2 = FindGameObject(@string);
11257 if ((Object)(object)obj2 == (Object)null)
11258 {
11259 throw new KeyNotFoundException(String.Concat("Could not locate Game Object at path ", @string));
11260 }
11261 return obj2;
11262 }
11263 }
11264
11265 private class SystemObjectSurrogate : Object, ISerializationSurrogate
11266 {
11267 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11268 {
11269 }
11270
11271 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11272 {
11273 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
11274 //IL_0006: Expected O, but got Unknown
11275 return (object)new Object();
11276 }
11277 }
11278
11279 private class ObjectSurrogate : Object, ISerializationSurrogate
11280 {
11281 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11282 {
11283 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
11284 Type type = obj.GetType();
11285 MemberInfo[] array = Enumerable.ToArray<MemberInfo>(Enumerable.Where<MemberInfo>((IEnumerable<MemberInfo>)(object)type.GetMembers((BindingFlags)52), (Func<MemberInfo, bool>)((MemberInfo m) => (int)m.MemberType == 4)));
11286 object[] array2 = (object[])(object)new Object[array.Length];
11287 for (int i = 0; i < array2.Length; i++)
11288 {
11289 MemberInfo val = array[i];
11290 if (Enumerable.Any<object>((IEnumerable<object>)(object)val.GetCustomAttributes(true), (Func<object, bool>)((object attr) => attr is NonSerializedAttribute)))
11291 {
11292 array2[i] = null;
11293 }
11294 else
11295 {
11296 array2[i] = ((FieldInfo)val).GetValue(obj);
11297 }
11298 }
11299 info.AddValue("type", (object)type.AssemblyQualifiedName);
11300 info.AddValue("members", (object)ParameterEncoder(array2));
11301 }
11302
11303 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11304 {
11305 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
11306 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
11307 //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
11308 //IL_0101: Unknown result type (might be due to invalid IL or missing references)
11309 string @string = info.GetString("type");
11310 object[] array = ParameterDecoder((byte[])info.GetValue("members", typeof(byte[])));
11311 Type type = Type.GetType(@string, false);
11312 if (type == (Type)null)
11313 {
11314 throw new KeyNotFoundException(String.Concat("Could not load type ", @string));
11315 }
11316 MemberInfo[] array2 = Enumerable.ToArray<MemberInfo>(Enumerable.Where<MemberInfo>((IEnumerable<MemberInfo>)(object)type.GetMembers((BindingFlags)52), (Func<MemberInfo, bool>)((MemberInfo m) => (int)m.MemberType == 4)));
11317 ScriptableObject val = ScriptableObject.CreateInstance(type);
11318 if ((Object)(object)val == (Object)null)
11319 {
11320 throw new NullReferenceException(String.Concat("Could not instantiate Scriptable Object of type ", ((MemberInfo)type).Name));
11321 }
11322 obj = val;
11323 if (array2.Length != array.Length)
11324 {
11325 throw new ArgumentException(String.Concat("Received members does not match the number of valid members present for ", @string));
11326 }
11327 for (int i = 0; i < array.Length; i++)
11328 {
11329 MemberInfo val2 = array2[i];
11330 if (!Enumerable.Any<object>((IEnumerable<object>)(object)val2.GetCustomAttributes(true), (Func<object, bool>)((object attr) => attr is NonSerializedAttribute)))
11331 {
11332 ((FieldInfo)val2).SetValue((object)val, array[i]);
11333 }
11334 }
11335 return val;
11336 }
11337 }
11338
11339 private class ArraySurrogate : Object, ISerializationSurrogate
11340 {
11341 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11342 {
11343 Type type = obj.GetType();
11344 Array val = (Array)((obj is Array) ? obj : null);
11345 info.AddValue("type", (object)type.AssemblyQualifiedName);
11346 int arrayRank = type.GetArrayRank();
11347 if (arrayRank <= 0 || arrayRank > 4)
11348 {
11349 info.AddValue("rank", 0);
11350 Debug.LogError((object)"ArrayRank out of range (1-4) in serialized array - not transmitted");
11351 return;
11352 }
11353 info.AddValue("rank", arrayRank);
11354 int num = 1;
11355 Int32[] array = new Int32[4];
11356 RuntimeHelpers.InitializeArray((Array)(object)array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
11357 int[] array2 = (int[])(object)array;
11358 for (int i = 0; i < arrayRank; i++)
11359 {
11360 array2[i] = val.GetLength(i);
11361 num *= array2[i];
11362 }
11363 if (num > 65536)
11364 {
11365 Debug.LogError((object)"Too many elements in serialized array - not transmitted");
11366 for (int j = 0; j < arrayRank; j++)
11367 {
11368 info.AddValue(String.Concat("dim_", ((Int32)(ref j)).ToString()), 0);
11369 }
11370 return;
11371 }
11372 for (int k = 0; k < arrayRank; k++)
11373 {
11374 info.AddValue(String.Concat("dim_", ((Int32)(ref k)).ToString()), array2[k]);
11375 }
11376 int[] array3 = (int[])(object)new Int32[arrayRank];
11377 for (int l = 0; l < array2[3]; l++)
11378 {
11379 if (arrayRank > 3)
11380 {
11381 array3[3] = l;
11382 }
11383 for (int m = 0; m < array2[2]; m++)
11384 {
11385 if (arrayRank > 2)
11386 {
11387 array3[2] = m;
11388 }
11389 for (int n = 0; n < array2[1]; n++)
11390 {
11391 if (arrayRank > 1)
11392 {
11393 array3[1] = n;
11394 }
11395 for (int num2 = 0; num2 < array2[0]; num2++)
11396 {
11397 array3[0] = num2;
11398 byte[] array4 = ParameterEncoder(val.GetValue(array3));
11399 info.AddValue(String.Concat((string[])(object)new String[8]
11400 {
11401 "elem_",
11402 ((Int32)(ref num2)).ToString(),
11403 ".",
11404 ((Int32)(ref n)).ToString(),
11405 ".",
11406 ((Int32)(ref m)).ToString(),
11407 ".",
11408 ((Int32)(ref l)).ToString()
11409 }), (object)array4);
11410 }
11411 }
11412 }
11413 }
11414 }
11415
11416 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11417 {
11418 //IL_0043: Unknown result type (might be due to invalid IL or missing references)
11419 //IL_0049: Expected I4, but got Unknown
11420 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
11421 //IL_009c: Unknown result type (might be due to invalid IL or missing references)
11422 //IL_00a2: Expected I4, but got Unknown
11423 string @string = info.GetString("type");
11424 Type type = Type.GetType(@string, false);
11425 if (type == (Type)null)
11426 {
11427 throw new KeyNotFoundException(String.Concat("Could not load type ", @string));
11428 }
11429 int num = (int)(Int32)info.GetValue("rank", typeof(Int32));
11430 if (num <= 0 || num > 4)
11431 {
11432 Debug.LogError((object)"ArrayRank out of range (1-4) in serialized array - not recieved");
11433 return null;
11434 }
11435 int num2 = 1;
11436 Int32[] array = new Int32[4];
11437 RuntimeHelpers.InitializeArray((Array)(object)array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
11438 int[] array2 = (int[])(object)array;
11439 for (int i = 0; i < num; i++)
11440 {
11441 array2[i] = (int)(Int32)info.GetValue(String.Concat("dim_", ((Int32)(ref i)).ToString()), typeof(Int32));
11442 num2 *= array2[i];
11443 }
11444 if (num2 > 65536)
11445 {
11446 Debug.LogError((object)"Too many elements in serialized array - not received");
11447 return null;
11448 }
11449 Array val = Array.CreateInstance(type.GetElementType(), array2);
11450 int[] array3 = (int[])(object)new Int32[num];
11451 for (int j = 0; j < array2[3]; j++)
11452 {
11453 if (num > 3)
11454 {
11455 array3[3] = j;
11456 }
11457 for (int k = 0; k < array2[2]; k++)
11458 {
11459 if (num > 2)
11460 {
11461 array3[2] = k;
11462 }
11463 for (int l = 0; l < array2[1]; l++)
11464 {
11465 if (num > 1)
11466 {
11467 array3[1] = l;
11468 }
11469 for (int m = 0; m < array2[0]; m++)
11470 {
11471 array3[0] = m;
11472 object obj2 = ParameterDecoder((byte[])info.GetValue(String.Concat((string[])(object)new String[8]
11473 {
11474 "elem_",
11475 ((Int32)(ref m)).ToString(),
11476 ".",
11477 ((Int32)(ref l)).ToString(),
11478 ".",
11479 ((Int32)(ref k)).ToString(),
11480 ".",
11481 ((Int32)(ref j)).ToString()
11482 }), typeof(byte[])));
11483 val.SetValue(Convert.ChangeType(obj2, type.GetElementType()), array3);
11484 }
11485 }
11486 }
11487 }
11488 return val;
11489 }
11490 }
11491
11492 private class GenericSurrogate : Object, ISerializationSurrogate
11493 {
11494 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
11495 {
11496 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
11497 //IL_0029: Expected O, but got Unknown
11498 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
11499 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
11500 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)
11501 Type type = obj.GetType();
11502 if (type.GetGenericTypeDefinition() == typeof(List<>))
11503 {
11504 List<object> val = Enumerable.ToList<object>(Enumerable.Cast<object>((IEnumerable)(IList)obj));
11505 short num = (short)val.Count;
11506 info.AddValue("type", (object)type.AssemblyQualifiedName);
11507 info.AddValue("length", num);
11508 for (short num2 = 0; num2 < num; num2++)
11509 {
11510 byte[] array = ParameterEncoder(val[(int)num2]);
11511 info.AddValue(((Int16)(ref num2)).ToString(), (object)array);
11512 }
11513 }
11514 else if (type.GetGenericTypeDefinition() == typeof(Dictionary<, >))
11515 {
11516 List<object> val2 = Enumerable.ToList<object>(Enumerable.Cast<object>((IEnumerable)(object)((IDictionary)obj).Keys));
11517 List<object> val3 = Enumerable.ToList<object>(Enumerable.Cast<object>((IEnumerable)(object)((IDictionary)obj).Values));
11518 short num3 = (short)((ICollection)(IDictionary)obj).Count;
11519 info.AddValue("type", (object)type.AssemblyQualifiedName);
11520 info.AddValue("length", num3);
11521 for (short num4 = 0; num4 < num3; num4++)
11522 {
11523 byte[] array = ParameterEncoder(val2[(int)num4]);
11524 info.AddValue(String.Concat("key_", ((Int16)(ref num4)).ToString()), (object)array);
11525 array = ParameterEncoder(val3[(int)num4]);
11526 info.AddValue(String.Concat("value_", ((Int16)(ref num4)).ToString()), (object)array);
11527 }
11528 }
11529 }
11530
11531 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11532 {
11533 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
11534 //IL_0063: Unknown result type (might be due to invalid IL or missing references)
11535 //IL_006a: Expected O, but got Unknown
11536 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
11537 //IL_00f7: Expected O, but got Unknown
11538 string @string = info.GetString("type");
11539 Type type = Type.GetType(@string, false);
11540 if (type == (Type)null)
11541 {
11542 throw new KeyNotFoundException(String.Concat("Could not load type ", @string));
11543 }
11544 object result = null;
11545 Type[] genericArguments = type.GetGenericArguments();
11546 if (type.GetGenericTypeDefinition() == typeof(List<>))
11547 {
11548 IList val = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(genericArguments));
11549 short @int = info.GetInt16("length");
11550 for (short num = 0; num < @int; num++)
11551 {
11552 object[] array = ParameterDecoder((byte[])info.GetValue(((Int16)(ref num)).ToString(), typeof(byte[])));
11553 val.Add(array[0]);
11554 }
11555 result = val;
11556 }
11557 else if (type.GetGenericTypeDefinition() == typeof(Dictionary<, >))
11558 {
11559 IDictionary val2 = (IDictionary)Activator.CreateInstance(typeof(Dictionary<, >).MakeGenericType(genericArguments));
11560 short int2 = info.GetInt16("length");
11561 for (short num2 = 0; num2 < int2; num2++)
11562 {
11563 object[] array2 = ParameterDecoder((byte[])info.GetValue(String.Concat("key_", ((Int16)(ref num2)).ToString()), typeof(byte[])));
11564 object[] array3 = ParameterDecoder((byte[])info.GetValue(String.Concat("value_", ((Int16)(ref num2)).ToString()), typeof(byte[])));
11565 val2.Add(array2[0], array3[0]);
11566 }
11567 result = val2;
11568 }
11569 return result;
11570 }
11571 }
11572
11573 private static readonly HashSet<Type> _allowedTypes;
11574
11575 private static readonly HashSet<Type> _allowedPluginTypes;
11576
11577 private static ISurrogateSelector _networkSurrogateSelector;
11578
11579 [field: CompilerGenerated]
11580 public static bool AllowPluginTypes
11581 {
11582 [CompilerGenerated]
11583 get;
11584 [CompilerGenerated]
11585 set;
11586 }
11587
11588 private static ISurrogateSelector SurrogateSelector => _networkSurrogateSelector ?? (_networkSurrogateSelector = (ISurrogateSelector)(object)new NetworkSurrogateSelector());
11589
11590 public static VRC_EventDispatcher Dispatcher
11591 {
11592 get
11593 {
11594 GameObject val = GameObject.Find("/VRC_OBJECTS/Dispatcher");
11595 if ((Object)(object)val == (Object)null)
11596 {
11597 return null;
11598 }
11599 return val.GetComponent<VRC_EventDispatcher>();
11600 }
11601 }
11602
11603 public static void RegisterVRCPlayer(Type type)
11604 {
11605 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
11606 if (type.FullName != "VRC.Player")
11607 {
11608 throw new SecurityException(String.Concat("Unrecognized VRC.Player type: ", type.FullName));
11609 }
11610 if (!_allowedTypes.Contains(type))
11611 {
11612 _allowedTypes.Add(type);
11613 }
11614 }
11615
11616 public static void RegisterPluginType(Type type)
11617 {
11618 if (!_allowedPluginTypes.Contains(type))
11619 {
11620 _allowedPluginTypes.Add(type);
11621 }
11622 }
11623
11624 public static void RegisterType(Type type)
11625 {
11626 if (!_allowedTypes.Contains(type))
11627 {
11628 _allowedTypes.Add(type);
11629 }
11630 }
11631
11632 public static byte[] ParameterEncoder(params object[] parameters)
11633 {
11634 //IL_002a: Expected O, but got Unknown
11635 //IL_0005: Unknown result type (might be due to invalid IL or missing references)
11636 //IL_000b: Expected O, but got Unknown
11637 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
11638 //IL_0011: Expected O, but got Unknown
11639 if (parameters == null)
11640 {
11641 return null;
11642 }
11643 MemoryStream val = new MemoryStream();
11644 IFormatter val2 = (IFormatter)new BinaryFormatter();
11645 val2.SurrogateSelector = SurrogateSelector;
11646 try
11647 {
11648 val2.Serialize((Stream)(object)val, (object)parameters);
11649 }
11650 catch (SecurityException)
11651 {
11652 throw;
11653 }
11654 catch (Exception val4)
11655 {
11656 Exception val5 = val4;
11657 Debug.LogError((object)String.Concat("Something went wrong serializing RPC parameters: \n", val5.Message, "\n", val5.StackTrace));
11658 return null;
11659 }
11660 ((Stream)val).Flush();
11661 return val.ToArray();
11662 }
11663
11664 public static object[] ParameterDecoder(byte[] dataParameters, bool rethrow = false)
11665 {
11666 //IL_0032: Expected O, but got Unknown
11667 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
11668 //IL_000e: Expected O, but got Unknown
11669 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
11670 //IL_0014: Expected O, but got Unknown
11671 if (dataParameters != null && dataParameters.Length != 0)
11672 {
11673 MemoryStream val = new MemoryStream(dataParameters);
11674 IFormatter val2 = (IFormatter)new BinaryFormatter();
11675 val2.SurrogateSelector = SurrogateSelector;
11676 try
11677 {
11678 return (object[])val2.Deserialize((Stream)(object)val);
11679 }
11680 catch (SecurityException)
11681 {
11682 throw;
11683 }
11684 catch (Exception val4)
11685 {
11686 Exception val5 = val4;
11687 if (rethrow)
11688 {
11689 throw;
11690 }
11691 Debug.LogError((object)String.Concat("Error decoding parameters: ", val5.Message, "\n", val5.StackTrace));
11692 return null;
11693 }
11694 }
11695 return (object[])(object)new Object[0];
11696 }
11697
11698 private static string GetGameObjectPathFallback(GameObject go)
11699 {
11700 string text = "";
11701 while ((Object)(object)go != (Object)null)
11702 {
11703 text = ((!(text == "")) ? String.Concat(((Object)go).name, "/", text) : ((Object)go).name);
11704 if ((Object)(object)go.transform.parent == (Object)null)
11705 {
11706 text = String.Concat("/", text);
11707 break;
11708 }
11709 go = ((Component)go.transform.parent).gameObject;
11710 }
11711 return text;
11712 }
11713
11714 private static string GetGameObjectPath(GameObject go)
11715 {
11716 VRC_EventDispatcher dispatcher = Dispatcher;
11717 if ((Object)(object)dispatcher != (Object)null)
11718 {
11719 return dispatcher.GetGameObjectPath(go);
11720 }
11721 return GetGameObjectPathFallback(go);
11722 }
11723
11724 private static GameObject FindGameObject(string path)
11725 {
11726 VRC_EventDispatcher dispatcher = Dispatcher;
11727 if ((Object)(object)dispatcher != (Object)null)
11728 {
11729 return dispatcher.FindGameObject(path, suppressErrors: true);
11730 }
11731 return GameObject.Find(path);
11732 }
11733
11735 {
11736 HashSet<Type> obj = new HashSet<Type>();
11737 obj.Add(typeof(Object));
11738 obj.Add(typeof(String));
11739 obj.Add(typeof(Byte));
11740 obj.Add(typeof(Int16));
11741 obj.Add(typeof(UInt16));
11742 obj.Add(typeof(Int32));
11743 obj.Add(typeof(UInt32));
11744 obj.Add(typeof(Single));
11745 obj.Add(typeof(Double));
11746 obj.Add(typeof(object[]));
11747 obj.Add(typeof(Vector2));
11748 obj.Add(typeof(Vector3));
11749 obj.Add(typeof(Vector4));
11750 obj.Add(typeof(Quaternion));
11751 obj.Add(typeof(GameObject));
11752 obj.Add(typeof(Transform));
11753 obj.Add(typeof(Color));
11754 obj.Add(typeof(Color32));
11755 obj.Add(typeof(VideoSource));
11756 obj.Add(typeof(VideoAspectRatio));
11757 obj.Add(typeof(VideoClip));
11758 obj.Add(typeof(VRC_SceneDescriptor.SpawnOrientation));
11759 _allowedTypes = obj;
11760 _allowedPluginTypes = new HashSet<Type>();
11761 _networkSurrogateSelector = null;
11762 }
11763 }
11764 public static class Utilities : Object
11765 {
11766 private static bool _isClient;
11767
11768 public static bool IsValid(object obj)
11769 {
11770 if (obj != null)
11771 {
11772 Object val = (Object)((obj is Object) ? obj : null);
11773 if (val == null || !(val == (Object)null))
11774 {
11775 if (obj is IValidChecker validChecker)
11776 {
11777 return validChecker.IsValid();
11778 }
11779 return true;
11780 }
11781 return false;
11782 }
11783 return false;
11784 }
11785
11786 public static void ShuffleArray<T>(T[] array)
11787 {
11788 int num = array.Length;
11789 for (int i = 0; i < num; i++)
11790 {
11791 int num2 = (i + (int)(Random.value * (float)(num - i))) % num;
11792 T val = array[num2];
11793 array[num2] = array[i];
11794 array[i] = val;
11795 }
11796 }
11797
11798 public static void ShuffleArray(int[] array)
11799 {
11800 Utilities.ShuffleArray<int>(array);
11801 }
11802
11803 public static bool IsClient()
11804 {
11805 return _isClient;
11806 }
11807
11808 public static void SetIsClient()
11809 {
11810 _isClient = true;
11811 }
11812 }
11813 public interface IValidChecker
11814 {
11815 bool IsValid();
11816 }
11817}
11819{
11820 public static class TypeUtils : Object
11821 {
11822 [CompilerGenerated]
11823 private sealed class <>c__DisplayClass3_0 : Object
11824 {
11825 public Type baseType;
11826
11827 internal bool <FindDerivedTypes>b__0(Type t)
11828 {
11829 if (t != baseType)
11830 {
11831 return baseType.IsAssignableFrom(t);
11832 }
11833 return false;
11834 }
11835 }
11836
11837 private static readonly Dictionary<string, Type> _typeCache = new Dictionary<string, Type>();
11838
11839 [PublicAPI]
11840 public static Type GetTypeFromName(string name, Assembly[] assemblies = null)
11841 {
11842 if (_typeCache.ContainsKey(name))
11843 {
11844 return _typeCache[name];
11845 }
11846 if (assemblies == null)
11847 {
11848 assemblies = AppDomain.CurrentDomain.GetAssemblies();
11849 }
11850 Assembly[] array = assemblies;
11851 for (int i = 0; i < array.Length; i++)
11852 {
11853 Type type = array[i].GetType(name);
11854 if (!(type == (Type)null))
11855 {
11856 _typeCache[name] = type;
11857 return type;
11858 }
11859 }
11860 _typeCache[name] = null;
11861 return null;
11862 }
11863
11864 public static IEnumerable<Type> FindDerivedTypes(Type baseType)
11865 {
11866 List<Type> val = new List<Type>();
11867 Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
11868 foreach (Assembly assembly in assemblies)
11869 {
11870 val.AddRange(FindDerivedTypes(assembly, baseType));
11871 }
11872 return (IEnumerable<Type>)(object)val;
11873 }
11874
11875 public static IEnumerable<Type> FindDerivedTypes(Assembly assembly, Type baseType)
11876 {
11877 <>c__DisplayClass3_0 CS$<>8__locals0 = new <>c__DisplayClass3_0();
11878 CS$<>8__locals0.baseType = baseType;
11879 return Enumerable.Where<Type>((IEnumerable<Type>)(object)assembly.GetTypes(), (Func<Type, bool>)((Type t) => t != CS$<>8__locals0.baseType && CS$<>8__locals0.baseType.IsAssignableFrom(t)));
11880 }
11881
11882 public static IEnumerable<T> FindAssemblyAttributes<T>() where T : Attribute
11883 {
11884 List<T> val = new List<T>();
11885 Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
11886 foreach (Assembly assembly in assemblies)
11887 {
11888 val.AddRange(FindAssemblyAttributes<T>(assembly));
11889 }
11890 return (IEnumerable<T>)(object)val;
11891 }
11892
11893 public static IEnumerable<T> FindAssemblyAttributes<T>(Assembly assembly) where T : Attribute
11894 {
11895 try
11896 {
11897 return (IEnumerable<T>)(object)(T[])(object)assembly.GetCustomAttributes(typeof(T), false);
11898 }
11899 catch (Object)
11900 {
11901 return Enumerable.Empty<T>();
11902 }
11903 }
11904 }
11905 public static class ValidationUtils : Object
11906 {
11907 [CompilerGenerated]
11908 private sealed class <>c__DisplayClass17_0 : Object
11909 {
11910 public List<Shader> illegalShaders;
11911
11912 internal void <FindIllegalShaders>b__0(Shader c)
11913 {
11914 illegalShaders.Add(c);
11915 }
11916 }
11917
11918 [CompilerGenerated]
11919 private sealed class <>c__DisplayClass18_0 : Object
11920 {
11921 public Material sharedMaterial;
11922
11923 internal bool <FindIllegalShadersEnumerator>b__0(Material cacheMtl)
11924 {
11925 return (Object)(object)sharedMaterial == (Object)(object)cacheMtl;
11926 }
11927
11928 internal bool <FindIllegalShadersEnumerator>b__1(string okayShaderName)
11929 {
11930 return ((Object)sharedMaterial.shader).name != okayShaderName;
11931 }
11932 }
11933
11934 private static readonly List<Component> _componentCache = new List<Component>();
11935
11936 private static string _EDITOR_ONLY_TAG = "EditorOnly";
11937
11938 private static readonly Dictionary<string, HashSet<Type>> _whitelistCache = new Dictionary<string, HashSet<Type>>();
11939
11940 private static readonly Dictionary<Type, ImmutableArray<RequireComponent>> _requireComponentsCache = new Dictionary<Type, ImmutableArray<RequireComponent>>();
11941
11942 public static void RemoveIllegalComponents(GameObject target, HashSet<Type> whitelist, bool retry = true, bool onlySceneObjects = false, bool logStripping = true, bool excludeEditorOnly = false, bool allowRemovingAssets = true)
11943 {
11944 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
11945 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
11946 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
11947 //IL_0055: Expected O, but got Unknown
11948 target.GetComponentsInChildren<Component>(true, _componentCache);
11949 StringBuilder val = null;
11950 Enumerator<Component> enumerator = _componentCache.GetEnumerator();
11951 try
11952 {
11953 while (enumerator.MoveNext())
11954 {
11955 Component current = enumerator.Current;
11956 if ((Object)(object)current == (Object)null || (onlySceneObjects && ((Object)current).GetInstanceID() < 0) || !IsIllegalComponent(current, whitelist, excludeEditorOnly))
11957 {
11958 continue;
11959 }
11960 if (logStripping)
11961 {
11962 if (val == null)
11963 {
11964 val = new StringBuilder("Component stripping report:");
11965 }
11966 val.AppendFormat("\nRemoving {0} comp from {1}", (object)((MemberInfo)((Object)current).GetType()).Name, (object)((Object)current.gameObject).name);
11967 }
11968 RemoveComponent(current, allowRemovingAssets);
11969 }
11970 }
11971 finally
11972 {
11973 ((IDisposable)enumerator).Dispose();
11974 }
11975 if (val != null)
11976 {
11977 Debug.LogWarning((object)((Object)val).ToString());
11978 }
11979 _componentCache.Clear();
11980 }
11981
11982 public static List<Component> FindIllegalComponents(GameObject target, HashSet<Type> whitelist, bool excludeEditorOnly = false)
11983 {
11984 //IL_0017: Unknown result type (might be due to invalid IL or missing references)
11985 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
11986 target.GetComponentsInChildren<Component>(true, _componentCache);
11987 List<Component> val = new List<Component>();
11988 Enumerator<Component> enumerator = _componentCache.GetEnumerator();
11989 try
11990 {
11991 while (enumerator.MoveNext())
11992 {
11993 Component current = enumerator.Current;
11994 if (IsIllegalComponent(current, whitelist, excludeEditorOnly))
11995 {
11996 val.Add(current);
11997 }
11998 }
11999 }
12000 finally
12001 {
12002 ((IDisposable)enumerator).Dispose();
12003 }
12004 _componentCache.Clear();
12005 return val;
12006 }
12007
12008 [MethodImpl(256)]
12009 private static bool IsIllegalComponent(Component component, HashSet<Type> whitelist, bool excludeEditorOnly = false)
12010 {
12011 if ((Object)(object)component == (Object)null)
12012 {
12013 return false;
12014 }
12015 if (whitelist.Contains(((Object)component).GetType()))
12016 {
12017 return false;
12018 }
12019 if (excludeEditorOnly && IsEditorOnly(component))
12020 {
12021 return false;
12022 }
12023 return true;
12024 }
12025
12026 private static bool IsEditorOnly(Component component)
12027 {
12028 if (component is IEditorOnly)
12029 {
12030 return true;
12031 }
12032 if (component.CompareTag(_EDITOR_ONLY_TAG))
12033 {
12034 return true;
12035 }
12036 Transform[] componentsInParent = ((Component)component.transform).GetComponentsInParent<Transform>(true);
12037 for (int i = 0; i < componentsInParent.Length; i++)
12038 {
12039 if (((Component)componentsInParent[i]).CompareTag(_EDITOR_ONLY_TAG))
12040 {
12041 return true;
12042 }
12043 }
12044 return false;
12045 }
12046
12047 public static List<T> GetComponentsInChildrenExcludingEditorOnly<T>(this GameObject target, bool includeInactive) where T : Component
12048 {
12049 List<T> val = new List<T>();
12050 T[] componentsInChildren = target.GetComponentsInChildren<T>(includeInactive);
12051 foreach (T val2 in componentsInChildren)
12052 {
12053 if (!((Object)(object)val2 == (Object)null) && !IsEditorOnly((Component)(object)val2))
12054 {
12055 val.Add(val2);
12056 }
12057 }
12058 return val;
12059 }
12060
12061 public static List<Component> GetComponentsInChildrenExcludingEditorOnly(this GameObject target, Type type, bool includeInactive)
12062 {
12063 List<Component> val = new List<Component>();
12064 Component[] componentsInChildren = target.GetComponentsInChildren(type, includeInactive);
12065 foreach (Component val2 in componentsInChildren)
12066 {
12067 if (!((Object)(object)val2 == (Object)null) && !IsEditorOnly(val2))
12068 {
12069 val.Add(val2);
12070 }
12071 }
12072 return val;
12073 }
12074
12075 public static bool GetCachedWhitelistedTypes(string whitelistName, out HashSet<Type> whitelist)
12076 {
12077 return _whitelistCache.TryGetValue(whitelistName, ref whitelist);
12078 }
12079
12080 public static HashSet<Type> WhitelistedTypes(string whitelistName, IEnumerable<string> componentTypeWhitelist)
12081 {
12082 HashSet<Type> result = default(HashSet<Type>);
12083 if (_whitelistCache.TryGetValue(whitelistName, ref result))
12084 {
12085 return result;
12086 }
12087 Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
12088 HashSet<Type> val = new HashSet<Type>();
12089 IEnumerator<string> enumerator = componentTypeWhitelist.GetEnumerator();
12090 try
12091 {
12092 while (((IEnumerator)enumerator).MoveNext())
12093 {
12094 Type typeFromName = TypeUtils.GetTypeFromName(enumerator.Current, assemblies);
12095 if (!(typeFromName == (Type)null) && !val.Contains(typeFromName))
12096 {
12097 val.Add(typeFromName);
12098 }
12099 }
12100 }
12101 finally
12102 {
12103 if (enumerator != null)
12104 {
12105 ((IDisposable)enumerator).Dispose();
12106 }
12107 }
12108 AddDerivedClasses(val);
12109 _whitelistCache[whitelistName] = val;
12110 return _whitelistCache[whitelistName];
12111 }
12112
12113 public static HashSet<Type> WhitelistedTypes(string whitelistName, IEnumerable<Type> componentTypeWhitelist)
12114 {
12115 if (_whitelistCache.ContainsKey(whitelistName))
12116 {
12117 return _whitelistCache[whitelistName];
12118 }
12119 HashSet<Type> val = new HashSet<Type>();
12120 val.UnionWith(componentTypeWhitelist);
12121 AddDerivedClasses(val);
12122 _whitelistCache[whitelistName] = val;
12123 return _whitelistCache[whitelistName];
12124 }
12125
12126 private static void AddDerivedClasses(HashSet<Type> whitelist)
12127 {
12128 Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
12129 for (int i = 0; i < assemblies.Length; i++)
12130 {
12131 Type[] types = assemblies[i].GetTypes();
12132 foreach (Type val in types)
12133 {
12134 if (whitelist.Contains(val) || !typeof(Component).IsAssignableFrom(val))
12135 {
12136 continue;
12137 }
12138 Type val2 = val;
12139 while (val2 != typeof(Object) && val2 != (Type)null)
12140 {
12141 if (whitelist.Contains(val2))
12142 {
12143 whitelist.Add(val);
12144 break;
12145 }
12146 val2 = val2.BaseType;
12147 }
12148 }
12149 }
12150 }
12151
12152 private static void RemoveDependencies(Component rootComponent, bool allowRemovingAssets = true)
12153 {
12154 //IL_0098: Unknown result type (might be due to invalid IL or missing references)
12155 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
12156 //IL_007e: Unknown result type (might be due to invalid IL or missing references)
12157 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
12158 //IL_008c: Unknown result type (might be due to invalid IL or missing references)
12159 if ((Object)(object)rootComponent == (Object)null)
12160 {
12161 return;
12162 }
12163 Component[] components = rootComponent.GetComponents<Component>();
12164 if (components == null || components.Length == 0)
12165 {
12166 return;
12167 }
12168 Type compType = ((Object)rootComponent).GetType();
12169 Component[] array = components;
12170 ImmutableArray<RequireComponent> val2 = default(ImmutableArray<RequireComponent>);
12171 foreach (Component val in array)
12172 {
12173 if ((Object)(object)val == (Object)null || (Object)(object)val == (Object)(object)rootComponent)
12174 {
12175 continue;
12176 }
12177 Type type = ((Object)val).GetType();
12178 if (!_requireComponentsCache.TryGetValue(type, ref val2))
12179 {
12180 val2 = ImmutableArray.ToImmutableArray<RequireComponent>(Enumerable.Cast<RequireComponent>((IEnumerable)(object)((MemberInfo)type).GetCustomAttributes(typeof(RequireComponent), true)));
12181 _requireComponentsCache.Add(type, val2);
12182 }
12183 bool flag = false;
12184 Enumerator<RequireComponent> enumerator = val2.GetEnumerator();
12185 while (enumerator.MoveNext())
12186 {
12187 RequireComponent current = enumerator.Current;
12188 if (current != null)
12189 {
12190 flag |= needsDeletion(current.m_Type0);
12191 flag |= flag || needsDeletion(current.m_Type1);
12192 flag |= flag || needsDeletion(current.m_Type2);
12193 if (flag)
12194 {
12195 break;
12196 }
12197 }
12198 }
12199 if (flag)
12200 {
12201 RemoveComponent(val, allowRemovingAssets);
12202 }
12203 }
12204 [CompilerGenerated]
12205 bool needsDeletion(Type reqType)
12206 {
12207 if (reqType == (Type)null)
12208 {
12209 return false;
12210 }
12211 if (!reqType.IsAssignableFrom(compType))
12212 {
12213 return false;
12214 }
12215 return true;
12216 }
12217 }
12218
12219 public static void RemoveComponent(Component comp, bool allowRemovingAssets = true)
12220 {
12221 if (!((Object)(object)comp == (Object)null))
12222 {
12223 RemoveDependencies(comp, allowRemovingAssets);
12224 Object.DestroyImmediate((Object)(object)comp, allowRemovingAssets);
12225 }
12226 }
12227
12228 public static void RemoveComponentsOfType<T>(GameObject target, bool allowRemovingAssets = true) where T : Component
12229 {
12230 if ((Object)(object)target == (Object)null)
12231 {
12232 return;
12233 }
12234 T[] componentsInChildren = target.GetComponentsInChildren<T>(true);
12235 foreach (T val in componentsInChildren)
12236 {
12237 if (!((Object)(object)val == (Object)null))
12238 {
12239 RemoveComponent((Component)(object)val, allowRemovingAssets);
12240 }
12241 }
12242 }
12243
12244 public static IEnumerable<Shader> FindIllegalShaders(GameObject target, string[] whitelist)
12245 {
12246 <>c__DisplayClass17_0 CS$<>8__locals0 = new <>c__DisplayClass17_0();
12247 CS$<>8__locals0.illegalShaders = new List<Shader>();
12248 IEnumerator val = FindIllegalShadersEnumerator(target, whitelist, delegate(Shader c)
12249 {
12250 CS$<>8__locals0.illegalShaders.Add(c);
12251 });
12252 while (val.MoveNext())
12253 {
12254 }
12255 return (IEnumerable<Shader>)(object)CS$<>8__locals0.illegalShaders;
12256 }
12257
12258 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
12259 private static IEnumerator FindIllegalShadersEnumerator(GameObject target, string[] whitelist, Action<Shader> onFound, bool useWatch = false)
12260 {
12261 Stopwatch watch = new Stopwatch();
12262 if (useWatch)
12263 {
12264 watch.Start();
12265 }
12266 List<Material> materialCache = new List<Material>();
12267 Queue<GameObject> children = new Queue<GameObject>();
12268 children.Enqueue(target.gameObject);
12269 while (children.Count > 0)
12270 {
12271 GameObject val = children.Dequeue();
12272 if ((Object)(object)val == (Object)null)
12273 {
12274 continue;
12275 }
12276 for (int i = 0; i < val.transform.childCount; i++)
12277 {
12278 children.Enqueue(((Component)val.transform.GetChild(i)).gameObject);
12279 }
12280 Renderer[] components = ((Component)val.transform).GetComponents<Renderer>();
12281 foreach (Renderer val2 in components)
12282 {
12283 if ((Object)(object)val2 == (Object)null)
12284 {
12285 continue;
12286 }
12287 Material[] sharedMaterials = val2.sharedMaterials;
12288 for (int k = 0; k < sharedMaterials.Length; k++)
12289 {
12290 <>c__DisplayClass18_0 CS$<>8__locals0 = new <>c__DisplayClass18_0
12291 {
12292 sharedMaterial = sharedMaterials[k]
12293 };
12294 if (!Enumerable.Any<Material>((IEnumerable<Material>)(object)materialCache, (Func<Material, bool>)((Material cacheMtl) => (Object)(object)CS$<>8__locals0.sharedMaterial == (Object)(object)cacheMtl)) && !((Object)(object)CS$<>8__locals0.sharedMaterial == (Object)null) && !((Object)(object)CS$<>8__locals0.sharedMaterial.shader == (Object)null))
12295 {
12296 if (Enumerable.All<string>((IEnumerable<string>)(object)whitelist, (Func<string, bool>)((string okayShaderName) => ((Object)CS$<>8__locals0.sharedMaterial.shader).name != okayShaderName)))
12297 {
12298 onFound.Invoke(CS$<>8__locals0.sharedMaterial.shader);
12299 yield return null;
12300 }
12301 materialCache.Add(CS$<>8__locals0.sharedMaterial);
12302 }
12303 }
12304 if (useWatch && watch.ElapsedMilliseconds > 1)
12305 {
12306 yield return null;
12307 watch.Reset();
12308 }
12309 }
12310 }
12311 }
12312 }
12313}
12315{
12316 public static class AvatarPerformance : Object
12317 {
12318 [PublicAPI]
12319 public delegate bool IgnoreDelegate(Component component);
12320
12321 [PublicAPI]
12322 public delegate void FilterBlockCallback();
12323
12324 [CompilerGenerated]
12325 private sealed class <>c__DisplayClass11_0 : Object
12326 {
12327 public bool avatarBlocked;
12328
12329 internal void <ApplyPerformanceFiltersEnumerator>b__0()
12330 {
12331 avatarBlocked = true;
12332 }
12333 }
12334
12335 [PublicAPI]
12336 public static readonly PerformanceRating AvatarPerformanceRatingMinimumToDisplayDefault = (Application.isMobilePlatform ? PerformanceRating.Medium : PerformanceRating.VeryPoor);
12337
12338 [PublicAPI]
12340
12341 [PublicAPI]
12342 public static readonly PerformanceRating AvatarPerformanceRatingMinimumToDisplayMax = (Application.isMobilePlatform ? PerformanceRating.Poor : PerformanceRating.VeryPoor);
12343
12344 [PublicAPI]
12345 [field: CompilerGenerated]
12347 {
12348 [CompilerGenerated]
12349 get;
12350 [CompilerGenerated]
12351 set;
12352 }
12353
12354 [PublicAPI]
12355 public static void CalculatePerformanceStats(string avatarName, GameObject avatarObject, AvatarPerformanceStats perfStats, bool mobilePlatform)
12356 {
12357 perfStats.Reset();
12358 perfStats.avatarName = avatarName;
12359 GetPerformanceScannerSet(mobilePlatform)?.RunPerformanceScan(avatarObject, perfStats, ShouldIgnoreComponentInternal);
12360 perfStats.CalculateAllPerformanceRatings(mobilePlatform);
12361 }
12362
12363 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
12364 [PublicAPI]
12365 public static IEnumerator CalculatePerformanceStatsEnumerator(string avatarName, GameObject avatarObject, AvatarPerformanceStats perfStats, bool mobilePlatform)
12366 {
12367 perfStats.Reset();
12368 perfStats.avatarName = avatarName;
12369 PerformanceScannerSet performanceScannerSet = GetPerformanceScannerSet(mobilePlatform);
12370 if (performanceScannerSet != null)
12371 {
12372 yield return performanceScannerSet.RunPerformanceScanEnumerator(avatarObject, perfStats, ShouldIgnoreComponentInternal);
12373 }
12374 perfStats.CalculateAllPerformanceRatings(mobilePlatform);
12375 }
12376
12377 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
12378 [PublicAPI]
12379 public static IEnumerator ApplyPerformanceFiltersEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, PerformanceRating minPerfRating, FilterBlockCallback onBlock, bool mobilePlatform, bool userForcedShow)
12380 {
12381 <>c__DisplayClass11_0 CS$<>8__locals0 = new <>c__DisplayClass11_0();
12382 if ((!mobilePlatform && userForcedShow) || minPerfRating == PerformanceRating.None)
12383 {
12384 yield break;
12385 }
12386 PerformanceFilterSet performanceFilterSet = GetPerformanceFilterSet(mobilePlatform);
12387 if (!((Object)(object)performanceFilterSet == (Object)null))
12388 {
12389 CS$<>8__locals0.avatarBlocked = false;
12390 yield return performanceFilterSet.ApplyPerformanceFilters(avatarObject, perfStats, minPerfRating, ShouldIgnoreComponentInternal, delegate
12391 {
12392 CS$<>8__locals0.avatarBlocked = true;
12393 }, userForcedShow);
12394 if (CS$<>8__locals0.avatarBlocked)
12395 {
12396 onBlock();
12397 }
12398 }
12399 }
12400
12401 [PublicAPI]
12402 private static PerformanceScannerSet GetPerformanceScannerSet(bool mobilePlatform)
12403 {
12404 PerformanceScannerSet performanceScannerSet = new PerformanceScannerSet();
12405 if (mobilePlatform)
12406 {
12407 performanceScannerSet.InitForPlatform(PerformancePlatform.Android);
12408 }
12409 else
12410 {
12411 performanceScannerSet.InitForPlatform(PerformancePlatform.Windows);
12412 }
12413 return performanceScannerSet;
12414 }
12415
12416 [PublicAPI]
12417 private static PerformanceFilterSet GetPerformanceFilterSet(bool mobilePlatform)
12418 {
12419 if (!mobilePlatform)
12420 {
12421 return Resources.Load<PerformanceFilterSet>("Validation/Performance/FilterSets/PerformanceFilterSet_Windows");
12422 }
12423 return Resources.Load<PerformanceFilterSet>("Validation/Performance/FilterSets/PerformanceFilterSet_Quest");
12424 }
12425
12426 private static bool IsEditorOnly(Component component)
12427 {
12428 if (component.CompareTag("EditorOnly"))
12429 {
12430 return true;
12431 }
12432 Transform[] componentsInParent = ((Component)component.transform).GetComponentsInParent<Transform>(true);
12433 for (int i = 0; i < componentsInParent.Length; i++)
12434 {
12435 if (((Component)componentsInParent[i]).CompareTag("EditorOnly"))
12436 {
12437 return true;
12438 }
12439 }
12440 return false;
12441 }
12442
12443 [PublicAPI]
12444 private static bool ShouldIgnoreComponentInternal(Component component)
12445 {
12446 if (Application.isEditor)
12447 {
12448 if ((Object)(object)component == (Object)null)
12449 {
12450 return false;
12451 }
12452 if (IsEditorOnly(component))
12453 {
12454 return true;
12455 }
12456 }
12457 if (ShouldIgnoreComponent != null)
12458 {
12459 return ShouldIgnoreComponent(component);
12460 }
12461 return false;
12462 }
12463 }
12464 public enum AvatarPerformanceCategory : Enum
12465 {
12466 None,
12467 Overall,
12468 DownloadSize,
12469 UncompressedSize,
12470 PolyCount,
12471 AABB,
12472 SkinnedMeshCount,
12473 MeshCount,
12474 MaterialCount,
12475 PhysBoneComponentCount,
12476 PhysBoneTransformCount,
12477 PhysBoneColliderCount,
12478 PhysBoneCollisionCheckCount,
12479 ContactCount,
12480 AnimatorCount,
12481 BoneCount,
12482 LightCount,
12483 ParticleSystemCount,
12484 ParticleTotalCount,
12485 ParticleMaxMeshPolyCount,
12486 ParticleTrailsEnabled,
12487 ParticleCollisionEnabled,
12488 TrailRendererCount,
12489 LineRendererCount,
12490 ClothCount,
12491 ClothMaxVertices,
12492 PhysicsColliderCount,
12493 PhysicsRigidbodyCount,
12494 AudioSourceCount,
12495 TextureMegabytes,
12496 ConstraintsCount,
12497 ConstraintDepth,
12498 AvatarPerformanceCategoryCount
12499 }
12500 public interface IVRCConstraint
12501 {
12503 }
12504 public static class MeshUtils : Object
12505 {
12506 private const uint INDICES_PER_TRIANGLE = 3u;
12507
12508 public static uint GetMeshTriangleCount(Mesh sourceMesh)
12509 {
12510 if ((Object)(object)sourceMesh == (Object)null)
12511 {
12512 return 0u;
12513 }
12514 if (!sourceMesh.isReadable)
12515 {
12516 return 4294967295u;
12517 }
12518 uint num = 0u;
12519 for (int i = 0; i < sourceMesh.subMeshCount; i++)
12520 {
12521 uint indexCount = sourceMesh.GetIndexCount(i);
12522 num += indexCount / 3;
12523 }
12524 return num;
12525 }
12526 }
12527 public class PerformanceFilterSet : ScriptableObject
12528 {
12529 [CompilerGenerated]
12530 private sealed class <>c__DisplayClass1_0 : Object
12531 {
12532 public bool avatarBlocked;
12533
12534 internal void <ApplyPerformanceFilters>b__0()
12535 {
12536 avatarBlocked = true;
12537 }
12538 }
12539
12541
12542 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
12543 public IEnumerator ApplyPerformanceFilters(GameObject avatarObject, AvatarPerformanceStats perfStats, PerformanceRating ratingLimit, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent, AvatarPerformance.FilterBlockCallback onBlock, bool userForcedShow)
12544 {
12546 foreach (AbstractPerformanceFilter abstractPerformanceFilter in array)
12547 {
12548 <>c__DisplayClass1_0 CS$<>8__locals0 = new <>c__DisplayClass1_0();
12549 if (!((Object)(object)abstractPerformanceFilter == (Object)null))
12550 {
12551 CS$<>8__locals0.avatarBlocked = false;
12552 yield return abstractPerformanceFilter.ApplyPerformanceFilter(avatarObject, perfStats, ratingLimit, shouldIgnoreComponent, delegate
12553 {
12554 CS$<>8__locals0.avatarBlocked = true;
12555 }, userForcedShow);
12556 if (CS$<>8__locals0.avatarBlocked)
12557 {
12558 onBlock();
12559 break;
12560 }
12561 }
12562 }
12563 }
12564 }
12566 {
12567 None,
12568 Verbose,
12569 Info,
12570 Warning,
12571 Error
12572 }
12573 public enum PerformanceRating : Enum
12574 {
12575 None,
12576 Excellent,
12577 Good,
12578 Medium,
12579 Poor,
12580 VeryPoor
12581 }
12582 public enum PerformancePlatform : Enum
12583 {
12584 Windows,
12585 Android
12586 }
12587 public class PerformanceScannerSet : Object
12588 {
12589 public List<AbstractPerformanceScanner> performanceScanners = new List<AbstractPerformanceScanner>();
12590
12592 {
12593 performanceScanners.Clear();
12594 IEnumerator<PerformanceScannerAttribute> enumerator = TypeUtils.FindAssemblyAttributes<PerformanceScannerAttribute>().GetEnumerator();
12595 try
12596 {
12597 while (((IEnumerator)enumerator).MoveNext())
12598 {
12599 PerformanceScannerAttribute current = enumerator.Current;
12600 if (current != null && current.type != (Type)null && Activator.CreateInstance(current.type) is AbstractPerformanceScanner abstractPerformanceScanner && abstractPerformanceScanner.EnabledOnPlatform(platform))
12601 {
12602 performanceScanners.Add(abstractPerformanceScanner);
12603 }
12604 }
12605 }
12606 finally
12607 {
12608 if (enumerator != null)
12609 {
12610 ((IDisposable)enumerator).Dispose();
12611 }
12612 }
12613 }
12614
12615 public void RunPerformanceScan(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
12616 {
12617 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
12618 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
12619 Enumerator<AbstractPerformanceScanner> enumerator = performanceScanners.GetEnumerator();
12620 try
12621 {
12622 while (enumerator.MoveNext())
12623 {
12624 enumerator.Current?.RunPerformanceScan(avatarObject, perfStats, shouldIgnoreComponent);
12625 }
12626 }
12627 finally
12628 {
12629 ((IDisposable)enumerator).Dispose();
12630 }
12631 }
12632
12633 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
12634 public IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
12635 {
12636 Enumerator<AbstractPerformanceScanner> enumerator = performanceScanners.GetEnumerator();
12637 try
12638 {
12639 while (enumerator.MoveNext())
12640 {
12641 AbstractPerformanceScanner current = enumerator.Current;
12642 if (current != null)
12643 {
12644 yield return current.RunPerformanceScanEnumerator(avatarObject, perfStats, shouldIgnoreComponent);
12645 }
12646 }
12647 }
12648 finally
12649 {
12650 ((IDisposable)enumerator).Dispose();
12651 }
12652 }
12653 }
12654}
12656{
12657 [PublicAPI]
12658 public class AvatarPerformanceStats : Object
12659 {
12661
12662 [Serializable]
12663 public struct PhysBoneStats : ValueType
12664 {
12665 public int componentCount;
12666
12667 public int transformCount;
12668
12669 public int colliderCount;
12670
12672 }
12673
12674 public readonly struct Snapshot : ValueType
12675 {
12676 public readonly string avatarName;
12677
12678 public readonly Nullable<int> polyCount;
12679
12680 public readonly Nullable<Bounds> aabb;
12681
12682 public readonly Nullable<int> skinnedMeshCount;
12683
12684 public readonly Nullable<int> meshCount;
12685
12686 public readonly Nullable<int> materialCount;
12687
12688 public readonly Nullable<int> animatorCount;
12689
12690 public readonly Nullable<int> boneCount;
12691
12692 public readonly Nullable<int> lightCount;
12693
12694 public readonly Nullable<int> particleSystemCount;
12695
12696 public readonly Nullable<int> particleTotalCount;
12697
12698 public readonly Nullable<int> particleMaxMeshPolyCount;
12699
12700 public readonly Nullable<bool> particleTrailsEnabled;
12701
12702 public readonly Nullable<bool> particleCollisionEnabled;
12703
12704 public readonly Nullable<int> trailRendererCount;
12705
12706 public readonly Nullable<int> lineRendererCount;
12707
12708 public readonly Nullable<PhysBoneStats> physBone;
12709
12710 public readonly Nullable<int> contactCount;
12711
12712 public readonly Nullable<int> contactCompleteCount;
12713
12714 public readonly Nullable<int> clothCount;
12715
12716 public readonly Nullable<int> clothMaxVertices;
12717
12718 public readonly Nullable<int> physicsColliderCount;
12719
12720 public readonly Nullable<int> physicsRigidbodyCount;
12721
12722 public readonly Nullable<int> audioSourceCount;
12723
12724 public readonly Nullable<float> textureMegabytes;
12725
12726 public readonly Nullable<int> downloadSizeBytes;
12727
12728 public readonly Nullable<int> uncompressedSizeBytes;
12729
12730 public readonly Nullable<int> constraintsCount;
12731
12732 public readonly Nullable<int> constraintDepth;
12733
12735
12737
12739
12741
12743
12745
12747
12749
12751
12753
12755
12757
12759
12761
12763
12765
12767
12769
12771
12773
12775
12777
12779
12781
12783
12785
12787
12789
12791
12793
12794 [Obsolete("Use downloadSizeBytes instead")]
12795 public Nullable<float> downloadSize
12796 {
12797 get
12798 {
12799 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
12800 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
12801 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
12802 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
12803 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
12804 Nullable<int> val = downloadSizeBytes;
12805 if (!val.HasValue)
12806 {
12807 return default(Nullable<float>);
12808 }
12809 return new Nullable<float>((float)val.GetValueOrDefault() / 1048576f);
12810 }
12811 }
12812
12813 [Obsolete("Use uncompressedSizeBytes instead")]
12814 public Nullable<float> uncompressedSize
12815 {
12816 get
12817 {
12818 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
12819 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
12820 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
12821 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
12822 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
12823 Nullable<int> val = uncompressedSizeBytes;
12824 if (!val.HasValue)
12825 {
12826 return default(Nullable<float>);
12827 }
12828 return new Nullable<float>((float)val.GetValueOrDefault() / 1048576f);
12829 }
12830 }
12831
12832 public Snapshot(AvatarPerformanceStats avatarPerformanceStats)
12833 {
12834 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
12835 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
12836 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
12837 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
12838 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
12839 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
12840 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
12841 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
12842 //IL_003e: Unknown result type (might be due to invalid IL or missing references)
12843 //IL_0043: Unknown result type (might be due to invalid IL or missing references)
12844 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
12845 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
12846 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
12847 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
12848 //IL_0062: Unknown result type (might be due to invalid IL or missing references)
12849 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
12850 //IL_006e: Unknown result type (might be due to invalid IL or missing references)
12851 //IL_0073: Unknown result type (might be due to invalid IL or missing references)
12852 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
12853 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
12854 //IL_0086: Unknown result type (might be due to invalid IL or missing references)
12855 //IL_008b: Unknown result type (might be due to invalid IL or missing references)
12856 //IL_0092: Unknown result type (might be due to invalid IL or missing references)
12857 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
12858 //IL_009e: Unknown result type (might be due to invalid IL or missing references)
12859 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
12860 //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
12861 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
12862 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
12863 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
12864 //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
12865 //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
12866 //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
12867 //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
12868 //IL_00da: Unknown result type (might be due to invalid IL or missing references)
12869 //IL_00df: Unknown result type (might be due to invalid IL or missing references)
12870 //IL_00e6: Unknown result type (might be due to invalid IL or missing references)
12871 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
12872 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
12873 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
12874 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
12875 //IL_0103: Unknown result type (might be due to invalid IL or missing references)
12876 //IL_010a: Unknown result type (might be due to invalid IL or missing references)
12877 //IL_010f: Unknown result type (might be due to invalid IL or missing references)
12878 //IL_0116: Unknown result type (might be due to invalid IL or missing references)
12879 //IL_011b: Unknown result type (might be due to invalid IL or missing references)
12880 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
12881 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
12882 //IL_012e: Unknown result type (might be due to invalid IL or missing references)
12883 //IL_0133: Unknown result type (might be due to invalid IL or missing references)
12884 //IL_013a: Unknown result type (might be due to invalid IL or missing references)
12885 //IL_013f: Unknown result type (might be due to invalid IL or missing references)
12886 //IL_0146: Unknown result type (might be due to invalid IL or missing references)
12887 //IL_014b: Unknown result type (might be due to invalid IL or missing references)
12888 //IL_0152: Unknown result type (might be due to invalid IL or missing references)
12889 //IL_0157: Unknown result type (might be due to invalid IL or missing references)
12890 avatarName = avatarPerformanceStats.avatarName;
12891 polyCount = avatarPerformanceStats.polyCount;
12892 aabb = avatarPerformanceStats.aabb;
12893 skinnedMeshCount = avatarPerformanceStats.skinnedMeshCount;
12894 meshCount = avatarPerformanceStats.meshCount;
12895 materialCount = avatarPerformanceStats.materialCount;
12896 animatorCount = avatarPerformanceStats.animatorCount;
12897 boneCount = avatarPerformanceStats.boneCount;
12898 lightCount = avatarPerformanceStats.lightCount;
12899 particleSystemCount = avatarPerformanceStats.particleSystemCount;
12900 particleTotalCount = avatarPerformanceStats.particleTotalCount;
12901 particleMaxMeshPolyCount = avatarPerformanceStats.particleMaxMeshPolyCount;
12902 particleTrailsEnabled = avatarPerformanceStats.particleTrailsEnabled;
12903 particleCollisionEnabled = avatarPerformanceStats.particleCollisionEnabled;
12904 trailRendererCount = avatarPerformanceStats.trailRendererCount;
12905 lineRendererCount = avatarPerformanceStats.lineRendererCount;
12906 physBone = avatarPerformanceStats.physBone;
12907 contactCount = avatarPerformanceStats.contactCount;
12908 contactCompleteCount = avatarPerformanceStats.contactCompleteCount;
12909 clothCount = avatarPerformanceStats.clothCount;
12910 clothMaxVertices = avatarPerformanceStats.clothMaxVertices;
12911 physicsColliderCount = avatarPerformanceStats.physicsColliderCount;
12912 physicsRigidbodyCount = avatarPerformanceStats.physicsRigidbodyCount;
12913 audioSourceCount = avatarPerformanceStats.audioSourceCount;
12914 textureMegabytes = avatarPerformanceStats.textureMegabytes;
12915 downloadSizeBytes = avatarPerformanceStats.downloadSizeBytes;
12916 uncompressedSizeBytes = avatarPerformanceStats.uncompressedSizeBytes;
12917 constraintsCount = avatarPerformanceStats.constraintsCount;
12918 constraintDepth = avatarPerformanceStats.constraintDepth;
12922 skinnedMeshCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.SkinnedMeshCount);
12928 particleSystemCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.ParticleSystemCount);
12929 particleTotalCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.ParticleTotalCount);
12930 particleMaxMeshPolyCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.ParticleMaxMeshPolyCount);
12931 particleTrailsEnabledRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.ParticleTrailsEnabled);
12932 particleCollisionEnabledRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.ParticleCollisionEnabled);
12933 trailRendererCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.TrailRendererCount);
12934 lineRendererCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.LineRendererCount);
12935 physBoneComponentCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.PhysBoneComponentCount);
12936 physBoneTransformCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.PhysBoneTransformCount);
12937 physBoneColliderCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.PhysBoneColliderCount);
12938 physBoneCollisionCheckCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.PhysBoneCollisionCheckCount);
12941 clothMaxVerticesRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.ClothMaxVertices);
12942 physicsColliderCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.PhysicsColliderCount);
12943 physicsRigidbodyCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.PhysicsRigidbodyCount);
12944 audioSourceCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.AudioSourceCount);
12945 textureMegabytesRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.TextureMegabytes);
12947 uncompressedSizeRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.UncompressedSize);
12948 constraintsCountRating = avatarPerformanceStats.GetPerformanceRatingForCategory(AvatarPerformanceCategory.ConstraintsCount);
12949 }
12950
12951 public override string ToString()
12952 {
12953 //IL_0005: Unknown result type (might be due to invalid IL or missing references)
12954 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
12955 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
12956 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
12957 //IL_003a: Unknown result type (might be due to invalid IL or missing references)
12958 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
12959 //IL_0051: Unknown result type (might be due to invalid IL or missing references)
12960 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
12961 //IL_006a: Unknown result type (might be due to invalid IL or missing references)
12962 //IL_0071: Unknown result type (might be due to invalid IL or missing references)
12963 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
12964 //IL_0088: Unknown result type (might be due to invalid IL or missing references)
12965 //IL_0098: Unknown result type (might be due to invalid IL or missing references)
12966 //IL_009f: Unknown result type (might be due to invalid IL or missing references)
12967 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
12968 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
12969 //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
12970 //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
12971 //IL_00dd: Unknown result type (might be due to invalid IL or missing references)
12972 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
12973 //IL_00f4: Unknown result type (might be due to invalid IL or missing references)
12974 //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
12975 //IL_010b: Unknown result type (might be due to invalid IL or missing references)
12976 //IL_0112: Unknown result type (might be due to invalid IL or missing references)
12977 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
12978 //IL_0129: Unknown result type (might be due to invalid IL or missing references)
12979 //IL_0139: Unknown result type (might be due to invalid IL or missing references)
12980 //IL_0140: Unknown result type (might be due to invalid IL or missing references)
12981 //IL_0150: Unknown result type (might be due to invalid IL or missing references)
12982 //IL_0157: Unknown result type (might be due to invalid IL or missing references)
12983 //IL_0167: Unknown result type (might be due to invalid IL or missing references)
12984 //IL_016e: Unknown result type (might be due to invalid IL or missing references)
12985 //IL_017e: Unknown result type (might be due to invalid IL or missing references)
12986 //IL_0185: Unknown result type (might be due to invalid IL or missing references)
12987 //IL_0195: Unknown result type (might be due to invalid IL or missing references)
12988 //IL_01bf: Unknown result type (might be due to invalid IL or missing references)
12989 //IL_01ac: Unknown result type (might be due to invalid IL or missing references)
12990 //IL_01b2: Unknown result type (might be due to invalid IL or missing references)
12991 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
12992 //IL_01f9: Unknown result type (might be due to invalid IL or missing references)
12993 //IL_01e6: Unknown result type (might be due to invalid IL or missing references)
12994 //IL_01ec: Unknown result type (might be due to invalid IL or missing references)
12995 //IL_0209: Unknown result type (might be due to invalid IL or missing references)
12996 //IL_0233: Unknown result type (might be due to invalid IL or missing references)
12997 //IL_0220: Unknown result type (might be due to invalid IL or missing references)
12998 //IL_0226: Unknown result type (might be due to invalid IL or missing references)
12999 //IL_0243: Unknown result type (might be due to invalid IL or missing references)
13000 //IL_026d: Unknown result type (might be due to invalid IL or missing references)
13001 //IL_025a: Unknown result type (might be due to invalid IL or missing references)
13002 //IL_0260: Unknown result type (might be due to invalid IL or missing references)
13003 //IL_027d: Unknown result type (might be due to invalid IL or missing references)
13004 //IL_0284: Unknown result type (might be due to invalid IL or missing references)
13005 //IL_0294: Unknown result type (might be due to invalid IL or missing references)
13006 //IL_029b: Unknown result type (might be due to invalid IL or missing references)
13007 //IL_02ab: Unknown result type (might be due to invalid IL or missing references)
13008 //IL_02b2: Unknown result type (might be due to invalid IL or missing references)
13009 //IL_02c2: Unknown result type (might be due to invalid IL or missing references)
13010 //IL_02c9: Unknown result type (might be due to invalid IL or missing references)
13011 //IL_02d9: Unknown result type (might be due to invalid IL or missing references)
13012 //IL_02e0: Unknown result type (might be due to invalid IL or missing references)
13013 //IL_02f0: Unknown result type (might be due to invalid IL or missing references)
13014 //IL_02f7: Unknown result type (might be due to invalid IL or missing references)
13015 //IL_0307: Unknown result type (might be due to invalid IL or missing references)
13016 //IL_030e: Unknown result type (might be due to invalid IL or missing references)
13017 //IL_0313: Unknown result type (might be due to invalid IL or missing references)
13018 //IL_0336: Unknown result type (might be due to invalid IL or missing references)
13019 //IL_031f: Unknown result type (might be due to invalid IL or missing references)
13020 //IL_0325: Unknown result type (might be due to invalid IL or missing references)
13021 //IL_0346: Unknown result type (might be due to invalid IL or missing references)
13022 //IL_034d: Unknown result type (might be due to invalid IL or missing references)
13023 //IL_0352: Unknown result type (might be due to invalid IL or missing references)
13024 //IL_0375: Unknown result type (might be due to invalid IL or missing references)
13025 //IL_035e: Unknown result type (might be due to invalid IL or missing references)
13026 //IL_0364: Unknown result type (might be due to invalid IL or missing references)
13027 //IL_0385: Unknown result type (might be due to invalid IL or missing references)
13028 //IL_038c: Unknown result type (might be due to invalid IL or missing references)
13029 //IL_039c: Unknown result type (might be due to invalid IL or missing references)
13030 //IL_03a3: Unknown result type (might be due to invalid IL or missing references)
13031 //IL_03b3: Unknown result type (might be due to invalid IL or missing references)
13032 //IL_03ba: Unknown result type (might be due to invalid IL or missing references)
13033 StringBuilder val = new StringBuilder(1024);
13034 val.AppendFormat("Avatar Name: {0}\n", (object)avatarName);
13035 val.AppendFormat("Overall Performance: {0}\n", (object)overallRating);
13036 val.AppendFormat("Poly Count: {0}\n", (object)polyCount);
13037 val.AppendFormat("Bounds: {0}\n", (object)((Object)aabb).ToString());
13038 val.AppendFormat("Skinned Mesh Count: {0}\n", (object)skinnedMeshCount);
13039 val.AppendFormat("Mesh Count: {0}\n", (object)meshCount);
13040 val.AppendFormat("Material Count: {0}\n", (object)materialCount);
13041 val.AppendFormat("Animator Count: {0}\n", (object)animatorCount);
13042 val.AppendFormat("Bone Count: {0}\n", (object)boneCount);
13043 val.AppendFormat("Light Count: {0}\n", (object)lightCount);
13044 val.AppendFormat("Particle System Count: {0}\n", (object)particleSystemCount);
13045 val.AppendFormat("Particle Total Count: {0}\n", (object)particleTotalCount);
13046 val.AppendFormat("Particle Max Mesh Poly Count: {0}\n", (object)particleMaxMeshPolyCount);
13047 val.AppendFormat("Particle Trails Enabled: {0}\n", (object)particleTrailsEnabled);
13048 val.AppendFormat("Particle Collision Enabled: {0}\n", (object)particleCollisionEnabled);
13049 val.AppendFormat("Trail Renderer Count: {0}\n", (object)trailRendererCount);
13050 val.AppendFormat("Line Renderer Count: {0}\n", (object)lineRendererCount);
13051 ref readonly Nullable<PhysBoneStats> reference = ref physBone;
13052 val.AppendFormat("Phys Bone Component Count: {0}\n", (object)(reference.HasValue ? new Nullable<int>(reference.GetValueOrDefault().componentCount) : default(Nullable<int>)));
13053 ref readonly Nullable<PhysBoneStats> reference2 = ref physBone;
13054 val.AppendFormat("Phys Bone Transform Count: {0}\n", (object)(reference2.HasValue ? new Nullable<int>(reference2.GetValueOrDefault().transformCount) : default(Nullable<int>)));
13055 ref readonly Nullable<PhysBoneStats> reference3 = ref physBone;
13056 val.AppendFormat("Phys Bone Collider Count: {0}\n", (object)(reference3.HasValue ? new Nullable<int>(reference3.GetValueOrDefault().colliderCount) : default(Nullable<int>)));
13057 ref readonly Nullable<PhysBoneStats> reference4 = ref physBone;
13058 val.AppendFormat("Phys Bone Collision Check Count: {0}\n", (object)(reference4.HasValue ? new Nullable<int>(reference4.GetValueOrDefault().collisionCheckCount) : default(Nullable<int>)));
13059 val.AppendFormat("Non-Local Contact Count: {0}\n", (object)contactCount);
13060 val.AppendFormat("Complete Contact Count: {0}\n", (object)contactCompleteCount);
13061 val.AppendFormat("Cloth Count: {0}\n", (object)clothCount);
13062 val.AppendFormat("Cloth Max Vertices: {0}\n", (object)clothMaxVertices);
13063 val.AppendFormat("Physics Collider Count: {0}\n", (object)physicsColliderCount);
13064 val.AppendFormat("Physics Rigidbody Count: {0}\n", (object)physicsRigidbodyCount);
13065 Nullable<int> val2 = downloadSizeBytes;
13066 val.AppendFormat("Download Size: {0} MB\n", (object)(val2.HasValue ? new Nullable<float>((float)val2.GetValueOrDefault() / 1048576f) : default(Nullable<float>)));
13067 val2 = uncompressedSizeBytes;
13068 val.AppendFormat("Uncompressed Size: {0} MB\n", (object)(val2.HasValue ? new Nullable<float>((float)val2.GetValueOrDefault() / 1048576f) : default(Nullable<float>)));
13069 val.AppendFormat("Texture Size: {0} MB\n", (object)textureMegabytes);
13070 val.AppendFormat("Constraint Count: {0}\n", (object)constraintsCount);
13071 val.AppendFormat("Constraint Depth: {0}\n", (object)constraintDepth);
13072 return ((Object)val).ToString();
13073 }
13074 }
13075
13076 private const float BYTES_TO_MEGABYTES_CONVERSION_FACTOR = 1048576f;
13077
13078 public string avatarName;
13079
13080 public Nullable<int> polyCount;
13081
13082 public Nullable<Bounds> aabb;
13083
13084 public Nullable<int> skinnedMeshCount;
13085
13086 public Nullable<int> meshCount;
13087
13088 public Nullable<int> materialCount;
13089
13090 public Nullable<int> animatorCount;
13091
13092 public Nullable<int> boneCount;
13093
13094 public Nullable<int> lightCount;
13095
13096 public Nullable<int> particleSystemCount;
13097
13098 public Nullable<int> particleTotalCount;
13099
13100 public Nullable<int> particleMaxMeshPolyCount;
13101
13102 public Nullable<bool> particleTrailsEnabled;
13103
13104 public Nullable<bool> particleCollisionEnabled;
13105
13106 public Nullable<int> trailRendererCount;
13107
13108 public Nullable<int> lineRendererCount;
13109
13110 public Nullable<int> clothCount;
13111
13112 public Nullable<int> clothMaxVertices;
13113
13114 public Nullable<int> physicsColliderCount;
13115
13116 public Nullable<int> physicsRigidbodyCount;
13117
13118 public Nullable<int> audioSourceCount;
13119
13120 public Nullable<int> downloadSizeBytes;
13121
13122 public Nullable<int> uncompressedSizeBytes;
13123
13124 public Nullable<float> textureMegabytes;
13125
13126 public Nullable<PhysBoneStats> physBone;
13127
13128 public Nullable<int> contactCount;
13129
13130 public Nullable<int> contactCompleteCount;
13131
13132 public Nullable<int> constraintsCount;
13133
13134 public Nullable<int> constraintDepth;
13135
13136 private readonly PerformanceRating[] _performanceRatingCache;
13137
13138 private bool _analyticsStatsValid;
13139
13140 private List<int> _analyticsStatValues = new List<int>(_analyticsStatNames.Count);
13141
13142 private static List<string> _analyticsStatNames;
13143
13144 private static readonly ImmutableArray<AvatarPerformanceCategory> _performanceCategories;
13145
13146 private static readonly Dictionary<AvatarPerformanceCategory, string> _performanceCategoryDisplayNames;
13147
13148 private static readonly Dictionary<PerformanceRating, string> _performanceRatingDisplayNames;
13149
13150 private static AvatarPerformanceStatsLevelSet _performanceStatsLevelSet_Windows;
13151
13152 private static AvatarPerformanceStatsLevelSet _performanceStatsLevelSet_Mobile;
13153
13154 private AvatarPerformanceStatsLevelSet _performanceStatsLevelSet;
13155
13156 [Obsolete("Use downloadSizeBytes instead")]
13157 public Nullable<float> downloadSize
13158 {
13159 get
13160 {
13161 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
13162 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
13163 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
13164 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
13165 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
13166 Nullable<int> val = downloadSizeBytes;
13167 if (!val.HasValue)
13168 {
13169 return default(Nullable<float>);
13170 }
13171 return new Nullable<float>((float)val.GetValueOrDefault() / 1048576f);
13172 }
13173 }
13174
13175 [Obsolete("Use uncompressedSizeBytes instead")]
13176 public Nullable<float> uncompressedSize
13177 {
13178 get
13179 {
13180 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
13181 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
13182 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
13183 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
13184 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
13185 Nullable<int> val = uncompressedSizeBytes;
13186 if (!val.HasValue)
13187 {
13188 return default(Nullable<float>);
13189 }
13190 return new Nullable<float>((float)val.GetValueOrDefault() / 1048576f);
13191 }
13192 }
13193
13194 public bool AnalyticsStatsValid => _analyticsStatsValid;
13195
13196 public static int AnalyticsStatNamesCount => _analyticsStatNames.Count;
13197
13199 {
13200 _analyticsStatsValid = false;
13201 _analyticsStatValues.Clear();
13202 if (polyCount.HasValue && polyCount.HasValue)
13203 {
13204 _analyticsStatValues.Add(polyCount.Value);
13205 }
13206 if (skinnedMeshCount.HasValue && skinnedMeshCount.HasValue)
13207 {
13208 _analyticsStatValues.Add(skinnedMeshCount.Value);
13209 }
13210 if (meshCount.HasValue && meshCount.HasValue)
13211 {
13212 _analyticsStatValues.Add(meshCount.Value);
13213 }
13214 if (materialCount.HasValue && materialCount.HasValue)
13215 {
13216 _analyticsStatValues.Add(materialCount.Value);
13217 }
13218 if (animatorCount.HasValue && animatorCount.HasValue)
13219 {
13220 _analyticsStatValues.Add(animatorCount.Value);
13221 }
13222 if (boneCount.HasValue && boneCount.HasValue)
13223 {
13224 _analyticsStatValues.Add(boneCount.Value);
13225 }
13226 if (lightCount.HasValue && lightCount.HasValue)
13227 {
13228 _analyticsStatValues.Add(lightCount.Value);
13229 }
13230 if (particleSystemCount.HasValue && particleSystemCount.HasValue)
13231 {
13232 _analyticsStatValues.Add(particleSystemCount.Value);
13233 }
13234 if (particleTotalCount.HasValue && particleTotalCount.HasValue)
13235 {
13236 _analyticsStatValues.Add(particleTotalCount.Value);
13237 }
13238 if (particleMaxMeshPolyCount.HasValue && particleMaxMeshPolyCount.HasValue)
13239 {
13240 _analyticsStatValues.Add(particleMaxMeshPolyCount.Value);
13241 }
13242 if (trailRendererCount.HasValue && trailRendererCount.HasValue)
13243 {
13244 _analyticsStatValues.Add(trailRendererCount.Value);
13245 }
13246 if (lineRendererCount.HasValue && lineRendererCount.HasValue)
13247 {
13248 _analyticsStatValues.Add(lineRendererCount.Value);
13249 }
13250 if (clothCount.HasValue && clothCount.HasValue)
13251 {
13252 _analyticsStatValues.Add(clothCount.Value);
13253 }
13254 if (clothMaxVertices.HasValue && clothMaxVertices.HasValue)
13255 {
13256 _analyticsStatValues.Add(clothMaxVertices.Value);
13257 }
13258 if (physicsColliderCount.HasValue && physicsColliderCount.HasValue)
13259 {
13260 _analyticsStatValues.Add(physicsColliderCount.Value);
13261 }
13262 if (physicsRigidbodyCount.HasValue && physicsRigidbodyCount.HasValue)
13263 {
13264 _analyticsStatValues.Add(physicsRigidbodyCount.Value);
13265 }
13266 if (audioSourceCount.HasValue && audioSourceCount.HasValue)
13267 {
13268 _analyticsStatValues.Add(audioSourceCount.Value);
13269 }
13270 if (contactCount.HasValue && contactCount.HasValue)
13271 {
13272 _analyticsStatValues.Add(contactCount.Value);
13273 }
13274 if (constraintDepth.HasValue && constraintDepth.HasValue)
13275 {
13276 _analyticsStatValues.Add(constraintDepth.Value);
13277 }
13278 if (constraintsCount.HasValue && constraintsCount.HasValue)
13279 {
13280 _analyticsStatValues.Add(constraintsCount.Value);
13281 }
13282 if (physBone.HasValue && physBone.HasValue)
13283 {
13284 _analyticsStatValues.Add(physBone.Value.componentCount);
13285 _analyticsStatValues.Add(physBone.Value.transformCount);
13286 _analyticsStatValues.Add(physBone.Value.colliderCount);
13287 _analyticsStatValues.Add(physBone.Value.collisionCheckCount);
13288 }
13289 _analyticsStatsValid = _analyticsStatValues.Count == _analyticsStatNames.Count;
13290 }
13291
13292 public int GetAvatarAnalyticsStatValue(int index)
13293 {
13294 return _analyticsStatValues[index];
13295 }
13296
13297 public static string GetAvatarAnalyticsStatName(int index)
13298 {
13299 return _analyticsStatNames[index];
13300 }
13301
13302 [RuntimeInitializeOnLoadMethod(/*Could not decode attribute arguments.*/)]
13303 public static void Initialize()
13304 {
13305 _performanceStatsLevelSet_Windows = Resources.Load<AvatarPerformanceStatsLevelSet>("Validation/Performance/StatsLevels/Windows/AvatarPerformanceStatLevels_Windows");
13306 _performanceStatsLevelSet_Mobile = Resources.Load<AvatarPerformanceStatsLevelSet>("Validation/Performance/StatsLevels/Quest/AvatarPerformanceStatLevels_Quest");
13307 }
13308
13310 {
13311 if (isMobilePlatform)
13312 {
13313 return _performanceStatsLevelSet_Mobile;
13314 }
13315 return _performanceStatsLevelSet_Windows;
13316 }
13317
13318 [PublicAPI]
13319 public AvatarPerformanceStats(bool isMobilePlatform)
13320 {
13321 _performanceStatsLevelSet = GetAvatarPerformanceStatsLevelSet(isMobilePlatform);
13322 _performanceRatingCache = new PerformanceRating[32];
13323 }
13324
13325 [PublicAPI]
13326 public void Reset()
13327 {
13328 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
13329 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
13330 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
13331 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
13332 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
13333 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
13334 //IL_0055: Unknown result type (might be due to invalid IL or missing references)
13335 //IL_0061: Unknown result type (might be due to invalid IL or missing references)
13336 //IL_006d: Unknown result type (might be due to invalid IL or missing references)
13337 //IL_0079: Unknown result type (might be due to invalid IL or missing references)
13338 //IL_0085: Unknown result type (might be due to invalid IL or missing references)
13339 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
13340 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
13341 //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
13342 //IL_00b5: Unknown result type (might be due to invalid IL or missing references)
13343 //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
13344 //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
13345 //IL_00d9: Unknown result type (might be due to invalid IL or missing references)
13346 //IL_00e5: Unknown result type (might be due to invalid IL or missing references)
13347 //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
13348 //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
13349 //IL_0109: Unknown result type (might be due to invalid IL or missing references)
13350 //IL_0115: Unknown result type (might be due to invalid IL or missing references)
13351 //IL_0121: Unknown result type (might be due to invalid IL or missing references)
13352 //IL_012d: Unknown result type (might be due to invalid IL or missing references)
13353 //IL_0139: Unknown result type (might be due to invalid IL or missing references)
13354 //IL_0145: Unknown result type (might be due to invalid IL or missing references)
13355 //IL_0151: Unknown result type (might be due to invalid IL or missing references)
13356 avatarName = null;
13357 polyCount = default(Nullable<int>);
13358 aabb = default(Nullable<Bounds>);
13359 skinnedMeshCount = default(Nullable<int>);
13360 meshCount = default(Nullable<int>);
13361 materialCount = default(Nullable<int>);
13362 animatorCount = default(Nullable<int>);
13363 boneCount = default(Nullable<int>);
13364 lightCount = default(Nullable<int>);
13365 particleSystemCount = default(Nullable<int>);
13366 particleTotalCount = default(Nullable<int>);
13367 particleMaxMeshPolyCount = default(Nullable<int>);
13368 particleTrailsEnabled = default(Nullable<bool>);
13369 particleCollisionEnabled = default(Nullable<bool>);
13370 trailRendererCount = default(Nullable<int>);
13371 lineRendererCount = default(Nullable<int>);
13372 clothCount = default(Nullable<int>);
13373 clothMaxVertices = default(Nullable<int>);
13374 physicsColliderCount = default(Nullable<int>);
13375 physicsRigidbodyCount = default(Nullable<int>);
13376 audioSourceCount = default(Nullable<int>);
13377 downloadSizeBytes = default(Nullable<int>);
13378 uncompressedSizeBytes = default(Nullable<int>);
13379 textureMegabytes = default(Nullable<float>);
13380 physBone = default(Nullable<PhysBoneStats>);
13381 contactCount = default(Nullable<int>);
13382 contactCompleteCount = default(Nullable<int>);
13383 constraintsCount = default(Nullable<int>);
13384 constraintDepth = default(Nullable<int>);
13385 for (int i = 0; i < 32; i++)
13386 {
13387 _performanceRatingCache[i] = PerformanceRating.None;
13388 }
13389 _performanceStatsLevelSet = null;
13390 }
13391
13393 {
13394 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
13395 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
13396 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
13397 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
13398 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
13399 //IL_002b: Unknown result type (might be due to invalid IL or missing references)
13400 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
13401 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
13402 //IL_003e: Unknown result type (might be due to invalid IL or missing references)
13403 //IL_0043: Unknown result type (might be due to invalid IL or missing references)
13404 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
13405 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
13406 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
13407 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
13408 //IL_0062: Unknown result type (might be due to invalid IL or missing references)
13409 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
13410 //IL_006e: Unknown result type (might be due to invalid IL or missing references)
13411 //IL_0073: Unknown result type (might be due to invalid IL or missing references)
13412 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
13413 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
13414 //IL_0086: Unknown result type (might be due to invalid IL or missing references)
13415 //IL_008b: Unknown result type (might be due to invalid IL or missing references)
13416 //IL_0092: Unknown result type (might be due to invalid IL or missing references)
13417 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
13418 //IL_009e: Unknown result type (might be due to invalid IL or missing references)
13419 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
13420 //IL_00aa: Unknown result type (might be due to invalid IL or missing references)
13421 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
13422 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
13423 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
13424 //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
13425 //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
13426 //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
13427 //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
13428 //IL_00da: Unknown result type (might be due to invalid IL or missing references)
13429 //IL_00df: Unknown result type (might be due to invalid IL or missing references)
13430 //IL_00e6: Unknown result type (might be due to invalid IL or missing references)
13431 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
13432 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
13433 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
13434 //IL_00fe: Unknown result type (might be due to invalid IL or missing references)
13435 //IL_0103: Unknown result type (might be due to invalid IL or missing references)
13436 //IL_010a: Unknown result type (might be due to invalid IL or missing references)
13437 //IL_010f: Unknown result type (might be due to invalid IL or missing references)
13438 //IL_0116: Unknown result type (might be due to invalid IL or missing references)
13439 //IL_011b: Unknown result type (might be due to invalid IL or missing references)
13440 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
13441 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
13442 //IL_012e: Unknown result type (might be due to invalid IL or missing references)
13443 //IL_0133: Unknown result type (might be due to invalid IL or missing references)
13444 //IL_013a: Unknown result type (might be due to invalid IL or missing references)
13445 //IL_013f: Unknown result type (might be due to invalid IL or missing references)
13446 //IL_0146: Unknown result type (might be due to invalid IL or missing references)
13447 //IL_014b: Unknown result type (might be due to invalid IL or missing references)
13448 to.avatarName = avatarName;
13449 to.polyCount = polyCount;
13450 to.aabb = aabb;
13451 to.skinnedMeshCount = skinnedMeshCount;
13452 to.meshCount = meshCount;
13453 to.materialCount = materialCount;
13454 to.animatorCount = animatorCount;
13455 to.boneCount = boneCount;
13456 to.lightCount = lightCount;
13457 to.particleSystemCount = particleSystemCount;
13458 to.particleTotalCount = particleTotalCount;
13459 to.particleMaxMeshPolyCount = particleMaxMeshPolyCount;
13460 to.particleTrailsEnabled = particleTrailsEnabled;
13461 to.particleCollisionEnabled = particleCollisionEnabled;
13462 to.trailRendererCount = trailRendererCount;
13463 to.lineRendererCount = lineRendererCount;
13464 to.clothCount = clothCount;
13465 to.clothMaxVertices = clothMaxVertices;
13466 to.physicsColliderCount = physicsColliderCount;
13467 to.physicsRigidbodyCount = physicsRigidbodyCount;
13468 to.audioSourceCount = audioSourceCount;
13469 to.downloadSizeBytes = downloadSizeBytes;
13470 to.uncompressedSizeBytes = uncompressedSizeBytes;
13471 to.textureMegabytes = textureMegabytes;
13472 to.physBone = physBone;
13473 to.contactCount = contactCount;
13474 to.constraintsCount = constraintsCount;
13475 to.constraintDepth = constraintDepth;
13476 }
13477
13478 [PublicAPI]
13480 {
13481 return new Snapshot(this);
13482 }
13483
13484 [PublicAPI]
13486 {
13487 if (_performanceRatingCache[(int)perfCategory] == PerformanceRating.None)
13488 {
13489 _performanceRatingCache[(int)perfCategory] = CalculatePerformanceRatingForCategory(perfCategory);
13490 }
13491 return _performanceRatingCache[(int)perfCategory];
13492 }
13493
13494 [PublicAPI]
13495 public void CalculateAllPerformanceRatings(bool isMobilePlatform)
13496 {
13497 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
13498 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
13499 _performanceStatsLevelSet = GetAvatarPerformanceStatsLevelSet(isMobilePlatform);
13500 for (int i = 0; i < _performanceRatingCache.Length; i++)
13501 {
13502 _performanceRatingCache[i] = PerformanceRating.None;
13503 }
13504 Enumerator<AvatarPerformanceCategory> enumerator = _performanceCategories.GetEnumerator();
13505 while (enumerator.MoveNext())
13506 {
13507 AvatarPerformanceCategory current = enumerator.Current;
13508 if (current != 0 && current != AvatarPerformanceCategory.AvatarPerformanceCategoryCount && _performanceRatingCache[(int)current] == PerformanceRating.None)
13509 {
13510 _performanceRatingCache[(int)current] = CalculatePerformanceRatingForCategory(current);
13511 }
13512 }
13513 }
13514
13515 [PublicAPI]
13516 public void LoadAllPerformanceRatings(Dictionary<string, object> stats, bool isMobilePlatform)
13517 {
13518 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
13519 //IL_002e: Unknown result type (might be due to invalid IL or missing references)
13520 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
13521 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
13522 //IL_0675: Unknown result type (might be due to invalid IL or missing references)
13523 //IL_067b: Unknown result type (might be due to invalid IL or missing references)
13524 //IL_0680: Unknown result type (might be due to invalid IL or missing references)
13525 //IL_0840: Unknown result type (might be due to invalid IL or missing references)
13526 //IL_0846: Unknown result type (might be due to invalid IL or missing references)
13527 //IL_084b: Unknown result type (might be due to invalid IL or missing references)
13528 //IL_06cc: Unknown result type (might be due to invalid IL or missing references)
13529 //IL_06d2: Unknown result type (might be due to invalid IL or missing references)
13530 //IL_06d7: Unknown result type (might be due to invalid IL or missing references)
13531 //IL_0706: Unknown result type (might be due to invalid IL or missing references)
13532 //IL_070c: Unknown result type (might be due to invalid IL or missing references)
13533 //IL_0711: Unknown result type (might be due to invalid IL or missing references)
13534 //IL_073f: Unknown result type (might be due to invalid IL or missing references)
13535 //IL_0749: Expected I4, but got Unknown
13536 //IL_0744: Unknown result type (might be due to invalid IL or missing references)
13537 //IL_0749: Unknown result type (might be due to invalid IL or missing references)
13538 //IL_0651: Unknown result type (might be due to invalid IL or missing references)
13539 //IL_065e: Unknown result type (might be due to invalid IL or missing references)
13540 //IL_0663: Unknown result type (might be due to invalid IL or missing references)
13541 //IL_04d1: Unknown result type (might be due to invalid IL or missing references)
13542 //IL_04e2: Unknown result type (might be due to invalid IL or missing references)
13543 //IL_04e7: Unknown result type (might be due to invalid IL or missing references)
13544 //IL_04ec: Unknown result type (might be due to invalid IL or missing references)
13545 //IL_04f1: Unknown result type (might be due to invalid IL or missing references)
13546 //IL_0594: Unknown result type (might be due to invalid IL or missing references)
13547 //IL_059a: Unknown result type (might be due to invalid IL or missing references)
13548 //IL_059f: Unknown result type (might be due to invalid IL or missing references)
13549 //IL_0795: Unknown result type (might be due to invalid IL or missing references)
13550 //IL_079b: Unknown result type (might be due to invalid IL or missing references)
13551 //IL_07a0: Unknown result type (might be due to invalid IL or missing references)
13552 //IL_0577: Unknown result type (might be due to invalid IL or missing references)
13553 //IL_057d: Unknown result type (might be due to invalid IL or missing references)
13554 //IL_0582: Unknown result type (might be due to invalid IL or missing references)
13555 //IL_0806: Unknown result type (might be due to invalid IL or missing references)
13556 //IL_080c: Unknown result type (might be due to invalid IL or missing references)
13557 //IL_0811: Unknown result type (might be due to invalid IL or missing references)
13558 //IL_07ec: Unknown result type (might be due to invalid IL or missing references)
13559 //IL_07f2: Unknown result type (might be due to invalid IL or missing references)
13560 //IL_07f7: Unknown result type (might be due to invalid IL or missing references)
13561 //IL_085a: Unknown result type (might be due to invalid IL or missing references)
13562 //IL_0860: Unknown result type (might be due to invalid IL or missing references)
13563 //IL_0865: Unknown result type (might be due to invalid IL or missing references)
13564 //IL_0723: Unknown result type (might be due to invalid IL or missing references)
13565 //IL_072d: Expected I4, but got Unknown
13566 //IL_0728: Unknown result type (might be due to invalid IL or missing references)
13567 //IL_072d: Unknown result type (might be due to invalid IL or missing references)
13568 //IL_05be: Unknown result type (might be due to invalid IL or missing references)
13569 //IL_05cb: Unknown result type (might be due to invalid IL or missing references)
13570 //IL_05d0: Unknown result type (might be due to invalid IL or missing references)
13571 //IL_053d: Unknown result type (might be due to invalid IL or missing references)
13572 //IL_0543: Unknown result type (might be due to invalid IL or missing references)
13573 //IL_0548: Unknown result type (might be due to invalid IL or missing references)
13574 //IL_06af: Unknown result type (might be due to invalid IL or missing references)
13575 //IL_06b5: Unknown result type (might be due to invalid IL or missing references)
13576 //IL_06ba: Unknown result type (might be due to invalid IL or missing references)
13577 //IL_0503: Unknown result type (might be due to invalid IL or missing references)
13578 //IL_0509: Unknown result type (might be due to invalid IL or missing references)
13579 //IL_050e: Unknown result type (might be due to invalid IL or missing references)
13580 //IL_07cf: Unknown result type (might be due to invalid IL or missing references)
13581 //IL_07d5: Unknown result type (might be due to invalid IL or missing references)
13582 //IL_07da: Unknown result type (might be due to invalid IL or missing references)
13583 //IL_0778: Unknown result type (might be due to invalid IL or missing references)
13584 //IL_077e: Unknown result type (might be due to invalid IL or missing references)
13585 //IL_0783: Unknown result type (might be due to invalid IL or missing references)
13586 //IL_06e9: Unknown result type (might be due to invalid IL or missing references)
13587 //IL_06ef: Unknown result type (might be due to invalid IL or missing references)
13588 //IL_06f4: Unknown result type (might be due to invalid IL or missing references)
13589 //IL_07b2: Unknown result type (might be due to invalid IL or missing references)
13590 //IL_07b8: Unknown result type (might be due to invalid IL or missing references)
13591 //IL_07bd: Unknown result type (might be due to invalid IL or missing references)
13592 //IL_0692: Unknown result type (might be due to invalid IL or missing references)
13593 //IL_0698: Unknown result type (might be due to invalid IL or missing references)
13594 //IL_069d: Unknown result type (might be due to invalid IL or missing references)
13595 //IL_0620: Unknown result type (might be due to invalid IL or missing references)
13596 //IL_062d: Unknown result type (might be due to invalid IL or missing references)
13597 //IL_0632: Unknown result type (might be due to invalid IL or missing references)
13598 //IL_05ef: Unknown result type (might be due to invalid IL or missing references)
13599 //IL_05fc: Unknown result type (might be due to invalid IL or missing references)
13600 //IL_0601: Unknown result type (might be due to invalid IL or missing references)
13601 //IL_0520: Unknown result type (might be due to invalid IL or missing references)
13602 //IL_0526: Unknown result type (might be due to invalid IL or missing references)
13603 //IL_052b: Unknown result type (might be due to invalid IL or missing references)
13604 //IL_055a: Unknown result type (might be due to invalid IL or missing references)
13605 //IL_0560: Unknown result type (might be due to invalid IL or missing references)
13606 //IL_0565: Unknown result type (might be due to invalid IL or missing references)
13607 //IL_0820: Unknown result type (might be due to invalid IL or missing references)
13608 //IL_082c: Unknown result type (might be due to invalid IL or missing references)
13609 //IL_0831: Unknown result type (might be due to invalid IL or missing references)
13610 //IL_075b: Unknown result type (might be due to invalid IL or missing references)
13611 //IL_0761: Unknown result type (might be due to invalid IL or missing references)
13612 //IL_0766: Unknown result type (might be due to invalid IL or missing references)
13613 _performanceStatsLevelSet = GetAvatarPerformanceStatsLevelSet(isMobilePlatform);
13614 for (int i = 0; i < _performanceRatingCache.Length; i++)
13615 {
13616 _performanceRatingCache[i] = PerformanceRating.None;
13617 }
13618 Enumerator<string, object> enumerator = stats.GetEnumerator();
13619 try
13620 {
13621 while (enumerator.MoveNext())
13622 {
13623 KeyValuePair<string, object> current = enumerator.Current;
13624 string key = current.Key;
13625 if (key == null)
13626 {
13627 continue;
13628 }
13629 switch (key.Length)
13630 {
13631 case 13:
13632 switch (key[0])
13633 {
13634 case 't':
13635 if (key == "totalPolygons")
13636 {
13637 polyCount = new Nullable<int>((int)(Double)current.Value);
13638 }
13639 break;
13640 case 'a':
13641 if (key == "animatorCount")
13642 {
13643 animatorCount = new Nullable<int>((int)(Double)current.Value);
13644 }
13645 break;
13646 }
13647 break;
13648 case 16:
13649 switch (key[0])
13650 {
13651 case 's':
13652 if (key == "skinnedMeshCount")
13653 {
13654 skinnedMeshCount = new Nullable<int>((int)(Double)current.Value);
13655 }
13656 break;
13657 case 'p':
13658 if (key == "physicsColliders")
13659 {
13660 physicsColliderCount = new Nullable<int>((int)(Double)current.Value);
13661 }
13662 break;
13663 case 'a':
13664 if (key == "audioSourceCount")
13665 {
13666 audioSourceCount = new Nullable<int>((int)(Double)current.Value);
13667 }
13668 break;
13669 }
13670 break;
13671 case 9:
13672 switch (key[0])
13673 {
13674 case 'm':
13675 if (key == "meshCount")
13676 {
13677 meshCount = new Nullable<int>((int)(Double)current.Value);
13678 }
13679 break;
13680 case 'b':
13681 if (key == "boneCount")
13682 {
13683 boneCount = new Nullable<int>((int)(Double)current.Value);
13684 }
13685 break;
13686 }
13687 break;
13688 case 17:
13689 switch (key[5])
13690 {
13691 case 'i':
13692 if (key == "materialSlotsUsed")
13693 {
13694 materialCount = new Nullable<int>((int)(Double)current.Value);
13695 }
13696 break;
13697 case 'M':
13698 if (key == "totalMaxParticles")
13699 {
13700 particleTotalCount = new Nullable<int>((int)(Double)current.Value);
13701 }
13702 break;
13703 case 'e':
13704 if (key == "lineRendererCount")
13705 {
13706 lineRendererCount = new Nullable<int>((int)(Double)current.Value);
13707 }
13708 break;
13709 case 'T':
13710 if (key == "totalTextureUsage")
13711 {
13712 textureMegabytes = new Nullable<float>((float)(Double)current.Value / 1048576f);
13713 }
13714 break;
13715 }
13716 break;
13717 case 22:
13718 switch (key[8])
13719 {
13720 case 'C':
13721 if (key == "physBoneComponentCount")
13722 {
13723 PhysBoneStats valueOrDefault = physBone.GetValueOrDefault();
13724 valueOrDefault.componentCount = (int)(Double)current.Value;
13725 physBone = new Nullable<PhysBoneStats>(valueOrDefault);
13726 }
13727 break;
13728 case 'T':
13729 if (key == "physBoneTransformCount")
13730 {
13731 PhysBoneStats valueOrDefault = physBone.GetValueOrDefault();
13732 valueOrDefault.transformCount = (int)(Double)current.Value;
13733 physBone = new Nullable<PhysBoneStats>(valueOrDefault);
13734 }
13735 break;
13736 }
13737 break;
13738 case 21:
13739 switch (key[1])
13740 {
13741 case 'h':
13742 if (key == "physBoneColliderCount")
13743 {
13744 PhysBoneStats valueOrDefault = physBone.GetValueOrDefault();
13745 valueOrDefault.colliderCount = (int)(Double)current.Value;
13746 physBone = new Nullable<PhysBoneStats>(valueOrDefault);
13747 }
13748 break;
13749 case 'a':
13750 if (key == "particleTrailsEnabled")
13751 {
13752 particleTrailsEnabled = new Nullable<bool>((byte)(int)(Boolean)current.Value != 0);
13753 }
13754 break;
13755 }
13756 break;
13757 case 20:
13758 switch (key[3])
13759 {
13760 case 't':
13761 if (key == "contactCompleteCount")
13762 {
13763 contactCompleteCount = new Nullable<int>((int)(Double)current.Value);
13764 }
13765 break;
13766 case 's':
13767 if (key == "constraintDepthCount")
13768 {
13769 constraintDepth = new Nullable<int>((int)(Double)current.Value);
13770 }
13771 break;
13772 }
13773 break;
13774 case 10:
13775 switch (key[0])
13776 {
13777 case 'l':
13778 if (key == "lightCount")
13779 {
13780 lightCount = new Nullable<int>((int)(Double)current.Value);
13781 }
13782 break;
13783 case 'c':
13784 if (key == "clothCount")
13785 {
13786 clothCount = new Nullable<int>((int)(Double)current.Value);
13787 }
13788 break;
13789 }
13790 break;
13791 case 18:
13792 switch (key[1])
13793 {
13794 case 'r':
13795 if (key == "trailRendererCount")
13796 {
13797 trailRendererCount = new Nullable<int>((int)(Double)current.Value);
13798 }
13799 break;
13800 case 'o':
13801 if (key == "totalClothVertices")
13802 {
13803 clothMaxVertices = new Nullable<int>((int)(Double)current.Value);
13804 }
13805 break;
13806 case 'h':
13807 if (key == "physicsRigidbodies")
13808 {
13809 physicsRigidbodyCount = new Nullable<int>((int)(Double)current.Value);
13810 }
13811 break;
13812 }
13813 break;
13814 case 4:
13815 if (key == "aabb")
13816 {
13817 float[] array = Enumerable.ToArray<float>(Enumerable.Select<object, float>((IEnumerable<object>)(object)(List<object>)current.Value, (Func<object, float>)((object v) => (float)(Double)v)));
13818 aabb = new Nullable<Bounds>(new Bounds(Vector3.zero, new Vector3(array[0], array[1], array[2])));
13819 }
13820 break;
13821 case 27:
13822 if (key == "physBoneCollisionCheckCount")
13823 {
13824 PhysBoneStats valueOrDefault = physBone.GetValueOrDefault();
13825 valueOrDefault.collisionCheckCount = (int)(Double)current.Value;
13826 physBone = new Nullable<PhysBoneStats>(valueOrDefault);
13827 }
13828 break;
13829 case 12:
13830 if (key == "contactCount")
13831 {
13832 contactCount = new Nullable<int>((int)(Double)current.Value);
13833 }
13834 break;
13835 case 19:
13836 if (key == "particleSystemCount")
13837 {
13838 particleSystemCount = new Nullable<int>((int)(Double)current.Value);
13839 }
13840 break;
13841 case 23:
13842 if (key == "meshParticleMaxPolygons")
13843 {
13844 particleMaxMeshPolyCount = new Nullable<int>((int)(Double)current.Value);
13845 }
13846 break;
13847 case 24:
13848 if (key == "particleCollisionEnabled")
13849 {
13850 particleCollisionEnabled = new Nullable<bool>((byte)(int)(Boolean)current.Value != 0);
13851 }
13852 break;
13853 case 15:
13854 if (key == "constraintCount")
13855 {
13856 constraintsCount = new Nullable<int>((int)(Double)current.Value);
13857 }
13858 break;
13859 }
13860 }
13861 }
13862 finally
13863 {
13864 ((IDisposable)enumerator).Dispose();
13865 }
13867 }
13868
13869 [PublicAPI]
13871 {
13872 return _performanceCategoryDisplayNames[category];
13873 }
13874
13875 [PublicAPI]
13877 {
13878 return _performanceRatingDisplayNames[rating];
13879 }
13880
13881 [PublicAPI]
13882 public static AvatarPerformanceStatsLevel GetStatLevelForRating(PerformanceRating rating, bool isMobilePlatform)
13883 {
13884 AvatarPerformanceStatsLevelSet avatarPerformanceStatsLevelSet = GetAvatarPerformanceStatsLevelSet(isMobilePlatform);
13885 return rating switch
13886 {
13887 PerformanceRating.None => avatarPerformanceStatsLevelSet.excellent,
13888 PerformanceRating.Excellent => avatarPerformanceStatsLevelSet.excellent,
13889 PerformanceRating.Good => avatarPerformanceStatsLevelSet.good,
13890 PerformanceRating.Medium => avatarPerformanceStatsLevelSet.medium,
13891 PerformanceRating.Poor => avatarPerformanceStatsLevelSet.poor,
13892 PerformanceRating.VeryPoor => avatarPerformanceStatsLevelSet.poor,
13893 _ => avatarPerformanceStatsLevelSet.excellent,
13894 };
13895 }
13896
13898 {
13899 //IL_0096: Unknown result type (might be due to invalid IL or missing references)
13900 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
13901 switch (perfCategory)
13902 {
13903 case AvatarPerformanceCategory.Overall:
13904 {
13905 PerformanceRating performanceRating = PerformanceRating.None;
13906 Enumerator<AvatarPerformanceCategory> enumerator = _performanceCategories.GetEnumerator();
13907 while (enumerator.MoveNext())
13908 {
13909 AvatarPerformanceCategory current = enumerator.Current;
13910 if (current != 0 && current != AvatarPerformanceCategory.Overall && current != AvatarPerformanceCategory.AvatarPerformanceCategoryCount)
13911 {
13912 PerformanceRating performanceRatingForCategory = GetPerformanceRatingForCategory(current);
13913 if (performanceRatingForCategory > performanceRating)
13914 {
13915 performanceRating = performanceRatingForCategory;
13916 }
13917 }
13918 }
13919 return performanceRating;
13920 }
13921 case AvatarPerformanceCategory.PolyCount:
13922 if (!polyCount.HasValue)
13923 {
13924 return PerformanceRating.None;
13925 }
13927 case AvatarPerformanceCategory.AABB:
13928 if (!aabb.HasValue)
13929 {
13930 return PerformanceRating.None;
13931 }
13933 {
13934 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
13935 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
13936 //IL_002a: Unknown result type (might be due to invalid IL or missing references)
13937 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
13938 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
13939 //IL_0054: Unknown result type (might be due to invalid IL or missing references)
13940 //IL_0059: Unknown result type (might be due to invalid IL or missing references)
13941 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
13942 //IL_006c: Unknown result type (might be due to invalid IL or missing references)
13943 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
13944 //IL_0088: Unknown result type (might be due to invalid IL or missing references)
13945 //IL_008b: Unknown result type (might be due to invalid IL or missing references)
13946 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
13947 if (ApproxLessOrEqual(((Bounds)(ref y.aabb)).extents.x, 0f))
13948 {
13949 goto IL_00af;
13950 }
13951 Bounds valueOrDefault = x.aabb.GetValueOrDefault();
13952 if (ApproxLessOrEqual(((Bounds)(ref valueOrDefault)).extents.x, ((Bounds)(ref y.aabb)).extents.x))
13953 {
13954 valueOrDefault = x.aabb.GetValueOrDefault();
13955 if (ApproxLessOrEqual(((Bounds)(ref valueOrDefault)).extents.y, ((Bounds)(ref y.aabb)).extents.y))
13956 {
13957 valueOrDefault = x.aabb.GetValueOrDefault();
13958 if (ApproxLessOrEqual(((Bounds)(ref valueOrDefault)).extents.z, ((Bounds)(ref y.aabb)).extents.z))
13959 {
13960 goto IL_00af;
13961 }
13962 }
13963 }
13964 int num = 1;
13965 goto IL_00b0;
13966 IL_00b0:
13967 return num;
13968 IL_00af:
13969 num = -1;
13970 goto IL_00b0;
13971 });
13972 case AvatarPerformanceCategory.SkinnedMeshCount:
13973 if (!skinnedMeshCount.HasValue)
13974 {
13975 return PerformanceRating.None;
13976 }
13978 case AvatarPerformanceCategory.MeshCount:
13979 if (!meshCount.HasValue)
13980 {
13981 return PerformanceRating.None;
13982 }
13984 case AvatarPerformanceCategory.MaterialCount:
13985 if (!materialCount.HasValue)
13986 {
13987 return PerformanceRating.None;
13988 }
13990 case AvatarPerformanceCategory.AnimatorCount:
13991 if (!animatorCount.HasValue)
13992 {
13993 return PerformanceRating.None;
13994 }
13996 case AvatarPerformanceCategory.BoneCount:
13997 if (!boneCount.HasValue)
13998 {
13999 return PerformanceRating.None;
14000 }
14002 case AvatarPerformanceCategory.LightCount:
14003 if (!lightCount.HasValue)
14004 {
14005 return PerformanceRating.None;
14006 }
14008 case AvatarPerformanceCategory.ParticleSystemCount:
14009 if (!particleSystemCount.HasValue)
14010 {
14011 return PerformanceRating.None;
14012 }
14014 case AvatarPerformanceCategory.ParticleTotalCount:
14015 if (!particleTotalCount.HasValue)
14016 {
14017 return PerformanceRating.None;
14018 }
14020 case AvatarPerformanceCategory.ParticleMaxMeshPolyCount:
14021 if (!particleMaxMeshPolyCount.HasValue)
14022 {
14023 return PerformanceRating.None;
14024 }
14026 case AvatarPerformanceCategory.ParticleTrailsEnabled:
14027 if (!particleTrailsEnabled.HasValue)
14028 {
14029 return PerformanceRating.None;
14030 }
14032 {
14033 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
14034 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
14035 Nullable<bool> val = x.particleTrailsEnabled;
14036 bool flag = y.particleTrailsEnabled;
14037 return ((val.GetValueOrDefault() == flag) & val.HasValue) ? 0f : ((float)(x.particleTrailsEnabled.GetValueOrDefault() ? 1 : (-1)));
14038 });
14039 case AvatarPerformanceCategory.ParticleCollisionEnabled:
14040 if (!particleCollisionEnabled.HasValue)
14041 {
14042 return PerformanceRating.None;
14043 }
14045 {
14046 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
14047 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
14048 Nullable<bool> val2 = x.particleCollisionEnabled;
14049 bool flag2 = y.particleCollisionEnabled;
14050 return ((val2.GetValueOrDefault() == flag2) & val2.HasValue) ? 0f : ((float)(x.particleCollisionEnabled.GetValueOrDefault() ? 1 : (-1)));
14051 });
14052 case AvatarPerformanceCategory.TrailRendererCount:
14053 if (!trailRendererCount.HasValue)
14054 {
14055 return PerformanceRating.None;
14056 }
14058 case AvatarPerformanceCategory.LineRendererCount:
14059 if (!lineRendererCount.HasValue)
14060 {
14061 return PerformanceRating.None;
14062 }
14064 case AvatarPerformanceCategory.PhysBoneComponentCount:
14065 if (!physBone.HasValue)
14066 {
14067 return PerformanceRating.None;
14068 }
14069 return CalculatePerformanceRating((AvatarPerformanceStats x, AvatarPerformanceStatsLevel y) => x.physBone.GetValueOrDefault().componentCount - y.physBone.componentCount);
14070 case AvatarPerformanceCategory.PhysBoneTransformCount:
14071 if (!physBone.HasValue)
14072 {
14073 return PerformanceRating.None;
14074 }
14075 return CalculatePerformanceRating((AvatarPerformanceStats x, AvatarPerformanceStatsLevel y) => x.physBone.GetValueOrDefault().transformCount - y.physBone.transformCount);
14076 case AvatarPerformanceCategory.PhysBoneColliderCount:
14077 if (!physBone.HasValue)
14078 {
14079 return PerformanceRating.None;
14080 }
14081 return CalculatePerformanceRating((AvatarPerformanceStats x, AvatarPerformanceStatsLevel y) => x.physBone.GetValueOrDefault().colliderCount - y.physBone.colliderCount);
14082 case AvatarPerformanceCategory.PhysBoneCollisionCheckCount:
14083 if (!physBone.HasValue)
14084 {
14085 return PerformanceRating.None;
14086 }
14087 return CalculatePerformanceRating((AvatarPerformanceStats x, AvatarPerformanceStatsLevel y) => x.physBone.GetValueOrDefault().collisionCheckCount - y.physBone.collisionCheckCount);
14088 case AvatarPerformanceCategory.ContactCount:
14089 if (!contactCount.HasValue)
14090 {
14091 return PerformanceRating.None;
14092 }
14094 case AvatarPerformanceCategory.ConstraintsCount:
14095 if (!constraintsCount.HasValue)
14096 {
14097 return PerformanceRating.None;
14098 }
14100 case AvatarPerformanceCategory.ConstraintDepth:
14101 if (!constraintDepth.HasValue)
14102 {
14103 return PerformanceRating.None;
14104 }
14106 case AvatarPerformanceCategory.ClothCount:
14107 if (!clothCount.HasValue)
14108 {
14109 return PerformanceRating.None;
14110 }
14112 case AvatarPerformanceCategory.ClothMaxVertices:
14113 if (!clothMaxVertices.HasValue)
14114 {
14115 return PerformanceRating.None;
14116 }
14118 case AvatarPerformanceCategory.PhysicsColliderCount:
14119 if (!physicsColliderCount.HasValue)
14120 {
14121 return PerformanceRating.None;
14122 }
14124 case AvatarPerformanceCategory.PhysicsRigidbodyCount:
14125 if (!physicsRigidbodyCount.HasValue)
14126 {
14127 return PerformanceRating.None;
14128 }
14130 case AvatarPerformanceCategory.AudioSourceCount:
14131 if (!audioSourceCount.HasValue)
14132 {
14133 return PerformanceRating.None;
14134 }
14136 case AvatarPerformanceCategory.TextureMegabytes:
14137 if (!textureMegabytes.HasValue)
14138 {
14139 return PerformanceRating.None;
14140 }
14142 case AvatarPerformanceCategory.DownloadSize:
14143 if (!downloadSizeBytes.HasValue)
14144 {
14145 return PerformanceRating.None;
14146 }
14147 return PerformanceRating.Excellent;
14148 case AvatarPerformanceCategory.UncompressedSize:
14149 if (!uncompressedSizeBytes.HasValue)
14150 {
14151 return PerformanceRating.None;
14152 }
14153 return PerformanceRating.Excellent;
14154 default:
14155 return PerformanceRating.None;
14156 }
14157 }
14158
14159 private PerformanceRating CalculatePerformanceRating(ComparePerformanceStatsDelegate compareFn)
14160 {
14161 if (compareFn(this, _performanceStatsLevelSet.excellent) <= 0f)
14162 {
14163 return PerformanceRating.Excellent;
14164 }
14165 if (compareFn(this, _performanceStatsLevelSet.good) <= 0f)
14166 {
14167 return PerformanceRating.Good;
14168 }
14169 if (compareFn(this, _performanceStatsLevelSet.medium) <= 0f)
14170 {
14171 return PerformanceRating.Medium;
14172 }
14173 if (compareFn(this, _performanceStatsLevelSet.poor) <= 0f)
14174 {
14175 return PerformanceRating.Poor;
14176 }
14177 return PerformanceRating.VeryPoor;
14178 }
14179
14180 private static bool ApproxLessOrEqual(float x1, float x2)
14181 {
14182 float num = x1 - x2;
14183 if (!(num < 0f))
14184 {
14185 return Mathf.Approximately(num, 0f);
14186 }
14187 return true;
14188 }
14189
14190 public override string ToString()
14191 {
14192 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
14193 //IL_0006: Expected O, but got Unknown
14194 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
14195 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
14196 //IL_0082: Unknown result type (might be due to invalid IL or missing references)
14197 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
14198 //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
14199 //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
14200 //IL_00de: Unknown result type (might be due to invalid IL or missing references)
14201 //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
14202 //IL_010c: Unknown result type (might be due to invalid IL or missing references)
14203 //IL_0123: Unknown result type (might be due to invalid IL or missing references)
14204 //IL_013a: Unknown result type (might be due to invalid IL or missing references)
14205 //IL_0151: Unknown result type (might be due to invalid IL or missing references)
14206 //IL_0168: Unknown result type (might be due to invalid IL or missing references)
14207 //IL_017f: Unknown result type (might be due to invalid IL or missing references)
14208 //IL_01b9: Unknown result type (might be due to invalid IL or missing references)
14209 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
14210 //IL_01ac: Unknown result type (might be due to invalid IL or missing references)
14211 //IL_01f3: Unknown result type (might be due to invalid IL or missing references)
14212 //IL_01e0: Unknown result type (might be due to invalid IL or missing references)
14213 //IL_01e6: Unknown result type (might be due to invalid IL or missing references)
14214 //IL_022d: Unknown result type (might be due to invalid IL or missing references)
14215 //IL_021a: Unknown result type (might be due to invalid IL or missing references)
14216 //IL_0220: Unknown result type (might be due to invalid IL or missing references)
14217 //IL_0267: Unknown result type (might be due to invalid IL or missing references)
14218 //IL_0254: Unknown result type (might be due to invalid IL or missing references)
14219 //IL_025a: Unknown result type (might be due to invalid IL or missing references)
14220 //IL_027e: Unknown result type (might be due to invalid IL or missing references)
14221 //IL_0295: Unknown result type (might be due to invalid IL or missing references)
14222 //IL_02ac: Unknown result type (might be due to invalid IL or missing references)
14223 //IL_02c3: Unknown result type (might be due to invalid IL or missing references)
14224 //IL_02d4: Unknown result type (might be due to invalid IL or missing references)
14225 //IL_02d9: Unknown result type (might be due to invalid IL or missing references)
14226 //IL_0330: Unknown result type (might be due to invalid IL or missing references)
14227 //IL_0335: Unknown result type (might be due to invalid IL or missing references)
14228 //IL_02f7: Unknown result type (might be due to invalid IL or missing references)
14229 //IL_02fc: Unknown result type (might be due to invalid IL or missing references)
14230 //IL_0392: Unknown result type (might be due to invalid IL or missing references)
14231 //IL_03a9: Unknown result type (might be due to invalid IL or missing references)
14232 //IL_0353: Unknown result type (might be due to invalid IL or missing references)
14233 //IL_0358: Unknown result type (might be due to invalid IL or missing references)
14234 //IL_031f: Unknown result type (might be due to invalid IL or missing references)
14235 //IL_0308: Unknown result type (might be due to invalid IL or missing references)
14236 //IL_030e: Unknown result type (might be due to invalid IL or missing references)
14237 //IL_037b: Unknown result type (might be due to invalid IL or missing references)
14238 //IL_0364: Unknown result type (might be due to invalid IL or missing references)
14239 //IL_036a: Unknown result type (might be due to invalid IL or missing references)
14240 StringBuilder val = new StringBuilder();
14241 val.AppendFormat("Avatar Name: {0}\n", (object)avatarName);
14242 val.AppendFormat("Overall Performance: {0}\n", (object)GetPerformanceRatingForCategory(AvatarPerformanceCategory.Overall));
14243 val.AppendFormat("Poly Count: {0}\n", (object)polyCount);
14244 val.AppendFormat("Bounds: {0}\n", (object)((Object)aabb).ToString());
14245 val.AppendFormat("Skinned Mesh Count: {0}\n", (object)skinnedMeshCount);
14246 val.AppendFormat("Mesh Count: {0}\n", (object)meshCount);
14247 val.AppendFormat("Material Count: {0}\n", (object)materialCount);
14248 val.AppendFormat("Animator Count: {0}\n", (object)animatorCount);
14249 val.AppendFormat("Bone Count: {0}\n", (object)boneCount);
14250 val.AppendFormat("Light Count: {0}\n", (object)lightCount);
14251 val.AppendFormat("Particle System Count: {0}\n", (object)particleSystemCount);
14252 val.AppendFormat("Particle Total Count: {0}\n", (object)particleTotalCount);
14253 val.AppendFormat("Particle Max Mesh Poly Count: {0}\n", (object)particleMaxMeshPolyCount);
14254 val.AppendFormat("Particle Trails Enabled: {0}\n", (object)particleTrailsEnabled);
14255 val.AppendFormat("Particle Collision Enabled: {0}\n", (object)particleCollisionEnabled);
14256 val.AppendFormat("Trail Renderer Count: {0}\n", (object)trailRendererCount);
14257 val.AppendFormat("Line Renderer Count: {0}\n", (object)lineRendererCount);
14258 ref Nullable<PhysBoneStats> reference = ref physBone;
14259 val.AppendFormat("PhysBone Component Count: {0}\n", (object)(reference.HasValue ? new Nullable<int>(reference.GetValueOrDefault().componentCount) : default(Nullable<int>)));
14260 ref Nullable<PhysBoneStats> reference2 = ref physBone;
14261 val.AppendFormat("PhysBone Transform Count: {0}\n", (object)(reference2.HasValue ? new Nullable<int>(reference2.GetValueOrDefault().transformCount) : default(Nullable<int>)));
14262 ref Nullable<PhysBoneStats> reference3 = ref physBone;
14263 val.AppendFormat("PhysBone Collider Count: {0}\n", (object)(reference3.HasValue ? new Nullable<int>(reference3.GetValueOrDefault().colliderCount) : default(Nullable<int>)));
14264 ref Nullable<PhysBoneStats> reference4 = ref physBone;
14265 val.AppendFormat("PhysBone Collision Check Count: {0}\n", (object)(reference4.HasValue ? new Nullable<int>(reference4.GetValueOrDefault().collisionCheckCount) : default(Nullable<int>)));
14266 val.AppendFormat("Cloth Count: {0}\n", (object)clothCount);
14267 val.AppendFormat("Cloth Max Vertices: {0}\n", (object)clothMaxVertices);
14268 val.AppendFormat("Physics Collider Count: {0}\n", (object)physicsColliderCount);
14269 val.AppendFormat("Physics Rigidbody Count: {0}\n", (object)physicsRigidbodyCount);
14270 Nullable<int> val2 = downloadSizeBytes;
14271 int num = 0;
14272 if ((val2.GetValueOrDefault() > num) & val2.HasValue)
14273 {
14274 val2 = downloadSizeBytes;
14275 val.AppendFormat("Download Size: {0} MB\n", (object)(val2.HasValue ? new Nullable<float>((float)val2.GetValueOrDefault() / 1048576f) : default(Nullable<float>)));
14276 }
14277 val2 = uncompressedSizeBytes;
14278 num = 0;
14279 if ((val2.GetValueOrDefault() > num) & val2.HasValue)
14280 {
14281 val2 = uncompressedSizeBytes;
14282 val.AppendFormat("Uncompressed Size: {0} MB\n", (object)(val2.HasValue ? new Nullable<float>((float)val2.GetValueOrDefault() / 1048576f) : default(Nullable<float>)));
14283 }
14284 val.AppendFormat("Constraint Count: {0}\n", (object)constraintsCount);
14285 val.AppendFormat("Constraint Depth: {0}\n", (object)constraintDepth);
14286 return ((Object)val).ToString();
14287 }
14288
14290 {
14291 //IL_0126: Unknown result type (might be due to invalid IL or missing references)
14292 //IL_012b: Unknown result type (might be due to invalid IL or missing references)
14293 List<string> obj = new List<string>();
14294 obj.Add("visible_avatar_poly_count");
14295 obj.Add("visible_avatar_skinned_mesh_count");
14296 obj.Add("visible_avatar_mesh_count");
14297 obj.Add("visible_avatar_material_count");
14298 obj.Add("visible_avatar_animator_count");
14299 obj.Add("visible_avatar_bone_count");
14300 obj.Add("visible_avatar_light_count");
14301 obj.Add("visible_avatar_particle_system_count");
14302 obj.Add("visible_avatar_particle_total_count");
14303 obj.Add("visible_avatar_particle_mesh_poly_count");
14304 obj.Add("visible_avatar_trail_renderer_count");
14305 obj.Add("visible_avatar_line_renderer_count");
14306 obj.Add("visible_avatar_cloth_count");
14307 obj.Add("visible_avatar_cloth_vertices_count");
14308 obj.Add("visible_avatar_physics_collider_count");
14309 obj.Add("visible_avatar_physics_rigidbody_count");
14310 obj.Add("visible_avatar_audio_source_count");
14311 obj.Add("visible_avatar_contact_count");
14312 obj.Add("visible_avatar_constraint_count");
14313 obj.Add("visible_avatar_constraint_depth");
14314 obj.Add("visible_avatar_physbone_component_count");
14315 obj.Add("visible_avatar_physbone_transform_count");
14316 obj.Add("visible_avatar_physbone_collider_count");
14317 obj.Add("visible_avatar_physbone_collision_count");
14318 _analyticsStatNames = obj;
14319 _performanceCategories = ImmutableArray.ToImmutableArray<AvatarPerformanceCategory>(Enumerable.Cast<AvatarPerformanceCategory>((IEnumerable)(object)Enum.GetValues(typeof(AvatarPerformanceCategory))));
14320 Dictionary<AvatarPerformanceCategory, string> obj2 = new Dictionary<AvatarPerformanceCategory, string>();
14321 obj2.Add(AvatarPerformanceCategory.PolyCount, "Polygons");
14322 obj2.Add(AvatarPerformanceCategory.AABB, "Bounds");
14323 obj2.Add(AvatarPerformanceCategory.SkinnedMeshCount, "Skinned Meshes");
14324 obj2.Add(AvatarPerformanceCategory.MeshCount, "Meshes");
14325 obj2.Add(AvatarPerformanceCategory.MaterialCount, "Material Slots");
14326 obj2.Add(AvatarPerformanceCategory.AnimatorCount, "Animators");
14327 obj2.Add(AvatarPerformanceCategory.BoneCount, "Bones");
14328 obj2.Add(AvatarPerformanceCategory.LightCount, "Lights");
14329 obj2.Add(AvatarPerformanceCategory.ParticleSystemCount, "Particle Systems");
14330 obj2.Add(AvatarPerformanceCategory.ParticleTotalCount, "Total Max Particles");
14331 obj2.Add(AvatarPerformanceCategory.ParticleMaxMeshPolyCount, "Mesh Particle Max Polygons");
14332 obj2.Add(AvatarPerformanceCategory.ParticleTrailsEnabled, "Particle Trails Enabled");
14333 obj2.Add(AvatarPerformanceCategory.ParticleCollisionEnabled, "Particle Collision Enabled");
14334 obj2.Add(AvatarPerformanceCategory.TrailRendererCount, "Trail Renderers");
14335 obj2.Add(AvatarPerformanceCategory.LineRendererCount, "Line Renderers");
14336 obj2.Add(AvatarPerformanceCategory.ClothCount, "Cloths");
14337 obj2.Add(AvatarPerformanceCategory.ClothMaxVertices, "Total Cloth Vertices");
14338 obj2.Add(AvatarPerformanceCategory.PhysicsColliderCount, "Physics Colliders");
14339 obj2.Add(AvatarPerformanceCategory.PhysicsRigidbodyCount, "Physics Rigidbodies");
14340 obj2.Add(AvatarPerformanceCategory.AudioSourceCount, "Audio Sources");
14341 obj2.Add(AvatarPerformanceCategory.DownloadSize, "Download Size");
14342 obj2.Add(AvatarPerformanceCategory.UncompressedSize, "Uncompressed Size");
14343 obj2.Add(AvatarPerformanceCategory.ContactCount, "Contact Count");
14344 obj2.Add(AvatarPerformanceCategory.PhysBoneComponentCount, "PhysBone Components");
14345 obj2.Add(AvatarPerformanceCategory.PhysBoneTransformCount, "PhysBone Transforms");
14346 obj2.Add(AvatarPerformanceCategory.PhysBoneColliderCount, "PhysBone Colliders");
14347 obj2.Add(AvatarPerformanceCategory.PhysBoneCollisionCheckCount, "PhysBone Collision Check Count");
14348 obj2.Add(AvatarPerformanceCategory.TextureMegabytes, "Texture Memory");
14349 obj2.Add(AvatarPerformanceCategory.ConstraintsCount, "Constraints");
14350 obj2.Add(AvatarPerformanceCategory.ConstraintDepth, "Constraint Depth");
14351 _performanceCategoryDisplayNames = obj2;
14352 Dictionary<PerformanceRating, string> obj3 = new Dictionary<PerformanceRating, string>();
14353 obj3.Add(PerformanceRating.None, "None");
14354 obj3.Add(PerformanceRating.Excellent, "Excellent");
14355 obj3.Add(PerformanceRating.Good, "Good");
14356 obj3.Add(PerformanceRating.Medium, "Medium");
14357 obj3.Add(PerformanceRating.Poor, "Poor");
14358 obj3.Add(PerformanceRating.VeryPoor, "VeryPoor");
14359 _performanceRatingDisplayNames = obj3;
14360 _performanceStatsLevelSet_Windows = null;
14361 _performanceStatsLevelSet_Mobile = null;
14362 }
14363 }
14364 public class AvatarPerformanceStatsLevel : ScriptableObject
14365 {
14366 public int polyCount;
14367
14368 public Bounds aabb;
14369
14371
14372 public int meshCount;
14373
14374 public int materialCount;
14375
14376 public int animatorCount;
14377
14378 public int boneCount;
14379
14380 public int lightCount;
14381
14383
14385
14387
14389
14391
14393
14395
14396 public int clothCount;
14397
14399
14401
14403
14405
14406 public float textureMegabytes;
14407
14409
14410 public int contactCount;
14411
14413
14415 }
14416 public class AvatarPerformanceStatsLevelSet : ScriptableObject
14417 {
14418 [FormerlySerializedAs("veryGood")]
14420
14422
14424
14425 [FormerlySerializedAs("bad")]
14427 }
14428}
14430{
14431 public abstract class AbstractPerformanceScanner : Object
14432 {
14434
14435 private static int _componentScansThisFrame;
14436
14437 private static int _componentScansFrameNumber;
14438
14439 private readonly Stack<IEnumerator> _coroutines = new Stack<IEnumerator>();
14440
14441 private bool _limitComponentScansPerFrame = true;
14442
14443 public abstract IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent);
14444
14445 public void RunPerformanceScan(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
14446 {
14447 _limitComponentScansPerFrame = false;
14448 try
14449 {
14450 _coroutines.Push(RunPerformanceScanEnumerator(avatarObject, perfStats, shouldIgnoreComponent));
14451 while (_coroutines.Count > 0)
14452 {
14453 IEnumerator val = _coroutines.Peek();
14454 if (val.MoveNext())
14455 {
14456 object current = val.Current;
14457 IEnumerator val2 = (IEnumerator)((current is IEnumerator) ? current : null);
14458 if (val2 != null)
14459 {
14460 _coroutines.Push(val2);
14461 }
14462 }
14463 else
14464 {
14465 _coroutines.Pop();
14466 }
14467 }
14468 _coroutines.Clear();
14469 }
14470 finally
14471 {
14472 _limitComponentScansPerFrame = true;
14473 }
14474 }
14475
14476 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
14477 protected IEnumerator ScanAvatarForComponentsOfType(Type componentType, GameObject avatarObject, List<Component> destinationBuffer)
14478 {
14479 yield return HandleComponentScansPerFrameLimit();
14480 destinationBuffer.Clear();
14481 destinationBuffer.AddRange((IEnumerable<Component>)(object)avatarObject.GetComponentsInChildren(componentType, true));
14482 }
14483
14484 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
14485 protected IEnumerator ScanAvatarForComponentsOfType<T>(GameObject avatarObject, List<T> destinationBuffer)
14486 {
14487 yield return HandleComponentScansPerFrameLimit();
14488 destinationBuffer.Clear();
14489 avatarObject.GetComponentsInChildren<T>(true, destinationBuffer);
14490 yield return null;
14491 }
14492
14493 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
14495 {
14496 if (!_limitComponentScansPerFrame)
14497 {
14498 yield break;
14499 }
14500 while (_componentScansThisFrame >= 10)
14501 {
14502 if (Time.frameCount > _componentScansFrameNumber)
14503 {
14504 _componentScansFrameNumber = Time.frameCount;
14505 _componentScansThisFrame = 0;
14506 break;
14507 }
14508 yield return null;
14509 }
14510 _componentScansThisFrame++;
14511 }
14512
14513 public virtual bool EnabledOnPlatform(PerformancePlatform platform)
14514 {
14515 return true;
14516 }
14517 }
14519 {
14520 [CompilerGenerated]
14521 private sealed class <>c__DisplayClass0_0 : Object
14522 {
14523 public AvatarPerformance.IgnoreDelegate shouldIgnoreComponent;
14524
14525 internal bool <RunPerformanceScanEnumerator>b__0(Animator c)
14526 {
14527 return shouldIgnoreComponent((Component)(object)c);
14528 }
14529
14530 internal bool <RunPerformanceScanEnumerator>b__1(Animation c)
14531 {
14532 return shouldIgnoreComponent((Component)(object)c);
14533 }
14534 }
14535
14536 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
14537 public override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
14538 {
14539 <>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0
14540 {
14541 shouldIgnoreComponent = shouldIgnoreComponent
14542 };
14543 int animatorCount3 = 0;
14544 List<Animator> animatorBuffer = new List<Animator>();
14545 yield return ScanAvatarForComponentsOfType<Animator>(avatarObject, animatorBuffer);
14546 if (CS$<>8__locals0.shouldIgnoreComponent != null)
14547 {
14548 animatorBuffer.RemoveAll((Predicate<Animator>)((Animator c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(object)c)));
14549 }
14550 animatorCount3 += animatorBuffer.Count;
14551 List<Animation> animationBuffer = new List<Animation>();
14552 yield return ScanAvatarForComponentsOfType<Animation>(avatarObject, animationBuffer);
14553 if (CS$<>8__locals0.shouldIgnoreComponent != null)
14554 {
14555 animationBuffer.RemoveAll((Predicate<Animation>)((Animation c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(object)c)));
14556 }
14557 animatorCount3 += animationBuffer.Count;
14558 perfStats.animatorCount = new Nullable<int>(animatorCount3);
14559 }
14560 }
14562 {
14563 [CompilerGenerated]
14564 private sealed class <>c__DisplayClass0_0 : Object
14565 {
14566 public AvatarPerformance.IgnoreDelegate shouldIgnoreComponent;
14567
14568 internal bool <RunPerformanceScanEnumerator>b__0(AudioSource c)
14569 {
14570 return shouldIgnoreComponent((Component)(object)c);
14571 }
14572 }
14573
14574 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
14575 public override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
14576 {
14577 <>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0
14578 {
14579 shouldIgnoreComponent = shouldIgnoreComponent
14580 };
14581 List<AudioSource> audioSourceBuffer = new List<AudioSource>();
14582 yield return ScanAvatarForComponentsOfType<AudioSource>(avatarObject, audioSourceBuffer);
14583 if (CS$<>8__locals0.shouldIgnoreComponent != null)
14584 {
14585 audioSourceBuffer.RemoveAll((Predicate<AudioSource>)((AudioSource c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(object)c)));
14586 }
14587 perfStats.audioSourceCount = new Nullable<int>(audioSourceBuffer.Count);
14588 List<PerformanceScannerPlaceholder> placeholderBuffer = new List<PerformanceScannerPlaceholder>();
14589 yield return ScanAvatarForComponentsOfType<PerformanceScannerPlaceholder>(avatarObject, placeholderBuffer);
14590 Enumerator<PerformanceScannerPlaceholder> enumerator = placeholderBuffer.GetEnumerator();
14591 try
14592 {
14593 while (enumerator.MoveNext())
14594 {
14595 PerformanceScannerPlaceholder current = enumerator.Current;
14596 if (Object.op_Implicit((Object)(object)current) && current.type == typeof(AudioSource) && !CS$<>8__locals0.shouldIgnoreComponent((Component)(object)current))
14597 {
14598 Nullable<int> audioSourceCount = perfStats.audioSourceCount;
14599 perfStats.audioSourceCount = (audioSourceCount.HasValue ? new Nullable<int>(audioSourceCount.GetValueOrDefault() + 1) : default(Nullable<int>));
14600 }
14601 }
14602 }
14603 finally
14604 {
14605 ((IDisposable)enumerator).Dispose();
14606 }
14607 }
14608 }
14610 {
14611 [CompilerGenerated]
14612 private sealed class <>c__DisplayClass0_0 : Object
14613 {
14614 public AvatarPerformance.IgnoreDelegate shouldIgnoreComponent;
14615
14616 internal bool <RunPerformanceScanEnumerator>b__0(Cloth c)
14617 {
14618 return shouldIgnoreComponent((Component)(object)c);
14619 }
14620 }
14621
14622 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
14623 public override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
14624 {
14625 <>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0
14626 {
14627 shouldIgnoreComponent = shouldIgnoreComponent
14628 };
14629 List<Cloth> clothBuffer = new List<Cloth>();
14630 yield return ScanAvatarForComponentsOfType<Cloth>(avatarObject, clothBuffer);
14631 if (CS$<>8__locals0.shouldIgnoreComponent != null)
14632 {
14633 clothBuffer.RemoveAll((Predicate<Cloth>)((Cloth c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(object)c)));
14634 }
14635 int num = 0;
14636 Enumerator<Cloth> enumerator = clothBuffer.GetEnumerator();
14637 try
14638 {
14639 while (enumerator.MoveNext())
14640 {
14641 Cloth current = enumerator.Current;
14642 if (!((Object)(object)current == (Object)null) && current.coefficients != null)
14643 {
14644 num += current.coefficients.Length;
14645 }
14646 }
14647 }
14648 finally
14649 {
14650 ((IDisposable)enumerator).Dispose();
14651 }
14652 perfStats.clothCount = new Nullable<int>(clothBuffer.Count);
14653 perfStats.clothMaxVertices = new Nullable<int>(num);
14654 }
14655 }
14657 {
14658 [CompilerGenerated]
14659 private sealed class <>c__DisplayClass0_0 : Object
14660 {
14661 public AvatarPerformance.IgnoreDelegate shouldIgnoreComponent;
14662
14663 internal bool <RunPerformanceScanEnumerator>b__0(Light c)
14664 {
14665 return shouldIgnoreComponent((Component)(object)c);
14666 }
14667 }
14668
14669 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
14670 public override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
14671 {
14672 <>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0
14673 {
14674 shouldIgnoreComponent = shouldIgnoreComponent
14675 };
14676 List<Light> lightBuffer = new List<Light>();
14677 yield return ScanAvatarForComponentsOfType<Light>(avatarObject, lightBuffer);
14678 if (CS$<>8__locals0.shouldIgnoreComponent != null)
14679 {
14680 lightBuffer.RemoveAll((Predicate<Light>)((Light c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(object)c)));
14681 }
14682 perfStats.lightCount = new Nullable<int>(lightBuffer.Count);
14683 }
14684 }
14686 {
14687 [CompilerGenerated]
14688 private sealed class <>c__DisplayClass0_0 : Object
14689 {
14690 public AvatarPerformance.IgnoreDelegate shouldIgnoreComponent;
14691
14692 internal bool <RunPerformanceScanEnumerator>b__0(LineRenderer c)
14693 {
14694 return shouldIgnoreComponent((Component)(object)c);
14695 }
14696 }
14697
14698 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
14699 public override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
14700 {
14701 <>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0
14702 {
14703 shouldIgnoreComponent = shouldIgnoreComponent
14704 };
14705 List<LineRenderer> lineRendererBuffer = new List<LineRenderer>();
14706 yield return ScanAvatarForComponentsOfType<LineRenderer>(avatarObject, lineRendererBuffer);
14707 if (CS$<>8__locals0.shouldIgnoreComponent != null)
14708 {
14709 lineRendererBuffer.RemoveAll((Predicate<LineRenderer>)((LineRenderer c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(object)c)));
14710 }
14711 int count = lineRendererBuffer.Count;
14712 perfStats.lineRendererCount = new Nullable<int>(count);
14713 perfStats.materialCount = new Nullable<int>(perfStats.materialCount.GetValueOrDefault() + count);
14714 }
14715 }
14717 {
14718 [CompilerGenerated]
14719 private sealed class <>c__DisplayClass4_0 : Object
14720 {
14721 public AvatarPerformance.IgnoreDelegate shouldIgnoreComponent;
14722
14723 internal bool <RunPerformanceScanEnumerator>b__0(Renderer c)
14724 {
14725 return shouldIgnoreComponent((Component)(object)c);
14726 }
14727 }
14728
14729 private const float TEXTURE_2D_MAXIMUM_BYTES_PER_PIXEL = 16f;
14730
14731 private static readonly Dictionary<TextureFormat, float> _texture2DBytesPerPixelLookup;
14732
14734
14735 private static readonly Dictionary<RenderTextureFormat, float> _renderTextureBytesPerPixelLookup;
14736
14737 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
14738 public override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
14739 {
14740 <>c__DisplayClass4_0 CS$<>8__locals0 = new <>c__DisplayClass4_0
14741 {
14742 shouldIgnoreComponent = shouldIgnoreComponent
14743 };
14744 List<Renderer> rendererBuffer = new List<Renderer>(16);
14745 yield return ScanAvatarForComponentsOfType<Renderer>(avatarObject, rendererBuffer);
14746 if (CS$<>8__locals0.shouldIgnoreComponent != null)
14747 {
14748 rendererBuffer.RemoveAll((Predicate<Renderer>)((Renderer c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(object)c)));
14749 }
14750 yield return AnalyzeGeometry(avatarObject, rendererBuffer, perfStats);
14751 AnalyzeMaterials(rendererBuffer, perfStats);
14752 AnalyzeMeshRenderers((IEnumerable<Renderer>)(object)rendererBuffer, perfStats);
14753 AnalyzeSkinnedMeshRenderers(rendererBuffer, perfStats);
14754 yield return null;
14755 }
14756
14757 private static uint CalculateRendererPolyCount(Renderer renderer)
14758 {
14759 Mesh val = null;
14760 SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(object)((renderer is SkinnedMeshRenderer) ? renderer : null);
14761 if ((Object)(object)val2 != (Object)null)
14762 {
14763 val = val2.sharedMesh;
14764 }
14765 if ((Object)(object)val == (Object)null)
14766 {
14767 MeshRenderer val3 = (MeshRenderer)(object)((renderer is MeshRenderer) ? renderer : null);
14768 if ((Object)(object)val3 != (Object)null)
14769 {
14770 MeshFilter component = ((Component)val3).GetComponent<MeshFilter>();
14771 if ((Object)(object)component != (Object)null)
14772 {
14773 val = component.sharedMesh;
14774 }
14775 }
14776 }
14777 if ((Object)(object)val == (Object)null)
14778 {
14779 return 0u;
14780 }
14781 return MeshUtils.GetMeshTriangleCount(val);
14782 }
14783
14784 private static bool RendererHasMesh(Renderer renderer)
14785 {
14786 MeshRenderer val = (MeshRenderer)(object)((renderer is MeshRenderer) ? renderer : null);
14787 if ((Object)(object)val != (Object)null)
14788 {
14789 MeshFilter component = ((Component)val).GetComponent<MeshFilter>();
14790 if ((Object)(object)component == (Object)null)
14791 {
14792 return false;
14793 }
14794 return (Object)(object)component.sharedMesh != (Object)null;
14795 }
14796 SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(object)((renderer is SkinnedMeshRenderer) ? renderer : null);
14797 if ((Object)(object)val2 != (Object)null)
14798 {
14799 return (Object)(object)val2.sharedMesh != (Object)null;
14800 }
14801 return false;
14802 }
14803
14804 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
14805 private IEnumerator AnalyzeGeometry(GameObject avatarObject, List<Renderer> renderers, AvatarPerformanceStats perfStats)
14806 {
14807 List<Renderer> lodGroupRendererIgnoreBuffer = new List<Renderer>(16);
14808 List<LODGroup> lodBuffer = new List<LODGroup>(16);
14809 ulong polyCount = 0uL;
14810 Bounds bounds = new Bounds(avatarObject.transform.position, Vector3.zero);
14811 yield return ScanAvatarForComponentsOfType<LODGroup>(avatarObject, lodBuffer);
14812 Enumerator<Renderer> enumerator2;
14813 checked
14814 {
14815 try
14816 {
14817 Enumerator<LODGroup> enumerator = lodBuffer.GetEnumerator();
14818 try
14819 {
14820 while (enumerator.MoveNext())
14821 {
14822 LOD[] lODs = enumerator.Current.GetLODs();
14823 ulong num = 0uL;
14824 LOD[] array = lODs;
14825 foreach (LOD val in array)
14826 {
14827 uint num2 = 0u;
14828 Renderer[] renderers2 = val.renderers;
14829 foreach (Renderer val2 in renderers2)
14830 {
14831 lodGroupRendererIgnoreBuffer.Add(val2);
14832 num2 += CalculateRendererPolyCount(val2);
14833 }
14834 if (num2 > num)
14835 {
14836 num = num2;
14837 }
14838 }
14839 polyCount += num;
14840 }
14841 }
14842 finally
14843 {
14844 ((IDisposable)enumerator).Dispose();
14845 }
14846 }
14847 catch (OverflowException)
14848 {
14849 polyCount = 4294967295uL;
14850 }
14851 enumerator2 = renderers.GetEnumerator();
14852 }
14853 try
14854 {
14855 while (enumerator2.MoveNext())
14856 {
14857 Renderer current = enumerator2.Current;
14858 if (current is MeshRenderer || current is SkinnedMeshRenderer)
14859 {
14860 if (!RendererHasMesh(current))
14861 {
14862 continue;
14863 }
14864 ((Bounds)(ref bounds)).Encapsulate(current.bounds);
14865 }
14866 if (!lodGroupRendererIgnoreBuffer.Contains(current))
14867 {
14868 polyCount += CalculateRendererPolyCount(current);
14869 }
14870 }
14871 }
14872 finally
14873 {
14874 ((IDisposable)enumerator2).Dispose();
14875 }
14876 ((Bounds)(ref bounds)).center = ((Bounds)(ref bounds)).center - avatarObject.transform.position;
14877 lodGroupRendererIgnoreBuffer.Clear();
14878 lodBuffer.Clear();
14879 perfStats.polyCount = new Nullable<int>((int)((polyCount > 2147483647) ? 2147483647 : polyCount));
14880 perfStats.aabb = new Nullable<Bounds>(bounds);
14881 }
14882
14883 private static void AnalyzeMaterials(List<Renderer> renderers, AvatarPerformanceStats perfStats)
14884 {
14885 //IL_0005: Unknown result type (might be due to invalid IL or missing references)
14886 //IL_000a: Unknown result type (might be due to invalid IL or missing references)
14887 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
14888 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
14889 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
14890 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
14891 //IL_0073: Unknown result type (might be due to invalid IL or missing references)
14892 //IL_0078: Unknown result type (might be due to invalid IL or missing references)
14893 //IL_009a: Unknown result type (might be due to invalid IL or missing references)
14894 //IL_009f: Unknown result type (might be due to invalid IL or missing references)
14895 //IL_010e: Unknown result type (might be due to invalid IL or missing references)
14896 //IL_0113: Unknown result type (might be due to invalid IL or missing references)
14897 //IL_0173: Unknown result type (might be due to invalid IL or missing references)
14898 //IL_0178: Unknown result type (might be due to invalid IL or missing references)
14899 //IL_017f: Unknown result type (might be due to invalid IL or missing references)
14900 //IL_0327: Unknown result type (might be due to invalid IL or missing references)
14901 //IL_032c: Unknown result type (might be due to invalid IL or missing references)
14902 //IL_01e4: Unknown result type (might be due to invalid IL or missing references)
14903 //IL_01e9: Unknown result type (might be due to invalid IL or missing references)
14904 //IL_01f0: Unknown result type (might be due to invalid IL or missing references)
14905 //IL_0255: Unknown result type (might be due to invalid IL or missing references)
14906 //IL_025a: Unknown result type (might be due to invalid IL or missing references)
14907 //IL_0261: Unknown result type (might be due to invalid IL or missing references)
14908 //IL_02ad: Unknown result type (might be due to invalid IL or missing references)
14909 //IL_02b2: Unknown result type (might be due to invalid IL or missing references)
14910 //IL_02b9: Unknown result type (might be due to invalid IL or missing references)
14911 ProfilerMarker val = new ProfilerMarker("AnalyzeMaterials");
14912 AutoScope val2 = ((ProfilerMarker)(ref val)).Auto();
14913 try
14914 {
14915 HashSet<Material> val3 = new HashSet<Material>();
14916 List<Material> val4 = new List<Material>();
14917 Enumerator<Renderer> enumerator = renderers.GetEnumerator();
14918 try
14919 {
14920 while (enumerator.MoveNext())
14921 {
14922 Renderer current = enumerator.Current;
14923 if (!((Object)(object)current == (Object)null))
14924 {
14925 current.GetSharedMaterials(val4);
14926 val3.UnionWith((IEnumerable<Material>)(object)val4);
14927 }
14928 }
14929 }
14930 finally
14931 {
14932 ((IDisposable)enumerator).Dispose();
14933 }
14934 HashSet<Texture> val5 = new HashSet<Texture>();
14935 List<int> val6 = new List<int>();
14936 Enumerator<Material> enumerator2 = val3.GetEnumerator();
14937 try
14938 {
14939 while (enumerator2.MoveNext())
14940 {
14941 Material current2 = enumerator2.Current;
14942 if ((Object)(object)current2 == (Object)null)
14943 {
14944 continue;
14945 }
14946 current2.GetTexturePropertyNameIDs(val6);
14947 Enumerator<int> enumerator3 = val6.GetEnumerator();
14948 try
14949 {
14950 while (enumerator3.MoveNext())
14951 {
14952 int current3 = enumerator3.Current;
14953 Texture texture = current2.GetTexture(current3);
14954 if (!((Object)(object)texture == (Object)null) && !val5.Contains(texture))
14955 {
14956 val5.Add(texture);
14957 }
14958 }
14959 }
14960 finally
14961 {
14962 ((IDisposable)enumerator3).Dispose();
14963 }
14964 }
14965 }
14966 finally
14967 {
14968 ((IDisposable)enumerator2).Dispose();
14969 }
14970 long num = 0L;
14971 Enumerator<Texture> enumerator4 = val5.GetEnumerator();
14972 try
14973 {
14974 float num2 = default(float);
14975 float num4 = default(float);
14976 float num6 = default(float);
14977 float num8 = default(float);
14978 while (enumerator4.MoveNext())
14979 {
14980 Texture current4 = enumerator4.Current;
14981 Texture2D val7 = (Texture2D)(object)((current4 is Texture2D) ? current4 : null);
14982 if (val7 == null)
14983 {
14984 if (current4 is RenderTexture)
14985 {
14986 continue;
14987 }
14988 Cubemap val8 = (Cubemap)(object)((current4 is Cubemap) ? current4 : null);
14989 if (val8 == null)
14990 {
14991 Texture2DArray val9 = (Texture2DArray)(object)((current4 is Texture2DArray) ? current4 : null);
14992 if (val9 == null)
14993 {
14994 Texture3D val10 = (Texture3D)(object)((current4 is Texture3D) ? current4 : null);
14995 if (val10 != null)
14996 {
14997 TextureFormat format = val10.format;
14998 if (!_texture2DBytesPerPixelLookup.TryGetValue(format, ref num2))
14999 {
15000 num2 = 16f;
15001 }
15002 int width = ((Texture)val10).width;
15003 int height = ((Texture)val10).height;
15004 int depth = val10.depth;
15005 int num3 = width * height * depth;
15006 num += Mathf.RoundToInt((float)num3 * num2);
15007 }
15008 }
15009 else
15010 {
15011 TextureFormat format2 = val9.format;
15012 if (!_texture2DBytesPerPixelLookup.TryGetValue(format2, ref num4))
15013 {
15014 num4 = 16f;
15015 }
15016 int width2 = ((Texture)val9).width;
15017 int height2 = ((Texture)val9).height;
15018 int depth2 = val9.depth;
15019 int num5 = width2 * height2 * depth2;
15020 num += Mathf.RoundToInt((float)num5 * num4);
15021 }
15022 }
15023 else
15024 {
15025 TextureFormat format3 = val8.format;
15026 if (!_texture2DBytesPerPixelLookup.TryGetValue(format3, ref num6))
15027 {
15028 num6 = 16f;
15029 }
15030 int width3 = ((Texture)val8).width;
15031 int height3 = ((Texture)val8).height;
15032 int mipmapCount = ((Texture)val8).mipmapCount;
15033 int num7 = width3 * height3;
15034 for (int i = 0; i < mipmapCount; i++)
15035 {
15036 num += Mathf.RoundToInt((float)(num7 >> 2 * i) * num6);
15037 }
15038 }
15039 }
15040 else
15041 {
15042 TextureFormat format4 = val7.format;
15043 if (!_texture2DBytesPerPixelLookup.TryGetValue(format4, ref num8))
15044 {
15045 num8 = 16f;
15046 }
15047 int width4 = ((Texture)val7).width;
15048 int height4 = ((Texture)val7).height;
15049 int mipmapCount2 = ((Texture)val7).mipmapCount;
15050 int num9 = width4 * height4;
15051 for (int j = 0; j < mipmapCount2; j++)
15052 {
15053 num += Mathf.RoundToInt((float)(num9 >> 2 * j) * num8);
15054 }
15055 }
15056 }
15057 }
15058 finally
15059 {
15060 ((IDisposable)enumerator4).Dispose();
15061 }
15062 perfStats.textureMegabytes = new Nullable<float>((float)num / 1048576f);
15063 }
15064 finally
15065 {
15066 ((IDisposable)(AutoScope)(ref val2)).Dispose();
15067 }
15068 }
15069
15070 private static void AnalyzeSkinnedMeshRenderers(List<Renderer> renderers, AvatarPerformanceStats perfStats)
15071 {
15072 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
15073 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
15074 //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
15075 //IL_00bc: Unknown result type (might be due to invalid IL or missing references)
15076 //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
15077 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
15078 //IL_00db: Unknown result type (might be due to invalid IL or missing references)
15079 //IL_00e0: Unknown result type (might be due to invalid IL or missing references)
15080 int num = 0;
15081 int num2 = 0;
15082 int num3 = 0;
15083 HashSet<Transform> val = new HashSet<Transform>();
15084 Enumerator<Renderer> enumerator = renderers.GetEnumerator();
15085 try
15086 {
15087 while (enumerator.MoveNext())
15088 {
15089 Renderer current = enumerator.Current;
15090 SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(object)((current is SkinnedMeshRenderer) ? current : null);
15091 if ((Object)(object)val2 == (Object)null)
15092 {
15093 continue;
15094 }
15095 num++;
15096 Mesh sharedMesh = val2.sharedMesh;
15097 if ((Object)(object)sharedMesh != (Object)null)
15098 {
15099 num2 += sharedMesh.subMeshCount;
15100 }
15101 Transform[] bones = val2.bones;
15102 foreach (Transform val3 in bones)
15103 {
15104 if (!((Object)(object)val3 == (Object)null) && !val.Contains(val3))
15105 {
15106 val.Add(val3);
15107 num3++;
15108 }
15109 }
15110 }
15111 }
15112 finally
15113 {
15114 ((IDisposable)enumerator).Dispose();
15115 }
15116 val.Clear();
15117 perfStats.skinnedMeshCount = new Nullable<int>(num);
15118 perfStats.boneCount = new Nullable<int>(num3);
15119 perfStats.materialCount = new Nullable<int>(perfStats.materialCount.GetValueOrDefault() + num2);
15120 }
15121
15122 private static void AnalyzeMeshRenderers(IEnumerable<Renderer> renderers, AvatarPerformanceStats perfStats)
15123 {
15124 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
15125 //IL_0070: Unknown result type (might be due to invalid IL or missing references)
15126 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
15127 //IL_0088: Unknown result type (might be due to invalid IL or missing references)
15128 int num = 0;
15129 int num2 = 0;
15130 IEnumerator<Renderer> enumerator = renderers.GetEnumerator();
15131 try
15132 {
15133 while (((IEnumerator)enumerator).MoveNext())
15134 {
15135 Renderer current = enumerator.Current;
15136 MeshRenderer val = (MeshRenderer)(object)((current is MeshRenderer) ? current : null);
15137 if ((Object)(object)val == (Object)null)
15138 {
15139 continue;
15140 }
15141 num++;
15142 MeshFilter component = ((Component)val).GetComponent<MeshFilter>();
15143 if (!((Object)(object)component == (Object)null))
15144 {
15145 Mesh sharedMesh = component.sharedMesh;
15146 if ((Object)(object)sharedMesh != (Object)null)
15147 {
15148 num2 += sharedMesh.subMeshCount;
15149 }
15150 }
15151 }
15152 }
15153 finally
15154 {
15155 if (enumerator != null)
15156 {
15157 ((IDisposable)enumerator).Dispose();
15158 }
15159 }
15160 perfStats.meshCount = new Nullable<int>(num);
15161 perfStats.materialCount = new Nullable<int>(perfStats.materialCount.GetValueOrDefault() + num2);
15162 }
15163
15165 {
15166 Dictionary<TextureFormat, float> obj = new Dictionary<TextureFormat, float>();
15167 obj.Add((TextureFormat)1, 1f);
15168 obj.Add((TextureFormat)2, 2f);
15169 obj.Add((TextureFormat)3, 4f);
15170 obj.Add((TextureFormat)4, 4f);
15171 obj.Add((TextureFormat)5, 4f);
15172 obj.Add((TextureFormat)7, 2f);
15173 obj.Add((TextureFormat)9, 2f);
15174 obj.Add((TextureFormat)10, 0.5f);
15175 obj.Add((TextureFormat)12, 1f);
15176 obj.Add((TextureFormat)13, 2f);
15177 obj.Add((TextureFormat)14, 4f);
15178 obj.Add((TextureFormat)15, 2f);
15179 obj.Add((TextureFormat)16, 4f);
15180 obj.Add((TextureFormat)17, 8f);
15181 obj.Add((TextureFormat)18, 4f);
15182 obj.Add((TextureFormat)19, 8f);
15183 obj.Add((TextureFormat)20, 16f);
15184 obj.Add((TextureFormat)26, 0.5f);
15185 obj.Add((TextureFormat)27, 1f);
15186 obj.Add((TextureFormat)24, 1f);
15187 obj.Add((TextureFormat)25, 1f);
15188 obj.Add((TextureFormat)28, 0.5f);
15189 obj.Add((TextureFormat)29, 1f);
15190 obj.Add((TextureFormat)30, 0.25f);
15191 obj.Add((TextureFormat)31, 0.25f);
15192 obj.Add((TextureFormat)32, 0.5f);
15193 obj.Add((TextureFormat)33, 0.5f);
15194 obj.Add((TextureFormat)34, 0.5f);
15195 obj.Add((TextureFormat)41, 0.5f);
15196 obj.Add((TextureFormat)42, 0.5f);
15197 obj.Add((TextureFormat)43, 1f);
15198 obj.Add((TextureFormat)44, 1f);
15199 obj.Add((TextureFormat)45, 0.5f);
15200 obj.Add((TextureFormat)46, 0.5f);
15201 obj.Add((TextureFormat)47, 1f);
15202 obj.Add((TextureFormat)48, 1f);
15203 obj.Add((TextureFormat)49, 0.64f);
15204 obj.Add((TextureFormat)50, 0.445f);
15205 obj.Add((TextureFormat)51, 0.25f);
15206 obj.Add((TextureFormat)52, 0.16f);
15207 obj.Add((TextureFormat)53, 0.11125f);
15208 obj.Add((TextureFormat)62, 2f);
15209 obj.Add((TextureFormat)63, 1f);
15210 obj.Add((TextureFormat)64, 0.5f);
15211 obj.Add((TextureFormat)65, 1f);
15212 _texture2DBytesPerPixelLookup = obj;
15213 Dictionary<RenderTextureFormat, float> obj2 = new Dictionary<RenderTextureFormat, float>();
15214 obj2.Add((RenderTextureFormat)1, 6f);
15215 obj2.Add((RenderTextureFormat)16, 1f);
15216 obj2.Add((RenderTextureFormat)28, 2f);
15217 obj2.Add((RenderTextureFormat)3, 6f);
15218 obj2.Add((RenderTextureFormat)14, 4f);
15219 obj2.Add((RenderTextureFormat)25, 2f);
15220 obj2.Add((RenderTextureFormat)23, 4f);
15221 obj2.Add((RenderTextureFormat)15, 2f);
15222 obj2.Add((RenderTextureFormat)19, 4f);
15223 obj2.Add((RenderTextureFormat)4, 2f);
15224 obj2.Add((RenderTextureFormat)12, 8f);
15225 obj2.Add((RenderTextureFormat)13, 4f);
15226 obj2.Add((RenderTextureFormat)18, 8f);
15227 obj2.Add((RenderTextureFormat)0, 4f);
15228 obj2.Add((RenderTextureFormat)10, 8f);
15229 obj2.Add((RenderTextureFormat)6, 2f);
15230 obj2.Add((RenderTextureFormat)5, 2f);
15231 obj2.Add((RenderTextureFormat)8, 2f);
15232 obj2.Add((RenderTextureFormat)20, 4f);
15233 obj2.Add((RenderTextureFormat)22, 4f);
15234 obj2.Add((RenderTextureFormat)11, 128f);
15235 obj2.Add((RenderTextureFormat)2, 64f);
15236 obj2.Add((RenderTextureFormat)17, 128f);
15237 obj2.Add((RenderTextureFormat)27, 4f);
15238 obj2.Add((RenderTextureFormat)26, 4f);
15239 obj2.Add((RenderTextureFormat)24, 8f);
15240 _renderTextureBytesPerPixelLookup = obj2;
15241 }
15242 }
15244 {
15245 [CompilerGenerated]
15246 private sealed class <>c__DisplayClass0_0 : Object
15247 {
15248 public AvatarPerformance.IgnoreDelegate shouldIgnoreComponent;
15249
15250 internal bool <RunPerformanceScanEnumerator>b__0(ParticleSystem c)
15251 {
15252 return shouldIgnoreComponent((Component)(object)c);
15253 }
15254 }
15255
15256 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
15257 public override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
15258 {
15259 <>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0
15260 {
15261 shouldIgnoreComponent = shouldIgnoreComponent
15262 };
15263 List<ParticleSystem> particleSystemBuffer = new List<ParticleSystem>();
15264 yield return ScanAvatarForComponentsOfType<ParticleSystem>(avatarObject, particleSystemBuffer);
15265 if (CS$<>8__locals0.shouldIgnoreComponent != null)
15266 {
15267 particleSystemBuffer.RemoveAll((Predicate<ParticleSystem>)((ParticleSystem c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(object)c)));
15268 }
15269 AnalyzeParticleSystemRenderers((IEnumerable<ParticleSystem>)(object)particleSystemBuffer, perfStats);
15270 yield return null;
15271 }
15272
15273 private static void AnalyzeParticleSystemRenderers(IEnumerable<ParticleSystem> particleSystems, AvatarPerformanceStats perfStats)
15274 {
15275 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
15276 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
15277 //IL_003a: Unknown result type (might be due to invalid IL or missing references)
15278 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
15279 //IL_0043: Unknown result type (might be due to invalid IL or missing references)
15280 //IL_0049: Invalid comparison between Unknown and I4
15281 //IL_0050: Unknown result type (might be due to invalid IL or missing references)
15282 //IL_0055: Unknown result type (might be due to invalid IL or missing references)
15283 //IL_0059: Unknown result type (might be due to invalid IL or missing references)
15284 //IL_005e: Unknown result type (might be due to invalid IL or missing references)
15285 //IL_02f4: Unknown result type (might be due to invalid IL or missing references)
15286 //IL_02f9: Unknown result type (might be due to invalid IL or missing references)
15287 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
15288 //IL_009c: Unknown result type (might be due to invalid IL or missing references)
15289 //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
15290 //IL_00a5: Unknown result type (might be due to invalid IL or missing references)
15291 //IL_006d: Unknown result type (might be due to invalid IL or missing references)
15292 //IL_0072: Unknown result type (might be due to invalid IL or missing references)
15293 //IL_0076: Unknown result type (might be due to invalid IL or missing references)
15294 //IL_007b: Unknown result type (might be due to invalid IL or missing references)
15295 //IL_0239: Unknown result type (might be due to invalid IL or missing references)
15296 //IL_023f: Invalid comparison between Unknown and I4
15297 //IL_0106: Unknown result type (might be due to invalid IL or missing references)
15298 //IL_010b: Unknown result type (might be due to invalid IL or missing references)
15299 //IL_010f: Unknown result type (might be due to invalid IL or missing references)
15300 //IL_0114: Unknown result type (might be due to invalid IL or missing references)
15301 //IL_0311: Unknown result type (might be due to invalid IL or missing references)
15302 //IL_0316: Unknown result type (might be due to invalid IL or missing references)
15303 //IL_02ab: Unknown result type (might be due to invalid IL or missing references)
15304 //IL_02b0: Unknown result type (might be due to invalid IL or missing references)
15305 //IL_00be: Unknown result type (might be due to invalid IL or missing references)
15306 //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
15307 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)
15308 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
15309 //IL_014d: Unknown result type (might be due to invalid IL or missing references)
15310 //IL_0152: Unknown result type (might be due to invalid IL or missing references)
15311 //IL_0156: Unknown result type (might be due to invalid IL or missing references)
15312 //IL_015b: Unknown result type (might be due to invalid IL or missing references)
15313 //IL_0123: Unknown result type (might be due to invalid IL or missing references)
15314 //IL_0128: Unknown result type (might be due to invalid IL or missing references)
15315 //IL_012c: Unknown result type (might be due to invalid IL or missing references)
15316 //IL_0131: Unknown result type (might be due to invalid IL or missing references)
15317 //IL_02c5: Unknown result type (might be due to invalid IL or missing references)
15318 //IL_02ca: Unknown result type (might be due to invalid IL or missing references)
15319 //IL_032e: Unknown result type (might be due to invalid IL or missing references)
15320 //IL_0333: Unknown result type (might be due to invalid IL or missing references)
15321 //IL_033a: Unknown result type (might be due to invalid IL or missing references)
15322 //IL_033f: Unknown result type (might be due to invalid IL or missing references)
15323 //IL_0347: Unknown result type (might be due to invalid IL or missing references)
15324 //IL_034c: Unknown result type (might be due to invalid IL or missing references)
15325 //IL_0360: Unknown result type (might be due to invalid IL or missing references)
15326 //IL_0365: Unknown result type (might be due to invalid IL or missing references)
15327 //IL_0174: Unknown result type (might be due to invalid IL or missing references)
15328 //IL_0179: Unknown result type (might be due to invalid IL or missing references)
15329 //IL_01a3: Unknown result type (might be due to invalid IL or missing references)
15330 //IL_01a8: Unknown result type (might be due to invalid IL or missing references)
15331 //IL_01f7: Unknown result type (might be due to invalid IL or missing references)
15332 //IL_01fc: Unknown result type (might be due to invalid IL or missing references)
15333 //IL_01c1: Unknown result type (might be due to invalid IL or missing references)
15334 //IL_01c6: Unknown result type (might be due to invalid IL or missing references)
15335 //IL_01cc: Unknown result type (might be due to invalid IL or missing references)
15336 //IL_01d1: Unknown result type (might be due to invalid IL or missing references)
15337 int num = 0;
15338 ulong num2 = 0uL;
15339 ulong num3 = 0uL;
15340 bool flag = false;
15341 bool flag2 = false;
15342 int num4 = 0;
15343 IEnumerator<ParticleSystem> enumerator = particleSystems.GetEnumerator();
15344 try
15345 {
15346 while (((IEnumerator)enumerator).MoveNext())
15347 {
15348 ParticleSystem current = enumerator.Current;
15349 MainModule main = current.main;
15350 int num5 = ((MainModule)(ref main)).maxParticles;
15351 main = current.main;
15352 if ((int)((MainModule)(ref main)).ringBufferMode == 2)
15353 {
15354 EmissionModule emission = current.emission;
15355 MinMaxCurve val = ((EmissionModule)(ref emission)).rateOverTime;
15356 if (((MinMaxCurve)(ref val)).curve == null)
15357 {
15358 int num6 = num5;
15359 emission = current.emission;
15360 val = ((EmissionModule)(ref emission)).rateOverTime;
15361 num5 = num6 + Mathf.CeilToInt(((MinMaxCurve)(ref val)).constant);
15362 }
15363 else
15364 {
15365 float num7 = 0f;
15366 emission = current.emission;
15367 val = ((EmissionModule)(ref emission)).rateOverTime;
15368 Keyframe[] keys = ((MinMaxCurve)(ref val)).curve.keys;
15369 for (int i = 0; i < keys.Length; i++)
15370 {
15371 Keyframe val2 = keys[i];
15372 if (((Keyframe)(ref val2)).value > num7)
15373 {
15374 num7 = ((Keyframe)(ref val2)).value;
15375 }
15376 }
15377 int num8 = num5;
15378 float num9 = num7;
15379 emission = current.emission;
15380 num5 = num8 + Mathf.CeilToInt(num9 * ((EmissionModule)(ref emission)).rateOverTimeMultiplier);
15381 }
15382 emission = current.emission;
15383 val = ((EmissionModule)(ref emission)).rateOverDistance;
15384 if (((MinMaxCurve)(ref val)).curve == null)
15385 {
15386 int num10 = num5;
15387 emission = current.emission;
15388 val = ((EmissionModule)(ref emission)).rateOverDistance;
15389 num5 = num10 + Mathf.CeilToInt(((MinMaxCurve)(ref val)).constantMax);
15390 }
15391 else
15392 {
15393 float num11 = 0f;
15394 emission = current.emission;
15395 val = ((EmissionModule)(ref emission)).rateOverDistance;
15396 Keyframe[] keys = ((MinMaxCurve)(ref val)).curve.keys;
15397 for (int i = 0; i < keys.Length; i++)
15398 {
15399 Keyframe val3 = keys[i];
15400 if (((Keyframe)(ref val3)).value > num11)
15401 {
15402 num11 = ((Keyframe)(ref val3)).value;
15403 }
15404 }
15405 int num12 = num5;
15406 float num13 = num11;
15407 emission = current.emission;
15408 num5 = num12 + Mathf.CeilToInt(num13 * ((EmissionModule)(ref emission)).rateOverDistanceMultiplier);
15409 }
15410 int num14 = 0;
15411 while (true)
15412 {
15413 int num15 = num14;
15414 emission = current.emission;
15415 if (num15 < ((EmissionModule)(ref emission)).burstCount)
15416 {
15417 emission = current.emission;
15418 Burst burst = ((EmissionModule)(ref emission)).GetBurst(num14);
15419 num5 += Mathf.CeilToInt((float)(((Burst)(ref burst)).maxCount * ((Burst)(ref burst)).cycleCount));
15420 num14++;
15421 continue;
15422 }
15423 break;
15424 }
15425 }
15426 else if (num5 <= 0)
15427 {
15428 continue;
15429 }
15430 num++;
15431 num2 += (uint)num5;
15432 ParticleSystemRenderer component = ((Component)current).GetComponent<ParticleSystemRenderer>();
15433 if ((Object)(object)component == (Object)null)
15434 {
15435 continue;
15436 }
15437 num4++;
15438 if ((int)component.renderMode == 4 && component.meshCount > 0)
15439 {
15440 uint num16 = 0u;
15441 Mesh[] array = (Mesh[])(object)new Mesh[component.meshCount];
15442 int meshes = component.GetMeshes(array);
15443 for (int j = 0; j < meshes; j++)
15444 {
15445 Mesh val4 = array[j];
15446 if (!((Object)(object)val4 == (Object)null))
15447 {
15448 uint meshTriangleCount = MeshUtils.GetMeshTriangleCount(val4);
15449 if (meshTriangleCount > num16)
15450 {
15451 num16 = meshTriangleCount;
15452 }
15453 }
15454 }
15455 ulong num17 = (uint)num5 * num16;
15456 num3 += num17;
15457 }
15458 TrailModule trails = current.trails;
15459 if (((TrailModule)(ref trails)).enabled)
15460 {
15461 flag = true;
15462 num4++;
15463 }
15464 CollisionModule collision = current.collision;
15465 if (((CollisionModule)(ref collision)).enabled)
15466 {
15467 flag2 = true;
15468 }
15469 }
15470 }
15471 finally
15472 {
15473 if (enumerator != null)
15474 {
15475 ((IDisposable)enumerator).Dispose();
15476 }
15477 }
15478 perfStats.particleSystemCount = new Nullable<int>(num);
15479 perfStats.particleTotalCount = new Nullable<int>((int)((num2 > 2147483647) ? 2147483647 : num2));
15480 perfStats.particleMaxMeshPolyCount = new Nullable<int>((int)((num3 > 2147483647) ? 2147483647 : num3));
15481 perfStats.particleTrailsEnabled = new Nullable<bool>(flag);
15482 perfStats.particleCollisionEnabled = new Nullable<bool>(flag2);
15483 perfStats.materialCount = new Nullable<int>(perfStats.materialCount.GetValueOrDefault() + num4);
15484 }
15485 }
15487 {
15488 [CompilerGenerated]
15489 private sealed class <>c__DisplayClass0_0 : Object
15490 {
15491 public AvatarPerformance.IgnoreDelegate shouldIgnoreComponent;
15492
15493 internal bool <RunPerformanceScanEnumerator>b__0(Collider o)
15494 {
15495 if (shouldIgnoreComponent != null && shouldIgnoreComponent((Component)(object)o))
15496 {
15497 return true;
15498 }
15499 if (HasStation((Component)(object)o))
15500 {
15501 return true;
15502 }
15503 return false;
15504 }
15505
15506 internal bool <RunPerformanceScanEnumerator>b__1(Rigidbody o)
15507 {
15508 if (shouldIgnoreComponent != null && shouldIgnoreComponent((Component)(object)o))
15509 {
15510 return true;
15511 }
15512 if (HasStation((Component)(object)o))
15513 {
15514 return true;
15515 }
15516 return false;
15517 }
15518 }
15519
15520 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
15521 public override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
15522 {
15523 <>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0
15524 {
15525 shouldIgnoreComponent = shouldIgnoreComponent
15526 };
15527 List<Collider> colliderBuffer = new List<Collider>();
15528 yield return ScanAvatarForComponentsOfType<Collider>(avatarObject, colliderBuffer);
15529 colliderBuffer.RemoveAll((Predicate<Collider>)delegate(Collider o)
15530 {
15531 if (CS$<>8__locals0.shouldIgnoreComponent != null && CS$<>8__locals0.shouldIgnoreComponent((Component)(object)o))
15532 {
15533 return true;
15534 }
15535 return HasStation((Component)(object)o) ? true : false;
15536 });
15537 perfStats.physicsColliderCount = new Nullable<int>(colliderBuffer.Count);
15538 List<Rigidbody> rigidbodyBuffer = new List<Rigidbody>();
15539 yield return ScanAvatarForComponentsOfType<Rigidbody>(avatarObject, rigidbodyBuffer);
15540 rigidbodyBuffer.RemoveAll((Predicate<Rigidbody>)delegate(Rigidbody o)
15541 {
15542 if (CS$<>8__locals0.shouldIgnoreComponent != null && CS$<>8__locals0.shouldIgnoreComponent((Component)(object)o))
15543 {
15544 return true;
15545 }
15546 return HasStation((Component)(object)o) ? true : false;
15547 });
15548 perfStats.physicsRigidbodyCount = new Nullable<int>(rigidbodyBuffer.Count);
15549 }
15550
15551 private static bool HasStation(Component comp)
15552 {
15553 VRCStation vRCStation = default(VRCStation);
15554 if (!comp.TryGetComponent<VRCStation>(ref vRCStation))
15555 {
15556 PerformanceScannerPlaceholder performanceScannerPlaceholder = default(PerformanceScannerPlaceholder);
15557 if (comp.TryGetComponent<PerformanceScannerPlaceholder>(ref performanceScannerPlaceholder))
15558 {
15559 return performanceScannerPlaceholder.type == typeof(VRCStation);
15560 }
15561 return false;
15562 }
15563 return true;
15564 }
15565 }
15567 {
15568 [CompilerGenerated]
15569 private sealed class <>c__DisplayClass0_0 : Object
15570 {
15571 public AvatarPerformance.IgnoreDelegate shouldIgnoreComponent;
15572
15573 internal bool <RunPerformanceScanEnumerator>b__0(TrailRenderer c)
15574 {
15575 return shouldIgnoreComponent((Component)(object)c);
15576 }
15577 }
15578
15579 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
15580 public override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
15581 {
15582 <>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0
15583 {
15584 shouldIgnoreComponent = shouldIgnoreComponent
15585 };
15586 List<TrailRenderer> trailRendererBuffer = new List<TrailRenderer>();
15587 yield return ScanAvatarForComponentsOfType<TrailRenderer>(avatarObject, trailRendererBuffer);
15588 if (CS$<>8__locals0.shouldIgnoreComponent != null)
15589 {
15590 trailRendererBuffer.RemoveAll((Predicate<TrailRenderer>)((TrailRenderer c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(object)c)));
15591 }
15592 int count = trailRendererBuffer.Count;
15593 perfStats.trailRendererCount = new Nullable<int>(count);
15594 perfStats.materialCount = new Nullable<int>(perfStats.materialCount.GetValueOrDefault() + count);
15595 }
15596 }
15597}
15599{
15600 public abstract class AbstractPerformanceFilter : ScriptableObject
15601 {
15602 public abstract IEnumerator ApplyPerformanceFilter(GameObject avatarObject, AvatarPerformanceStats perfStats, PerformanceRating ratingLimit, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent, AvatarPerformance.FilterBlockCallback onBlock, bool userForcedShow);
15603
15604 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
15605 protected static IEnumerator RemoveComponentsOfTypeEnumerator<T>(GameObject target) where T : Component
15606 {
15607 if ((Object)(object)target == (Object)null)
15608 {
15609 yield break;
15610 }
15611 T[] componentsInChildren = target.GetComponentsInChildren<T>(true);
15612 foreach (T val in componentsInChildren)
15613 {
15614 if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null))
15615 {
15616 yield return RemoveComponent((Component)(object)val);
15617 }
15618 }
15619 }
15620
15621 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
15622 protected static IEnumerator RemoveComponent(Component targetComponent)
15623 {
15624 yield return RemoveDependencies(targetComponent);
15625 Object.Destroy((Object)(object)targetComponent);
15626 yield return null;
15627 }
15628
15629 [IteratorStateMachine(/*Could not decode attribute arguments.*/)]
15630 protected static IEnumerator RemoveDependencies(Component targetComponent)
15631 {
15632 if ((Object)(object)targetComponent == (Object)null)
15633 {
15634 yield break;
15635 }
15636 Component[] components = targetComponent.GetComponents<Component>();
15637 if (components == null || components.Length == 0)
15638 {
15639 yield break;
15640 }
15641 Type componentType = ((Object)targetComponent).GetType();
15642 Component[] array = components;
15643 foreach (Component val in array)
15644 {
15645 if ((Object)(object)val == (Object)null)
15646 {
15647 continue;
15648 }
15649 bool flag = false;
15650 object[] customAttributes = ((MemberInfo)((Object)val).GetType()).GetCustomAttributes(typeof(RequireComponent), true);
15651 if (customAttributes.Length == 0)
15652 {
15653 continue;
15654 }
15655 object[] array2 = customAttributes;
15656 foreach (object obj in array2)
15657 {
15658 RequireComponent val2 = (RequireComponent)((obj is RequireComponent) ? obj : null);
15659 if (val2 != null && (!(val2.m_Type0 != componentType) || !(val2.m_Type1 != componentType) || !(val2.m_Type2 != componentType)))
15660 {
15661 flag = true;
15662 break;
15663 }
15664 }
15665 if (flag)
15666 {
15667 yield return RemoveComponent(val);
15668 }
15669 }
15670 }
15671 }
15672}
15674{
15675 [AttributeUsage(/*Could not decode attribute arguments.*/)]
15676 public class PerformanceScannerAttribute : Attribute
15677 {
15678 [field: CompilerGenerated]
15679 public Type type
15680 {
15681 [CompilerGenerated]
15682 get;
15683 }
15684
15686 {
15687 this.type = type;
15688 }
15689 }
15690}
15692{
15698 public enum VRCOrientation : Enum
15699 {
15705 Landscape,
15711 Portrait
15712 }
15713}
15715{
15716 public interface IVRCMidiInput
15717 {
15718 string Name { get; }
15719
15721
15722 bool OpenDevice(string name);
15723
15724 void Close();
15725
15726 void Update();
15727
15728 IEnumerable<string> GetDeviceNames();
15729 }
15730 public struct MidiRawEventArgs : ValueType
15731 {
15732 public readonly byte status;
15733
15734 public readonly byte data1;
15735
15736 public readonly byte data2;
15737
15738 public MidiRawEventArgs(byte status, byte data1, byte data2)
15739 {
15740 this.status = status;
15741 this.data1 = data1;
15742 this.data2 = data2;
15743 }
15744 }
15745 public struct MidiVoiceEventArgs : ValueType
15746 {
15747 public readonly int command;
15748
15749 public readonly int channel;
15750
15751 public readonly int number;
15752
15753 public readonly int value;
15754
15755 public MidiVoiceEventArgs(int command, int channel, byte number, byte value)
15756 {
15757 this.command = command;
15758 this.channel = channel;
15759 this.number = number;
15760 this.value = value;
15761 }
15762 }
15763 public delegate void MidiRawMessageDelegate(object sender, MidiRawEventArgs args);
15764 public delegate void MidiVoiceMessageDelegate(object sender, MidiVoiceEventArgs args);
15765}
15767{
15768 public abstract class VRCNetworkBehaviour : MonoBehaviour, INetworkID
15769 {
15770 }
15771 [Serializable]
15772 public class NetworkIDPair : Object
15773 {
15774 public GameObject gameObject;
15775
15776 public int ID;
15777
15778 public List<string> SerializedTypeNames = new List<string>();
15779
15780 public override string ToString()
15781 {
15782 string text = (Object.op_Implicit((Object)(object)gameObject) ? ((Object)gameObject).name : String.Empty);
15783 string text2 = ((SerializedTypeNames != null) ? String.Join(", ", (IEnumerable<string>)(object)SerializedTypeNames) : String.Empty);
15784 return String.Format("{0}: {1} [{2}]", (object)ID, (object)text, (object)text2);
15785 }
15786 }
15787 public static class NetworkIDAssignment : Object
15788 {
15789 public enum SetError : Enum
15790 {
15791 InvalidId,
15792 IdInUse,
15793 IncompatibleTypes,
15794 InvalidObject
15795 }
15796
15797 public struct SetErrorLocation : ValueType
15798 {
15800
15802
15804
15805 public override string ToString()
15806 {
15807 if (relatedLocation != null)
15808 {
15809 return String.Format("{0} at {1}\nRelated: {2}", (object)error, (object)location, (object)relatedLocation);
15810 }
15811 return String.Format("{0} at {1}", (object)error, (object)location);
15812 }
15813 }
15814
15815 [CompilerGenerated]
15816 private sealed class <>c__DisplayClass7_0 : Object
15817 {
15818 public Scene curScene;
15819
15821
15822 public Dictionary<GameObject, NetworkIDPair> idMap;
15823
15824 public Dictionary<int, GameObject> idMapReverse;
15825
15826 internal bool <ConfigureNetworkIDs>b__0(INetworkID nid)
15827 {
15828 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
15829 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
15830 Component val = (Component)((nid is Component) ? nid : null);
15831 if (val != null && Object.op_Implicit((Object)(object)val.gameObject))
15832 {
15833 return curScene == val.gameObject.scene;
15834 }
15835 return false;
15836 }
15837
15838 internal bool <ConfigureNetworkIDs>b__4(SetErrorLocation err)
15839 {
15840 return Enumerable.Contains<SetError>((IEnumerable<SetError>)(object)errorsToIgnore, err.error);
15841 }
15842
15843 internal NetworkIDPair <ConfigureNetworkIDs>b__5(INetworkID nid)
15844 {
15845 return idMap[((Component)((nid is Component) ? nid : null)).gameObject];
15846 }
15847 }
15848
15849 [CompilerGenerated]
15850 private sealed class <>c__DisplayClass7_1 : Object
15851 {
15852 public int curId;
15853
15854 public GameObject source;
15855
15856 internal bool <ConfigureNetworkIDs>b__9(NetworkIDPair pair)
15857 {
15858 if (pair.ID == curId)
15859 {
15860 return (Object)(object)pair.gameObject != (Object)(object)source;
15861 }
15862 return false;
15863 }
15864 }
15865
15866 public const int MinID = 10;
15867
15868 public const int MaxID = 100000;
15869
15870 public static string GetNetworkIDGameObjectPath(Transform t)
15871 {
15872 string text = ((Object)t).name;
15873 Transform parent = t.parent;
15874 while ((Object)(object)parent != (Object)null)
15875 {
15876 text = String.Concat(((Object)parent).name, "/", text);
15877 parent = parent.parent;
15878 }
15879 return String.Concat("/", text);
15880 }
15881
15882 public static List<string> GetSerializedTypes(INetworkID NetworkID)
15883 {
15884 return GetSerializedTypes(((Component)((NetworkID is Component) ? NetworkID : null)).gameObject);
15885 }
15886
15887 public static List<string> GetSerializedTypes(GameObject NetworkID)
15888 {
15889 return Enumerable.ToList<string>(Enumerable.Select<VRCNetworkBehaviour, string>((IEnumerable<VRCNetworkBehaviour>)(object)NetworkID.GetComponents<VRCNetworkBehaviour>(), (Func<VRCNetworkBehaviour, string>)((VRCNetworkBehaviour nb) => ((Object)nb).GetType().FullName)));
15890 }
15891
15892 public static ValueTuple<IEnumerable<NetworkIDPair>, IEnumerable<NetworkIDPair>> ConfigureNetworkIDs(INetworkIDContainer container, out List<SetErrorLocation> errors, params SetError[] errorsToIgnore)
15893 {
15894 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
15895 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
15896 //IL_005c: Unknown result type (might be due to invalid IL or missing references)
15897 //IL_0061: Unknown result type (might be due to invalid IL or missing references)
15898 //IL_0086: Unknown result type (might be due to invalid IL or missing references)
15899 //IL_008c: Unknown result type (might be due to invalid IL or missing references)
15900 //IL_0231: Unknown result type (might be due to invalid IL or missing references)
15901 //IL_0236: Unknown result type (might be due to invalid IL or missing references)
15902 //IL_02b9: Unknown result type (might be due to invalid IL or missing references)
15903 <>c__DisplayClass7_0 CS$<>8__locals0 = new <>c__DisplayClass7_0();
15904 CS$<>8__locals0.errorsToIgnore = errorsToIgnore;
15905 errors = new List<SetErrorLocation>();
15906 if (container.NetworkIDCollection == null)
15907 {
15908 container.NetworkIDCollection = new List<NetworkIDPair>();
15909 }
15910 CS$<>8__locals0.curScene = ((Component)((container is Component) ? container : null)).gameObject.scene;
15911 int num = 10;
15912 CS$<>8__locals0.idMap = new Dictionary<GameObject, NetworkIDPair>();
15913 CS$<>8__locals0.idMapReverse = new Dictionary<int, GameObject>();
15914 Enumerator<NetworkIDPair> enumerator = container.NetworkIDCollection.GetEnumerator();
15915 try
15916 {
15917 while (enumerator.MoveNext())
15918 {
15919 NetworkIDPair current = enumerator.Current;
15920 if (!Object.op_Implicit((Object)(object)current.gameObject) || current.gameObject.scene != CS$<>8__locals0.curScene)
15921 {
15922 errors.Add(new SetErrorLocation
15923 {
15924 error = SetError.InvalidObject,
15925 location = current
15926 });
15927 continue;
15928 }
15929 if (current.ID < 10 || current.ID >= 100000)
15930 {
15931 errors.Add(new SetErrorLocation
15932 {
15933 error = SetError.InvalidId,
15934 location = current
15935 });
15936 continue;
15937 }
15938 CS$<>8__locals0.idMap[current.gameObject] = current;
15939 CS$<>8__locals0.idMapReverse[current.ID] = current.gameObject;
15940 if (current.ID >= num)
15941 {
15942 num = current.ID + 1;
15943 }
15944 }
15945 }
15946 finally
15947 {
15948 ((IDisposable)enumerator).Dispose();
15949 }
15950 Debug.LogWarningFormat("Recovered {0} Network IDs from {1}", (object[])(object)new Object[2]
15951 {
15952 (object)CS$<>8__locals0.idMap.Count,
15953 (Object)((Object)((container is Component) ? container : null)).name
15954 });
15955 List<INetworkID> val = new List<INetworkID>();
15956 List<NetworkIDPair> val2 = new List<NetworkIDPair>();
15957 container.GetNetworkIDObjects(val);
15958 val = Enumerable.ToList<INetworkID>(Enumerable.Select<GameObject, INetworkID>((IEnumerable<GameObject>)(object)Enumerable.OrderBy<GameObject, string>(Enumerable.Distinct<GameObject>(Enumerable.Select<INetworkID, GameObject>(Enumerable.Where<INetworkID>((IEnumerable<INetworkID>)(object)val, (Func<INetworkID, bool>)delegate(INetworkID nid)
15959 {
15960 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
15961 //IL_0023: Unknown result type (might be due to invalid IL or missing references)
15962 Component val4 = (Component)((nid is Component) ? nid : null);
15963 return val4 != null && Object.op_Implicit((Object)(object)val4.gameObject) && CS$<>8__locals0.curScene == val4.gameObject.scene;
15964 }), (Func<INetworkID, GameObject>)((INetworkID nid) => ((Component)((nid is Component) ? nid : null)).gameObject))), (Func<GameObject, string>)((GameObject go) => GetNetworkIDGameObjectPath(go.transform)), (IComparer<string>)(object)StringComparer.InvariantCulture), (Func<GameObject, INetworkID>)((GameObject go) => go.GetComponent<INetworkID>())));
15965 num = FindNextFreeID(num);
15966 Enumerator<INetworkID> enumerator2 = val.GetEnumerator();
15967 try
15968 {
15969 while (enumerator2.MoveNext())
15970 {
15971 INetworkID current2 = enumerator2.Current;
15972 if (TrySetID(current2, ref num, ref errors, out var newIDPair2) && newIDPair2 != null)
15973 {
15974 val2.Add(newIDPair2);
15975 }
15976 }
15977 }
15978 finally
15979 {
15980 ((IDisposable)enumerator2).Dispose();
15981 }
15982 errors.RemoveAll((Predicate<SetErrorLocation>)((SetErrorLocation err) => Enumerable.Contains<SetError>((IEnumerable<SetError>)(object)CS$<>8__locals0.errorsToIgnore, err.error)));
15983 container.NetworkIDCollection = Enumerable.ToList<NetworkIDPair>((IEnumerable<NetworkIDPair>)(object)CS$<>8__locals0.idMap.Values);
15984 return new ValueTuple<IEnumerable<NetworkIDPair>, IEnumerable<NetworkIDPair>>(Enumerable.Distinct<NetworkIDPair>(Enumerable.Select<INetworkID, NetworkIDPair>((IEnumerable<INetworkID>)(object)val, (Func<INetworkID, NetworkIDPair>)((INetworkID nid) => CS$<>8__locals0.idMap[((Component)((nid is Component) ? nid : null)).gameObject]))), (IEnumerable<NetworkIDPair>)(object)val2);
15985 [CompilerGenerated]
15986 static bool DoTypesMatch(NetworkIDPair idInfo, List<string> typeNames)
15987 {
15988 if (idInfo.SerializedTypeNames.Count != 0)
15989 {
15990 return Enumerable.SequenceEqual<string>((IEnumerable<string>)(object)idInfo.SerializedTypeNames, (IEnumerable<string>)(object)typeNames);
15991 }
15992 return true;
15993 }
15994 void findNextFree()
15995 {
15996 while (CS$<>8__locals0.idMapReverse.ContainsKey(P_0.curId) && P_0.curId < 100000)
15997 {
15998 P_0.curId++;
15999 }
16000 }
16001 int FindNextFreeID(int curId)
16002 {
16003 //IL_0040: Unknown result type (might be due to invalid IL or missing references)
16004 findNextFree();
16005 if (curId >= 100000)
16006 {
16007 curId = 10;
16008 findNextFree();
16009 }
16010 if (curId >= 100000)
16011 {
16012 throw new ApplicationException("Ran out of Network IDs!");
16013 }
16014 return curId;
16015 }
16016 bool TrySetID(INetworkID NetworkID, ref int refId, ref List<SetErrorLocation> errors, out NetworkIDPair newIDPair)
16017 {
16018 <>c__DisplayClass7_1 CS$<>8__locals1 = new <>c__DisplayClass7_1
16019 {
16020 source = ((Component)((NetworkID is Component) ? NetworkID : null)).gameObject
16021 };
16022 List<string> serializedTypes = GetSerializedTypes(NetworkID);
16023 CS$<>8__locals1.curId = refId;
16024 newIDPair = null;
16025 if (CS$<>8__locals1.curId < 10 || CS$<>8__locals1.curId >= 100000)
16026 {
16027 errors.Add(new SetErrorLocation
16028 {
16029 error = SetError.InvalidId,
16030 location = new NetworkIDPair
16031 {
16032 gameObject = CS$<>8__locals1.source,
16033 ID = CS$<>8__locals1.curId
16034 }
16035 });
16036 return false;
16037 }
16038 GameObject val3 = default(GameObject);
16039 if (CS$<>8__locals0.idMapReverse.TryGetValue(CS$<>8__locals1.curId, ref val3) && (Object)(object)val3 != (Object)(object)CS$<>8__locals1.source)
16040 {
16041 errors.Add(new SetErrorLocation
16042 {
16043 error = SetError.IdInUse,
16044 location = new NetworkIDPair
16045 {
16046 gameObject = CS$<>8__locals1.source,
16047 ID = CS$<>8__locals1.curId
16048 },
16049 relatedLocation = Enumerable.First<NetworkIDPair>((IEnumerable<NetworkIDPair>)(object)CS$<>8__locals0.idMap.Values, (Func<NetworkIDPair, bool>)((NetworkIDPair pair) => pair.ID == CS$<>8__locals1.curId && (Object)(object)pair.gameObject != (Object)(object)CS$<>8__locals1.source))
16050 });
16051 return false;
16052 }
16053 NetworkIDPair networkIDPair = default(NetworkIDPair);
16054 if (CS$<>8__locals0.idMap.TryGetValue(CS$<>8__locals1.source, ref networkIDPair))
16055 {
16056 if (!DoTypesMatch(networkIDPair, serializedTypes))
16057 {
16058 errors.Add(new SetErrorLocation
16059 {
16060 error = SetError.IncompatibleTypes,
16061 location = networkIDPair
16062 });
16063 }
16064 }
16065 else
16066 {
16067 newIDPair = new NetworkIDPair
16068 {
16069 gameObject = CS$<>8__locals1.source,
16070 ID = CS$<>8__locals1.curId,
16071 SerializedTypeNames = serializedTypes
16072 };
16073 CS$<>8__locals0.idMap.Add(CS$<>8__locals1.source, newIDPair);
16074 CS$<>8__locals0.idMapReverse[CS$<>8__locals1.curId] = CS$<>8__locals1.source;
16075 refId = FindNextFreeID(CS$<>8__locals1.curId);
16076 }
16077 return true;
16078 }
16079 }
16080 }
16081}
16083{
16084 public interface IVRCInteractable
16085 {
16086 float Proximity { get; }
16087 }
16088}
16090{
16091 public class PerformanceScannerPlaceholder : MonoBehaviour
16092 {
16093 private Type _type;
16094
16095 [SerializeField]
16096 private string TypeInfo;
16097
16098 public Type type
16099 {
16100 get
16101 {
16102 return _type;
16103 }
16104 set
16105 {
16106 _type = value;
16107 TypeInfo = ((Object)value).ToString();
16108 }
16109 }
16110 }
16111}
16113{
16114 public class CurveAttribute : PropertyAttribute
16115 {
16116 public float PosX;
16117
16118 public float PosY;
16119
16120 public float RangeX;
16121
16122 public float RangeY;
16123
16124 public CurveAttribute(float PosX, float PosY, float RangeX, float RangeY)
16125 {
16126 this.PosX = PosX;
16127 this.PosY = PosY;
16128 this.RangeX = RangeX;
16129 this.RangeY = RangeY;
16130 }
16131 }
16132 public class HelpBoxAttribute : PropertyAttribute
16133 {
16134 public enum MessageType : Enum
16135 {
16136 None,
16137 Info,
16138 Warning,
16139 Error
16140 }
16141
16142 public string text;
16143
16145
16147 {
16148 this.text = text;
16149 this.messageType = messageType;
16150 }
16151 }
16152}
ControllerHand
Definition: VRCSDKBase.cs:432
TutorialLabelType
Definition: VRCSDKBase.cs:469
ControllerInputUI
Definition: VRCSDKBase.cs:438
ControllerActionUI
Definition: VRCSDKBase.cs:457
AttachMode
Definition: VRCSDKBase.cs:480
@ PositionAndRotation
void< ExecuteComputeShader > b__0(AsyncGPUReadbackRequest req)
Definition: VRCSDKBase.cs:76
const int THREADS
Definition: VRCSDKBase.cs:98
static bool ComputeShaderReady
Definition: VRCSDKBase.cs:106
static int OutputProperty
Definition: VRCSDKBase.cs:102
static DPIDMipmapper Instance
Definition: VRCSDKBase.cs:104
int kernelDownsampling
Definition: VRCSDKBase.cs:94
static void GenerateDPIDMipmapsFast(Texture2D texture, bool alphaIsTransparency, bool sRGB, bool conservative=false, bool normalMap=false)
Definition: VRCSDKBase.cs:134
int kernelGuidance
Definition: VRCSDKBase.cs:96
static int TmpGuidanceProperty
Definition: VRCSDKBase.cs:100
static void GenerateDPIDMipmapsQuality(Texture2D input, Texture2D output, bool alphaIsTransparency, bool sRGB, bool conservative=false, bool normalMap=false)
Definition: VRCSDKBase.cs:128
ComputeShader computeShader
Definition: VRCSDKBase.cs:92
static void GenerateDPIDMipmaps(Texture2D input, Texture2D output, bool alphaIsTransparency, bool sRGB, bool asyncOnGPU=false, bool inPlace=true, bool inputIsGuidance=false, bool conservative=false, uint minimumSize=4u, bool normalMap=false)
Definition: VRCSDKBase.cs:123
void ExecuteComputeShader(Texture2D input, Texture2D output, bool alphaIsTransparency, bool sRGB, bool asyncOnGPU=false, bool inPlace=true, bool inputIsGuidance=false, bool conservative=false, uint minimumSize=4u, bool normalMap=false)
Definition: VRCSDKBase.cs:139
static ulong GetUnitSize(this FileSizeUnit unit)
Definition: VRCSDKBase.cs:553
const string UnitPostfixKB
Definition: VRCSDKBase.cs:498
static bool TryParse(string unitText, out FileSizeUnit unitLiteral)
Definition: VRCSDKBase.cs:518
static string GetPostfix(this FileSizeUnit unit)
Definition: VRCSDKBase.cs:567
const string UnitPostfixGB
Definition: VRCSDKBase.cs:502
const string UnitPostfixTB
Definition: VRCSDKBase.cs:504
const string UnitPostfixMB
Definition: VRCSDKBase.cs:500
bool< RunPerformanceScanEnumerator > b__1(IVRCConstraint c)
Definition: VRCSDKBase.cs:736
bool< RunPerformanceScanEnumerator > b__0(IConstraint c)
Definition: VRCSDKBase.cs:731
override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
Definition: VRCSDKBase.cs:743
int GetGroupDepth(List< IVRCConstraint > vrcConstraints, out int vrcCachedConstraintsCount)
Definition: VRCSDKBase.cs:779
void< DownloadImageInternal > b__0(AsyncOperation _)
Definition: VRCSDKBase.cs:843
static ImageDownloader Instance
Definition: VRCSDKBase.cs:918
readonly List< string > cachedImageQueue
Definition: VRCSDKBase.cs:911
void TrimCacheInternal(int size)
Definition: VRCSDKBase.cs:942
static void DownloadImage(string imageUrl, int imageSize, Action< Texture2D > onImageDownload=null, Action< ImageLoadError > onImageDownloadFailed=null, string fallbackImageUrl="", bool isRetry=false)
Definition: VRCSDKBase.cs:937
void CacheTexture(string cacheRef, Texture2D tex)
Definition: VRCSDKBase.cs:1071
void DownloadImageInternal(string imageUrl, int imageSize, Action< Texture2D > onImageDownload, Action< ImageLoadError > onImageDownloadFailed, string fallbackImageUrl="", bool isRetry=false)
Definition: VRCSDKBase.cs:963
void DownloadFallbackOrUseErrorImage(string fallbackImageUrl, Action< Texture2D > onImageDownload)
Definition: VRCSDKBase.cs:1087
static void TrimCache(int size)
Definition: VRCSDKBase.cs:931
CurveAttribute(float PosX, float PosY, float RangeX, float RangeY)
HelpBoxAttribute(string text, MessageType messageType=MessageType.None)
static void SetBoolInputSetting(VRCInputSetting setting, bool enabled)
static void EnableObjectHighlight(Renderer r, bool enable)
static bool GetBoolInputSetting(VRCInputSetting setting)
static void EnableObjectHighlight(GameObject obj, bool enable)
static VRCInputMethod GetLastUsedInputMethod()
static bool IsUsingHandController()
static float AngleClosestBetweenTwoUnitVectors(Vector3 planeNormal, Vector3 vectorA, Vector3 vectorB)
Definition: VRCSDKBase.cs:4734
static float AngleBetweenTwoUnitVectors(Vector3 planeNormal, Vector3 vectorA, Vector3 vectorB)
Definition: VRCSDKBase.cs:4717
static float ClosestPointOnLineSegment_Value(Vector3 lineA, Vector3 lineB, Vector3 point)
Definition: VRCSDKBase.cs:4751
static float TWO_PI
Definition: VRCSDKBase.cs:4711
static Vector3 ClosestPointOnLineSegment(Vector3 lineA, Vector3 lineB, Vector3 point)
Definition: VRCSDKBase.cs:4777
static float HALF_PI
Definition: VRCSDKBase.cs:4713
static float QUARTER_PI
Definition: VRCSDKBase.cs:4715
static Vector3 ClosestPointOnPlane(Vector3 planeOrigin, Vector3 planeNormal, Vector3 point)
Definition: VRCSDKBase.cs:4809
bool< ConfigureNetworkIDs > b__4(SetErrorLocation err)
NetworkIDPair< ConfigureNetworkIDs > b__5(INetworkID nid)
Dictionary< GameObject, NetworkIDPair > idMap
bool< ConfigureNetworkIDs > b__0(INetworkID nid)
bool< ConfigureNetworkIDs > b__9(NetworkIDPair pair)
static List< string > GetSerializedTypes(INetworkID NetworkID)
static ValueTuple< IEnumerable< NetworkIDPair >, IEnumerable< NetworkIDPair > > ConfigureNetworkIDs(INetworkIDContainer container, out List< SetErrorLocation > errors, params SetError[] errorsToIgnore)
static List< string > GetSerializedTypes(GameObject NetworkID)
static string GetNetworkIDGameObjectPath(Transform t)
Networking is a class that provides a set of static methods relating to the networking of UdonBehavio...
static GameObject[] GetPlayerObjects(VRCPlayerApi target)
SyncType
The different sync types available for entire U# objects. Setting this in code will remove the inspec...
static object[] DecodeParameters(byte[] encodedData)
static double CalculateServerDeltaTime(double timeInSeconds, double previousTimeInSeconds)
Calculates the difference between two server time stamps as returned by VRC.SDKBase....
static DateTime GetNetworkDateTime()
Returns the current network time as a System.DateTime object.
static bool IsOwner(VRCPlayerApi player, GameObject obj)
Tells you whether a Player is the Owner of a given GameObject, important for Sync.
static VRCPlayerApi LocalPlayer
returns the VRC.SDKBase.VRCPlayerApi object of the local player.
static float SimulationTime(GameObject target)
returns the current simulation time of a object with networking components. Simulation time is a time...
static void SetOwner(VRCPlayerApi player, GameObject obj)
Sets the owner of a given GameObject to a given player.
static void RPC(VRCPlayerApi targetPlayer, GameObject targetObject, string methodName, params object[] parameters)
static void Destroy(GameObject obj)
static bool GoToRoom(string roomID)
static bool IsOwner(GameObject obj)
Tells you whether the local Player is the Owner of a given GameObject, important for Sync.
static int GetServerTimeInMilliseconds()
Returns the current server time in milliseconds.
static string GetUniqueName(GameObject obj)
Returns a unique name for a given GameObject.
static Coroutine SafeStartCoroutine(IEnumerator target)
static VRC_EventDispatcher GetEventDispatcher()
static void RPC(RPC.Destination targetClients, GameObject targetObject, string methodName, params object[] parameters)
static VRCPlayerApi GetOwner(GameObject obj)
Returns the VRC.SDKBase.VRCPlayerApi object of the owner of a given GameObject.
static bool IsObjectReady(GameObject obj)
Returns whether a given GameObject is ready for use.
static float SimulationTime(VRCPlayerApi target)
returns the current simulation time of a player. Simulation time is a timestamp that refers to how fa...
static GameObject Instantiate(VRC_EventHandler.VrcBroadcastType broadcast, string prefabPathOrDynamicPrefabName, Vector3 position, Quaternion rotation)
static double GetServerTimeInSeconds()
Returns the current server time in seconds.
static byte[] EncodeParameters(params object[] parameters)
static Component FindComponentInPlayerObjects(VRCPlayerApi target, Component referenceComponent)
Destination[] allowedTargets
RPC(params Destination[] targets)
RPC(short code, float playerRateLimit, float globalRateLimit, params Destination[] targets)
RPC(short code, float playerRateLimit, params Destination[] targets)
void SetupTargets(Destination[] targets)
RPC(short code, params Destination[] targets)
static void DeactivateObjectLabel(Transform targetObject)
Definition: VRCSDKBase.cs:9025
static void ActivateAreaMarkerLabel(Transform targetObject, string text)
Definition: VRCSDKBase.cs:9002
static void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, float duration=0.1f, int priority=0, AttachMode attachMode=AttachMode.PositionOnly, bool showOffscreen=false)
Definition: VRCSDKBase.cs:9007
static void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, float duration=0.1f, int priority=0, AttachMode attachMode=AttachMode.PositionOnly, bool showOffscreen=false)
Definition: VRCSDKBase.cs:9012
static void ActivateControllerLabel(ControllerHand hand, ControllerInputUI controllerPart, string text, float duration, int priority)
Definition: VRCSDKBase.cs:9033
delegate void ActivateObjectLabelDelegate(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, AttachMode attachMode, bool showOffscreen)
delegate void DeactivateControllerLabelDelegate(ControllerHand hand, ControllerInputUI controllerPart)
delegate void ActivateControllerLabelDelegate(ControllerHand hand, ControllerInputUI controllerPart, string text, float duration, int priority)
static void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, AttachMode attachMode, bool showOffscreen)
Definition: VRCSDKBase.cs:9017
static void DeactivateControllerLabel(ControllerHand hand, ControllerInputUI controllerPart)
Definition: VRCSDKBase.cs:9041
delegate void DeactivateObjectLabelDelegate(Transform targetObject)
static bool IsValid(object obj)
static void SetIsClient()
static void ShuffleArray(int[] array)
static bool IsClient()
virtual void Execute(VRCUrl parameter)
Definition: VRCSDKBase.cs:5919
virtual void Execute(int parameter)
Definition: VRCSDKBase.cs:5914
virtual void Execute(string parameter)
Definition: VRCSDKBase.cs:5906
static void Blit(Texture source, RenderTexture dest, Material mat)
Definition: VRCSDKBase.cs:5529
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties)
Definition: VRCSDKBase.cs:5572
static void Blit(Texture source, RenderTexture dest, Material mat, int pass=-1)
Definition: VRCSDKBase.cs:5523
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera)
Definition: VRCSDKBase.cs:5601
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows)
Definition: VRCSDKBase.cs:5577
static void CheckBlitTarget(RenderTexture dest)
Definition: VRCSDKBase.cs:5646
static void Blit(Texture source, RenderTexture dest, int sourceDepthSlice, int destDepthSlice)
Definition: VRCSDKBase.cs:5543
static void Blit(Texture source, Material mat, int pass, int destDepthSlice)
Definition: VRCSDKBase.cs:5557
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer)
Definition: VRCSDKBase.cs:5589
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows)
Definition: VRCSDKBase.cs:5583
static LayerMask GetLayerMask()
Definition: VRCSDKBase.cs:5639
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera, LightProbeUsage lightProbeUsage, LightProbeProxyVolume lightProbeProxyVolume)
Definition: VRCSDKBase.cs:5626
static void Blit(Texture source, RenderTexture dest, Vector2 scale, Vector2 offset, int sourceDepthSlice, int destDepthSlice)
Definition: VRCSDKBase.cs:5549
static void Blit(Texture source, RenderTexture dest, Vector2 scale, Vector2 offset)
Definition: VRCSDKBase.cs:5535
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices)
Definition: VRCSDKBase.cs:5562
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count)
Definition: VRCSDKBase.cs:5567
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera, LightProbeUsage lightProbeUsage)
Definition: VRCSDKBase.cs:5613
static void Blit(Texture source, RenderTexture dest)
Definition: VRCSDKBase.cs:5517
You can interact with Players in your world through the VRCPlayerApi. Each Player has a VRCPlayerApi ...
Definition: VRCSDKBase.cs:1297
static BoolDelegate IsGrounded
Definition: VRCSDKBase.cs:1413
bool isLocal
Tells you whether the given Player is the local one.
Definition: VRCSDKBase.cs:1398
string displayName
Get the name displayed for the Player (can be different than Username, which is used to log into VRCh...
Definition: VRCSDKBase.cs:1405
void CombatSetRespawn(bool respawnOnDeath, float respawnTimer, Transform respawnLocation)
Definition: VRCSDKBase.cs:2335
delegate bool BoolDelegate(VRCPlayerApi player)
void SetAvatarEyeHeightByMeters(float scaleMeters)
Sets the eye height for the target player's avatar in meters. This function only works for the local ...
Definition: VRCSDKBase.cs:2727
void SetVoiceGain(float gain)
Add boost to the Player's voice in decibels.
Definition: VRCSDKBase.cs:2366
delegate void SetAnimatorBoolDelegate(VRCPlayerApi player, string name, bool value)
static VRCPlayerApi[] GetPlayers(VRCPlayerApi[] players)
This is how you get all the Players in your world so you can go through them in a For Loop and apply ...
Definition: VRCSDKBase.cs:1679
bool IsPlayerGrounded()
Get whether the player is touching the ground, which enables Jump.
Definition: VRCSDKBase.cs:1659
void SetStrafeSpeed(float speed=2f)
The speed at which a Player can strafe around your world. Players speed when strafing is not affected...
Definition: VRCSDKBase.cs:2142
delegate Ray GetLookRayDelegate(VRCPlayerApi player)
float GetWalkSpeed()
The speed at which a Player can walk around your world.
Definition: VRCSDKBase.cs:2195
static VRCPlayerApi GetPlayerById(int playerId)
Get a VRCPlayerApi object for the given player Id if it exists.
Definition: VRCSDKBase.cs:1731
Quaternion GetBoneRotation(HumanBodyBones tt)
Gets the rotation of the specified Bone in the Player's Avatar, or Quaternion.Identity (0,...
Definition: VRCSDKBase.cs:1845
void SetAvatarAudioGain(float gain)
Set the Maximum Gain allowed on Avatar Audio.
Definition: VRCSDKBase.cs:2468
void CombatSetDamageGraphic(GameObject prefab)
Definition: VRCSDKBase.cs:2344
bool isMaster
Tells you whether the given Player is the instance master.
Definition: VRCSDKBase.cs:1598
void SetPlayerTag(string tagName, string tagValue="")
Sets a string variable that you can look up later. For example, you could set the "role" of a player...
Definition: VRCSDKBase.cs:2037
void SetAvatarAudioForceSpatial(bool force)
If this is on, then Spatialization is enabled for the source, and the spatialBlend is set to 1.
Definition: VRCSDKBase.cs:2528
float GetRunSpeed()
The speed at which a Player can run around your world.
Definition: VRCSDKBase.cs:2182
IVRC_Destructible CombatGetDestructible()
Definition: VRCSDKBase.cs:2353
float GetAvatarEyeHeightMaximumAsMeters()
Returns the maximum eye height that the local player is permitted to scale themselves to in the playe...
Definition: VRCSDKBase.cs:2685
VRC_Pickup GetPickupInHand(VRC_Pickup.PickupHand hand)
Gets the pickup a Player is holding in the specified hand. Only works for the Local Player.
Definition: VRCSDKBase.cs:1861
void Respawn(int spawnsIndex)
Respawns the player
Definition: VRCSDKBase.cs:1985
void SetNamePlateVisibility(bool flag)
Definition: VRCSDKBase.cs:2014
Quaternion GetRotation()
Gets the rotation of the Player in world space.
Definition: VRCSDKBase.cs:2656
void SetInvisibleToTagged(bool invisible, string tagName, string tagValue="")
Definition: VRCSDKBase.cs:2086
void SetWalkSpeed(float speed=2f)
The speed at which a Player can walk around your world.
Definition: VRCSDKBase.cs:2127
void SetRunSpeed(float speed=4f)
The speed at which a Player can run around your world.
Definition: VRCSDKBase.cs:2114
void SetJumpImpulse(float impulse=3f)
How much force applied when a player jumps. Set this if you want to enable jump in your world....
Definition: VRCSDKBase.cs:2156
void SetSilencedToUntagged(int level, string tagName, string tagValue="")
Definition: VRCSDKBase.cs:2101
void SetGravityStrength(float strength=1f)
Multiplier for the Gravity force of the world (set to Earth's default).
Definition: VRCSDKBase.cs:2247
static List< VRCPlayerApi > sPlayers
Definition: VRCSDKBase.cs:1415
void SetAvatarEyeHeightByMultiplier(float scaleMultiplier)
Sets the eye height using a multiplier of the target player's avatar eye height at its prefab scale....
Definition: VRCSDKBase.cs:2742
bool IsUserInVR()
Tells you whether a Player is using a VR headset.
Definition: VRCSDKBase.cs:2234
void EnablePickups(bool enable)
Turn off the Player's ability to pickup and use VRCPickup objects in the world. This property is on b...
Definition: VRCSDKBase.cs:1998
float GetAvatarEyeHeightMinimumAsMeters()
Returns the minimum eye height in meters that the local player is permitted to scale themselves to in...
Definition: VRCSDKBase.cs:2699
bool IsOwner(GameObject obj)
Tells you whether a Player is the Owner of a given GameObject, important for Sync.
Definition: VRCSDKBase.cs:1760
bool GetManualAvatarScalingAllowed()
Checks if the local player is allowed to control their avatar scale.
Definition: VRCSDKBase.cs:2713
void TeleportTo(Vector3 teleportPos, Quaternion teleportRot)
Send a player to a new spot and specified rotation, unless a Station does not allow it.
Definition: VRCSDKBase.cs:1904
void SetVoiceDistanceFar(float far)
This sets the end of the range for hearing the user's voice. You can lower this to make another playe...
Definition: VRCSDKBase.cs:2406
void ClearPlayerTags()
Remove all tags that you've set on this player.
Definition: VRCSDKBase.cs:2081
Transform GetBoneTransform(HumanBodyBones tt)
Gets the transform of a bone in the Player's Avatar. Currently unusable in Udon, use VRC....
Definition: VRCSDKBase.cs:1801
void CombatSetMaxHitpoints(float maxHp)
Definition: VRCSDKBase.cs:2307
delegate void ClaimNetworkControlDelegate(VRCPlayerApi player, VRC_ObjectApi obj)
void Respawn()
Respawns the player
Definition: VRCSDKBase.cs:1972
static List< VRCPlayerApi > AllPlayers
Gets all the players in the instance as a list. Currently unusable in udon
Definition: VRCSDKBase.cs:1630
void TakeOwnership(GameObject obj)
Definition: VRCSDKBase.cs:1765
bool isInstanceOwner
If the player is the owner of the instance. This isnt as straightforward as it seems,...
Definition: VRCSDKBase.cs:1607
void PlayHapticEventInHand(VRC_Pickup.PickupHand hand, float duration, float amplitude, float frequency)
Vibrate the Player's Haptic controllers if they have them.
Definition: VRCSDKBase.cs:1885
static SetAnimatorBoolDelegate SetAnimatorBool
Definition: VRCSDKBase.cs:1407
void CombatSetCurrentHitpoints(float hp)
Definition: VRCSDKBase.cs:2316
string GetPlayerTag(string tagName)
Gets the value of a tag that was set with SetPlayerTag.
Definition: VRCSDKBase.cs:2053
static ClaimNetworkControlDelegate ClaimNetworkControl
Definition: VRCSDKBase.cs:1409
void SetAvatarAudioCustomCurve(bool allow)
This sets whether the audio source should use a pre-configured custom curve??????
Definition: VRCSDKBase.cs:2541
List< int > GetPlayersWithTag(string tagName, string tagValue="")
NOT CURRENTLY FUNCTIONAL! DO NOT USE, WILL THROW EXPOSURE EXCEPTION!
Definition: VRCSDKBase.cs:2071
void SetAvatarEyeHeightMaximumByMeters(float scaleMeters)
Sets the maximum eye height in meters that the local player is permitted to scale themselves to in th...
Definition: VRCSDKBase.cs:2756
Vector3 GetPosition()
Gets the position of the Player in world space.
Definition: VRCSDKBase.cs:2642
void SetAvatarAudioFarRadius(float distance)
This sets the maximum end of the range for hearing the avatar's audio.
Definition: VRCSDKBase.cs:2482
float GetStrafeSpeed()
The speed at which a Player can strafe around your world.
Definition: VRCSDKBase.cs:2208
void SetVelocity(Vector3 velocity)
Set the speed and direction of the player's movement.
Definition: VRCSDKBase.cs:2614
int playerId
Get the cached PlayerId, calls GetPlayerId if it hasn't been cached yet.
Definition: VRCSDKBase.cs:1641
void SetManualAvatarScalingAllowed(bool enabled)
Toggles between player-controlled and world-authoritative scaling modes.
Definition: VRCSDKBase.cs:2783
void SetSilencedToTagged(int level, string tagName, string tagValue="")
Definition: VRCSDKBase.cs:2096
bool isModerator
if the player is a moderator. Currently unusable in udon
Definition: VRCSDKBase.cs:1614
void PushAnimations(RuntimeAnimatorController animations)
Definition: VRCSDKBase.cs:2582
void UseAttachedStation()
Makes the player get into the Station which is on the same GameObject as this UdonBehaviour.
Definition: VRCSDKBase.cs:2267
static VRCPlayerApi GetPlayerByGameObject(GameObject playerGameObject)
Definition: VRCSDKBase.cs:1715
void SetAvatarAudioNearRadius(float distance)
This sets the minimum start of the range for hearing the avatar's audio.
Definition: VRCSDKBase.cs:2499
static int GetPlayerCount()
Gets the number of Players in the instance when it is called.
Definition: VRCSDKBase.cs:1693
delegate void Action< T1, T2, T3, T4, T5 >(T1 p1, T2 p2, T3 p3, T4 p4, T5 p5)
TrackingData GetTrackingData(TrackingDataType tt)
Gets a struct called TrackingData, which contains separate Position and Rotation data.
Definition: VRCSDKBase.cs:1791
static int GetPlayerId(VRCPlayerApi player)
Gets the Player's Network Id from the source.
Definition: VRCSDKBase.cs:1710
void SetPickupInHand(VRC_Pickup pickup, VRC_Pickup.PickupHand hand)
Definition: VRCSDKBase.cs:1866
GameObject[] GetPlayerObjects()
Definition: VRCSDKBase.cs:2572
void SetAvatarAudioVolumetricRadius(float radius)
Set the Volumetric Radius of the Avatar's Audio.
Definition: VRCSDKBase.cs:2514
void SetVoiceVolumetricRadius(float radius)
A player's voice is normally simulated to be a point source, however changing this value allows the s...
Definition: VRCSDKBase.cs:2430
Vector3 GetVelocity()
Get the speed and direction of the player's movement.
Definition: VRCSDKBase.cs:2628
void SetAvatarEyeHeightMinimumByMeters(float scaleMeters)
Sets the minimum height in meters that the local player is permitted to scale themselves to in the pl...
Definition: VRCSDKBase.cs:2770
float CombatGetCurrentHitpoints()
NOT IMPLEMENTED AND NON-FUNCTIONAL! DO NOT USE!
Definition: VRCSDKBase.cs:2326
bool IsValid()
If a player has left since you saved a reference to them, this will return False.
Definition: VRCSDKBase.cs:1744
TrackingDataType
The specific type of tracking data to get, IE hand position, head position, etc.
Definition: VRCSDKBase.cs:1312
void TeleportTo(Vector3 teleportPos, Quaternion teleportRot, VRC_SceneDescriptor.SpawnOrientation teleportOrientation)
Send a player to a new spot and specified rotation, unless a Station does not allow it.
Definition: VRCSDKBase.cs:1927
void SetInvisibleToUntagged(bool invisible, string tagName, string tagValue="")
Definition: VRCSDKBase.cs:2091
float GetGravityStrength()
Multiplier for the Gravity force of the world (set to Earth's default).
Definition: VRCSDKBase.cs:2169
Component FindComponentInPlayerObjects(Component referenceComponent)
Definition: VRCSDKBase.cs:2577
static GetLookRayDelegate GetLookRay
Definition: VRCSDKBase.cs:1411
bool isSuper
if the player is a super user? Currently unusable in udon
Definition: VRCSDKBase.cs:1621
void Immobilize(bool immobile)
Keeps a Player stuck in place, turning off their Locomotion.
Definition: VRCSDKBase.cs:2600
static string[] GetAvailableLanguages()
Gets all available languages a player can select, in RFC 5646 format.
Definition: VRCSDKBase.cs:2554
void SetVoiceLowpass(bool enabled)
Disables the low-pass filter on the player's voice.
Definition: VRCSDKBase.cs:2450
void UseLegacyLocomotion()
WARNING: This method is not recommended to be used. turns on legacy locomotion for this player.
Definition: VRCSDKBase.cs:2256
void SetVoiceDistanceNear(float near)
The near radius, in meters, where volume begins to fall off. It is strongly recommended to leave the ...
Definition: VRCSDKBase.cs:2386
Vector3 GetBonePosition(HumanBodyBones tt)
Gets the position of the specified Bone in the Player's Avatar, or Vector3.Zero (0,...
Definition: VRCSDKBase.cs:1821
void TeleportTo(Vector3 teleportPos, Quaternion teleportRot, VRC_SceneDescriptor.SpawnOrientation teleportOrientation, bool lerpOnRemote)
Send a player to a new spot and specified rotation, unless a Station does not allow it.
Definition: VRCSDKBase.cs:1957
float GetAvatarEyeHeightAsMeters()
Returns the configured eye height for the target player's avatar. This function works for the local p...
Definition: VRCSDKBase.cs:2671
float GetJumpImpulse()
How much force applied when a player jumps.
Definition: VRCSDKBase.cs:2221
void SetNamePlateColor(Color col)
Definition: VRCSDKBase.cs:2003
static string GetCurrentLanguage()
Gets the selected language of the local user, in RFC 5646 format.
Definition: VRCSDKBase.cs:2567
static Action< RenderTexture > m_OnReleaseTemporaryRenderTexture
Definition: VRCSDKBase.cs:5661
static Action< RenderTexture > OnReleaseTemporaryRenderTexture
Definition: VRCSDKBase.cs:5695
static void ReleaseTemporary(RenderTexture renderTexture)
Definition: VRCSDKBase.cs:5743
static RenderTexture GetTemporary(RenderTextureDescriptor renderTextureDescriptor)
Definition: VRCSDKBase.cs:5735
static Action< RenderTexture > OnGetTemporaryRenderTexture
Definition: VRCSDKBase.cs:5665
static Action< RenderTexture > m_OnGetTemporaryRenderTexture
Definition: VRCSDKBase.cs:5658
static RenderTexture GetTemporary(int width, int height, int depthBuffer=0, RenderTextureFormat format=7, RenderTextureReadWrite readWrite=0, int antiAliasing=0, RenderTextureMemoryless memorylessMode=0, VRTextureUsage vrUsage=0, bool useDynamicScale=false)
Definition: VRCSDKBase.cs:5724
static void ValidateAgainstPropertyIDWhitelist(int nameID)
Definition: VRCSDKBase.cs:5883
static void ClearGlobalVariableWhitelist()
Definition: VRCSDKBase.cs:5892
static int PropertyToID(string name)
Definition: VRCSDKBase.cs:5802
static void SetGlobalMatrixArray(int nameID, Matrix4x4[] value)
Definition: VRCSDKBase.cs:5876
static void SetGlobalColor(int nameID, Color value)
Definition: VRCSDKBase.cs:5838
static void SetGlobalVector(int nameID, Vector4 value)
Definition: VRCSDKBase.cs:5846
static Action< int, ShaderVariableType > OnSetGlobalShaderVariable
Definition: VRCSDKBase.cs:5773
static void SetGlobalVectorArray(int nameID, Vector4[] value)
Definition: VRCSDKBase.cs:5869
static Action< int, ShaderVariableType > m_OnSetGlobalShaderVariable
Definition: VRCSDKBase.cs:5765
static void SetGlobalTexture(int nameID, Texture value)
Definition: VRCSDKBase.cs:5831
static void SetGlobalMatrix(int nameID, Matrix4x4 value)
Definition: VRCSDKBase.cs:5854
static void SetGlobalFloat(int nameID, float value)
Definition: VRCSDKBase.cs:5824
static void SetGlobalFloatArray(int nameID, float[] value)
Definition: VRCSDKBase.cs:5862
static void SetGlobalInteger(int nameID, int value)
Definition: VRCSDKBase.cs:5817
static Action< VRCStation, VRCPlayerApi > useStationDelegate
Definition: VRCSDKBase.cs:5953
void UseStation(VRCPlayerApi player)
Definition: VRCSDKBase.cs:5965
Transform stationEnterPlayerLocation
Definition: VRCSDKBase.cs:5945
Transform stationExitPlayerLocation
Definition: VRCSDKBase.cs:5947
VRC_ObjectApi controlsObject
Definition: VRCSDKBase.cs:5949
void ExitStation(VRCPlayerApi player)
Definition: VRCSDKBase.cs:5970
RuntimeAnimatorController animatorController
Definition: VRCSDKBase.cs:5939
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:5951
delegate void InitializationDelegate(VRCStation obj)
static Action< VRCStation, VRCPlayerApi > exitStationDelegate
Definition: VRCSDKBase.cs:5955
void OnTriggerExit(Collider col)
Definition: VRCSDKBase.cs:9174
void OnTriggerEnter(Collider col)
Definition: VRCSDKBase.cs:9169
static Action< VRCTriggerRelay > Initialize
Definition: VRCSDKBase.cs:9149
bool< IsAllowlistedUri > b__0(string d)
Definition: VRCSDKBase.cs:9192
Represents a URL that can be used to load at runtime. Cannot be constructed at runtime,...
Definition: VRCSDKBase.cs:9186
VRCUrl(string url)
Definition: VRCSDKBase.cs:9269
static bool IsAllowlistedUri(Uri uri)
Definition: VRCSDKBase.cs:9258
bool Equals(VRCUrl other)
Definition: VRCSDKBase.cs:9301
static bool IsNullOrEmpty(VRCUrl vrcUrl)
Definition: VRCSDKBase.cs:9252
override bool Equals(object obj)
Definition: VRCSDKBase.cs:9284
override int GetHashCode()
Definition: VRCSDKBase.cs:9314
override string ToString()
Definition: VRCSDKBase.cs:9279
static bool TryCreateAllowlistedVRCUrl(string url, out VRCUrl vrcUrl)
Definition: VRCSDKBase.cs:9239
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
Definition: VRCSDKBase.cs:2836
delegate void ApplySettingsDelegate(VRC_AnimatorLayerControl control, Animator animator)
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:2823
ApplySettingsDelegate ApplySettings
Definition: VRCSDKBase.cs:2826
delegate void InitializationDelegate(VRC_AnimatorLayerControl obj)
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:2857
delegate void ApplySettingsDelegate(VRC_AnimatorLocomotionControl control, Animator animator)
delegate void InitializationDelegate(VRC_AnimatorLocomotionControl obj)
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
Definition: VRCSDKBase.cs:2870
This behavior modifies an AudioSource when transitioning to the animation state. It can change the au...
Definition: VRCSDKBase.cs:2882
delegate void InitializationDelegate(VRC_AnimatorPlayAudio obj)
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
This is not documented properly yet
Definition: VRCSDKBase.cs:3127
AudioClip[] Clips
A list of AudioClips that can be applied to the AudioSource when transitioning to this state.
Definition: VRCSDKBase.cs:3010
ApplySettings PitchApplySettings
How to apply the pitch setting
Definition: VRCSDKBase.cs:3005
ApplySettings
Determines when the settings are applied to the audio source.
Definition: VRCSDKBase.cs:2924
float DelayInSeconds
The delay before "Play On Enter" plays a clip, if enabled. Clamped from 0 to 60 seconds....
Definition: VRCSDKBase.cs:3031
ApplySettings ClipsApplySettings
How to apply the clip setting
Definition: VRCSDKBase.cs:3015
bool Loop
Whether the AudioSource's looping should be set enabled or disabled when transitioning to this state.
Definition: VRCSDKBase.cs:3021
bool StopOnExit
To stop the audio source on exit
Definition: VRCSDKBase.cs:3052
bool StopOnEnter
To stop the audio source on enter
Definition: VRCSDKBase.cs:3041
ApplySettings VolumeApplySettings
How to apply the volume setting
Definition: VRCSDKBase.cs:2993
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:3069
bool ShouldApplyLoop
This is not documented properly yet
Definition: VRCSDKBase.cs:3099
Order
The order in which audio clips are chosen.
Definition: VRCSDKBase.cs:2889
bool PlayOnEnter
To play the audiosource on enter, after possibly stopping it first
Definition: VRCSDKBase.cs:3036
string ParameterName
The name of the "int" type avatar parameter that determines which audio clip is chosen....
Definition: VRCSDKBase.cs:2981
Order PlaybackOrder
Determines which audio clip is chosen when transitioning to this state.
Definition: VRCSDKBase.cs:2975
Vector2 Volume
The random volume range for the AudioSource.
Definition: VRCSDKBase.cs:2988
delegate void EnterStateDelegate(VRC_AnimatorPlayAudio control, Animator animator)
bool ShouldApplyClip
This is not documented properly yet
Definition: VRCSDKBase.cs:3093
delegate void ExitStateDelegate(VRC_AnimatorPlayAudio control, Animator animator)
AudioSource Source
The AudioSource to play through. If the AudioSource is not found when transitioning to this state for...
Definition: VRCSDKBase.cs:2959
string SourcePath
The path to the AudioSource relative to the avatar's root transform. If the AudioSource is not found ...
Definition: VRCSDKBase.cs:2968
Vector2 Pitch
The random pitch range for the AudioSource.
Definition: VRCSDKBase.cs:3000
int playbackIndex
This is not documented properly yet
Definition: VRCSDKBase.cs:3059
ApplySettings LoopApplySettings
How to apply the looping setting
Definition: VRCSDKBase.cs:3026
bool ShouldApplyVolume
This is not documented properly yet
Definition: VRCSDKBase.cs:3081
override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
This is not documented properly yet
Definition: VRCSDKBase.cs:3136
object destParam
This is not documented properly yet
Definition: VRCSDKBase.cs:3066
bool ShouldApplySetting(ApplySettings setting)
This is not documented properly yet
Definition: VRCSDKBase.cs:3105
bool ShouldApplyPitch
This is not documented properly yet
Definition: VRCSDKBase.cs:3087
bool PlayOnExit
To play the audio source on exit
Definition: VRCSDKBase.cs:3047
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:3163
override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
Definition: VRCSDKBase.cs:3192
delegate void ApplySettingsDelegate(VRC_AnimatorTemporaryPoseSpace view, Animator animator)
delegate void InitializationDelegate(VRC_AnimatorTemporaryPoseSpace obj)
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
Definition: VRCSDKBase.cs:3181
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:3251
delegate void ApplySettingsDelegate(VRC_AnimatorTrackingControl control, Animator animator)
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
Definition: VRCSDKBase.cs:3264
delegate void InitializationDelegate(VRC_AnimatorTrackingControl obj)
List< NetworkIDPair > NetworkIDCollection
Definition: VRCSDKBase.cs:3342
void GetNetworkIDObjects(List< INetworkID > netIds)
Definition: VRCSDKBase.cs:3392
void PositionPortraitCamera(Transform cam)
Definition: VRCSDKBase.cs:3370
GameObject FindNetworkIDGameObject(string path)
Definition: VRCSDKBase.cs:3397
List< NetworkIDPair > networkIDs
Definition: VRCSDKBase.cs:3339
SkinnedMeshRenderer VisemeSkinnedMesh
Definition: VRCSDKBase.cs:3323
string GetNetworkIDGameObjectPath(GameObject obj)
Definition: VRCSDKBase.cs:3411
static Action< VRC_AvatarParameterDriver, Animator > OnApplySettings
Definition: VRCSDKBase.cs:3485
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
Definition: VRCSDKBase.cs:3487
virtual void SwitchAvatar(string id)
Definition: VRCSDKBase.cs:4878
void SetAvatarUse(VRCPlayerApi instigator)
Definition: VRCSDKBase.cs:4892
static InstantiationDelegate Instantiate
Definition: VRCSDKBase.cs:4845
virtual void SwitchAvatar(string id, VRCPlayerApi instigator)
Definition: VRCSDKBase.cs:4873
delegate Object InstantiationDelegate(Object prefab)
delegate void DataElementDelegate(VRC_DataStorage obj, int idx)
static SerializationDelegate Serialize
Definition: VRCSDKBase.cs:9436
int GetElementIndex(string name)
Definition: VRCSDKBase.cs:9475
delegate void InitializationDelegate(VRC_DataStorage obj)
void OnDataElementChanged(int idx)
Definition: VRCSDKBase.cs:9491
static DeserializationDelegate Deserialize
Definition: VRCSDKBase.cs:9438
VrcDataElement GetElement(string name)
Definition: VRCSDKBase.cs:9480
delegate bool DeserializationDelegate(VrcDataElement ds, out object obj)
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:9434
DataElementDelegate m_ElementChanged
Definition: VRCSDKBase.cs:9441
delegate bool SerializationDelegate(VrcDataElement ds, object obj)
VRC_EventHandler.VrcEvent onDestructedEvent
Definition: VRCSDKBase.cs:3768
VRC_EventHandler.VrcEvent onFullHealedEvent
Definition: VRCSDKBase.cs:3776
VRC_EventHandler.VrcEvent spawnerOnDamagedEvent
Definition: VRCSDKBase.cs:3780
VRC_EventHandler.VrcEvent spawnerOnFullHealedEvent
Definition: VRCSDKBase.cs:3792
VRC_EventHandler.VrcEvent spawnerOnHealedEvent
Definition: VRCSDKBase.cs:3788
VRC_EventHandler.VrcEvent spawnerOnDestructedEvent
Definition: VRCSDKBase.cs:3784
void HandleCallbackTrigger(VRC_Trigger trigger, VRC_EventHandler.VrcEvent e)
Definition: VRCSDKBase.cs:3946
VRC_EventHandler.VrcEvent onHealedEvent
Definition: VRCSDKBase.cs:3772
VRC_EventHandler.VrcEvent onDamagedEvent
Definition: VRCSDKBase.cs:3764
override void UnregisterEventHandler(VRC_EventHandler handler)
Definition: VRCSDKBase.cs:9545
override void TriggerEvent(VRC_EventHandler handler, VRC_EventHandler.VrcEvent e, VRC_EventHandler.VrcBroadcastType broadcast, int instagatorId, float fastForward)
Definition: VRCSDKBase.cs:9537
override string GetGameObjectPath(GameObject go)
Definition: VRCSDKBase.cs:9554
override void RegisterEventHandler(VRC_EventHandler handler)
Definition: VRCSDKBase.cs:9541
override GameObject FindGameObject(string path, bool suppressErrors)
Definition: VRCSDKBase.cs:9549
abstract GameObject FindGameObject(string path, bool suppressErrors)
virtual GameObject FindGameObject(string path)
Definition: VRCSDKBase.cs:9521
abstract void UnregisterEventHandler(VRC_EventHandler handler)
abstract void TriggerEvent(VRC_EventHandler handler, VRC_EventHandler.VrcEvent e, VRC_EventHandler.VrcBroadcastType broadcast, int instagatorId, float fastForward)
abstract string GetGameObjectPath(GameObject go)
abstract void RegisterEventHandler(VRC_EventHandler handler)
static LogEventDelegate LogEvent
Definition: VRCSDKBase.cs:9704
void VrcAnimationEvent(AnimationEvent aEvent)
Definition: VRCSDKBase.cs:9780
void TriggerEvent(VrcEvent e, VrcBroadcastType broadcast, GameObject instagator=null, float fastForward=0f)
Definition: VRCSDKBase.cs:9811
static GetNetworkIdDelegate GetInstigatorId
Definition: VRCSDKBase.cs:9702
void TriggerEvent(string eventName, VrcBroadcastType broadcast, GameObject instagator=null, int instagatorId=0)
Definition: VRCSDKBase.cs:9916
static bool IsReceiverRequiredForEventType(VrcEventType eventType)
Definition: VRCSDKBase.cs:9802
static bool BooleanOp(VrcBooleanOp Op, bool Current)
Definition: VRCSDKBase.cs:9734
IEnumerator ProcessDeferredEvents()
void TriggerEvent(string eventName, VrcBroadcastType broadcast, GameObject instagator, int instagatorId, float fastForward)
Definition: VRCSDKBase.cs:9939
void DeferEvent(VrcEvent e, VrcBroadcastType broadcast, GameObject instagator, float fastForward)
void InternalTriggerEvent(VrcEvent e, VrcBroadcastType broadcast, int instagatorId, float fastForward)
Definition: VRCSDKBase.cs:9876
delegate int GetNetworkIdDelegate(GameObject obj)
delegate void LogEventDelegate(VRC_EventHandler eventHandler, VrcEvent vrcEvent, VrcBroadcastType broadcast, int instagatorId, float fastForward)
void TriggerEvent(VrcEvent e, VrcBroadcastType broadcast, int instagatorId, float fastForward)
Definition: VRCSDKBase.cs:9897
static bool HasEventTrigger(GameObject go)
delegate void InitializationDelegate(VRC_IKFollower obj)
static InitializationDelegate Initialize
delegate void InitializationDelegate(VRC_Interactable obj)
delegate bool ValidDelegate(VRC_Interactable obj, VRCPlayerApi player)
static InitializationDelegate Initialize
bool IsInteractiveForPlayer(VRCPlayerApi player)
static ValidDelegate CheckValid
virtual void OnPickupUseDown()
VRC_EventHandler Handler
Definition: VRCSDKBase.cs:3507
delegate void InitializationDelegate(VRC_KeyEvents obj)
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:3509
VRC_EventHandler.VrcBroadcastType BroadcastType
Definition: VRCSDKBase.cs:3505
void MetadataChangedInternal(Dictionary< string, object > data)
Definition: VRCSDKBase.cs:6015
static MetadataCallback callbacks
Definition: VRCSDKBase.cs:5979
static void TriggerUpdate(Dictionary< string, object > data)
Definition: VRCSDKBase.cs:6007
delegate void MetadataCallback(Dictionary< string, object > data)
This is not documented properly yet
Definition: VRCSDKBase.cs:4086
Note note
This is not documented properly yet
Definition: VRCSDKBase.cs:4647
VRC_Trigger.CustomTriggerTarget OnNoteOn
This is not documented properly yet
Definition: VRCSDKBase.cs:4653
Channel channel
This is not documented properly yet
Definition: VRCSDKBase.cs:4641
Channel
The MIDI channel.
Definition: VRCSDKBase.cs:4094
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:4661
delegate void InitializationDelegate(VRC_MidiNoteIn obj)
Note
The MIDI note. 0-127 range number for the note played.
Definition: VRCSDKBase.cs:4191
VRC_Trigger.CustomTriggerTarget OnNoteOff
This is not documented properly yet
Definition: VRCSDKBase.cs:4659
virtual void UpdateCameraClearing(Camera src, Camera mirrorCamera, Skybox mirrorSkybox)
Definition: VRCSDKBase.cs:6621
bool ShouldRenderMonoscopic(Camera cam)
Definition: VRCSDKBase.cs:6524
Quaternion GetWorldEyeRot(Camera cam, XRNode eye)
Definition: VRCSDKBase.cs:6544
void RenderMirrorCameras(Camera currentCamera)
Definition: VRCSDKBase.cs:6280
void RenderMirror(RenderTexture targetTexture, Vector3 camPosition, Quaternion camRotation, Matrix4x4 camProjectionMatrix)
Definition: VRCSDKBase.cs:6571
static Vector4 Plane(Vector3 pos, Vector3 normal)
Definition: VRCSDKBase.cs:6794
void UpdateCameraModes(Camera src)
Definition: VRCSDKBase.cs:6643
static Matrix4x4 CalculateReflectionMatrix(Vector4 plane)
Definition: VRCSDKBase.cs:6825
static Vector4 CameraSpacePlane(Camera cam, Vector3 pos, Vector3 normal)
Definition: VRCSDKBase.cs:6805
void CameraPostRender(Camera currentCamera)
Definition: VRCSDKBase.cs:6405
static RenderMirrorEventDelegate m_PreRenderMirror
Definition: VRCSDKBase.cs:6094
delegate void RenderMirrorEventDelegate(VRC_MirrorReflection sender)
ReflectionData GetReflectionData(Camera currentCamera)
Definition: VRCSDKBase.cs:6712
static RenderMirrorEventDelegate PreRenderMirror
Definition: VRCSDKBase.cs:6142
static Quaternion GetRotation(Matrix4x4 matrix)
Definition: VRCSDKBase.cs:6855
static RenderMirrorEventDelegate PostRenderMirror
Definition: VRCSDKBase.cs:6172
Vector3 GetWorldEyePos(Camera cam, XRNode eye)
Definition: VRCSDKBase.cs:6533
bool ShouldRenderRightEye(Camera cam)
Definition: VRCSDKBase.cs:6499
void UpdateParentTransform(Camera cam)
Definition: VRCSDKBase.cs:6677
static Vector3 GetPosition(Matrix4x4 matrix)
Definition: VRCSDKBase.cs:6894
static RenderMirrorEventDelegate m_PostRenderMirror
Definition: VRCSDKBase.cs:6097
Matrix4x4 GetEyeProjectionMatrix(Camera cam, XRNode eye)
Definition: VRCSDKBase.cs:6556
static void GetAutoResolution(Camera currentCamera, out int width, out int height)
Definition: VRCSDKBase.cs:6773
static float CopySign(float sizeValue, float signValue)
Definition: VRCSDKBase.cs:6850
bool ShouldRenderLeftEye(Camera cam)
Definition: VRCSDKBase.cs:6474
static InstantiationDelegate Initialize
Definition: VRCSDKBase.cs:4938
RuntimeAnimatorController customAnimation
Definition: VRCSDKBase.cs:4934
delegate void InstantiationDelegate(VRC_NPCSpawn obj)
void SayThis(AudioClip clip, float volume)
Definition: VRCSDKBase.cs:3618
delegate void InitializeDelegate(VRC_NpcApi obj)
void SetMuteStatus(bool canSpeak, bool canHear)
Definition: VRCSDKBase.cs:3633
void SetNamePlate(bool visible, string playerName, string vipTag)
Definition: VRCSDKBase.cs:3623
void SetSocialStatus(bool friend, bool vip, bool blocked)
Definition: VRCSDKBase.cs:3628
static InitializeDelegate Initialize
Definition: VRCSDKBase.cs:3582
static VRC_NpcApi GetApiByGameObject(GameObject npcGameObject)
Definition: VRCSDKBase.cs:3604
void ActThis(int number, bool loop)
Definition: VRCSDKBase.cs:3613
void ClaimControl(VRCPlayerApi player)
Definition: VRCSDKBase.cs:4952
delegate void ObjectReaperDelegate()
void SpawnObject(Vector3 position, Quaternion rotation)
Definition: VRCSDKBase.cs:4981
ObjectReaperDelegate ReapObjects
Definition: VRCSDKBase.cs:4970
delegate void InitializationDelegate(VRC_ObjectSpawn obj)
IEnumerable< VRC_EventHandler.VrcEvent > ProvideEvents()
Definition: VRCSDKBase.cs:5012
delegate void InstantiationDelegate(Vector3 position, Quaternion rotation)
InstantiationDelegate Instantiate
Definition: VRCSDKBase.cs:4968
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:4966
VRC_Trigger.CustomTriggerTarget OnButtonOn
Definition: VRCSDKBase.cs:4685
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:4689
VRC_Trigger.CustomTriggerTarget OnButtonOff
Definition: VRCSDKBase.cs:4687
delegate void InitializationDelegate(VRC_OscButtonIn obj)
IEnumerator ShowPano(int index)
Definition: VRCSDKBase.cs:7013
void ShowPanoAt(int index)
Definition: VRCSDKBase.cs:7006
VRC_DataStorage data
Definition: VRCSDKBase.cs:6930
List< PanoSpec > panoramas
Definition: VRCSDKBase.cs:6926
VRCPlayerApi currentLocalPlayer
Definition: VRCSDKBase.cs:5114
PickupOrientation orientation
Definition: VRCSDKBase.cs:5074
delegate void OnDestroyedDelegate(VRC_Pickup obj)
IEnumerable< VRC_EventHandler.VrcEvent > ProvideEvents()
Definition: VRCSDKBase.cs:5232
static HapticEventDelegate HapticEvent
Definition: VRCSDKBase.cs:5127
delegate void ForceDropDelegate(VRC_Pickup obj)
AutoHoldMode AutoHold
Definition: VRCSDKBase.cs:5076
delegate void AwakeDelegate(VRC_Pickup obj)
VRC_EventHandler.VrcBroadcastType useEventBroadcastType
Definition: VRCSDKBase.cs:5084
static AwakeDelegate OnAwake
Definition: VRCSDKBase.cs:5121
delegate void HapticEventDelegate(VRC_Pickup obj, float duration, float amplitude, float frequency)
ForceMode MomentumTransferMethod
Definition: VRCSDKBase.cs:5064
VRC_EventHandler.VrcBroadcastType pickupDropEventBroadcastType
Definition: VRCSDKBase.cs:5096
static ForceDropDelegate ForceDrop
Definition: VRCSDKBase.cs:5123
void GenerateHapticEvent(float duration=0.25f, float amplitude=0.5f, float frequency=0.5f)
Definition: VRCSDKBase.cs:5210
VRCPlayerApi currentPlayer
Definition: VRCSDKBase.cs:5134
static OnDestroyedDelegate OnDestroyed
Definition: VRCSDKBase.cs:5125
void Drop(VRCPlayerApi instigator)
Definition: VRCSDKBase.cs:5184
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
Definition: VRCSDKBase.cs:3722
ApplySettingsDelegate ApplySettings
Definition: VRCSDKBase.cs:3709
delegate void InitializationDelegate(VRC_PlayableLayerControl obj)
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:3706
delegate void ApplySettingsDelegate(VRC_PlayableLayerControl control, Animator animator)
delegate void InitializationDelegate(VRC_PortalMarker obj)
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:5311
HumanBodyBones mountPoint
Definition: VRCSDKBase.cs:5352
delegate void InitializeDelegate(VRC_PropController obj)
delegate void UpdateDelegate(VRC_PropController obj)
int GetInputIndex(string inputName)
Definition: VRCSDKBase.cs:5415
static UpdateDelegate UpdateInputs
Definition: VRCSDKBase.cs:5393
static InitializeDelegate Initialize
Definition: VRCSDKBase.cs:5395
RespawnHeightBehaviour ObjectBehaviourAtRespawnHeight
Definition: VRCSDKBase.cs:7077
static IntializationDelegate Initialize
Definition: VRCSDKBase.cs:7221
string GetNetworkIDGameObjectPath(GameObject obj)
Definition: VRCSDKBase.cs:7344
static Dictionary< string, GameObject > sDynamicPrefabs
Definition: VRCSDKBase.cs:7137
static Material GetMaterial(string name)
Definition: VRCSDKBase.cs:7295
DefaultReflectionMode RenderDefaultReflectionMode
Definition: VRCSDKBase.cs:7204
void GetNetworkIDObjects(List< INetworkID > netIds)
Definition: VRCSDKBase.cs:7325
static Dictionary< string, Material > sDynamicMaterials
Definition: VRCSDKBase.cs:7141
static GameObject GetPrefab(string name)
Definition: VRCSDKBase.cs:7265
SphericalHarmonicsL2 RenderAmbientProbe
Definition: VRCSDKBase.cs:7168
delegate void IntializationDelegate(VRC_SceneDescriptor sceneDescriptor)
GameObject FindNetworkIDGameObject(string path)
Definition: VRCSDKBase.cs:7339
void PositionPortraitCamera(Transform cam)
Definition: VRCSDKBase.cs:7425
SpawnOrientation spawnOrientation
Definition: VRCSDKBase.cs:7071
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
ISerializationSurrogate GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector)
void ChainSelector(ISurrogateSelector selector)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
static string GetGameObjectPathFallback(GameObject go)
static void RegisterVRCPlayer(Type type)
static object[] ParameterDecoder(byte[] dataParameters, bool rethrow=false)
static void RegisterType(Type type)
static string GetGameObjectPath(GameObject go)
static void RegisterPluginType(Type type)
static byte[] ParameterEncoder(params object[] parameters)
static GameObject FindGameObject(string path)
IEnumerator StartAutoplayWithDuration(float duration)
Definition: VRCSDKBase.cs:5497
void ShowNextImage(int Instigator=0)
Definition: VRCSDKBase.cs:5453
void ShowPreviousImage(int Instigator=0)
Definition: VRCSDKBase.cs:5479
void StopAutoplayWithDuration(float duration)
Definition: VRCSDKBase.cs:5506
delegate void InitializationDelegate(VRC_SpatialAudioSource obj)
static InitializationDelegate Initialize
Definition: VRCSDKBase.cs:1220
VRC_EventHandler Handler
Definition: VRCSDKBase.cs:7503
delegate void CollisionExitDelegate(VRC_TriggerColliderEventTrigger obj, Collider other)
delegate void CollisionEnterDelegate(VRC_TriggerColliderEventTrigger obj, Collider other)
static CollisionEnterDelegate CollisionEnter
Definition: VRCSDKBase.cs:8085
static CollisionExitDelegate CollisionExit
Definition: VRCSDKBase.cs:8087
List< VRC_EventHandler.VrcEvent > Events
Definition: VRCSDKBase.cs:7658
VRC_EventHandler.VrcBroadcastType BroadcastType
Definition: VRCSDKBase.cs:7655
bool< ExecuteTriggerType > b__0(TriggerEvent t)
Definition: VRCSDKBase.cs:7713
bool< ExecuteCustomTrigger > b__0(TriggerEvent t)
Definition: VRCSDKBase.cs:7728
void ExecuteCustomTrigger(string name)
Definition: VRCSDKBase.cs:8008
override void OnDrop()
Definition: VRCSDKBase.cs:7942
override void OnPickup()
Definition: VRCSDKBase.cs:7937
List< TriggerEvent > Triggers
Definition: VRCSDKBase.cs:7752
void ExecuteTriggerType(TriggerType triggerType)
Definition: VRCSDKBase.cs:7972
override void Interact()
Definition: VRCSDKBase.cs:7922
static void TriggerCustom(CustomTriggerTarget target)
Definition: VRCSDKBase.cs:7788
override void OnPickupUseDown()
Definition: VRCSDKBase.cs:7932
override void Awake()
Definition: VRCSDKBase.cs:7820
static Action< VRC_Trigger > InitializeTrigger
Definition: VRCSDKBase.cs:7738
void ExecuteTriggers(IEnumerable< TriggerEvent > triggers)
Definition: VRCSDKBase.cs:7947
static EditorTriggerLineMode EditorGlobalTriggerLineMode
Definition: VRCSDKBase.cs:7749
Action< TriggerEvent > ExecuteTrigger
Definition: VRCSDKBase.cs:7754
void ResetClock(TriggerEvent timer)
Definition: VRCSDKBase.cs:8060
static void Trigger(GameObject obj, TriggerType type)
Definition: VRCSDKBase.cs:7796
override void OnPickupUseUp()
Definition: VRCSDKBase.cs:7927
static void TriggerCustom(GameObject obj, string name)
Definition: VRCSDKBase.cs:7808
void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, AttachMode attachMode, bool showOffscreen)
Definition: VRCSDKBase.cs:8882
void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, float duration=0.1f, int priority=0, AttachMode attachMode=AttachMode.PositionOnly, bool showOffscreen=false)
Definition: VRCSDKBase.cs:8877
void DeactivateObjectLabel(Transform targetObject)
Definition: VRCSDKBase.cs:8887
void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, float duration=0.1f, int priority=0, AttachMode attachMode=AttachMode.PositionOnly, bool showOffscreen=false)
Definition: VRCSDKBase.cs:8872
void ActivateAreaMarkerLabel(Transform targetObject, string text)
Definition: VRCSDKBase.cs:8867
void ActivateControllerLabel(ControllerHand hand, ControllerInputUI controllerPart, string text, float duration, int priority)
Definition: VRCSDKBase.cs:8892
void DeactivateControllerLabel(ControllerHand hand, ControllerInputUI controllerPart)
Definition: VRCSDKBase.cs:8897
delegate Camera GetEventCameraDelegate(GameObject obj)
void OnRectTransformDimensionsChange()
Definition: VRCSDKBase.cs:9107
static GetEventCameraDelegate GetEventCamera
Definition: VRCSDKBase.cs:9053
override void Start()
Definition: VRCSDKBase.cs:8155
static UpdateDelegate UpdateUse
Definition: VRCSDKBase.cs:8140
override void Awake()
Definition: VRCSDKBase.cs:8142
delegate void UpdateDelegate(VRC_UseEvents obj)
override void Interact()
Definition: VRCSDKBase.cs:8164
void SetDamagePercent(float damagePercent)
Definition: VRCSDKBase.cs:4024
static void CalculateReflectionMatrix(ref Matrix4x4 reflectionMat, Vector4 plane)
Definition: VRCSDKBase.cs:8623
WaterMode GetWaterMode()
Definition: VRCSDKBase.cs:8559
void UpdateCameraModes(Camera src, Camera dest)
Definition: VRCSDKBase.cs:8424
void CreateWaterObjects(Camera currentCamera, out Camera reflectionCamera, out Camera refractionCamera)
Definition: VRCSDKBase.cs:8458
Vector4 CameraSpacePlane(Camera cam, Vector3 pos, Vector3 normal, float sideSign)
Definition: VRCSDKBase.cs:8591
static bool s_InsideWater
Definition: VRCSDKBase.cs:8215
RenderTexture m_ReflectionTexture
Definition: VRCSDKBase.cs:8205
WaterMode FindHardwareWaterSupport()
Definition: VRCSDKBase.cs:8568
RenderTexture m_RefractionTexture
Definition: VRCSDKBase.cs:8207
void NavigateTo(string uri)
Definition: VRCSDKBase.cs:8754
void ReadData(string root, int junk)
Definition: VRCSDKBase.cs:8816
Material[] extraVideoScreens
Definition: VRCSDKBase.cs:8669
IEnumerable< VRC_EventHandler.VrcEvent > ProvideEvents()
Definition: VRCSDKBase.cs:8775
static new InitializeDelegate Initialize
Definition: VRCSDKBase.cs:8671
bool BindCall(string function, Delegate handler)
Definition: VRCSDKBase.cs:8745
override void Interact()
Definition: VRCSDKBase.cs:8771
delegate void InitializeDelegate(VRC_WebPanel obj)
List< WebFile > webData
Definition: VRCSDKBase.cs:8692
override void Awake()
Definition: VRCSDKBase.cs:8762
static PerformanceScannerSet GetPerformanceScannerSet(bool mobilePlatform)
static void CalculatePerformanceStats(string avatarName, GameObject avatarObject, AvatarPerformanceStats perfStats, bool mobilePlatform)
delegate bool IgnoreDelegate(Component component)
static readonly PerformanceRating AvatarPerformanceRatingMinimumToDisplayDefault
static PerformanceFilterSet GetPerformanceFilterSet(bool mobilePlatform)
static bool IsEditorOnly(Component component)
static IEnumerator ApplyPerformanceFiltersEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, PerformanceRating minPerfRating, FilterBlockCallback onBlock, bool mobilePlatform, bool userForcedShow)
static IEnumerator CalculatePerformanceStatsEnumerator(string avatarName, GameObject avatarObject, AvatarPerformanceStats perfStats, bool mobilePlatform)
static bool ShouldIgnoreComponentInternal(Component component)
static readonly PerformanceRating AvatarPerformanceRatingMinimumToDisplayMin
static readonly PerformanceRating AvatarPerformanceRatingMinimumToDisplayMax
abstract IEnumerator ApplyPerformanceFilter(GameObject avatarObject, AvatarPerformanceStats perfStats, PerformanceRating ratingLimit, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent, AvatarPerformance.FilterBlockCallback onBlock, bool userForcedShow)
static IEnumerator RemoveComponent(Component targetComponent)
static IEnumerator RemoveDependencies(Component targetComponent)
static IEnumerator RemoveComponentsOfTypeEnumerator< T >(GameObject target)
static uint GetMeshTriangleCount(Mesh sourceMesh)
IEnumerator ApplyPerformanceFilters(GameObject avatarObject, AvatarPerformanceStats perfStats, PerformanceRating ratingLimit, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent, AvatarPerformance.FilterBlockCallback onBlock, bool userForcedShow)
void RunPerformanceScan(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
List< AbstractPerformanceScanner > performanceScanners
IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
void InitForPlatform(PerformancePlatform platform)
virtual bool EnabledOnPlatform(PerformancePlatform platform)
void RunPerformanceScan(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
IEnumerator ScanAvatarForComponentsOfType(Type componentType, GameObject avatarObject, List< Component > destinationBuffer)
IEnumerator ScanAvatarForComponentsOfType< T >(GameObject avatarObject, List< T > destinationBuffer)
abstract IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
static void AnalyzeMeshRenderers(IEnumerable< Renderer > renderers, AvatarPerformanceStats perfStats)
static void AnalyzeMaterials(List< Renderer > renderers, AvatarPerformanceStats perfStats)
static void AnalyzeSkinnedMeshRenderers(List< Renderer > renderers, AvatarPerformanceStats perfStats)
override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
IEnumerator AnalyzeGeometry(GameObject avatarObject, List< Renderer > renderers, AvatarPerformanceStats perfStats)
static void AnalyzeParticleSystemRenderers(IEnumerable< ParticleSystem > particleSystems, AvatarPerformanceStats perfStats)
override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
static string GetPerformanceRatingDisplayName(PerformanceRating rating)
static AvatarPerformanceStatsLevel GetStatLevelForRating(PerformanceRating rating, bool isMobilePlatform)
PerformanceRating CalculatePerformanceRating(ComparePerformanceStatsDelegate compareFn)
delegate float ComparePerformanceStatsDelegate(AvatarPerformanceStats stats, AvatarPerformanceStatsLevel statsLevel)
void LoadAllPerformanceRatings(Dictionary< string, object > stats, bool isMobilePlatform)
PerformanceRating CalculatePerformanceRatingForCategory(AvatarPerformanceCategory perfCategory)
PerformanceRating GetPerformanceRatingForCategory(AvatarPerformanceCategory perfCategory)
static AvatarPerformanceStatsLevelSet GetAvatarPerformanceStatsLevelSet(bool isMobilePlatform)
static string GetPerformanceCategoryDisplayName(AvatarPerformanceCategory category)
static IEnumerable< T > FindAssemblyAttributes< T >()
static Type GetTypeFromName(string name, Assembly[] assemblies=null)
static IEnumerable< Type > FindDerivedTypes(Type baseType)
static IEnumerable< Type > FindDerivedTypes(Assembly assembly, Type baseType)
bool< FindIllegalShadersEnumerator > b__1(string okayShaderName)
bool< FindIllegalShadersEnumerator > b__0(Material cacheMtl)
static void RemoveComponentsOfType< T >(GameObject target, bool allowRemovingAssets=true)
static List< T > GetComponentsInChildrenExcludingEditorOnly< T >(this GameObject target, bool includeInactive)
static void RemoveComponent(Component comp, bool allowRemovingAssets=true)
static void AddDerivedClasses(HashSet< Type > whitelist)
static void RemoveIllegalComponents(GameObject target, HashSet< Type > whitelist, bool retry=true, bool onlySceneObjects=false, bool logStripping=true, bool excludeEditorOnly=false, bool allowRemovingAssets=true)
static IEnumerator FindIllegalShadersEnumerator(GameObject target, string[] whitelist, Action< Shader > onFound, bool useWatch=false)
static List< Component > FindIllegalComponents(GameObject target, HashSet< Type > whitelist, bool excludeEditorOnly=false)
static void RemoveDependencies(Component rootComponent, bool allowRemovingAssets=true)
static bool GetCachedWhitelistedTypes(string whitelistName, out HashSet< Type > whitelist)
static HashSet< Type > WhitelistedTypes(string whitelistName, IEnumerable< string > componentTypeWhitelist)
static HashSet< Type > WhitelistedTypes(string whitelistName, IEnumerable< Type > componentTypeWhitelist)
static IEnumerable< Shader > FindIllegalShaders(GameObject target, string[] whitelist)
static bool IsEditorOnly(Component component)
static bool IsIllegalComponent(Component component, HashSet< Type > whitelist, bool excludeEditorOnly=false)
static List< Component > GetComponentsInChildrenExcludingEditorOnly(this GameObject target, Type type, bool includeInactive)
static string FormatFileSize(long filesize, bool includeUnitPostfix=true, int precision=-1, string requiredUnit=null)
Definition: VRCSDKBase.cs:695
const int CONTENT_AVATAR_UNCOMPRESSED_ASSET_BUNDLE_SIZE_LIMIT_PC
Definition: VRCSDKBase.cs:596
static string GetAssetBundleOverSizeLimitMessageSDKWarning(ContentType contentType, int contentSize, bool mobilePlatform, bool compressed=true)
Definition: VRCSDKBase.cs:676
const int CONTENT_AVATAR_UNCOMPRESSED_ASSET_BUNDLE_SIZE_LIMIT_MOBILE
Definition: VRCSDKBase.cs:604
const int CONTENT_AVATAR_ASSET_BUNDLE_SIZE_LIMIT_PC
Definition: VRCSDKBase.cs:594
const int CONTENT_WORLD_UNCOMPRESSED_ASSET_BUNDLE_SIZE_LIMIT_MOBILE
Definition: VRCSDKBase.cs:600
static int GetAssetBundleSizeLimit(ContentType contentType, bool mobilePlatform, bool compressed=true)
Definition: VRCSDKBase.cs:607
const int CONTENT_WORLD_ASSET_BUNDLE_SIZE_LIMIT_MOBILE
Definition: VRCSDKBase.cs:598
const int CONTENT_WORLD_UNCOMPRESSED_ASSET_BUNDLE_SIZE_LIMIT_PC
Definition: VRCSDKBase.cs:592
static string GetAssetBundleOverSizeLimitMessage(ContentType contentType, bool mobilePlatform, bool compressed=true)
Definition: VRCSDKBase.cs:656
const int CONTENT_AVATAR_ASSET_BUNDLE_SIZE_LIMIT_MOBILE
Definition: VRCSDKBase.cs:602
const int CONTENT_WORLD_ASSET_BUNDLE_SIZE_LIMIT_PC
Definition: VRCSDKBase.cs:590
static string GetAssetBundleOverSizeLimitMessage(ContentType contentType, int contentSize, bool mobilePlatform, bool compressed=true)
Definition: VRCSDKBase.cs:662
string GetNetworkIDGameObjectPath(GameObject obj)
GameObject FindNetworkIDGameObject(string path)
List< NetworkIDPair > NetworkIDCollection
Definition: VRCSDKBase.cs:4073
void GetNetworkIDObjects(List< INetworkID > netIds)
IEnumerable< VRC_EventHandler.VrcEvent > ProvideEvents()
void ApplyDamage(float damage)
void SetState(object[] state)
void ApplyHealing(float healing)
bool OpenDevice(string name)
IEnumerable< string > GetDeviceNames()
MidiVoiceMessageDelegate OnMidiVoiceMessage
delegate void MidiRawMessageDelegate(object sender, MidiRawEventArgs args)
delegate void MidiVoiceMessageDelegate(object sender, MidiVoiceEventArgs args)
VRCOrientation
the orientation of the player's device.
FileSizeUnit
Definition: VRCSDKBase.cs:487
ContentType
Definition: VRCSDKBase.cs:582
bool Equals(DisposableJobHandle other)
Definition: VRCSDKBase.cs:1156
static IList< DisposableJobHandle > GetIncompleteDisposableJobs()
Definition: VRCSDKBase.cs:1124
static bool operator!=(DisposableJobHandle a, DisposableJobHandle b)
Definition: VRCSDKBase.cs:1176
override bool Equals(object obj)
Definition: VRCSDKBase.cs:1162
static bool operator==(DisposableJobHandle a, DisposableJobHandle b)
Definition: VRCSDKBase.cs:1171
DisposableJobHandle(JobHandle jobHandle)
Definition: VRCSDKBase.cs:1114
MidiRawEventArgs(byte status, byte data1, byte data2)
MidiVoiceEventArgs(int command, int channel, byte number, byte value)
A struct containing separate Position and Rotation data relating to a player's tracking
Definition: VRCSDKBase.cs:1355
Quaternion rotation
The rotation of the player's tracking data
Definition: VRCSDKBase.cs:1368
TrackingData(Vector3 pos, Quaternion rot)
Definition: VRCSDKBase.cs:1370
Vector3 position
The position of the player's tracking data
Definition: VRCSDKBase.cs:1361
Snapshot(AvatarPerformanceStats avatarPerformanceStats)