2using System.Collections;
3using System.Collections.Generic;
4using System.Collections.Immutable;
5using System.ComponentModel;
6using System.Diagnostics;
9using System.Reflection;
10using System.Runtime.CompilerServices;
11using System.Runtime.Serialization;
12using System.Runtime.Serialization.Formatters.Binary;
13using System.Runtime.Versioning;
16using System.Threading;
17using JetBrains.Annotations;
18using Unity.Collections;
22using UnityEngine.Animations;
23using UnityEngine.Networking;
24using UnityEngine.Rendering;
25using UnityEngine.SceneManagement;
26using UnityEngine.Serialization;
28using UnityEngine.Video;
39[assembly: CompilationRelaxations(8)]
40[assembly: RuntimeCompatibility(WrapNonExceptionThrows =
true)]
41[assembly: Debuggable()]
42[assembly: PerformanceScanner()]
43[assembly: PerformanceScanner()]
44[assembly: PerformanceScanner()]
45[assembly: PerformanceScanner()]
46[assembly: PerformanceScanner()]
47[assembly: PerformanceScanner()]
48[assembly: PerformanceScanner()]
49[assembly: PerformanceScanner()]
50[assembly: PerformanceScanner()]
51[assembly: PerformanceScanner()]
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")]
76 internal void <ExecuteComputeShader>
b__0(AsyncGPUReadbackRequest req)
79 if (((AsyncGPUReadbackRequest)(ref req)).hasError)
81 Debug.LogError((
object)
"GPU readback error detected.");
83 else if (((AsyncGPUReadbackRequest)(ref req)).done)
85 CS$<>8__locals1.output.SetPixelData<
byte>(((AsyncGPUReadbackRequest)(ref req)).GetData<byte>(0), mipCopy, 0);
110 if (Application.isBatchMode)
112 Debug.Log((
object)
"DPIDMipmapper is not supported in batch mode.");
115 computeShader = Resources.Load<ComputeShader>(
"PerceptualMipmapping/PerceptualPostProcessor");
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)
125 Instance.
ExecuteComputeShader(input, output, alphaIsTransparency, sRGB, asyncOnGPU, inPlace, inputIsGuidance, conservative, minimumSize, normalMap);
128 public static void GenerateDPIDMipmapsQuality(Texture2D input, Texture2D output,
bool alphaIsTransparency,
bool sRGB,
bool conservative =
false,
bool normalMap =
false)
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);
134 public static void GenerateDPIDMipmapsFast(Texture2D texture,
bool alphaIsTransparency,
bool sRGB,
bool conservative =
false,
bool normalMap =
false)
136 Instance.
ExecuteComputeShader(texture, texture, alphaIsTransparency, sRGB, asyncOnGPU:
true, inPlace:
true, inputIsGuidance:
true, conservative, 4u, normalMap);
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)
227 <>c__DisplayClass15_.output = output;
228 if ((Object)(
object)input == (Object)
null || (Object)(
object)<>c__DisplayClass15_.
output == (Object)
null)
230 Debug.LogError((
object)
"Input and output textures must be non-null, input: {input != null}, output: {output != null}");
234 if (asyncOnGPU && (
int)<>c__DisplayClass15_.
output.format != 4 && (
int)<>c__DisplayClass15_.
output.format != 5)
238 if (Application.isBatchMode)
240 Debug.LogError((
object)
"DPIDMipmapper is not supported in batch mode.");
243 if (inputIsGuidance && (alphaIsTransparency || sRGB))
245 inputIsGuidance =
false;
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)
249 inputIsGuidance =
false;
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))
257 alphaIsTransparency =
false;
261 computeShader = (ComputeShader)Resources.Load(
"PerceptualMipmapping/PerceptualPostProcessor");
269 CommandBuffer val =
new CommandBuffer();
272 val.SetExecutionFlags((CommandBufferExecutionFlags)2);
274 int num = (inPlace ? 1 : 0);
277 int width = ((Texture)input).width;
278 int height = ((Texture)input).height;
279 float num2 = (conservative ? 0.5f : 1f);
283 val.SetComputeIntParam(
computeShader,
"premultiplyAlpha", alphaIsTransparency ? 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;
293 if ((
int)format == 63)
295 val2 = (RenderTextureFormat)16;
299 val2 = (RenderTextureFormat)11;
305 val2 = (RenderTextureFormat)0;
308 val2 = (RenderTextureFormat)2;
311 val2 = (RenderTextureFormat)5;
314 val2 = (RenderTextureFormat)14;
317 val2 = (RenderTextureFormat)12;
320 val2 = (RenderTextureFormat)15;
323 val2 = (RenderTextureFormat)13;
326 val2 = (RenderTextureFormat)28;
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;
343 RenderTargetIdentifier val4 =
default(RenderTargetIdentifier);
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++)
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)
358 float num6 = (float)((Texture)input).width / (
float)num4;
359 float num7 = (float)((Texture)input).height / (
float)num5;
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;
373 val.CopyTexture(val5, 0, i, val7, 0, 0);
385 val.CopyTexture(val4, 0, i, RenderTargetIdentifier.op_Implicit((Texture)(object)<>c__DisplayClass15_.
output), 0, i);
391 RenderTexture val8 =
new RenderTexture(val3);
392 for (
int j = num; j < ((Texture)<>c__DisplayClass15_.
output).mipmapCount; j++)
395 CS$<>8__locals0.CS$<>8__locals1 = <>c__DisplayClass15_;
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)
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)
408 if (((AsyncGPUReadbackRequest)(ref req)).hasError)
410 Debug.LogError((
object)
"GPU readback error detected.");
412 else if (((AsyncGPUReadbackRequest)(ref req)).done)
414 CS$<>8__locals0.CS$<>8__locals1.output.SetPixelData<
byte>(((AsyncGPUReadbackRequest)(ref req)).GetData<byte>(0), CS$<>8__locals0.mipCopy, 0);
418 val.WaitAllAsyncReadbackRequests();
420 Graphics.ExecuteCommandBuffer(val);
426 Graphics.ExecuteCommandBufferAsync(val, (ComputeQueueType)1);
520 if (!String.IsNullOrEmpty(unitText))
522 string text = unitText.ToUpperInvariant();
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)),
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)),
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]
671 (Object)((contentSize > 0) ? String.Concat(
"Current ", text,
": ",
FormatFileSize(contentSize)) :
"")
678 string text = (compressed ?
"download size" :
"uncompressed size");
679 return String.Concat((
string[])(object)
new String[10]
682 ((Object)contentType).ToString().ToLower(),
685 " was too large for VRChat to load on this platform. Please reduce the number or size of assets in the scene. The maximum ",
690 (contentSize > 0) ? String.Concat(
"Current ", text,
": ",
FormatFileSize(contentSize)) :
""
695 public static string FormatFileSize(
long filesize,
bool includeUnitPostfix =
true,
int precision = -1,
string requiredUnit =
null)
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)
709 string postfix = fileSizeUnit.GetPostfix();
710 return String.Concat(text2,
" ", postfix);
731 internal bool <RunPerformanceScanEnumerator>
b__0(IConstraint c)
733 return shouldIgnoreComponent((Component)(
object)((c is Component) ? c :
null));
738 return shouldIgnoreComponent((Component)((c is Component) ? c :
null));
742 [IteratorStateMachine()]
747 shouldIgnoreComponent = shouldIgnoreComponent
749 List<IConstraint> engineConstraintBuffer =
new List<IConstraint>();
750 yield
return ScanAvatarForComponentsOfType<IConstraint>(avatarObject, engineConstraintBuffer);
751 if (CS$<>8__locals0.shouldIgnoreComponent !=
null)
753 engineConstraintBuffer.RemoveAll((Predicate<IConstraint>)((IConstraint c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)((c is Component) ? c :
null))));
755 List<IVRCConstraint> vrcConstraintBuffer =
new List<IVRCConstraint>();
756 yield
return ScanAvatarForComponentsOfType<IVRCConstraint>(avatarObject, vrcConstraintBuffer);
757 if (CS$<>8__locals0.shouldIgnoreComponent !=
null)
759 vrcConstraintBuffer.RemoveAll((Predicate<IVRCConstraint>)((
IVRCConstraint c) => CS$<>8__locals0.shouldIgnoreComponent((Component)((c is Component) ? c :
null))));
761 int count = engineConstraintBuffer.Count;
762 int count2 = vrcConstraintBuffer.Count;
763 int num = count + count2;
764 perfStats.constraintsCount =
new Nullable<int>(num);
768 num2 =
GetGroupDepth(vrcConstraintBuffer, out var vrcCachedConstraintsCount);
769 int num3 = count2 - vrcCachedConstraintsCount;
776 perfStats.constraintDepth =
new Nullable<int>(num2);
779 private int GetGroupDepth(List<IVRCConstraint> vrcConstraints, out
int vrcCachedConstraintsCount)
784 vrcCachedConstraintsCount = 0;
785 Enumerator<IVRCConstraint> enumerator = vrcConstraints.GetEnumerator();
788 while (enumerator.MoveNext())
790 int latestValidExecutionGroupIndex = enumerator.Current.LatestValidExecutionGroupIndex;
791 if (latestValidExecutionGroupIndex >= 0)
793 vrcCachedConstraintsCount++;
794 if (latestValidExecutionGroupIndex >= num)
796 num = latestValidExecutionGroupIndex + 1;
804 ((IDisposable)enumerator).Dispose();
823 public ImageDownloader <>4__this;
843 internal void <DownloadImageInternal>
b__0(AsyncOperation _)
857 if ((
int)imageRequest.result == 2 || (
int)imageRequest.result == 3)
859 <>4__this._downloadingImages.Remove(cacheRef);
862 <>4__this.
DownloadImageInternal(imageUrl, imageSize, onImageDownload, onImageDownloadFailed, fallbackImageUrl, isRetry:
true);
865 Debug.LogWarning((
object)String.Concat(
"An error occurred downloading an image: ", imageRequest.error));
870 Texture2D content = DownloadHandlerTexture.GetContent(imageRequest);
871 if ((Object)(
object)content == (Object)
null || ((Texture)content).GetNativeTexturePtr() == IntPtr.Zero)
873 Debug.LogError((
object)
"An error occurred downloading an image: Data was null");
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);
885 imageRequest.Dispose();
886 Object.Destroy((Object)(object)content);
888 onImageDownload?.Invoke(val);
889 Enumerator<Action<Texture2D>> enumerator = <>4__this._downloadingImages[cacheRef].GetEnumerator();
892 while (enumerator.MoveNext())
894 enumerator.Current?.Invoke(val);
899 ((IDisposable)enumerator).Dispose();
901 <>4__this._downloadingImages.Remove(cacheRef);
913 private readonly Dictionary<string, Texture2D> _downloadedImages =
new Dictionary<string, Texture2D>();
915 private readonly Dictionary<string, List<Action<Texture2D>>> _downloadingImages =
new Dictionary<string, List<Action<Texture2D>>>();
921 if (_instance !=
null)
937 public static void DownloadImage(
string imageUrl,
int imageSize, Action<Texture2D> onImageDownload =
null, Action<ImageLoadError> onImageDownloadFailed =
null,
string fallbackImageUrl =
"",
bool isRetry =
false)
946 _downloadedImages.Clear();
948 Resources.UnloadUnusedAssets();
951 int num = cachedImageQueue.Count - size;
954 for (
int i = 0; i < num; i++)
959 Resources.UnloadUnusedAssets();
963 private void DownloadImageInternal(
string imageUrl,
int imageSize, Action<Texture2D> onImageDownload, Action<ImageLoadError> onImageDownloadFailed,
string fallbackImageUrl =
"",
bool isRetry =
false)
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))
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))
981 CS$<>8__locals0.onImageDownload?.Invoke(_downloadedImages[CS$<>8__locals0.cacheRef]);
984 if (_downloadingImages.ContainsKey(CS$<>8__locals0.cacheRef))
986 _downloadingImages[CS$<>8__locals0.cacheRef].Add(CS$<>8__locals0.onImageDownload);
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
1009 if ((
int)CS$<>8__locals0.imageRequest.result == 2 || (int)CS$<>8__locals0.imageRequest.result == 3)
1011 CS$<>8__locals0.<>4__this._downloadingImages.Remove(CS$<>8__locals0.cacheRef);
1012 if (!CS$<>8__locals0.isRetry)
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);
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);
1025 Texture2D content = DownloadHandlerTexture.GetContent(CS$<>8__locals0.imageRequest);
1026 if ((Object)(object)content == (Object)
null || ((Texture)content).GetNativeTexturePtr() == IntPtr.Zero)
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);
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);
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();
1048 while (enumerator.MoveNext())
1050 enumerator.Current?.Invoke(val3);
1055 ((IDisposable)enumerator).Dispose();
1057 CS$<>8__locals0.<>4__this._downloadingImages.Remove(CS$<>8__locals0.cacheRef);
1062 catch (Exception val)
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);
1079 _downloadedImages[cacheRef] = tex;
1089 if (String.IsNullOrEmpty(fallbackImageUrl))
1091 Object obj = Resources.Load(
"no_image", typeof(Texture2D));
1092 Texture2D val = (Texture2D)(
object)((obj is Texture2D) ? obj :
null);
1093 onImageDownload.Invoke(val);
1106 private JobHandle _jobHandle;
1108 private static readonly List<DisposableJobHandle> _knownDisposableJobHandles =
new List<DisposableJobHandle>(32);
1118 _jobHandle = jobHandle;
1120 _knownDisposableJobHandles.Add(
this);
1127 return (IList<DisposableJobHandle>)(object)_knownDisposableJobHandles;
1132 for (
int num = _knownDisposableJobHandles.Count - 1; num >= 0; num--)
1136 _knownDisposableJobHandles.RemoveAt(num);
1144 ((JobHandle)(ref _jobHandle)).
Complete();
1159 return ((JobHandle)(ref _jobHandle)).Equals(other._jobHandle);
1184 return disposableJobHandle._jobHandle;
1189 return ((Object)(JobHandle)(ref _jobHandle)).GetHashCode();
1196 [RequireComponent()]
1197 [DisallowMultipleComponent]
1202 [Tooltip(
"Loudness increase in decibels, can be negative.")]
1205 [Tooltip(
"Distance where loudness falls off to zero, in meters.")]
1208 [Tooltip(
"Distance where loudness begins to falloff, in meters. Default of 0 ensures accurate spatialization.")]
1211 [Tooltip(
"Radius in meters of a spherical shaped sound source. Default of 0 simulates a point-source (recommended).")]
1214 [Tooltip(
"Enable Spatialization. Uncheck only for directionless audio.")]
1217 [Tooltip(
"Use the AudioSource '3D Sound Settings' volume curve. If unchecked, use Inverse Square falloff.")]
1222 private AudioSource _source;
1226 _source = ((Component)
this).GetComponent<AudioSource>();
1227 if ((Object)(object)_source == (Object)
null)
1229 Debug.LogErrorFormat(
"[{0}:VRC_SpatialAudioSource without an AudioSource component!", (
object[])(object)
new Object[1] { (Object)((Object)((Component)
this).gameObject).name });
1236 _source.spatialize =
false;
1257 Color color =
default(Color);
1262 Gizmos.color = color;
1263 Gizmos.DrawWireSphere(((Component)
this).transform.position,
Near);
1265 Gizmos.color = color;
1266 Gizmos.DrawSphere(((Component)
this).transform.position,
Near);
1271 Gizmos.color = Color.red;
1272 Gizmos.DrawWireSphere(((Component)
this).transform.position,
Far);
1274 Gizmos.color = color;
1275 Gizmos.DrawSphere(((Component)
this).transform.position,
Far);
1280 Gizmos.color = color;
1281 Gizmos.DrawWireSphere(((Component)
this).transform.position,
VolumetricRadius);
1283 Gizmos.color = color;
1383 public static Func<VRCPlayerApi, bool> _isMasterDelegate =
null;
1385 public static Func<VRCPlayerApi, bool> _isInstanceOwnerDelegate =
null;
1387 public static Func<VRCPlayerApi, bool> _isModeratorDelegate =
null;
1389 public static Func<VRCPlayerApi, bool> _isSuperDelegate =
null;
1391 public static Func<VRCPlayerApi, bool> _isSuspendedDelegate =
null;
1415 public static List<VRCPlayerApi>
sPlayers =
new List<VRCPlayerApi>();
1419 public static Func<VRCPlayerApi, int> _GetPlayerId =
null;
1421 public static Func<GameObject, VRCPlayerApi> _GetPlayerByGameObject =
null;
1423 public static Func<int, VRCPlayerApi> _GetPlayerById =
null;
1425 public static Func<VRCPlayerApi, GameObject, bool> _IsOwner =
null;
1427 public static Action<VRCPlayerApi, GameObject> _TakeOwnership =
null;
1429 public static Func<VRCPlayerApi, TrackingDataType, TrackingData> _GetTrackingData =
null;
1431 public static Func<VRCPlayerApi, HumanBodyBones, Transform> _GetBoneTransform =
null;
1433 public static Func<VRCPlayerApi, HumanBodyBones, Vector3> _GetBonePosition =
null;
1435 public static Func<VRCPlayerApi, HumanBodyBones, Quaternion> _GetBoneRotation =
null;
1441 public static Action<VRCPlayerApi, Vector3, Quaternion> _TeleportTo =
null;
1447 public static Action<VRCPlayerApi> _Respawn =
null;
1449 public static Action<VRCPlayerApi, int> _RespawnWithIndex =
null;
1451 public static Action<VRCPlayerApi, bool> _EnablePickups =
null;
1453 public static Func<string[]> _GetAvailableLanguages =
null;
1455 public static Func<string> _GetCurrentLanguage =
null;
1457 public static Action<VRCPlayerApi, Color> _SetNamePlateColor =
null;
1459 public static Action<VRCPlayerApi> _RestoreNamePlateColor =
null;
1461 public static Action<VRCPlayerApi, bool> _SetNamePlateVisibility =
null;
1463 public static Action<VRCPlayerApi> _RestoreNamePlateVisibility =
null;
1465 public static Action<VRCPlayerApi, string, string> _SetPlayerTag =
null;
1467 public static Func<VRCPlayerApi, string, string> _GetPlayerTag =
null;
1469 public static Func<string, string, List<int>> _GetPlayersWithTag =
null;
1471 public static Action<VRCPlayerApi> _ClearPlayerTags =
null;
1473 public static Action<VRCPlayerApi, bool, string, string> _SetInvisibleToTagged =
null;
1475 public static Action<VRCPlayerApi, bool, string, string> _SetInvisibleToUntagged =
null;
1477 public static Action<VRCPlayerApi, int, string, string> _SetSilencedToTagged =
null;
1479 public static Action<VRCPlayerApi, int, string, string> _SetSilencedToUntagged =
null;
1481 public static Action<VRCPlayerApi> _ClearInvisible =
null;
1483 public static Action<VRCPlayerApi> _ClearSilence =
null;
1485 public static Action<VRCPlayerApi, float> _SetRunSpeed =
null;
1487 public static Action<VRCPlayerApi, float> _SetWalkSpeed =
null;
1489 public static Action<VRCPlayerApi, float> _SetStrafeSpeed =
null;
1491 public static Action<VRCPlayerApi, float> _SetJumpImpulse =
null;
1493 public static Action<VRCPlayerApi, float> _SetGravityStrength =
null;
1495 public static Func<VRCPlayerApi, float> _GetRunSpeed =
null;
1497 public static Func<VRCPlayerApi, float> _GetWalkSpeed =
null;
1499 public static Func<VRCPlayerApi, float> _GetStrafeSpeed =
null;
1501 public static Func<VRCPlayerApi, float> _GetJumpImpulse =
null;
1503 public static Func<VRCPlayerApi, float> _GetGravityStrength =
null;
1505 public static Action<VRCPlayerApi, float> _SetVoiceGain =
null;
1507 public static Action<VRCPlayerApi, float> _SetVoiceDistanceNear =
null;
1509 public static Action<VRCPlayerApi, float> _SetVoiceDistanceFar =
null;
1511 public static Action<VRCPlayerApi, float> _SetVoiceVolumetricRadius =
null;
1513 public static Action<VRCPlayerApi, bool> _SetVoiceLowpass =
null;
1515 public static Func<VRCPlayerApi, float> _GetVoiceGain =
null;
1517 public static Func<VRCPlayerApi, float> _GetVoiceDistanceNear =
null;
1519 public static Func<VRCPlayerApi, float> _GetVoiceDistanceFar =
null;
1521 public static Func<VRCPlayerApi, float> _GetVoiceVolumetricRadius =
null;
1523 public static Func<VRCPlayerApi, bool> _GetVoiceLowpass =
null;
1525 public static Action<VRCPlayerApi, float> _SetAvatarAudioGain =
null;
1527 public static Action<VRCPlayerApi, float> _SetAvatarAudioFarRadius =
null;
1529 public static Action<VRCPlayerApi, float> _SetAvatarAudioNearRadius =
null;
1531 public static Action<VRCPlayerApi, float> _SetAvatarAudioVolumetricRadius =
null;
1533 public static Action<VRCPlayerApi, bool> _SetAvatarAudioForceSpatial =
null;
1535 public static Action<VRCPlayerApi, bool> _SetAvatarAudioCustomCurve =
null;
1537 public static Action<VRCPlayerApi> _CombatSetup =
null;
1539 public static Action<VRCPlayerApi, float> _CombatSetMaxHitpoints =
null;
1541 public static Action<VRCPlayerApi, float> _CombatSetCurrentHitpoints =
null;
1543 public static Func<VRCPlayerApi, float> _CombatGetCurrentHitpoints =
null;
1545 public static Action<VRCPlayerApi, bool, float, Transform> _CombatSetRespawn =
null;
1547 public static Action<VRCPlayerApi, GameObject> _CombatSetDamageGraphic =
null;
1549 public static Func<VRCPlayerApi, IVRC_Destructible> _CombatGetDestructible =
null;
1551 public static Func<VRCPlayerApi, bool> _IsUserInVR =
null;
1553 public static Action<VRCPlayerApi> _UseLegacyLocomotion =
null;
1555 public static Action<VRCPlayerApi> _UseAttachedStation =
null;
1557 public static Action<VRCPlayerApi, RuntimeAnimatorController> _PushAnimations =
null;
1559 public static Action<VRCPlayerApi> _PopAnimations =
null;
1561 public static Action<VRCPlayerApi, bool> _Immobilize =
null;
1563 public static Action<VRCPlayerApi, Vector3> _SetVelocity =
null;
1565 public static Func<VRCPlayerApi, Vector3> _GetVelocity =
null;
1567 public static Func<VRCPlayerApi, Vector3> _GetPosition =
null;
1569 public static Func<VRCPlayerApi, Quaternion> _GetRotation =
null;
1573 private bool _isValid;
1575 public static Func<VRCPlayerApi, float> _GetAvatarEyeHeightAsMeters =
null;
1577 public static Func<VRCPlayerApi, float> _GetAvatarEyeHeightMaximumAsMeters =
null;
1579 public static Func<VRCPlayerApi, float> _GetAvatarEyeHeightMinimumAsMeters =
null;
1581 public static Func<VRCPlayerApi, bool> _GetManualAvatarScalingAllowed =
null;
1583 public static Action<VRCPlayerApi, float> _SetAvatarEyeHeightByMeters =
null;
1585 public static Action<VRCPlayerApi, float> _SetAvatarEyeHeightByMultiplier =
null;
1587 public static Action<VRCPlayerApi, float> _SetAvatarEyeHeightMaximumByMeters =
null;
1589 public static Action<VRCPlayerApi, float> _SetAvatarEyeHeightMinimumByMeters =
null;
1591 public static Action<VRCPlayerApi, bool> _SetManualAvatarScalingAllowed =
null;
1598 public bool isMaster => _isMasterDelegate.Invoke(
this);
1621 public bool isSuper => _isSuperDelegate.Invoke(
this);
1712 return _GetPlayerId.Invoke(player);
1717 return _GetPlayerByGameObject?.Invoke(playerGameObject);
1733 return _GetPlayerById.Invoke(
playerId);
1762 return _IsOwner.Invoke(
this, obj);
1767 _TakeOwnership.Invoke(
this, obj);
1793 return _GetTrackingData.Invoke(
this, tt);
1804 return _GetBoneTransform.Invoke(
this, tt);
1825 return _GetBonePosition.Invoke(
this, tt);
1849 return _GetBoneRotation.Invoke(
this, tt);
1863 return _GetPickupInHand.Invoke(
this, hand);
1887 if (!(duration < 0f) && !(amplitude < 0f) && !(frequency < 0f))
1889 _PlayHapticEventInHand(
this, hand, duration, amplitude, frequency);
1904 public void TeleportTo(Vector3 teleportPos, Quaternion teleportRot)
1908 if (_TeleportTo !=
null)
1910 _TeleportTo.Invoke(
this, teleportPos, teleportRot);
1931 if (_TeleportToOrientation !=
null)
1933 _TeleportToOrientation.Invoke(
this, teleportPos, teleportRot, teleportOrientation);
1961 if (_TeleportToOrientationLerp !=
null)
1963 _TeleportToOrientationLerp(
this, teleportPos, teleportRot, teleportOrientation, lerpOnRemote);
1974 _Respawn.Invoke(
this);
1987 _RespawnWithIndex.Invoke(
this, spawnsIndex);
2000 _EnablePickups.Invoke(
this, enable);
2006 _SetNamePlateColor.Invoke(
this, col);
2011 _RestoreNamePlateColor.Invoke(
this);
2016 _SetNamePlateVisibility.Invoke(
this, flag);
2021 _RestoreNamePlateVisibility.Invoke(
this);
2039 _SetPlayerTag.Invoke(
this, tagName, tagValue);
2055 return _GetPlayerTag.Invoke(
this, tagName);
2083 _ClearPlayerTags.Invoke(
this);
2088 _SetInvisibleToTagged.Invoke(
this, invisible, tagName, tagValue);
2093 _SetInvisibleToUntagged.Invoke(
this, invisible, tagName, tagValue);
2098 _SetSilencedToTagged.Invoke(
this, level, tagName, tagValue);
2103 _SetSilencedToUntagged.Invoke(
this, level, tagName, tagValue);
2116 _SetRunSpeed.Invoke(
this, speed);
2129 _SetWalkSpeed.Invoke(
this, speed);
2144 _SetStrafeSpeed.Invoke(
this, speed);
2158 _SetJumpImpulse.Invoke(
this, impulse);
2171 return _GetGravityStrength.Invoke(
this);
2184 return _GetRunSpeed.Invoke(
this);
2197 return _GetWalkSpeed.Invoke(
this);
2210 return _GetStrafeSpeed.Invoke(
this);
2223 return _GetJumpImpulse.Invoke(
this);
2236 return _IsUserInVR.Invoke(
this);
2249 _SetGravityStrength.Invoke(
this, strength);
2258 _UseLegacyLocomotion.Invoke(
this);
2269 _UseAttachedStation.Invoke(
this);
2274 _ClearInvisible.Invoke(
this);
2279 _ClearSilence.Invoke(
this);
2300 _CombatSetup.Invoke(
this);
2309 _CombatSetMaxHitpoints.Invoke(
this, maxHp);
2318 _CombatSetCurrentHitpoints.Invoke(
this, hp);
2328 return _CombatGetCurrentHitpoints.Invoke(
this);
2335 public void CombatSetRespawn(
bool respawnOnDeath,
float respawnTimer, Transform respawnLocation)
2337 _CombatSetRespawn.Invoke(
this, respawnOnDeath, respawnTimer, respawnLocation);
2346 _CombatSetDamageGraphic.Invoke(
this, prefab);
2355 return _CombatGetDestructible.Invoke(
this);
2368 _SetVoiceGain.Invoke(
this, gain);
2373 return _GetVoiceGain.Invoke(
this);
2388 _SetVoiceDistanceNear.Invoke(
this, near);
2393 return _GetVoiceDistanceNear.Invoke(
this);
2408 _SetVoiceDistanceFar.Invoke(
this, far);
2413 return _GetVoiceDistanceFar.Invoke(
this);
2432 _SetVoiceVolumetricRadius.Invoke(
this, radius);
2437 return _GetVoiceVolumetricRadius.Invoke(
this);
2452 _SetVoiceLowpass.Invoke(
this, enabled);
2457 return _GetVoiceLowpass.Invoke(
this);
2470 _SetAvatarAudioGain.Invoke(
this, gain);
2484 _SetAvatarAudioFarRadius.Invoke(
this, distance);
2501 _SetAvatarAudioNearRadius.Invoke(
this, distance);
2516 _SetAvatarAudioVolumetricRadius.Invoke(
this, radius);
2530 _SetAvatarAudioForceSpatial.Invoke(
this, force);
2543 _SetAvatarAudioCustomCurve.Invoke(
this, allow);
2556 return _GetAvailableLanguages.Invoke();
2569 return _GetCurrentLanguage.Invoke();
2584 _PushAnimations.Invoke(
this, animations);
2589 _PopAnimations.Invoke(
this);
2602 _Immobilize.Invoke(
this, immobile);
2617 _SetVelocity.Invoke(
this, velocity);
2631 return _GetVelocity.Invoke(
this);
2645 return _GetPosition.Invoke(
this);
2659 return _GetRotation.Invoke(
this);
2673 return _GetAvatarEyeHeightAsMeters.Invoke(
this);
2687 return _GetAvatarEyeHeightMaximumAsMeters.Invoke(
this);
2701 return _GetAvatarEyeHeightMinimumAsMeters.Invoke(
this);
2715 return _GetManualAvatarScalingAllowed.Invoke(
this);
2729 _SetAvatarEyeHeightByMeters.Invoke(
this, scaleMeters);
2744 _SetAvatarEyeHeightByMultiplier.Invoke(
this, scaleMultiplier);
2758 _SetAvatarEyeHeightMaximumByMeters.Invoke(
this, scaleMeters);
2772 _SetAvatarEyeHeightMinimumByMeters.Invoke(
this, scaleMeters);
2785 _SetManualAvatarScalingAllowed.Invoke(
this, enabled);
2788 [HelpURL(
"https://creators.vrchat.com/avatars/state-behaviors#animator-layer-controller")]
2806 [Tooltip(
"Playable layer to affect")]
2809 [Tooltip(
"Index of sub-layer to affect")]
2812 [Tooltip(
"Goal weight 0-1")]
2816 [Tooltip(
"Time to reach goal weight, should be less than animation length")]
2819 [Tooltip(
"Message for debugging")]
2836 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo,
int layerIndex)
2841 [HelpURL(
"https://creators.vrchat.com/avatars/state-behaviors#animator-locomotion-control")]
2850 [Tooltip(
"Disable player locomotion.")]
2853 [Tooltip(
"Message for debugging")]
2870 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo,
int layerIndex)
2880 [HelpURL(
"https://creators.vrchat.com/avatars/state-behaviors#animator-play-audio")]
3000 public Vector2
Pitch =
new Vector2(1f, 1f);
3107 return setting
switch
3109 ApplySettings.ApplyIfStopped => !
Source.isPlaying,
3110 ApplySettings.AlwaysApply =>
true,
3127 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo,
int layerIndex)
3136 public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo,
int layerIndex)
3141 [HelpURL(
"https://creators.vrchat.com/avatars/state-behaviors#animator-temporary-pose-space")]
3150 [Tooltip(
"Enter or exit a pose space based on the avatar's current pose.")]
3153 [Tooltip(
"Is the delay fixed or normalized.")]
3156 [Tooltip(
"Delay before applying.")]
3159 [Tooltip(
"Message for debugging")]
3181 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo,
int layerIndex)
3192 public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo,
int layerIndex)
3201 [HelpURL(
"https://creators.vrchat.com/avatars/state-behaviors#animator-tracking-control")]
3217 [Tooltip(
"Disable tracking of user's head and follow animation instead.")]
3220 [Tooltip(
"Disable tracking of user's left hand and follow animation instead.")]
3223 [Tooltip(
"Disable tracking of user's right hand and follow animation instead.")]
3226 [Tooltip(
"Disable tracking of user's hip and follow animation instead")]
3229 [Tooltip(
"Disable tracking of user's left foot and follow animation instead. Also disables procedural footsteps.")]
3232 [Tooltip(
"Disable tracking of user's right foot and follow animation instead. Also disables procedural footsteps.")]
3235 [Tooltip(
"Disable tracking of user's left fingers and follow animation instead.")]
3238 [Tooltip(
"Disable tracking of user's right fingers and follow animation instead.")]
3241 [Tooltip(
"Disable EyeLook and use animated eye positions")]
3244 [Tooltip(
"Disable Jawflap or Visemes and use animated jaw and mouth positions")]
3247 [Tooltip(
"Message for debugging")]
3264 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo,
int layerIndex)
3339 private List<NetworkIDPair>
networkIDs =
new List<NetworkIDPair>();
3360 float num = ((Vector3)(ref
ViewPosition)).magnitude / 1.6f;
3365 Vector3 val = ((Component)
this).transform.position +
ViewPosition;
3366 Gizmos.DrawRay(((Component)
this).transform.position, Vector3.forward);
3367 Gizmos.DrawSphere(val, 0.01f * num);
3384 float num = y * 0.8f;
3385 float num2 = y * 0.7f;
3394 ((Component)
this).gameObject.GetComponentsInChildren<
INetworkID>(
true, netIds);
3399 if (path.StartsWith(
"/"))
3401 path = path.Substring(1);
3403 Transform obj = ((Component)
this).transform.Find(path);
3408 return ((Component)obj).gameObject;
3416 [HelpURL(
"https://creators.vrchat.com/avatars/state-behaviors#avatar-parameter-driver")]
3430 [Tooltip(
"The type of operation to be executed")]
3433 [Tooltip(
"Parameter that will be written to")]
3436 [Tooltip(
"Source parameter that will be read")]
3439 [Tooltip(
"The value used for this operation")]
3442 [Tooltip(
"Minimum value to be set")]
3445 [Tooltip(
"Maximum value to be set")]
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.")]
3452 [Tooltip(
"If true, we convert the range of the source and destination values according to the ranges given.")]
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.")]
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.")]
3487 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo,
int layerIndex)
3492 [Obsolete(
"Please use VRC_Trigger instead",
false)]
3513 if (((Component)
this).GetComponentInParent<VRCPlayerApi>() !=
null || ((Component)
this).GetComponent<VRCPlayerApi>() !=
null)
3515 Object.Destroy((Object)(
object)
this);
3522 if ((Object)(object)
Handler == (Object)
null)
3542 while (((IEnumerator)enumerator).MoveNext())
3550 if (enumerator !=
null)
3552 ((IDisposable)enumerator).Dispose();
3563 while (((IEnumerator)enumerator).MoveNext())
3571 if (enumerator !=
null)
3573 ((IDisposable)enumerator).Dispose();
3584 public static Func<GameObject, VRC_NpcApi> _GetApiByGameObject;
3586 public static Action<VRC_NpcApi, bool, string, string> _SetNamePlate;
3588 public static Action<VRC_NpcApi, bool, bool, bool> _SetSocialStatus;
3590 public static Action<VRC_NpcApi, bool, bool> _SetMuteStatus;
3592 public static Action<VRC_NpcApi, int, bool> _ActThis;
3594 public static Action<VRC_NpcApi, AudioClip, float> _SayThis;
3606 if ((Object)(
object)npcGameObject != (Object)
null)
3608 return _GetApiByGameObject.Invoke(npcGameObject);
3615 _ActThis.Invoke(
this, number, loop);
3620 _SayThis.Invoke(
this, clip, volume);
3625 _SetNamePlate.Invoke(
this, visible, playerName, vipTag);
3630 _SetSocialStatus.Invoke(
this,
friend, vip, blocked);
3635 _SetMuteStatus.Invoke(
this, canSpeak, canHear);
3654 PhysicsObjects = (GameObject[])(
object)
new GameObject[((Component)
this).transform.childCount];
3655 for (
int i = 0; i < ((Component)
this).transform.childCount; i++)
3657 PhysicsObjects[i] = ((Component)((Component)
this).transform.GetChild(i)).gameObject;
3660 for (
int j = 0; j < physicsObjects.Length; j++)
3662 physicsObjects[j].transform.parent =
PhysicsRoot.transform;
3669 for (
int i = 0; i < physicsObjects.Length; i++)
3671 Object.Destroy((Object)(
object)physicsObjects[i]);
3692 [Tooltip(
"Layer to affect")]
3695 [Tooltip(
"Goal weight 0-1")]
3699 [Tooltip(
"Time to reach goal weight")]
3702 [Tooltip(
"Message for debugging")]
3722 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo,
int layerIndex)
3726 Debug.Log((
object)String.Concat(
"VRCPlayableLayerControl:",
debugString));
3745 [RequireComponent()]
3831 while (((IEnumerator)enumerator).MoveNext())
3839 if (enumerator !=
null)
3841 ((IDisposable)enumerator).Dispose();
3856 while (((IEnumerator)enumerator).MoveNext())
3864 if (enumerator !=
null)
3866 ((IDisposable)enumerator).Dispose();
3876 Debug.Log((
object)
"ApplyHealing");
3891 while (((IEnumerator)enumerator).MoveNext())
3899 if (enumerator !=
null)
3901 ((IDisposable)enumerator).Dispose();
3916 while (((IEnumerator)enumerator).MoveNext())
3924 if (enumerator !=
null)
3926 ((IDisposable)enumerator).Dispose();
3936 return (
object[])(object)
new Object[1] { (object)
currentHealth };
3948 if ((Object)(
object)trigger != (Object)
null && !String.IsNullOrEmpty(e.ParameterString))
3956 [Tooltip(
"the scale of the damage indicator when at full damage")]
3959 [Tooltip(
"the scale of the damage indicator when at minimum damage")]
3962 [Tooltip(
"the distance in front of the player's head for the damage indicator")]
3965 private AnimationCurve
curve =
new AnimationCurve();
3975 renderer = ((Component)
this).GetComponent<Renderer>();
3984 initScale = ((Component)
this).transform.localScale;
3991 Object.Destroy((Object)(
object)((Component)
this).gameObject);
4010 if ((Object)(
object)
renderer != (Object)
null)
4012 renderer.enabled =
false;
4018 if ((Object)(
object)
renderer != (Object)
null)
4020 renderer.enabled =
true;
4027 if (damagePercent > 0f)
4033 curve.MoveKey(1,
new Keyframe(1f, num2));
4709 public static float PI = (float)Math.PI;
4713 public static float HALF_PI = (
float)Math.PI / 2f;
4727 if (Vector3.Dot(Vector3.Cross(vectorA, planeNormal), vectorB) > 0f)
4729 return (
TWO_PI - Mathf.Acos(Mathf.Clamp(Vector3.Dot(vectorA, vectorB), -1f, 1f))) * 57.29578f;
4731 return Mathf.Acos(Mathf.Clamp(Vector3.Dot(vectorA, vectorB), -1f, 1f)) * 57.29578f;
4744 if (Vector3.Dot(Vector3.Cross(vectorA, planeNormal), vectorB) > 0f)
4746 return (0f - Mathf.Acos(Mathf.Clamp(Vector3.Dot(vectorA, vectorB), -1f, 1f))) * 57.29578f;
4748 return Mathf.Acos(Mathf.Clamp(Vector3.Dot(vectorA, vectorB), -1f, 1f)) * 57.29578f;
4763 Vector3 val = lineB - lineA;
4764 float num = Vector3.Dot(point - lineA, val);
4769 float num2 = Vector3.Dot(val, val);
4795 Vector3 val = lineB - lineA;
4796 float num = Vector3.Dot(point - lineA, val);
4801 float num2 = Vector3.Dot(val, val);
4806 return lineA + val * (num / num2);
4819 return point + planeNormal * Vector3.Dot(planeNormal, planeOrigin - point);
4852 GameObject val = Resources.Load<GameObject>(
"AvatarPedestal");
4853 if ((Object)(object)val != (Object)
null &&
Instantiate !=
null)
4855 ref GameObject instance = ref
Instance;
4857 instance = (GameObject)(
object)((obj is GameObject) ? obj :
null);
4858 if ((Object)(object)
Placement != (Object)
null)
4860 Instance.transform.parent = ((Component)
Placement).transform;
4864 Instance.transform.parent = ((Component)
this).transform;
4866 Instance.transform.localPosition =
new Vector3(0f, 0f, 0f);
4867 Instance.transform.localRotation = Quaternion.identity;
4868 Instance.transform.localScale =
new Vector3(1f, 1f, 1f);
4881 if ((Object)(
object)
Instance != (Object)
null)
4889 RPC.Destination.All,
4890 RPC.Destination.Local
4894 if ((Object)(
object)
Instance != (Object)
null && instigator !=
null && instigator.
isLocal)
4977 SpawnObject(((Component)
this).transform.position, ((Component)
this).transform.rotation);
4991 Debug.LogError((
object)
"Spawner not initialized.", (Object)(
object)((Component)
this).gameObject);
5016 vrcEvent.Name =
"SpawnObject";
5018 vrcEvent.ParameterInt = 3;
5019 vrcEvent.ParameterString =
"SpawnObject";
5020 vrcEvent.ParameterObjects = (GameObject[])(
object)
new GameObject[1] { ((Component)
this).gameObject };
5023 vrcEvent.Name =
"DestroySpawnedObjects";
5025 vrcEvent.ParameterInt = 0;
5026 vrcEvent.ParameterString =
"DestroySpawnedObjects";
5027 vrcEvent.ParameterObjects = (GameObject[])(
object)
new GameObject[1] { ((Component)
this).gameObject };
5029 return (IEnumerable<VRC_EventHandler.VrcEvent>)(object)val;
5032 [RequireComponent()]
5083 [Obsolete(
"Please use a VRC_Trigger",
false)]
5087 [Obsolete(
"Please use a VRC_Trigger",
false)]
5091 [Obsolete(
"Please use a VRC_Trigger",
false)]
5095 [Obsolete(
"Please use a VRC_Trigger",
false)]
5099 [Obsolete(
"Please use a VRC_Trigger",
false)]
5103 [Obsolete(
"Please use a VRC_Trigger",
false)]
5129 public static Func<VRC_Pickup, PickupHand> _GetPickupHand;
5131 public static Func<VRC_Pickup, VRCPlayerApi> _GetCurrentPlayer;
5137 if (_GetCurrentPlayer ==
null)
5141 return _GetCurrentPlayer.Invoke(
this);
5171 ((Component)
this).gameObject.layer = LayerMask.NameToLayer(
"Pickup");
5181 RPC.Destination.Local,
5182 RPC.Destination.Owner
5199 Object[] obj =
new Object[2]
5201 (object)((instigator !=
null) ?
new Nullable<int>(instigator.
playerId) :
default(Nullable<int>)),
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);
5214 HapticEvent(
this, duration, amplitude, frequency);
5237 Name =
"PlayHaptics",
5240 ParameterObjects = (GameObject[])(object)
new GameObject[1] { ((Component)
this).gameObject },
5241 ParameterString =
"PlayHaptics"
5248 ParameterObjects = (GameObject[])(object)
new GameObject[1] { ((Component)
this).gameObject },
5249 ParameterString =
"Drop"
5251 return (IEnumerable<VRC_EventHandler.VrcEvent>)(object)val;
5281 [Tooltip(
"Contains a specific VRChat location such as the Hub or Home, if one is selected portal will go there.")]
5284 [Tooltip(
"Id of the destination world, like `wrld_f995a2eb-7ddc-4558-aef1-815c3b23df6c`.")]
5287 [Tooltip(
"Overrides the name shown above the Portal.")]
5290 [Tooltip(
"How to sort the search results if they're used instead of a roomId.")]
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.")]
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.")]
5299 [Tooltip(
"The words to use when searching for worlds")]
5302 [Tooltip(
"A comma-separated list of tags to search for, if `Room Id` is not set, and `Sort Heading` is set to `None`.")]
5330 initializedWithRoomId =
true;
5331 if (Initialize !=
null)
5340 if (!initializedWithRoomId && !String.IsNullOrEmpty(roomId))
5342 initializedWithRoomId =
true;
5343 if (Initialize !=
null)
5397 public List<InputPairing> Inputs =
new List<InputPairing>();
5401 if (Initialize !=
null)
5409 if (controllingPlayer !=
null && controllingPlayer.
isLocal && UpdateInputs !=
null)
5417 for (
int i = 0; i < Inputs.Count; i++)
5419 if (Inputs[i].name == inputName)
5435 public float displayDuration = -1f;
5443 if (images.Length != 0)
5445 imageMaterial.mainTexture = (Texture)(
object)images[0];
5447 if (autoplay && displayDuration > 0f)
5449 ((MonoBehaviour)
this).StartCoroutine(
"StartAutoplayWithDuration", (
object)displayDuration);
5455 Texture2D val =
null;
5456 if (images.Length != 0)
5460 showingImage = Random.Range(0, images.Length - 1);
5464 showingImage = ++showingImage % images.Length;
5466 val = images[showingImage];
5467 if ((Object)(
object)val == (Object)
null)
5469 Debug.LogError((
object)
"Loaded image is null. Did you add the image to the array in the inspector?");
5471 imageMaterial.mainTexture = (Texture)(
object)val;
5475 Debug.LogError((
object)
"Image array length is zero.");
5481 Texture2D val =
null;
5482 showingImage = --showingImage % images.Length;
5483 if (showingImage < 0)
5485 showingImage = images.Length + showingImage;
5487 Debug.Log((
object)String.Concat(
"showing prev image: ", ((Int32)(ref showingImage)).ToString()));
5488 val = images[showingImage];
5489 if ((Object)(
object)val == (Object)
null)
5491 Debug.LogError((
object)
"Loaded image is null. Did you add the image to the array in the inspector?");
5493 imageMaterial.mainTexture = (Texture)(
object)val;
5496 [IteratorStateMachine()]
5501 yield
return new WaitForSeconds(duration);
5508 ((MonoBehaviour)
this).StopCoroutine(
"StartAutoplayWithDuration");
5513 private static readonly Lazy<LayerMask> _uiLayerMaskLazy =
new Lazy<LayerMask>((Func<LayerMask>)GetLayerMask);
5515 private static LayerMask UiLayerMask => _uiLayerMaskLazy.Value;
5517 public static void Blit(Texture source, RenderTexture dest)
5519 CheckBlitTarget(dest);
5520 Graphics.Blit(source, dest);
5523 public static void Blit(Texture source, RenderTexture dest, Material mat,
int pass = -1)
5525 CheckBlitTarget(dest);
5526 Graphics.Blit(source, dest, mat, pass);
5529 public static void Blit(Texture source, RenderTexture dest, Material mat)
5531 CheckBlitTarget(dest);
5532 Graphics.Blit(source, dest, mat);
5535 public static void Blit(Texture source, RenderTexture dest, Vector2 scale, Vector2 offset)
5539 CheckBlitTarget(dest);
5540 Graphics.Blit(source, dest, scale, offset);
5543 public static void Blit(Texture source, RenderTexture dest,
int sourceDepthSlice,
int destDepthSlice)
5545 CheckBlitTarget(dest);
5546 Graphics.Blit(source, dest, sourceDepthSlice, destDepthSlice);
5549 public static void Blit(Texture source, RenderTexture dest, Vector2 scale, Vector2 offset,
int sourceDepthSlice,
int destDepthSlice)
5553 CheckBlitTarget(dest);
5554 Graphics.Blit(source, dest, scale, offset, sourceDepthSlice, destDepthSlice);
5557 public static void Blit(Texture source, Material mat,
int pass,
int destDepthSlice)
5559 Graphics.Blit(source, mat, pass, destDepthSlice);
5562 public static void DrawMeshInstanced(Mesh mesh,
int submeshIndex, Material material, Matrix4x4[] matrices)
5564 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, matrices.Length, (MaterialPropertyBlock)
null, (ShadowCastingMode)1,
true, 0, (Camera)
null, (LightProbeUsage)1, (LightProbeProxyVolume)
null);
5567 public static void DrawMeshInstanced(Mesh mesh,
int submeshIndex, Material material, Matrix4x4[] matrices,
int count)
5569 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, (MaterialPropertyBlock)
null, (ShadowCastingMode)1,
true, 0, (Camera)
null, (LightProbeUsage)1, (LightProbeProxyVolume)
null);
5572 public static void DrawMeshInstanced(Mesh mesh,
int submeshIndex, Material material, Matrix4x4[] matrices,
int count, MaterialPropertyBlock properties)
5574 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, (ShadowCastingMode)1,
true, 0, (Camera)
null, (LightProbeUsage)1, (LightProbeProxyVolume)
null);
5577 public static void DrawMeshInstanced(Mesh mesh,
int submeshIndex, Material material, Matrix4x4[] matrices,
int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows)
5580 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows,
true, 0, (Camera)
null, (LightProbeUsage)1, (LightProbeProxyVolume)
null);
5583 public static void DrawMeshInstanced(Mesh mesh,
int submeshIndex, Material material, Matrix4x4[] matrices,
int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows,
bool receiveShadows)
5586 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, 0, (Camera)
null, (LightProbeUsage)1, (LightProbeProxyVolume)
null);
5589 public static void DrawMeshInstanced(Mesh mesh,
int submeshIndex, Material material, Matrix4x4[] matrices,
int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows,
bool receiveShadows,
int layer)
5594 if ((LayerMask.op_Implicit(UiLayerMask) & layer) != 0)
5596 throw new InvalidOperationException(String.Concat(
"VRCGraphics cannot render to ", LayerMask.LayerToName(layer),
"."));
5598 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, (Camera)
null, (LightProbeUsage)1, (LightProbeProxyVolume)
null);
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)
5606 if ((LayerMask.op_Implicit(UiLayerMask) & layer) != 0)
5608 throw new InvalidOperationException(String.Concat(
"VRCGraphics cannot render to ", LayerMask.LayerToName(layer),
"."));
5610 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, camera, (LightProbeUsage)1, (LightProbeProxyVolume)
null);
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)
5619 if ((LayerMask.op_Implicit(UiLayerMask) & layer) != 0)
5621 throw new InvalidOperationException(String.Concat(
"VRCGraphics cannot render to ", LayerMask.LayerToName(layer),
"."));
5623 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, (LightProbeProxyVolume)
null);
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)
5632 if ((LayerMask.op_Implicit(UiLayerMask) & layer) != 0)
5634 throw new InvalidOperationException(String.Concat(
"VRCGraphics cannot render to ", LayerMask.LayerToName(layer),
"."));
5636 Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
5642 return LayerMask.op_Implicit(3670016);
5649 if (!Object.op_Implicit((Object)(
object)dest))
5651 throw new ArgumentException(
"Dest cannot be null with Graphics Blit.");
5664 public static event Action<RenderTexture> OnGetTemporaryRenderTexture
5670 Action<RenderTexture> val2;
5674 Action<RenderTexture> val3 = (Action<RenderTexture>)(
object)Delegate.Combine((Delegate)(object)val2, (Delegate)(object)value);
5677 while (val != val2);
5683 Action<RenderTexture> val2;
5687 Action<RenderTexture> val3 = (Action<RenderTexture>)(
object)Delegate.Remove((Delegate)(object)val2, (Delegate)(object)value);
5690 while (val != val2);
5694 public static event Action<RenderTexture> OnReleaseTemporaryRenderTexture
5700 Action<RenderTexture> val2;
5704 Action<RenderTexture> val3 = (Action<RenderTexture>)(
object)Delegate.Combine((Delegate)(object)val2, (Delegate)(object)value);
5707 while (val != val2);
5713 Action<RenderTexture> val2;
5717 Action<RenderTexture> val3 = (Action<RenderTexture>)(
object)Delegate.Remove((Delegate)(object)val2, (Delegate)(object)value);
5720 while (val != val2);
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)
5730 RenderTexture temporary = RenderTexture.GetTemporary(width, height, depthBuffer, format, readWrite, antiAliasing, memorylessMode, vrUsage, useDynamicScale);
5735 public static RenderTexture
GetTemporary(RenderTextureDescriptor renderTextureDescriptor)
5738 RenderTexture temporary = RenderTexture.GetTemporary(renderTextureDescriptor);
5746 RenderTexture.ReleaseTemporary(renderTexture);
5767 private static HashSet<int> _globalVariableIDWhitelist =
new HashSet<int>();
5769 private static List<string> _variableNameWhitelist;
5772 public static event Action<int, ShaderVariableType> OnSetGlobalShaderVariable
5778 Action<int, ShaderVariableType> val2;
5782 Action<int, ShaderVariableType> val3 = (Action<int, ShaderVariableType>)(
object)Delegate.Combine((Delegate)(object)val2, (Delegate)(object)value);
5785 while (val != val2);
5791 Action<int, ShaderVariableType> val2;
5795 Action<int, ShaderVariableType> val3 = (Action<int, ShaderVariableType>)(
object)Delegate.Remove((Delegate)(object)val2, (Delegate)(object)value);
5798 while (val != val2);
5805 if (String.IsNullOrWhiteSpace(
"name"))
5807 throw new InvalidOperationException(
"Property name is null or empty.");
5809 int num = Shader.PropertyToID(name);
5810 if (name.StartsWith(
"_Udon", (StringComparison)5) || _variableNameWhitelist.Contains(name))
5812 _globalVariableIDWhitelist.Add(num);
5819 ValidateAgainstPropertyIDWhitelist(nameID);
5821 Shader.SetGlobalInt(nameID, value);
5826 ValidateAgainstPropertyIDWhitelist(nameID);
5828 Shader.SetGlobalFloat(nameID, value);
5833 ValidateAgainstPropertyIDWhitelist(nameID);
5835 Shader.SetGlobalTexture(nameID, value);
5841 ValidateAgainstPropertyIDWhitelist(nameID);
5843 Shader.SetGlobalColor(nameID, value);
5849 ValidateAgainstPropertyIDWhitelist(nameID);
5851 Shader.SetGlobalVector(nameID, value);
5857 ValidateAgainstPropertyIDWhitelist(nameID);
5859 Shader.SetGlobalMatrix(nameID, value);
5864 ValidateAgainstPropertyIDWhitelist(nameID);
5866 Shader.SetGlobalFloatArray(nameID, value);
5871 ValidateAgainstPropertyIDWhitelist(nameID);
5873 Shader.SetGlobalVectorArray(nameID, value);
5878 ValidateAgainstPropertyIDWhitelist(nameID);
5880 Shader.SetGlobalMatrixArray(nameID, value);
5886 if (!_globalVariableIDWhitelist.Contains(nameID))
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));
5894 _globalVariableIDWhitelist.Clear();
5899 List<string> obj =
new List<string>();
5900 obj.Add(
"_AudioTexture");
5901 _variableNameWhitelist = obj;
5908 if (!String.IsNullOrEmpty(parameter))
5910 Debug.Log((
object)String.Concat(
"Custom Action Execute: ", parameter));
5916 Debug.Log((
object)String.Format(
"Custom Action Execute: {0}", (
object)parameter));
5921 Debug.Log((
object)String.Format(
"Custom Action Execute: {0}", (
object)parameter));
5930 ImmobilizeForVehicle
5937 public bool canUseStationFromStation =
true;
5943 public bool seated =
true;
5959 if (Initialize !=
null)
5967 useStationDelegate.Invoke(
this, player);
5972 exitStationDelegate.Invoke(
this, player);
5983 public static Func<Dictionary<string, object>> _GetCurrentMetadata;
5985 public static Dictionary<string, object> currentMetadata
5989 if (_GetCurrentMetadata ==
null)
5993 return _GetCurrentMetadata.Invoke();
5999 callbacks = (MetadataCallback)(
object)Delegate.Combine((Delegate)(object)callbacks, (Delegate)(object)
new MetadataCallback(MetadataChangedInternal));
6004 callbacks = (MetadataCallback)(
object)Delegate.Remove((Delegate)(object)callbacks, (Delegate)(object)
new MetadataCallback(MetadataChangedInternal));
6009 if (callbacks !=
null)
6017 if (metadataUpdate !=
null)
6019 metadataUpdate(data);
6061 public readonly RenderTexture[] texture = (RenderTexture[])(
object)
new RenderTexture[2];
6066 private const string VRC_MIRROR_CAMERA_POS_PROPERTY =
"_VRChatMirrorCameraPos";
6068 private const string VRC_MIRROR_MODE_PROPERTY =
"_VRChatMirrorMode";
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;
6073 [Tooltip(
"Disables occlusion culling on the mirror. Enable this if you see objects flickering in the mirror.")]
6074 public bool TurnOffMirrorOcclusion =
true;
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);
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.")]
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.")]
6088 [Tooltip(
"The mirror will use this shader instead of the default shader if one is provided.")]
6099 private RenderTexture _temporaryRenderTexture;
6101 private Dictionary<Camera, ReflectionData> _mReflections =
new Dictionary<Camera, ReflectionData>();
6103 private Renderer _mirrorRenderer;
6105 private Camera _mirrorCamera;
6107 private Skybox _mirrorSkybox;
6109 private Matrix4x4 _parentTransform;
6111 private Quaternion _parentRotation;
6113 private int _playerLocalLayer = 10;
6115 private static readonly
int[] _texturePropertyId = (
int[])(
object)
new Int32[2];
6117 private const int MAX_AUTO_VR_RESOLUTION = 2048;
6119 private const int MAX_AUTO_DESKTOP_RESOLUTION = 2048;
6121 private const int MAX_AUTO_RESOLUTION_UNLIMITER = 32;
6123 [field: CompilerGenerated]
6132 [field: CompilerGenerated]
6133 public static Vector3 CurrentMirrorCenterEyePos
6141 public static event RenderMirrorEventDelegate PreRenderMirror
6147 RenderMirrorEventDelegate renderMirrorEventDelegate2;
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);
6154 while (renderMirrorEventDelegate != renderMirrorEventDelegate2);
6160 RenderMirrorEventDelegate renderMirrorEventDelegate2;
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);
6167 while (renderMirrorEventDelegate != renderMirrorEventDelegate2);
6171 public static event RenderMirrorEventDelegate PostRenderMirror
6177 RenderMirrorEventDelegate renderMirrorEventDelegate2;
6180 renderMirrorEventDelegate2 = renderMirrorEventDelegate;
6181 RenderMirrorEventDelegate renderMirrorEventDelegate3 = (RenderMirrorEventDelegate)(
object)Delegate.Combine((Delegate)(object)renderMirrorEventDelegate2, (Delegate)(object)value);
6184 while (renderMirrorEventDelegate != renderMirrorEventDelegate2);
6190 RenderMirrorEventDelegate renderMirrorEventDelegate2;
6193 renderMirrorEventDelegate2 = renderMirrorEventDelegate;
6194 RenderMirrorEventDelegate renderMirrorEventDelegate3 = (RenderMirrorEventDelegate)(
object)Delegate.Remove((Delegate)(object)renderMirrorEventDelegate2, (Delegate)(object)value);
6197 while (renderMirrorEventDelegate != renderMirrorEventDelegate2);
6203 CurrentlyRenderingMirror =
null;
6204 _mirrorRenderer = ((Component)
this).GetComponent<Renderer>();
6205 if ((Object)(object)_mirrorRenderer == (Object)
null)
6209 Material sharedMaterial = _mirrorRenderer.sharedMaterial;
6210 if (!((Object)(object)sharedMaterial == (Object)
null))
6212 if ((Object)(object)customShader != (Object)
null)
6214 sharedMaterial.shader = customShader;
6218 sharedMaterial.shader = Shader.Find(
"FX/MirrorReflection");
6229 _mirrorRenderer = ((Component)
this).GetComponent<Renderer>();
6230 if ((Object)(object)_mirrorRenderer == (Object)
null)
6232 ((Behaviour)
this).enabled =
false;
6235 Material sharedMaterial = _mirrorRenderer.sharedMaterial;
6236 if ((Object)(object)sharedMaterial == (Object)
null)
6238 ((Behaviour)
this).enabled =
false;
6241 if ((Object)(object)customShader != (Object)
null)
6243 sharedMaterial.shader = customShader;
6247 sharedMaterial.shader = Shader.Find(
"FX/MirrorReflection");
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"));
6260 if (!((Behaviour)
this).enabled || !Object.op_Implicit((Object)(
object)_mirrorRenderer) || !_mirrorRenderer.enabled)
6264 Camera current = Camera.current;
6265 if (!Object.op_Implicit((Object)(
object)current) || (Object)(
object)current == (Object)(
object)_mirrorCamera || (Object)(
object)CurrentlyRenderingMirror != (Object)
null)
6271 CurrentlyRenderingMirror =
this;
6272 RenderMirrorCameras(current);
6276 CurrentlyRenderingMirror =
null;
6328 ReflectionData reflectionData = GetReflectionData(currentCamera);
6329 int pixelLightCount = QualitySettings.pixelLightCount;
6330 if (m_DisablePixelLights)
6332 QualitySettings.pixelLightCount = 0;
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)
6343 if (ShouldRenderLeftEye(currentCamera))
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))
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);
6356 RenderMirror(reflectionData.
texture[0], worldEyePos, worldEyeRot, eyeProjectionMatrix);
6359 if (ShouldRenderRightEye(currentCamera))
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))
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);
6372 RenderMirror(reflectionData.
texture[1], worldEyePos2, worldEyeRot2, eyeProjectionMatrix2);
6376 else if (ShouldRenderMonoscopic(currentCamera))
6378 Shader.SetGlobalFloat(
"_VRChatMirrorMode", 2f);
6379 Transform transform = ((Component)currentCamera).transform;
6380 if (Object.op_Implicit((Object)(object)_temporaryRenderTexture))
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);
6387 RenderMirror(reflectionData.
texture[0], transform.position, transform.rotation, currentCamera.projectionMatrix);
6390 Shader.SetGlobalFloat(
"_VRChatMirrorMode", 0f);
6391 Shader.SetGlobalVector(
"_VRChatMirrorCameraPos", Vector4.zero);
6392 if (Object.op_Implicit((Object)(
object)_temporaryRenderTexture))
6394 RenderTexture.ReleaseTemporary(_temporaryRenderTexture);
6395 _temporaryRenderTexture =
null;
6397 _mirrorRenderer.SetPropertyBlock(reflectionData.
propertyBlock);
6398 if (m_DisablePixelLights)
6400 QualitySettings.pixelLightCount = pixelLightCount;
6407 if (_mReflections.ContainsKey(currentCamera))
6410 if ((Object)(
object)reflectionData.
texture[0] != (Object)
null)
6412 RenderTexture.ReleaseTemporary(reflectionData.
texture[0]);
6413 reflectionData.
texture[0] =
null;
6415 if ((Object)(
object)reflectionData.
texture[1] != (Object)
null)
6417 RenderTexture.ReleaseTemporary(reflectionData.
texture[1]);
6418 reflectionData.
texture[1] =
null;
6427 Enumerator<Camera, ReflectionData> enumerator = _mReflections.Values.GetEnumerator();
6430 while (enumerator.MoveNext())
6433 if ((Object)(
object)current.
texture[0] != (Object)
null)
6435 RenderTexture.ReleaseTemporary(current.
texture[0]);
6438 if ((Object)(
object)current.
texture[1] != (Object)
null)
6440 RenderTexture.ReleaseTemporary(current.
texture[1]);
6447 ((IDisposable)enumerator).Dispose();
6449 _mReflections.Clear();
6458 if (!((Object)(
object)_mirrorCamera == (Object)
null))
6460 if (!Application.isEditor)
6462 Object.Destroy((Object)(
object)((Component)_mirrorCamera).gameObject);
6466 Object.DestroyImmediate((Object)(
object)((Component)_mirrorCamera).gameObject);
6468 _mirrorCamera =
null;
6469 _mirrorSkybox =
null;
6470 Camera.onPostRender = (CameraCallback)Delegate.Remove((Delegate)(object)Camera.onPostRender, (Delegate)
new CameraCallback(CameraPostRender));
6486 StereoTargetEyeMask stereoTargetEye = cam.stereoTargetEye;
6487 bool flag = (int)stereoTargetEye == 3 || (
int)stereoTargetEye == 1;
6492 if (Vector3.Dot(GetWorldEyePos(cam, (XRNode)0) - ((Component)
this).transform.position, GetNormalDirection()) <= 0f)
6511 StereoTargetEyeMask stereoTargetEye = cam.stereoTargetEye;
6512 bool flag = (int)stereoTargetEye == 3 || (
int)stereoTargetEye == 2;
6517 if (Vector3.Dot(GetWorldEyePos(cam, (XRNode)1) - ((Component)
this).transform.position, GetNormalDirection()) <= 0f)
6530 return Vector3.Dot(((Component)cam).transform.position - ((Component)
this).transform.position, GetNormalDirection()) > 0f;
6540 Vector3 localPosition = InputTracking.GetLocalPosition(eye);
6541 return ((Matrix4x4)(ref _parentTransform)).MultiplyPoint3x4(localPosition);
6552 Quaternion localRotation = InputTracking.GetLocalRotation(eye);
6553 return _parentRotation * localRotation;
6561 return cam.GetStereoProjectionMatrix((StereoscopicEye)((
int)eye == 1));
6568 return -((Component)
this).transform.forward;
6571 private void RenderMirror(RenderTexture targetTexture, Vector3 camPosition, Quaternion camRotation, Matrix4x4 camProjectionMatrix)
6598 _mirrorCamera.ResetWorldToCameraMatrix();
6599 ((Component)_mirrorCamera).transform.position = camPosition;
6600 ((Component)_mirrorCamera).transform.rotation = camRotation;
6601 _mirrorCamera.projectionMatrix = camProjectionMatrix;
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;
6627 mirrorCamera.clearFlags = src.clearFlags;
6628 mirrorCamera.backgroundColor = src.backgroundColor;
6629 if ((
int)src.clearFlags == 1)
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))
6635 ((Behaviour)mirrorSkybox).enabled =
false;
6638 ((Behaviour)mirrorSkybox).enabled =
true;
6639 mirrorSkybox.material = val.material;
6648 if (!Object.op_Implicit((Object)(
object)_mirrorCamera))
6650 GameObject val =
new GameObject(String.Concat(
"MirrorCam", ((Object)((Component)
this).gameObject).name), (Type[])(
object)
new Type[3]
6657 hideFlags = (HideFlags)61
6659 _mirrorSkybox = val.GetComponent<Skybox>();
6660 _mirrorCamera = val.GetComponent<Camera>();
6661 ((Behaviour)_mirrorCamera).enabled =
false;
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)
6673 _mirrorCamera.fieldOfView = src.fieldOfView;
6699 if ((Object)(
object)((Component)cam).transform.parent != (Object)
null)
6701 _parentTransform = ((Component)cam).transform.parent.localToWorldMatrix;
6702 _parentRotation = ((Component)cam).transform.parent.rotation;
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);
6716 if (_mReflections ==
null)
6718 _mReflections =
new Dictionary<Camera, ReflectionData>();
6721 if (!_mReflections.TryGetValue(currentCamera, ref reflectionData))
6725 propertyBlock =
new MaterialPropertyBlock()
6727 _mReflections[currentCamera] = reflectionData;
6729 if (Object.op_Implicit((Object)(
object)_temporaryRenderTexture))
6731 RenderTexture.ReleaseTemporary(_temporaryRenderTexture);
6733 if (Object.op_Implicit((Object)(
object)reflectionData.
texture[0]))
6735 RenderTexture.ReleaseTemporary(reflectionData.
texture[0]);
6737 if (Object.op_Implicit((Object)(
object)reflectionData.
texture[1]))
6739 RenderTexture.ReleaseTemporary(reflectionData.
texture[1]);
6745 GetAutoResolution(currentCamera, out width, out height);
6749 width = (int)mirrorResolution;
6750 height = (int)mirrorResolution;
6752 int antiAliasing = QualitySettings.antiAliasing;
6753 antiAliasing = Mathf.Clamp(1, antiAliasing, (
int)maximumAntialiasing);
6754 if (antiAliasing > 1)
6756 _temporaryRenderTexture = RenderTexture.GetTemporary(width, height, 24, (RenderTextureFormat)2, (RenderTextureReadWrite)0, antiAliasing);
6758 if (currentCamera.stereoEnabled)
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]);
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]);
6770 return reflectionData;
6775 int num = (currentCamera.stereoEnabled ? 2048 : 2048);
6780 width = Mathf.Min(currentCamera.pixelWidth, num);
6781 height = Mathf.Min(currentCamera.pixelHeight, num);
6794 private static Vector4
Plane(Vector3 pos, Vector3 normal)
6802 return new Vector4(normal.x, normal.y, normal.z, 0f - Vector3.Dot(pos, normal));
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);
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];
6850 private static float CopySign(
float sizeValue,
float signValue)
6852 return Mathf.Sign(signValue) * Mathf.Abs(sizeValue);
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);
6900 float m = matrix.m03;
6901 float m2 = matrix.m13;
6902 float m3 = matrix.m23;
6903 return new Vector3(m, m2, m3);
6906 [RequireComponent()]
6928 private int currentlyShown = -1;
6932 private int dataIndex = -1;
6936 renderer = ((Component)
this).GetComponent<Renderer>();
6938 for (
int i = 0; i < data.data.Length; i++)
6940 if (data.data[i].name ==
"display")
6962 Nullable<int> val =
default(Nullable<int>);
6963 if ((Object)(
object)data != (Object)
null && data.
data !=
null && data.
data.Length < dataIndex + 1)
6966 val = ((obj !=
null) ?
new Nullable<int>(obj.
valueInt) :
default(Nullable<int>));
6969 if (!val.HasValue || val.Value < 0)
6971 val..ctor(panoramas.Count - 1);
6976 int count = panoramas.Count;
6977 val = (val2.HasValue ?
new Nullable<int>(val2.GetValueOrDefault() % count) :
default(Nullable<int>));
6979 int num = currentlyShown;
6981 if (!((num == val2.GetValueOrDefault()) & val2.HasValue))
6983 currentlyShown = val.Value;
6984 ((MonoBehaviour)
this).StartCoroutine(ShowPano(val.Value));
7008 index = ((index >= 0) ? ((index >= panoramas.Count) ? (panoramas.Count - 1) : index) : 0);
7012 [IteratorStateMachine()]
7015 if ((Object)(
object)panoramas[index].texture == (Object)
null)
7017 string url = panoramas[index].url;
7018 UnityWebRequest unityWebRequest = UnityWebRequestTexture.GetTexture(url);
7021 UnityWebRequest.ClearCookieCache(unityWebRequest.uri);
7022 yield
return unityWebRequest.SendWebRequest();
7023 if ((
int)unityWebRequest.result != 2 && (
int)unityWebRequest.result != 3)
7025 panoramas[index].texture = DownloadHandlerTexture.GetContent(unityWebRequest);
7030 if (unityWebRequest !=
null)
7032 ((IDisposable)unityWebRequest).Dispose();
7036 if (currentlyShown == index)
7038 renderer.material.mainTexture = (Texture)(
object)panoramas[index].texture;
7055 AlignPlayerWithSpawnPoint,
7056 AlignRoomWithSpawnPoint
7075 public float RespawnHeightY = -100f;
7088 public Vector3 gravity =
new Vector3(0f, -9.81f, 0f);
7116 [Obsolete(
"Property is not used.")]
7120 [Obsolete(
"Property is not used.")]
7124 public Vector3 SpawnPosition =
new Vector3(0f, 0f, 0f);
7135 public List<GameObject> DynamicPrefabs =
new List<GameObject>();
7139 public List<Material> DynamicMaterials =
new List<Material>();
7219 private List<NetworkIDPair> NetworkIDs =
new List<NetworkIDPair>();
7228 public Vector3 portraitCameraPositionOffset =
new Vector3(0f, 0f, 0f);
7230 public Quaternion portraitCameraRotationOffset = Quaternion.AngleAxis(180f, Vector3.up);
7232 public List<NetworkIDPair> NetworkIDCollection
7244 [field: CompilerGenerated]
7245 public Dictionary<GameObject, NetworkIDPair> NetworkIDLookup
7257 if ((Object)(
object)_instance == (Object)
null)
7269 if (sDynamicPrefabs.ContainsKey(name))
7271 return sDynamicPrefabs[name];
7273 if (name.StartsWith(
"Assets"))
7275 Enumerator<string, GameObject> enumerator = sDynamicPrefabs.Keys.GetEnumerator();
7278 while (enumerator.MoveNext())
7280 string current = enumerator.Current;
7281 if (name.Contains(String.Concat(
"/", current,
".prefab")))
7283 return sDynamicPrefabs[current];
7289 ((IDisposable)enumerator).Dispose();
7299 if (sDynamicMaterials.ContainsKey(name))
7301 return sDynamicMaterials[name];
7303 if (name.StartsWith(
"Assets"))
7305 Enumerator<string, Material> enumerator = sDynamicMaterials.Keys.GetEnumerator();
7308 while (enumerator.MoveNext())
7310 string current = enumerator.Current;
7311 if (name.Contains(String.Concat(
"/", current,
".mat")))
7313 return sDynamicMaterials[current];
7319 ((IDisposable)enumerator).Dispose();
7330 Scene scene = ((Component)
this).gameObject.scene;
7331 GameObject[] rootGameObjects = ((Scene)(ref scene)).GetRootGameObjects();
7332 foreach (GameObject val
in rootGameObjects)
7334 netIds.AddRange((IEnumerable<INetworkID>)(object)val.GetComponentsInChildren<
INetworkID>(
true));
7336 netIds.RemoveAll((Predicate<INetworkID>)((
INetworkID id) => !(
id is Component)));
7341 return GameObject.Find(path);
7357 if ((Object)(
object)_instance != (Object)
null && (Object)(
object)_instance != (Object)(
object)
this)
7359 Debug.LogWarning((
object)
"Destroying existing Scene Descriptor");
7360 Object.Destroy((Object)(
object)_instance);
7363 sDynamicPrefabs =
new Dictionary<string, GameObject>();
7364 Enumerator<GameObject> enumerator = DynamicPrefabs.GetEnumerator();
7367 while (enumerator.MoveNext())
7369 GameObject current = enumerator.Current;
7370 if ((Object)(
object)current != (Object)
null && !sDynamicPrefabs.ContainsKey(((Object)current).name))
7372 sDynamicPrefabs.Add(((Object)current).name, current);
7378 ((IDisposable)enumerator).Dispose();
7380 sDynamicMaterials =
new Dictionary<string, Material>();
7381 Enumerator<Material> enumerator2 = DynamicMaterials.GetEnumerator();
7384 while (enumerator2.MoveNext())
7386 Material current2 = enumerator2.Current;
7387 if ((Object)(
object)current2 != (Object)
null && !sDynamicMaterials.ContainsKey(((Object)current2).name))
7389 sDynamicMaterials.Add(((Object)current2).name, current2);
7395 ((IDisposable)enumerator2).Dispose();
7397 NetworkIDLookup =
new Dictionary<GameObject, NetworkIDPair>();
7398 Enumerator<NetworkIDPair> enumerator3 = NetworkIDs.GetEnumerator();
7401 while (enumerator3.MoveNext())
7404 if (!((Object)(
object)current3?.gameObject == (Object)
null))
7406 NetworkIDLookup[current3.
gameObject] = current3;
7412 ((IDisposable)enumerator3).Dispose();
7414 if (Initialize !=
null)
7432 cam.position = ((Component)
this).transform.TransformPoint(portraitCameraPositionOffset);
7433 cam.rotation = ((Component)
this).transform.rotation * portraitCameraRotationOffset;
7451 switch (specialLayer)
7454 num = LayerMask.NameToLayer(
"Environment");
7457 num = LayerMask.NameToLayer(
"Interactive");
7460 num = ((!((Object)(
object)((Component)
this).gameObject.GetComponent<
VRC_Pickup>() != (Object)
null)) ? LayerMask.NameToLayer(
"Walkthrough") : LayerMask.NameToLayer(
"Pickup"));
7463 num = LayerMask.NameToLayer(
"Pickup");
7468 ((Component)
this).gameObject.layer = num;
7482 [Obsolete(
"Please use VRC_Trigger",
false)]
7485 public bool Repeat =
true;
7487 public float LowPeriodTime = 5f;
7489 public float HighPeriodTime = 10f;
7491 public bool ResetOnEnable =
true;
7508 if ((Object)(object)Handler == (Object)
null)
7525 Timer += Time.deltaTime;
7526 if (Timer > Duration && !EventFired && (Object)(
object)Handler != (Object)
null)
7542 Duration = LowPeriodTime + Random.value * (HighPeriodTime - LowPeriodTime);
7547 [RequireComponent()]
7555 public string CustomName =
"";
7569 OnPickupUseDown = 8,
7572 OnEnterTrigger = 11,
7579 OnEnterCollider = 18,
7580 OnExitCollider = 19,
7581 OnDataStorageChange = 20,
7583 OnStationEntered = 24,
7584 OnStationExited = 25,
7590 OnOwnershipTransfer = 31,
7591 OnParticleCollision = 32
7616 TriggerType.OnExitCollider
7622 TriggerType.OnExitTrigger
7632 RuntimeHelpers.InitializeArray((Array)(
object)array, (RuntimeFieldHandle));
7633 PickupTypes = array;
7634 DataStorageTypes =
new TriggerType[1] { TriggerType.OnDataStorageChange };
7663 public List<VRC_Trigger> Others =
new List<VRC_Trigger>();
7667 public bool TriggerIndividuals =
true;
7669 public LayerMask Layers = LayerMask.op_Implicit(0);
7671 public bool Repeat =
true;
7673 public float LowPeriodTime = 5f;
7675 public float HighPeriodTime = 10f;
7677 public bool ResetOnEnable =
true;
7688 public List<DataStorageShadow> DataStorageShadowValues =
new List<DataStorageShadow>();
7693 public bool[] ProbabilityLock = (
bool[])(
object)
new Boolean[0];
7696 public float[] Probabilities = (
float[])(
object)
new Single[0];
7698 [Tooltip(
"Midi Channel [1-16], 0=any")]
7701 [Tooltip(
"Midi Note [0-127]")]
7704 [Tooltip(
"OSC Address")]
7717 return t.TriggerType == triggerType;
7732 return t.Name == name;
7742 [Obsolete(
"'Advanced Mode' is now the default behavior and this field no longer does anything.")]
7747 public bool DrawLines =
true;
7752 public List<TriggerEvent> Triggers =
new List<TriggerEvent>();
7760 public bool HasColliderTriggers
7776 public override bool IsInteractive
7780 if (!HasInteractiveTriggers)
7782 return HasPickupTriggers;
7790 if (target !=
null && (Object)(
object)target.
TriggerObject != (Object)
null && !String.IsNullOrEmpty(target.
CustomName))
7798 if (!((Object)(
object)obj == (Object)
null))
7801 if ((Object)(object)component != (Object)
null)
7810 if (!((Object)(
object)obj == (Object)
null))
7813 if ((Object)(object)component != (Object)
null)
7823 InitializeTrigger?.Invoke(
this);
7853 List<VRC_Trigger> val =
new List<VRC_Trigger>();
7854 List<VRC_Trigger> obj2 =
new List<VRC_Trigger>();
7856 List<VRC_Trigger> val2 = obj2;
7857 Action<GameObject> val3 = [CompilerGenerated] (GameObject obj) =>
7861 if (!((Object)(
object)obj == (Object)
null))
7863 Gizmos.DrawLine(((Component)
this).transform.position, obj.transform.position);
7866 while (val2.Count > 0)
7870 if ((Object)(object)vRC_Trigger == (Object)
null)
7874 val.Add(vRC_Trigger);
7875 Enumerator<TriggerEvent> enumerator = vRC_Trigger.
Triggers.GetEnumerator();
7878 while (enumerator.MoveNext())
7881 if (current ==
null)
7888 while (enumerator2.MoveNext())
7891 if (current2 ==
null)
7898 foreach (GameObject val4
in parameterObjects)
7911 ((IDisposable)enumerator2).Dispose();
7917 ((IDisposable)enumerator).Dispose();
7949 if (ExecuteTrigger ==
null)
7951 Debug.LogErrorFormat(
"Trigger on {0} was not initialized in time!", (
object[])(
object)
new Object[1] { (Object)((Object)((Component)
this).gameObject).name });
7954 IEnumerator<TriggerEvent> enumerator = triggers.GetEnumerator();
7957 while (((IEnumerator)enumerator).MoveNext())
7960 ExecuteTrigger.Invoke(current);
7965 if (enumerator !=
null)
7967 ((IDisposable)enumerator).Dispose();
7975 CS$<>8__locals0.triggerType = triggerType;
7976 if (Triggers ==
null)
7980 if (ExecuteTrigger ==
null)
7982 Debug.LogErrorFormat(
"Trigger on {0} was not initialized in time!", (
object[])(
object)
new Object[1] { (Object)((Object)((Component)
this).gameObject).name });
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)
7990 IEnumerator<TriggerEvent> enumerator = val.GetEnumerator();
7993 while (((IEnumerator)enumerator).MoveNext())
7996 ExecuteTrigger.Invoke(current);
8001 if (enumerator !=
null)
8003 ((IDisposable)enumerator).Dispose();
8011 CS$<>8__locals0.name = name;
8012 if (ExecuteTrigger ==
null)
8014 Debug.LogErrorFormat(
"Trigger on {0} was not initialized in time!", (
object[])(
object)
new Object[1] { (Object)((Object)((Component)
this).gameObject).name });
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)
8022 IEnumerator<TriggerEvent> enumerator = val.GetEnumerator();
8025 while (((IEnumerator)enumerator).MoveNext())
8028 ExecuteTrigger.Invoke(current);
8033 if (enumerator !=
null)
8035 ((IDisposable)enumerator).Dispose();
8042 IEnumerator<TriggerEvent> enumerator = Enumerable.Where<
TriggerEvent>((IEnumerable<TriggerEvent>)(
object)Triggers, (Func<TriggerEvent, bool>)((
TriggerEvent t) => t.TriggerType == TriggerType.OnTimer && t.
ResetOnEnable)).GetEnumerator();
8045 while (((IEnumerator)enumerator).MoveNext())
8048 ResetClock(current);
8053 if (enumerator !=
null)
8055 ((IDisposable)enumerator).Dispose();
8062 timer.Duration = timer.LowPeriodTime + Random.value * (timer.HighPeriodTime - timer.
LowPeriodTime);
8064 timer.EventFired =
false;
8067 [Obsolete(
"Please use VRC_Trigger",
false)]
8078 public bool TriggerIndividuals =
true;
8080 public LayerMask layers = LayerMask.op_Implicit(512);
8094 if ((Object)(object)Handler == (Object)
null)
8102 int num = 1 << ((Component)other).gameObject.layer;
8103 if ((((LayerMask)(ref layers)).value & num) != 0)
8106 if ((currentOccupants == 1 || TriggerIndividuals) && CollisionEnter !=
null)
8108 CollisionEnter(
this, other);
8115 int num = 1 << ((Component)other).gameObject.layer;
8116 if ((((LayerMask)(ref layers)).value & num) != 0)
8118 if (currentOccupants > 0)
8122 if ((currentOccupants == 0 || TriggerIndividuals) && CollisionExit !=
null)
8124 CollisionExit(
this, other);
8129 [Obsolete(
"Please use VRC_Trigger",
false)]
8134 public string EventName =
"Use";
8147 ((Component)
this).gameObject.layer = LayerMask.NameToLayer(
"Default");
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)))
8151 Object.Destroy((Object)(object)
this);
8158 if ((Object)(
object)interactTextPlacement != (Object)
null && (Object)(
object)interactTextGO != (Object)
null)
8160 interactTextGO.transform.position = interactTextPlacement.position;
8167 if ((Object)(object)vRC_EventHandler == (Object)
null)
8169 vRC_EventHandler = ((Component)
this).GetComponentInParent<
VRC_EventHandler>();
8171 if ((Object)(object)vRC_EventHandler != (Object)
null)
8189 public bool disablePixelLights =
true;
8191 public int textureSize = 256;
8193 public float clipPlaneOffset = 0.07f;
8195 public LayerMask reflectLayers = LayerMask.op_Implicit(-1);
8197 public LayerMask refractLayers = LayerMask.op_Implicit(-1);
8199 public bool TurnOffWaterOcclusion =
true;
8201 private Dictionary<Camera, Camera> m_ReflectionCameras =
new Dictionary<Camera, Camera>();
8203 private Dictionary<Camera, Camera> m_RefractionCameras =
new Dictionary<Camera, Camera>();
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)
8266 Camera current = Camera.current;
8267 if (Object.op_Implicit((Object)(
object)current) && !s_InsideWater)
8269 s_InsideWater =
true;
8270 m_HardwareWaterSupport = FindHardwareWaterSupport();
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)
8278 QualitySettings.pixelLightCount = 0;
8280 UpdateCameraModes(current, reflectionCamera);
8281 UpdateCameraModes(current, refractionCamera);
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);
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);
8318 if (disablePixelLights)
8320 QualitySettings.pixelLightCount = pixelLightCount;
8325 Shader.EnableKeyword(
"WATER_SIMPLE");
8326 Shader.DisableKeyword(
"WATER_REFLECTIVE");
8327 Shader.DisableKeyword(
"WATER_REFRACTIVE");
8330 Shader.DisableKeyword(
"WATER_SIMPLE");
8331 Shader.EnableKeyword(
"WATER_REFLECTIVE");
8332 Shader.DisableKeyword(
"WATER_REFRACTIVE");
8335 Shader.DisableKeyword(
"WATER_SIMPLE");
8336 Shader.DisableKeyword(
"WATER_REFLECTIVE");
8337 Shader.EnableKeyword(
"WATER_REFRACTIVE");
8340 s_InsideWater =
false;
8354 if (Object.op_Implicit((Object)(
object)m_ReflectionTexture))
8356 Object.DestroyImmediate((Object)(
object)m_ReflectionTexture);
8357 m_ReflectionTexture =
null;
8359 if (Object.op_Implicit((Object)(
object)m_RefractionTexture))
8361 Object.DestroyImmediate((Object)(
object)m_RefractionTexture);
8362 m_RefractionTexture =
null;
8364 Enumerator<Camera, Camera> enumerator = m_ReflectionCameras.GetEnumerator();
8367 while (enumerator.MoveNext())
8369 Object.DestroyImmediate((Object)(
object)((Component)enumerator.Current.Value).gameObject);
8374 ((IDisposable)enumerator).Dispose();
8376 m_ReflectionCameras.Clear();
8377 enumerator = m_RefractionCameras.GetEnumerator();
8380 while (enumerator.MoveNext())
8382 Object.DestroyImmediate((Object)(object)((Component)enumerator.Current.Value).gameObject);
8387 ((IDisposable)enumerator).Dispose();
8389 m_RefractionCameras.Clear();
8406 if (Object.op_Implicit((Object)(
object)((Component)
this).GetComponent<Renderer>()))
8408 Material sharedMaterial = ((Component)
this).GetComponent<Renderer>().sharedMaterial;
8409 if (Object.op_Implicit((Object)(object)sharedMaterial))
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);
8430 if ((Object)(
object)dest == (Object)
null)
8434 dest.clearFlags = src.clearFlags;
8435 dest.backgroundColor = src.backgroundColor;
8436 if ((
int)src.clearFlags == 1)
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))
8442 ((Behaviour)component2).enabled =
false;
8446 ((Behaviour)component2).enabled =
true;
8447 component2.material = component.material;
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;
8458 private void CreateWaterObjects(Camera currentCamera, out Camera reflectionCamera, out Camera refractionCamera)
8473 reflectionCamera =
null;
8474 refractionCamera =
null;
8478 if (!Object.op_Implicit((Object)(
object)m_ReflectionTexture) || m_OldReflectionTextureSize != textureSize)
8480 if (Object.op_Implicit((Object)(
object)m_ReflectionTexture))
8482 Object.DestroyImmediate((Object)(
object)m_ReflectionTexture);
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;
8492 m_ReflectionCameras.TryGetValue(currentCamera, ref reflectionCamera);
8493 if (!Object.op_Implicit((Object)(object)reflectionCamera))
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]
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)
8512 reflectionCamera.useOcclusionCulling =
false;
8520 if (!Object.op_Implicit((Object)(object)m_RefractionTexture) || m_OldRefractionTextureSize != textureSize)
8522 if (Object.op_Implicit((Object)(object)m_RefractionTexture))
8524 Object.DestroyImmediate((Object)(object)m_RefractionTexture);
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;
8534 m_RefractionCameras.TryGetValue(currentCamera, ref refractionCamera);
8535 if (!Object.op_Implicit((Object)(object)refractionCamera))
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]
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)
8554 reflectionCamera.useOcclusionCulling =
false;
8561 if (m_HardwareWaterSupport < waterMode)
8563 return m_HardwareWaterSupport;
8570 if (!Object.op_Implicit((Object)(
object)((Component)
this).GetComponent<Renderer>()))
8574 Material sharedMaterial = ((Component)
this).GetComponent<Renderer>().sharedMaterial;
8575 if (!Object.op_Implicit((Object)(object)sharedMaterial))
8579 string tag = sharedMaterial.GetTag(
"WATERMODE",
false);
8580 if (tag ==
"Refractive")
8584 if (tag ==
"Reflective")
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));
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;
8644 [RequireComponent()]
8657 public string webRoot =
"WebRoot";
8659 public string defaultUrl =
"http://api.vrchat.cloud/public/blank.html";
8661 public int resolutionWidth = 1280;
8663 public int resolutionHeight = 720;
8665 public Rect displayRegion =
new Rect(0f, 0f, 1f, 1f);
8689 public bool autoFormSubmit =
true;
8694 public Action<string> _NavigateTo;
8696 public Action _WebPanelForward;
8698 public Action _WebPanelBackward;
8700 public Action _WebPanelReload;
8702 public Action<string> _ExecuteScript;
8704 public Func<string, Delegate, bool> _BindCall;
8706 private string WebRootPath
8710 if (webRoot !=
null && !(webRoot.Trim() ==
""))
8712 return String.Concat(Application.dataPath, webRoot.Replace(
'/', Path.DirectorySeparatorChar));
8721 if (_WebPanelForward !=
null)
8723 _WebPanelForward.Invoke();
8730 if (_WebPanelBackward !=
null)
8732 _WebPanelBackward.Invoke();
8739 if (_WebPanelReload !=
null)
8741 _WebPanelReload.Invoke();
8745 public bool BindCall(
string function, Delegate handler)
8747 if (_BindCall ==
null)
8751 return _BindCall.Invoke(
function, handler);
8756 if (_NavigateTo !=
null)
8758 _NavigateTo.Invoke(uri);
8765 if (Application.isPlaying && Initialize !=
null)
8779 vrcEvent.Name =
"SetWebPanelURI";
8780 vrcEvent.ParameterInt = 7;
8782 vrcEvent.ParameterString =
"http://example.com";
8783 vrcEvent.ParameterObjects = (GameObject[])(
object)
new GameObject[1] { ((Component)
this).gameObject };
8786 vrcEvent.Name =
"SetWebPanelVolume";
8787 vrcEvent.ParameterInt = 7;
8789 vrcEvent.ParameterFloat = 0.5f;
8790 vrcEvent.ParameterObjects = (GameObject[])(
object)
new GameObject[1] { ((Component)
this).gameObject };
8793 vrcEvent.Name =
"WebPanelForward";
8794 vrcEvent.ParameterInt = 6;
8796 vrcEvent.ParameterString =
"WebPanelForward";
8797 vrcEvent.ParameterObjects = (GameObject[])(
object)
new GameObject[1] { ((Component)
this).gameObject };
8800 vrcEvent.Name =
"WebPanelBackward";
8801 vrcEvent.ParameterInt = 6;
8803 vrcEvent.ParameterString =
"WebPanelBackward";
8804 vrcEvent.ParameterObjects = (GameObject[])(
object)
new GameObject[1] { ((Component)
this).gameObject };
8807 vrcEvent.Name =
"WebPanelReload";
8808 vrcEvent.ParameterInt = 6;
8810 vrcEvent.ParameterString =
"WebPanelReload";
8811 vrcEvent.ParameterObjects = (GameObject[])(
object)
new GameObject[1] { ((Component)
this).gameObject };
8813 return (IEnumerable<VRC_EventHandler.VrcEvent>)(object)val;
8818 string[] files = Directory.GetFiles(root);
8819 foreach (
string text
in files)
8821 if (!text.EndsWith(
".meta") && !text.EndsWith(
".unity"))
8825 path = text.Substring(Application.dataPath.Length + 1).Replace(Path.DirectorySeparatorChar,
'/'),
8826 data = File.ReadAllBytes(text)
8830 files = Directory.GetDirectories(root);
8831 foreach (
string root2
in files)
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]
8843 Application.dataPath,
8844 ((Char)(ref Path.DirectorySeparatorChar)).ToString(),
8846 ((Char)(ref Path.DirectorySeparatorChar)).ToString(),
8848 ((Char)(ref Path.DirectorySeparatorChar)).ToString(),
8850 ((Char)(ref Path.DirectorySeparatorChar)).ToString(),
8854 ReadData(webRootPath, 0);
8855 string text = String.Join(
", ", webData.ConvertAll<
string>((Converter<WebFile, string>)delegate(
WebFile item)
8857 string path = item.
path;
8858 int num = item.
data.Length;
8859 return String.Concat(path,
" [", ((Int32)(ref num)).ToString(),
"]");
8861 Debug.Log((
object)String.Concat(
"Web Panel has files: \n", text));
8874 Tutorial.
ActivateObjectLabel(targetObject, type, hand, text,
ControllerActionUI.None,
"",
ControllerActionUI.None, duration, priority, attachMode, showOffscreen);
8879 Tutorial.
ActivateObjectLabel(targetObject, type, hand, text, action,
"",
ControllerActionUI.None, duration, priority, attachMode, showOffscreen);
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)
8884 Tutorial.
ActivateObjectLabel(targetObject, type, hand, text, action, textSecondary, actionSecondary, duration, priority, attachMode, showOffscreen);
8906 public float EnableDistance = 3f;
8908 public float MaxVisibleDistance = 15f;
8912 private bool _showingLabel;
8914 private bool _enabled =
true;
8916 private float _timeStarted = -1f;
8931 if (_timeStarted < 0f)
8933 _timeStarted = Time.unscaledTime;
8935 if (Time.unscaledTime < _timeStarted + 1f)
8940 float magnitude = ((Vector3)(ref val)).magnitude;
8941 if (magnitude >= EnableDistance)
8943 if (magnitude <= MaxVisibleDistance)
8945 ShowLabel(show:
true);
8949 ShowLabel(show:
false);
8953 ShowLabel(show:
false);
8954 if (DisableWhenPlayerInRange)
8956 Enable(enable:
false);
8961 ShowLabel(show:
false);
8967 if (show == _showingLabel)
8971 if (show && _enabled && !String.IsNullOrEmpty(Text))
8974 _showingLabel =
true;
8981 _showingLabel =
false;
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);
8994 public static ActivateObjectLabelDelegate _ActivateObjectLabel;
8996 public static DeactivateObjectLabelDelegate _DeactivateObjectLabel;
8998 public static ActivateControllerLabelDelegate _ActivateControllerLabel;
9000 public static DeactivateControllerLabelDelegate _DeactivateControllerLabel;
9009 ActivateObjectLabel(targetObject, type, hand, text,
ControllerActionUI.None,
"",
ControllerActionUI.None, duration, priority, attachMode, showOffscreen);
9014 ActivateObjectLabel(targetObject, type, hand, text, action,
"",
ControllerActionUI.None, duration, priority, attachMode, showOffscreen);
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)
9019 if (_ActivateObjectLabel !=
null)
9021 _ActivateObjectLabel(targetObject, type, hand, text, action, textSecondary, actionSecondary, duration, priority, attachMode, showOffscreen);
9027 if (_DeactivateObjectLabel !=
null)
9029 _DeactivateObjectLabel(targetObject);
9035 if (_ActivateControllerLabel !=
null)
9037 _ActivateControllerLabel(hand, controllerPart, text, duration, priority);
9043 if (_DeactivateControllerLabel !=
null)
9045 _DeactivateControllerLabel(hand, controllerPart);
9055 public bool AllowFocusView =
true;
9057 private Canvas _uiCanvas;
9059 private RectTransform _localRectTransform;
9061 [field: CompilerGenerated]
9062 public Canvas RootCanvas
9070 [field: CompilerGenerated]
9071 public RectTransform RootCanvasRectTransform
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);
9090 if ((Object)(
object)_uiCanvas != (Object)
null)
9092 if (GetEventCamera !=
null)
9094 _uiCanvas.worldCamera = GetEventCamera(((Component)
this).gameObject);
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)
9102 component.blockingObjects = (BlockingObjects)0;
9128 if ((Object)(
object)_localRectTransform != (Object)
null && (Object)(
object)_uiCanvas != (Object)
null)
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)
9135 val = ((Component)
this).gameObject.AddComponent<BoxCollider>();
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;
9152 public HashSet<Collider>[] triggersInside =
new HashSet<Collider>[2]
9154 new HashSet<Collider>(),
9155 new HashSet<Collider>()
9163 if (Initialize !=
null)
9165 Initialize.Invoke(
this);
9171 triggersInside[currentIdx].Add(col);
9176 triggersInside[currentIdx].Remove(col);
9185 public class VRCUrl : Object, IEquatable<VRCUrl>
9192 internal bool <IsAllowlistedUri>
b__0(
string d)
9194 return dnsSafeHost.EndsWith(d);
9199 [FormerlySerializedAs(
"_url")]
9208 [field: CompilerGenerated]
9217 [field: CompilerGenerated]
9218 public static Func<IEnumerable<string>> DomainExplicitAllowlistDelegate
9224 } = () => (IEnumerable<string>)(object)Array.Empty<
string>();
9228 [field: CompilerGenerated]
9229 public static Func<IEnumerable<string>> DomainWildcardAllowlistDelegate
9235 } = () => (IEnumerable<string>)(object)Array.Empty<
string>();
9241 Uri uri =
default(Uri);
9242 if (!Uri.TryCreate(url, (UriKind)1, ref uri) || !IsAllowlistedUri(uri))
9247 vrcUrl =
new VRCUrl(url);
9254 return vrcUrl?.
Equals(Empty) ??
true;
9261 CS$<>8__locals0.dnsSafeHost = uri.DnsSafeHost;
9262 if (!Enumerable.Contains<
string>(DomainExplicitAllowlistDelegate.Invoke(), CS$<>8__locals0.dnsSafeHost))
9264 return Enumerable.Any<
string>(DomainWildcardAllowlistDelegate.Invoke(), (Func<string, bool>)((
string d) => CS$<>8__locals0.dnsSafeHost.EndsWith(d)));
9271 this.url = url ?? String.Empty;
9294 if (obj.GetType() != ((Object)
this).GetType())
9298 return Equals((
VRCUrl)obj);
9311 return url == other.
url;
9320 return ((Object)url).GetHashCode();
9371 public bool Serialize<T>(T objectToSerialize)
9378 catch (Exception val)
9380 Exception val2 = val;
9381 Debug.LogError((
object)String.Concat((
string[])(
object)
new String[6]
9383 "Could not serialize ",
9384 ((MemberInfo)typeof(T)).Name,
9394 public bool Deserialize<T>(out T objectToDeserialize)
9397 objectToDeserialize =
default(T);
9402 objectToDeserialize = (T)obj;
9407 catch (Exception val)
9409 Exception val2 = val;
9410 Debug.LogError((
object)String.Concat((
string[])(
object)
new String[6]
9412 "Could not deserialize ",
9413 ((MemberInfo)typeof(T)).Name,
9443 public static Func<VRC_DataStorage, string, int> _GetElementIndex;
9445 public event DataElementDelegate ElementChanged
9450 DataElementDelegate dataElementDelegate = this.m_ElementChanged;
9451 DataElementDelegate dataElementDelegate2;
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);
9458 while (dataElementDelegate != dataElementDelegate2);
9463 DataElementDelegate dataElementDelegate = this.m_ElementChanged;
9464 DataElementDelegate dataElementDelegate2;
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);
9471 while (dataElementDelegate != dataElementDelegate2);
9477 return _GetElementIndex.Invoke(
this, name);
9482 int elementIndex = GetElementIndex(name);
9484 if (data !=
null && data.Length > elementIndex)
9486 result = data[elementIndex];
9493 if (this.ElementChanged !=
null)
9495 this.ElementChanged(
this, idx);
9501 if (Initialize !=
null)
9523 return FindGameObject(path, suppressErrors:
false);
9534 Object.Destroy((Object)(
object)
this);
9551 return GameObject.Find(path);
9557 while ((Object)(
object)go != (Object)
null)
9559 text = ((!(text ==
"")) ? String.Concat(((Object)go).name,
"/", text) : ((Object)go).name);
9560 if ((Object)(object)go.transform.parent == (Object)
null)
9562 text = String.Concat(
"/", text);
9565 go = ((Component)go.transform.parent).gameObject;
9578 AnimationTrigger = 3,
9582 SetParticlePlaying = 7,
9584 RunConsoleCommand = 9,
9585 SetGameObjectActive = 10,
9586 SetWebPanelURI = 11,
9587 SetWebPanelVolume = 12,
9590 ActivateCustomTrigger = 15,
9596 SetComponentActive = 21,
9598 AnimationIntAdd = 24,
9599 AnimationIntSubtract = 25,
9600 AnimationIntMultiply = 26,
9601 AnimationIntDivide = 27,
9604 AddAngularVelocity = 30,
9605 SetAngularVelocity = 31,
9650 public string Name =
"";
9654 public string ParameterString =
"";
9663 public int ParameterInt = 1;
9698 public List<VrcEvent> Events =
new List<VrcEvent>();
9706 public List<EventInfo> deferredEvents =
new List<EventInfo>();
9714 if ((Object)(
object)_dispatcher == (Object)
null)
9722 public static GetNetworkIdDelegate GetInsitgatorId
9726 return GetInstigatorId;
9730 GetInstigatorId = value;
9738 VrcBooleanOp.False =>
false,
9739 VrcBooleanOp.True =>
true,
9740 VrcBooleanOp.Toggle => !Current,
9741 VrcBooleanOp.Unused => Current,
9751 if (components.Length > 1 || (Object)(object)components[0] != (Object)(object)
this)
9753 Debug.LogError((
object)String.Concat(
"Multiple event handlers found on ", ((Object)((Component)
this).gameObject).name,
", bad things will happen."));
9755 Enumerator<VrcEvent> enumerator = Events.GetEnumerator();
9758 while (enumerator.MoveNext())
9760 VrcEvent current = enumerator.Current;
9776 ((IDisposable)enumerator).Dispose();
9784 Enumerator<VrcEvent> enumerator = Events.GetEnumerator();
9787 while (enumerator.MoveNext())
9789 VrcEvent current = enumerator.Current;
9790 if (!(current.
Name != aEvent.stringParameter))
9798 ((IDisposable)enumerator).Dispose();
9816 throw new ArgumentException(
"Event was null");
9818 if ((Object)(
object)instagator == (Object)
null)
9820 Debug.LogErrorFormat(
"Cancelling event {0} because the Instagator was null.", (
object[])(
object)
new Object[1] { (Object)e.
Name });
9823 if ((Object)(object)Dispatcher == (Object)
null)
9825 Debug.LogFormat(
"Deferring event {0} of type {1} because dispatcher is unavailable.", (
object[])(object)
new Object[2]
9830 DeferEvent(e, broadcast, instagator, fastForward);
9835 Debug.LogError((
object)String.Concat(
"No object to receive event ", e.
Name,
" of type ", ((Object)e.
EventType).ToString()));
9838 int instagatorId = GetInstigatorId(instagator);
9842 foreach (GameObject parameterObject
in parameterObjects)
9845 e.ParameterObject = parameterObject;
9850 Debug.LogWarning((
object)String.Concat((
string[])(
object)
new String[5]
9852 "Null object in parameter objects to receive event ",
9855 ((Object)e.EventType).ToString(),
9856 ", trigger event ignored."
9861 InternalTriggerEvent(e, broadcast, instagatorId, fastForward);
9866 e.ParameterObject = parameterObject2;
9872 InternalTriggerEvent(e, broadcast, instagatorId, fastForward);
9878 if (instagatorId <= 0)
9880 Debug.LogErrorFormat(
"Cancelling event because the Instigator was invalid: {0}/{1}", (
object[])(
object)
new Object[2]
9886 if (LogEvent !=
null)
9888 LogEvent(
this, e, broadcast, instagatorId, fastForward);
9892 Dispatcher.TriggerEvent(
this, e, broadcast, instagatorId, fastForward);
9896 [Obsolete(
"Use the player object as the instigator",
false)]
9901 Debug.LogErrorFormat(
"Cancelling event because it was not valid", Array.Empty<
object>());
9905 if (playerById ==
null)
9907 Debug.LogErrorFormat(
"Cancelling event because instagator was not valid", Array.Empty<
object>());
9911 TriggerEvent(e, broadcast, playerById.
gameObject, fastForward);
9915 [Obsolete(
"Do not trigger events by name",
false)]
9920 Enumerator<VrcEvent> enumerator = Events.GetEnumerator();
9923 while (enumerator.MoveNext())
9925 VrcEvent current = enumerator.Current;
9926 if (!(current.
Name != eventName))
9928 TriggerEvent(current, broadcast, instagator);
9934 ((IDisposable)enumerator).Dispose();
9938 [Obsolete(
"Do not trigger events by name",
false)]
9943 Enumerator<VrcEvent> enumerator = Events.GetEnumerator();
9946 while (enumerator.MoveNext())
9948 VrcEvent current = enumerator.Current;
9949 if (!(current.
Name != eventName))
9951 TriggerEvent(current, broadcast, instagator, fastForward);
9957 ((IDisposable)enumerator).Dispose();
9965 Enumerator<VrcEvent> enumerator = Events.GetEnumerator();
9968 while (enumerator.MoveNext())
9970 VrcEvent current = enumerator.Current;
9986 ((IDisposable)enumerator).Dispose();
9992 if (deferredEvents.Count > 0)
9994 Debug.LogError((
object)
"Not all events were triggered prior to the handler being destroyed.");
9996 if ((Object)(
object)Dispatcher != (Object)
null)
9998 Dispatcher.UnregisterEventHandler(
this);
10002 [Obsolete(
"Event Handler Combined ID is no longer used")]
10010 return (Object)(object)go.GetComponent<
VRC_Interactable>() != (Object)
null;
10013 [Obsolete(
"They will defer.")]
10021 if (deferredEvents ==
null)
10023 deferredEvents =
new List<EventInfo>();
10028 broadcast = broadcast,
10029 instagator = instagator,
10030 fastForward = fastForward
10032 if (DeferredEventProcessor ==
null)
10038 [IteratorStateMachine()]
10042 while ((Object)(
object)
this != (Object)
null && deferredEvents !=
null && deferredEvents.Count > 0)
10044 if ((Object)(
object)Dispatcher == (Object)
null)
10049 deferredEvents =
new List<EventInfo>();
10050 Enumerator<EventInfo> enumerator = deferredEvents.GetEnumerator();
10053 while (enumerator.MoveNext())
10055 EventInfo current = enumerator.Current;
10056 if (current !=
null)
10058 if (GetInstigatorId(current.
instagator) <= 0)
10060 deferredEvents.Add(current);
10071 ((IDisposable)enumerator).Dispose();
10075 DeferredEventProcessor =
null;
10086 if (Initialize !=
null)
10100 ThirdPersonRotation,
10105 VoicePrioritization
10117 HPMotionController = 11,
10122 OpenXRGeneric = 16,
10129 public static Func<bool> _IsUsingHandController;
10131 public static Func<VRCInputMethod> _GetLastUsedInputMethod;
10133 public static Func<VRCInputSetting, bool> _GetInputSetting;
10135 public static Action<VRCInputSetting, bool> _SetInputSetting;
10137 public static Action<Renderer, bool> _EnableObjectHighlight;
10141 if (_IsUsingHandController !=
null)
10143 return _IsUsingHandController.Invoke();
10150 if (_GetLastUsedInputMethod !=
null)
10152 VRCInputMethod vRCInputMethod = _GetLastUsedInputMethod.Invoke();
10157 return vRCInputMethod;
10164 if (_GetInputSetting !=
null)
10166 return _GetInputSetting.Invoke(setting);
10173 if (_SetInputSetting !=
null)
10175 _SetInputSetting.Invoke(setting, enabled);
10181 if ((Object)(
object)obj != (Object)
null)
10183 EnableObjectHighlight(obj.GetComponent<Renderer>(), enable);
10189 if (_EnableObjectHighlight !=
null)
10191 _EnableObjectHighlight.Invoke(r, enable);
10203 public string interactText =
"Use";
10209 public float proximity = 2f;
10215 public virtual bool IsInteractive =>
false;
10217 public float Proximity => proximity;
10225 Initialize?.Invoke(
this);
10248 if (!IsInteractive)
10252 if (CheckValid !=
null)
10254 return CheckValid(
this, player);
10261 public string label =
"";
10290 SetupTargets(targets);
10296 SetupTargets(targets);
10302 this.playerRateLimit = playerRateLimit;
10303 SetupTargets(targets);
10306 public RPC(
short code,
float playerRateLimit,
float globalRateLimit, params
Destination[] targets)
10309 this.playerRateLimit = playerRateLimit;
10310 this.globalRateLimit = globalRateLimit;
10311 SetupTargets(targets);
10316 if (targets ==
null || targets.Length == 0)
10323 allowedTargets = targets;
10326 List<Destination> val = Enumerable.ToList<
Destination>((IEnumerable<Destination>)(
object)targets);
10328 allowedTargets = val.ToArray();
10382 public static Func<GameObject, float> _GetSimulationTime;
10384 public static Func<GameObject, string> _GetUniqueName;
10386 public static Action<
RPC.
Destination, GameObject, string,
object[]> _RPC;
10388 public static Action<VRCPlayerApi, GameObject, string, object[]> _RPCtoPlayer;
10390 public static Func<bool> _IsNetworkSettled;
10392 public static Func<bool> _IsMaster;
10394 public static Func<bool> _IsSuffering;
10396 public static Func<bool> _IsInstanceOwner;
10398 public static Func<VRCPlayerApi> _LocalPlayer;
10400 public static Func<VRCPlayerApi> _GetMaster;
10402 public static Func<VRCPlayerApi> _GetInstanceOwner;
10404 public static Func<VRCPlayerApi, GameObject, bool> _IsOwner;
10406 public static Action<VRCPlayerApi, GameObject> _SetOwner;
10408 public static Func<GameObject, bool> _IsObjectReady;
10412 public static Func<GameObject, VRCPlayerApi> _GetOwner;
10414 public static Func<object[], byte[]> _ParameterEncoder;
10416 public static Func<byte[], object[]> _ParameterDecoder;
10418 public static Action<GameObject> _Destroy;
10420 public static Func<VRC_EventHandler> _SceneEventHandler;
10422 public static Func<string, bool> _GoToRoom;
10424 public static Func<DateTime> _GetNetworkDateTime;
10426 public static Func<double> _GetServerTimeInSeconds;
10428 public static Func<int> _GetServerTimeInMilliseconds;
10430 public static Func<double, double, double> _CalculateServerDeltaTime;
10432 public static Func<IEnumerator, Coroutine> _SafeStartCoroutine;
10434 public static Func<VRC_EventDispatcher> _GetEventDispatcher;
10436 public static Func<VRCPlayerApi, GameObject[]> _GetPlayerPersistence;
10438 public static Func<VRCPlayerApi, Component, Component> _FindComponentInPlayerObjects;
10444 if (_SceneEventHandler !=
null)
10446 return _SceneEventHandler.Invoke();
10458 public static bool IsNetworkSettled
10462 if (_IsNetworkSettled !=
null)
10464 return _IsNetworkSettled.Invoke();
10475 public static bool IsMaster
10479 if (_IsMaster !=
null)
10481 return _IsMaster.Invoke();
10493 public static bool IsClogged
10497 if (Application.isEditor)
10501 if (_IsSuffering !=
null)
10503 return _IsSuffering.Invoke();
10516 public static bool IsInstanceOwner
10520 if (_IsInstanceOwner !=
null)
10522 return _IsInstanceOwner.Invoke();
10536 if (_LocalPlayer !=
null)
10538 return _LocalPlayer.Invoke();
10548 if (_GetMaster !=
null)
10550 return _GetMaster.Invoke();
10560 if (_GetInstanceOwner !=
null)
10562 return _GetInstanceOwner.Invoke();
10584 if (_IsOwner !=
null)
10586 return _IsOwner.Invoke(player, obj);
10605 if (_IsOwner !=
null)
10607 return _IsOwner.Invoke(LocalPlayer, obj);
10623 if (_GetOwner !=
null)
10625 return _GetOwner.Invoke(obj);
10643 if (_SetOwner !=
null)
10645 _SetOwner.Invoke(player, obj);
10662 if (_IsObjectReady !=
null)
10664 return _IsObjectReady.Invoke(obj);
10673 if (_Instantiate ==
null)
10677 return _Instantiate.Invoke(broadcast, prefabPathOrDynamicPrefabName, position, rotation);
10680 public static void RPC(
RPC.
Destination targetClients, GameObject targetObject,
string methodName, params
object[] parameters)
10684 _RPC.Invoke(targetClients, targetObject, methodName, parameters);
10688 public static void RPC(
VRCPlayerApi targetPlayer, GameObject targetObject,
string methodName, params
object[] parameters)
10690 if (_RPCtoPlayer !=
null)
10692 _RPCtoPlayer.Invoke(targetPlayer, targetObject, methodName, parameters);
10698 if (_ParameterEncoder !=
null)
10700 return _ParameterEncoder.Invoke(parameters);
10707 if (_ParameterDecoder !=
null)
10709 return _ParameterDecoder.Invoke(encodedData);
10716 if (_Destroy !=
null)
10718 _Destroy.Invoke(obj);
10735 if (_GetUniqueName !=
null)
10737 return _GetUniqueName.Invoke(obj);
10744 if (_GoToRoom !=
null)
10746 return _GoToRoom.Invoke(roomID);
10759 if (_GetNetworkDateTime !=
null)
10761 return _GetNetworkDateTime.Invoke();
10763 return DateTime.UtcNow;
10776 if (_GetServerTimeInSeconds !=
null)
10778 return _GetServerTimeInSeconds.Invoke();
10793 if (_GetServerTimeInMilliseconds !=
null)
10795 return _GetServerTimeInMilliseconds.Invoke();
10797 return (
int)(Time.time * 1000f);
10814 if (_CalculateServerDeltaTime !=
null)
10816 return _CalculateServerDeltaTime.Invoke(timeInSeconds, previousTimeInSeconds);
10818 return timeInSeconds - previousTimeInSeconds;
10823 if (_SafeStartCoroutine !=
null)
10825 return _SafeStartCoroutine.Invoke(target);
10832 if (_GetEventDispatcher !=
null)
10834 return _GetEventDispatcher.Invoke();
10864 if (_GetSimulationTime !=
null)
10866 return _GetSimulationTime.Invoke(target);
10896 if (_GetSimulationTime !=
null && target !=
null)
10898 return _GetSimulationTime.Invoke(target.
gameObject);
10905 if (_GetPlayerPersistence !=
null && target !=
null)
10907 return _GetPlayerPersistence.Invoke(target);
10909 return Array.Empty<GameObject>();
10914 return _FindComponentInPlayerObjects?.Invoke(target, referenceComponent);
10921 [CompilerGenerated]
10926 internal bool <IsAllowedType>
b__0(Type t)
10928 return t.IsAssignableFrom(type);
10931 internal bool <IsAllowedType>
b__1(Type t)
10933 return t.IsAssignableFrom(type);
10937 private ISurrogateSelector _next;
10942 if (selector ==
this)
10944 throw new ArgumentException(
"Cannot allow Cyclical Surrogates");
10952 _next.ChainSelector(selector);
10961 public ISerializationSurrogate
GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector)
10965 selector = (ISurrogateSelector)(
object)
this;
10966 if (!IsAllowedType(type))
10968 throw new SecurityException(String.Concat(
"Unknown type: ", type.FullName));
10970 if (type == typeof(Vector2))
10974 if (type == typeof(Vector3))
10978 if (type == typeof(Vector4))
10982 if (type == typeof(Quaternion))
10986 if (type == typeof(Color))
10990 if (type == typeof(Color32))
10994 if (type == typeof(GameObject))
10998 if (type == typeof(Transform))
11002 if (type.IsSubclassOf(typeof(Object)))
11006 if (type == typeof(Object))
11013 return _next.GetSurrogate(type, context, ref selector);
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))))))
11026 if (!AllowPluginTypes)
11030 if (!_allowedPluginTypes.Contains(CS$<>8__locals0.type) && (!CS$<>8__locals0.type.IsSubclassOf(typeof(Array)) || !_allowedPluginTypes.Contains(CS$<>8__locals0.type.GetElementType())))
11040 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
11046 Vector2 val = (Vector2)obj;
11047 info.AddValue(
"x", val.x);
11048 info.AddValue(
"y", val.y);
11051 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11056 Vector2 val = (Vector2)obj;
11057 val.x = info.GetSingle(
"x");
11058 val.y = info.GetSingle(
"y");
11065 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
11072 Vector3 val = (Vector3)obj;
11073 info.AddValue(
"x", val.x);
11074 info.AddValue(
"y", val.y);
11075 info.AddValue(
"z", val.z);
11078 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11083 Vector3 val = (Vector3)obj;
11084 val.x = info.GetSingle(
"x");
11085 val.y = info.GetSingle(
"y");
11086 val.z = info.GetSingle(
"z");
11093 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
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);
11108 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
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");
11124 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
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);
11139 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
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");
11155 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
11160 Transform val = (Transform)obj;
11161 if ((Object)(object)((Component)val).gameObject == (Object)
null)
11163 throw new ArgumentException(
"Transform must have an associated gameObject.");
11165 string gameObjectPath = GetGameObjectPath(((Component)val).gameObject);
11166 info.AddValue(
"path", (
object)gameObjectPath);
11169 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11172 string @
string = info.GetString(
"path");
11173 GameObject obj2 = FindGameObject(@
string);
11174 if ((Object)(
object)obj2 == (Object)
null)
11176 throw new KeyNotFoundException(String.Concat(
"Could not locate Transform at path ", @
string));
11178 return obj2.transform;
11184 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
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);
11199 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
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");
11215 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
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);
11230 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
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");
11246 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
11248 string gameObjectPath = GetGameObjectPath((GameObject)((obj is GameObject) ? obj :
null));
11249 info.AddValue(
"path", (
object)gameObjectPath);
11252 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11255 string @
string = info.GetString(
"path");
11256 GameObject obj2 = FindGameObject(@
string);
11257 if ((Object)(
object)obj2 == (Object)
null)
11259 throw new KeyNotFoundException(String.Concat(
"Could not locate Game Object at path ", @
string));
11267 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
11271 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11275 return (
object)
new Object();
11281 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
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++)
11289 MemberInfo val = array[i];
11290 if (Enumerable.Any<
object>((IEnumerable<object>)(object)val.GetCustomAttributes(
true), (Func<object, bool>)((
object attr) => attr is NonSerializedAttribute)))
11296 array2[i] = ((FieldInfo)val).GetValue(obj);
11299 info.AddValue(
"type", (
object)type.AssemblyQualifiedName);
11300 info.AddValue(
"members", (
object)ParameterEncoder(array2));
11303 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
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)
11314 throw new KeyNotFoundException(String.Concat(
"Could not load type ", @
string));
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)
11320 throw new NullReferenceException(String.Concat(
"Could not instantiate Scriptable Object of type ", ((MemberInfo)type).Name));
11323 if (array2.Length != array.Length)
11325 throw new ArgumentException(String.Concat(
"Received members does not match the number of valid members present for ", @
string));
11327 for (
int i = 0; i < array.Length; i++)
11329 MemberInfo val2 = array2[i];
11330 if (!Enumerable.Any<
object>((IEnumerable<object>)(
object)val2.GetCustomAttributes(
true), (Func<object, bool>)((
object attr) => attr is NonSerializedAttribute)))
11332 ((FieldInfo)val2).SetValue((
object)val, array[i]);
11341 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
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)
11349 info.AddValue(
"rank", 0);
11350 Debug.LogError((
object)
"ArrayRank out of range (1-4) in serialized array - not transmitted");
11353 info.AddValue(
"rank", arrayRank);
11355 Int32[] array =
new Int32[4];
11356 RuntimeHelpers.InitializeArray((Array)(object)array, (RuntimeFieldHandle));
11357 int[] array2 = (
int[])(
object)array;
11358 for (
int i = 0; i < arrayRank; i++)
11360 array2[i] = val.GetLength(i);
11365 Debug.LogError((
object)
"Too many elements in serialized array - not transmitted");
11366 for (
int j = 0; j < arrayRank; j++)
11368 info.AddValue(String.Concat(
"dim_", ((Int32)(ref j)).ToString()), 0);
11372 for (
int k = 0; k < arrayRank; k++)
11374 info.AddValue(String.Concat(
"dim_", ((Int32)(ref k)).ToString()), array2[k]);
11376 int[] array3 = (
int[])(
object)
new Int32[arrayRank];
11377 for (
int l = 0; l < array2[3]; l++)
11383 for (
int m = 0; m < array2[2]; m++)
11389 for (
int n = 0; n < array2[1]; n++)
11395 for (
int num2 = 0; num2 < array2[0]; num2++)
11398 byte[] array4 = ParameterEncoder(val.GetValue(array3));
11399 info.AddValue(String.Concat((
string[])(
object)
new String[8]
11402 ((Int32)(ref num2)).ToString(),
11404 ((Int32)(ref n)).ToString(),
11406 ((Int32)(ref m)).ToString(),
11408 ((Int32)(ref l)).ToString()
11409 }), (
object)array4);
11416 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11423 string @
string = info.GetString(
"type");
11424 Type type = Type.GetType(@
string,
false);
11425 if (type == (Type)
null)
11427 throw new KeyNotFoundException(String.Concat(
"Could not load type ", @
string));
11429 int num = (int)(Int32)info.GetValue(
"rank", typeof(Int32));
11430 if (num <= 0 || num > 4)
11432 Debug.LogError((
object)
"ArrayRank out of range (1-4) in serialized array - not recieved");
11436 Int32[] array =
new Int32[4];
11437 RuntimeHelpers.InitializeArray((Array)(object)array, (RuntimeFieldHandle));
11438 int[] array2 = (
int[])(
object)array;
11439 for (
int i = 0; i < num; i++)
11441 array2[i] = (int)(Int32)info.GetValue(String.Concat(
"dim_", ((Int32)(ref i)).ToString()), typeof(Int32));
11446 Debug.LogError((
object)
"Too many elements in serialized array - not received");
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++)
11457 for (
int k = 0; k < array2[2]; k++)
11463 for (
int l = 0; l < array2[1]; l++)
11469 for (
int m = 0; m < array2[0]; m++)
11472 object obj2 = ParameterDecoder((
byte[])info.GetValue(String.Concat((
string[])(
object)
new String[8]
11475 ((Int32)(ref m)).ToString(),
11477 ((Int32)(ref l)).ToString(),
11479 ((Int32)(ref k)).ToString(),
11481 ((Int32)(ref j)).ToString()
11482 }), typeof(
byte[])));
11483 val.SetValue(Convert.ChangeType(obj2, type.GetElementType()), array3);
11494 public void GetObjectData(
object obj, SerializationInfo info, StreamingContext context)
11501 Type type = obj.GetType();
11502 if (type.GetGenericTypeDefinition() == typeof(List<>))
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++)
11510 byte[] array = ParameterEncoder(val[(
int)num2]);
11511 info.AddValue(((Int16)(ref num2)).ToString(), (
object)array);
11514 else if (type.GetGenericTypeDefinition() == typeof(Dictionary<, >))
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++)
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);
11531 public object SetObjectData(
object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
11538 string @
string = info.GetString(
"type");
11539 Type type = Type.GetType(@
string,
false);
11540 if (type == (Type)
null)
11542 throw new KeyNotFoundException(String.Concat(
"Could not load type ", @
string));
11544 object result =
null;
11545 Type[] genericArguments = type.GetGenericArguments();
11546 if (type.GetGenericTypeDefinition() == typeof(List<>))
11548 IList val = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(genericArguments));
11549 short @
int = info.GetInt16(
"length");
11550 for (
short num = 0; num < @int; num++)
11552 object[] array = ParameterDecoder((
byte[])info.GetValue(((Int16)(ref num)).ToString(), typeof(
byte[])));
11557 else if (type.GetGenericTypeDefinition() == typeof(Dictionary<, >))
11559 IDictionary val2 = (IDictionary)Activator.CreateInstance(typeof(Dictionary<, >).MakeGenericType(genericArguments));
11560 short int2 = info.GetInt16(
"length");
11561 for (
short num2 = 0; num2 < int2; num2++)
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]);
11573 private static readonly HashSet<Type> _allowedTypes;
11575 private static readonly HashSet<Type> _allowedPluginTypes;
11577 private static ISurrogateSelector _networkSurrogateSelector;
11579 [field: CompilerGenerated]
11580 public static bool AllowPluginTypes
11582 [CompilerGenerated]
11584 [CompilerGenerated]
11588 private static ISurrogateSelector SurrogateSelector => _networkSurrogateSelector ?? (_networkSurrogateSelector = (ISurrogateSelector)(
object)
new NetworkSurrogateSelector());
11594 GameObject val = GameObject.Find(
"/VRC_OBJECTS/Dispatcher");
11595 if ((Object)(object)val == (Object)
null)
11606 if (type.FullName !=
"VRC.Player")
11608 throw new SecurityException(String.Concat(
"Unrecognized VRC.Player type: ", type.FullName));
11610 if (!_allowedTypes.Contains(type))
11612 _allowedTypes.Add(type);
11618 if (!_allowedPluginTypes.Contains(type))
11620 _allowedPluginTypes.Add(type);
11626 if (!_allowedTypes.Contains(type))
11628 _allowedTypes.Add(type);
11639 if (parameters ==
null)
11643 MemoryStream val =
new MemoryStream();
11644 IFormatter val2 = (IFormatter)
new BinaryFormatter();
11645 val2.SurrogateSelector = SurrogateSelector;
11648 val2.Serialize((Stream)(object)val, (
object)parameters);
11650 catch (SecurityException)
11654 catch (Exception val4)
11656 Exception val5 = val4;
11657 Debug.LogError((
object)String.Concat(
"Something went wrong serializing RPC parameters: \n", val5.Message,
"\n", val5.StackTrace));
11660 ((Stream)val).Flush();
11661 return val.ToArray();
11671 if (dataParameters !=
null && dataParameters.Length != 0)
11673 MemoryStream val =
new MemoryStream(dataParameters);
11674 IFormatter val2 = (IFormatter)
new BinaryFormatter();
11675 val2.SurrogateSelector = SurrogateSelector;
11678 return (
object[])val2.Deserialize((Stream)(object)val);
11680 catch (SecurityException)
11684 catch (Exception val4)
11686 Exception val5 = val4;
11691 Debug.LogError((
object)String.Concat(
"Error decoding parameters: ", val5.Message,
"\n", val5.StackTrace));
11695 return (
object[])(object)
new Object[0];
11701 while ((Object)(
object)go != (Object)
null)
11703 text = ((!(text ==
"")) ? String.Concat(((Object)go).name,
"/", text) : ((Object)go).name);
11704 if ((Object)(object)go.transform.parent == (Object)
null)
11706 text = String.Concat(
"/", text);
11709 go = ((Component)go.transform.parent).gameObject;
11717 if ((Object)(
object)dispatcher != (Object)
null)
11721 return GetGameObjectPathFallback(go);
11727 if ((Object)(
object)dispatcher != (Object)
null)
11731 return GameObject.Find(path);
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));
11759 _allowedTypes = obj;
11760 _allowedPluginTypes =
new HashSet<Type>();
11761 _networkSurrogateSelector =
null;
11766 private static bool _isClient;
11772 Object val = (Object)((obj is Object) ? obj :
null);
11773 if (val ==
null || !(val == (Object)
null))
11777 return validChecker.IsValid();
11786 public static void ShuffleArray<T>(T[] array)
11788 int num = array.Length;
11789 for (
int i = 0; i < num; i++)
11791 int num2 = (i + (int)(Random.value * (
float)(num - i))) % num;
11792 T val = array[num2];
11793 array[num2] = array[i];
11822 [CompilerGenerated]
11827 internal bool <FindDerivedTypes>
b__0(Type t)
11831 return baseType.IsAssignableFrom(t);
11837 private static readonly Dictionary<string, Type> _typeCache =
new Dictionary<string, Type>();
11842 if (_typeCache.ContainsKey(name))
11844 return _typeCache[name];
11846 if (assemblies ==
null)
11848 assemblies = AppDomain.CurrentDomain.GetAssemblies();
11850 Assembly[] array = assemblies;
11851 for (
int i = 0; i < array.Length; i++)
11853 Type type = array[i].GetType(name);
11854 if (!(type == (Type)
null))
11856 _typeCache[name] = type;
11860 _typeCache[name] =
null;
11866 List<Type> val =
new List<Type>();
11867 Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
11868 foreach (Assembly assembly
in assemblies)
11872 return (IEnumerable<Type>)(object)val;
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)));
11884 List<T> val =
new List<T>();
11885 Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
11886 foreach (Assembly assembly
in assemblies)
11890 return (IEnumerable<T>)(object)val;
11897 return (IEnumerable<T>)(object)(T[])(object)assembly.GetCustomAttributes(typeof(T),
false);
11901 return Enumerable.Empty<T>();
11907 [CompilerGenerated]
11912 internal void <FindIllegalShaders>
b__0(Shader c)
11914 illegalShaders.Add(c);
11918 [CompilerGenerated]
11923 internal bool <FindIllegalShadersEnumerator>
b__0(Material cacheMtl)
11925 return (Object)(object)sharedMaterial == (Object)(object)cacheMtl;
11928 internal bool <FindIllegalShadersEnumerator>
b__1(
string okayShaderName)
11930 return ((Object)sharedMaterial.shader).name != okayShaderName;
11934 private static readonly List<Component> _componentCache =
new List<Component>();
11936 private static string _EDITOR_ONLY_TAG =
"EditorOnly";
11938 private static readonly Dictionary<string, HashSet<Type>> _whitelistCache =
new Dictionary<string, HashSet<Type>>();
11940 private static readonly Dictionary<Type, ImmutableArray<RequireComponent>> _requireComponentsCache =
new Dictionary<Type, ImmutableArray<RequireComponent>>();
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)
11948 target.GetComponentsInChildren<Component>(
true, _componentCache);
11949 StringBuilder val =
null;
11950 Enumerator<Component> enumerator = _componentCache.GetEnumerator();
11953 while (enumerator.MoveNext())
11955 Component current = enumerator.Current;
11956 if ((Object)(object)current == (Object)
null || (onlySceneObjects && ((Object)current).GetInstanceID() < 0) || !
IsIllegalComponent(current, whitelist, excludeEditorOnly))
11964 val =
new StringBuilder(
"Component stripping report:");
11966 val.AppendFormat(
"\nRemoving {0} comp from {1}", (
object)((MemberInfo)((Object)current).GetType()).Name, (
object)((Object)current.gameObject).name);
11973 ((IDisposable)enumerator).Dispose();
11977 Debug.LogWarning((
object)((Object)val).ToString());
11979 _componentCache.Clear();
11982 public static List<Component>
FindIllegalComponents(GameObject target, HashSet<Type> whitelist,
bool excludeEditorOnly =
false)
11986 target.GetComponentsInChildren<Component>(
true, _componentCache);
11987 List<Component> val =
new List<Component>();
11988 Enumerator<Component> enumerator = _componentCache.GetEnumerator();
11991 while (enumerator.MoveNext())
11993 Component current = enumerator.Current;
12002 ((IDisposable)enumerator).Dispose();
12004 _componentCache.Clear();
12009 private static bool IsIllegalComponent(Component component, HashSet<Type> whitelist,
bool excludeEditorOnly =
false)
12011 if ((Object)(
object)component == (Object)
null)
12015 if (whitelist.Contains(((Object)component).GetType()))
12032 if (component.CompareTag(_EDITOR_ONLY_TAG))
12036 Transform[] componentsInParent = ((Component)component.transform).GetComponentsInParent<Transform>(
true);
12037 for (
int i = 0; i < componentsInParent.Length; i++)
12039 if (((Component)componentsInParent[i]).CompareTag(_EDITOR_ONLY_TAG))
12049 List<T> val =
new List<T>();
12050 T[] componentsInChildren = target.GetComponentsInChildren<T>(includeInactive);
12051 foreach (T val2
in componentsInChildren)
12053 if (!((Object)(
object)val2 == (Object)
null) && !
IsEditorOnly((Component)(
object)val2))
12063 List<Component> val =
new List<Component>();
12064 Component[] componentsInChildren = target.GetComponentsInChildren(type, includeInactive);
12065 foreach (Component val2
in componentsInChildren)
12067 if (!((Object)(
object)val2 == (Object)
null) && !
IsEditorOnly(val2))
12077 return _whitelistCache.TryGetValue(whitelistName, ref whitelist);
12080 public static HashSet<Type>
WhitelistedTypes(
string whitelistName, IEnumerable<string> componentTypeWhitelist)
12082 HashSet<Type> result =
default(HashSet<Type>);
12083 if (_whitelistCache.TryGetValue(whitelistName, ref result))
12087 Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
12088 HashSet<Type> val =
new HashSet<Type>();
12089 IEnumerator<string> enumerator = componentTypeWhitelist.GetEnumerator();
12092 while (((IEnumerator)enumerator).MoveNext())
12095 if (!(typeFromName == (Type)
null) && !val.Contains(typeFromName))
12097 val.Add(typeFromName);
12103 if (enumerator !=
null)
12105 ((IDisposable)enumerator).Dispose();
12109 _whitelistCache[whitelistName] = val;
12110 return _whitelistCache[whitelistName];
12113 public static HashSet<Type>
WhitelistedTypes(
string whitelistName, IEnumerable<Type> componentTypeWhitelist)
12115 if (_whitelistCache.ContainsKey(whitelistName))
12117 return _whitelistCache[whitelistName];
12119 HashSet<Type> val =
new HashSet<Type>();
12120 val.UnionWith(componentTypeWhitelist);
12122 _whitelistCache[whitelistName] = val;
12123 return _whitelistCache[whitelistName];
12128 Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
12129 for (
int i = 0; i < assemblies.Length; i++)
12131 Type[] types = assemblies[i].GetTypes();
12132 foreach (Type val
in types)
12134 if (whitelist.Contains(val) || !typeof(Component).IsAssignableFrom(val))
12139 while (val2 != typeof(Object) && val2 != (Type)
null)
12141 if (whitelist.Contains(val2))
12143 whitelist.Add(val);
12146 val2 = val2.BaseType;
12159 if ((Object)(
object)rootComponent == (Object)
null)
12163 Component[] components = rootComponent.GetComponents<Component>();
12164 if (components ==
null || components.Length == 0)
12168 Type compType = ((Object)rootComponent).GetType();
12169 Component[] array = components;
12170 ImmutableArray<RequireComponent> val2 =
default(ImmutableArray<RequireComponent>);
12171 foreach (Component val
in array)
12173 if ((Object)(object)val == (Object)
null || (Object)(
object)val == (Object)(
object)rootComponent)
12177 Type type = ((Object)val).GetType();
12178 if (!_requireComponentsCache.TryGetValue(type, ref val2))
12180 val2 = ImmutableArray.ToImmutableArray<RequireComponent>(Enumerable.Cast<RequireComponent>((IEnumerable)(
object)((MemberInfo)type).GetCustomAttributes(typeof(RequireComponent),
true)));
12181 _requireComponentsCache.Add(type, val2);
12184 Enumerator<RequireComponent> enumerator = val2.GetEnumerator();
12185 while (enumerator.MoveNext())
12187 RequireComponent current = enumerator.Current;
12188 if (current !=
null)
12190 flag |= needsDeletion(current.m_Type0);
12191 flag |= flag || needsDeletion(current.m_Type1);
12192 flag |= flag || needsDeletion(current.m_Type2);
12204 [CompilerGenerated]
12205 bool needsDeletion(Type reqType)
12207 if (reqType == (Type)
null)
12211 if (!reqType.IsAssignableFrom(compType))
12221 if (!((Object)(
object)comp == (Object)
null))
12224 Object.DestroyImmediate((Object)(
object)comp, allowRemovingAssets);
12230 if ((Object)(
object)target == (Object)
null)
12234 T[] componentsInChildren = target.GetComponentsInChildren<T>(
true);
12235 foreach (T val
in componentsInChildren)
12237 if (!((Object)(
object)val == (Object)
null))
12247 CS$<>8__locals0.illegalShaders =
new List<Shader>();
12250 CS$<>8__locals0.illegalShaders.Add(c);
12252 while (val.MoveNext())
12255 return (IEnumerable<Shader>)(object)CS$<>8__locals0.illegalShaders;
12258 [IteratorStateMachine()]
12261 Stopwatch watch =
new Stopwatch();
12266 List<Material> materialCache =
new List<Material>();
12267 Queue<GameObject> children =
new Queue<GameObject>();
12268 children.Enqueue(target.gameObject);
12269 while (children.Count > 0)
12271 GameObject val = children.Dequeue();
12272 if ((Object)(
object)val == (Object)
null)
12276 for (
int i = 0; i < val.transform.childCount; i++)
12278 children.Enqueue(((Component)val.transform.GetChild(i)).gameObject);
12280 Renderer[] components = ((Component)val.transform).GetComponents<Renderer>();
12281 foreach (Renderer val2
in components)
12283 if ((Object)(object)val2 == (Object)
null)
12287 Material[] sharedMaterials = val2.sharedMaterials;
12288 for (
int k = 0; k < sharedMaterials.Length; k++)
12292 sharedMaterial = sharedMaterials[k]
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))
12296 if (Enumerable.All<
string>((IEnumerable<string>)(object)whitelist, (Func<string, bool>)((
string okayShaderName) => ((Object)CS$<>8__locals0.sharedMaterial.shader).name != okayShaderName)))
12298 onFound.Invoke(CS$<>8__locals0.sharedMaterial.shader);
12301 materialCache.Add(CS$<>8__locals0.sharedMaterial);
12304 if (useWatch && watch.ElapsedMilliseconds > 1)
12324 [CompilerGenerated]
12329 internal void <ApplyPerformanceFiltersEnumerator>
b__0()
12331 avatarBlocked =
true;
12345 [field: CompilerGenerated]
12348 [CompilerGenerated]
12350 [CompilerGenerated]
12358 perfStats.avatarName = avatarName;
12363 [IteratorStateMachine()]
12368 perfStats.avatarName = avatarName;
12370 if (performanceScannerSet !=
null)
12377 [IteratorStateMachine()]
12382 if ((!mobilePlatform && userForcedShow) || minPerfRating ==
PerformanceRating.None)
12387 if (!((Object)(
object)performanceFilterSet == (Object)
null))
12389 CS$<>8__locals0.avatarBlocked =
false;
12392 CS$<>8__locals0.avatarBlocked =
true;
12393 }, userForcedShow);
12394 if (CS$<>8__locals0.avatarBlocked)
12405 if (mobilePlatform)
12413 return performanceScannerSet;
12419 if (!mobilePlatform)
12421 return Resources.Load<
PerformanceFilterSet>(
"Validation/Performance/FilterSets/PerformanceFilterSet_Windows");
12423 return Resources.Load<
PerformanceFilterSet>(
"Validation/Performance/FilterSets/PerformanceFilterSet_Quest");
12428 if (component.CompareTag(
"EditorOnly"))
12432 Transform[] componentsInParent = ((Component)component.transform).GetComponentsInParent<Transform>(
true);
12433 for (
int i = 0; i < componentsInParent.Length; i++)
12435 if (((Component)componentsInParent[i]).CompareTag(
"EditorOnly"))
12446 if (Application.isEditor)
12448 if ((Object)(
object)component == (Object)
null)
12475 PhysBoneComponentCount,
12476 PhysBoneTransformCount,
12477 PhysBoneColliderCount,
12478 PhysBoneCollisionCheckCount,
12483 ParticleSystemCount,
12484 ParticleTotalCount,
12485 ParticleMaxMeshPolyCount,
12486 ParticleTrailsEnabled,
12487 ParticleCollisionEnabled,
12488 TrailRendererCount,
12492 PhysicsColliderCount,
12493 PhysicsRigidbodyCount,
12498 AvatarPerformanceCategoryCount
12510 if ((Object)(
object)sourceMesh == (Object)
null)
12514 if (!sourceMesh.isReadable)
12516 return 4294967295u;
12519 for (
int i = 0; i < sourceMesh.subMeshCount; i++)
12521 uint indexCount = sourceMesh.GetIndexCount(i);
12522 num += indexCount / 3;
12529 [CompilerGenerated]
12534 internal void <ApplyPerformanceFilters>
b__0()
12536 avatarBlocked =
true;
12542 [IteratorStateMachine()]
12549 if (!((Object)(
object)abstractPerformanceFilter == (Object)
null))
12551 CS$<>8__locals0.avatarBlocked =
false;
12552 yield
return abstractPerformanceFilter.
ApplyPerformanceFilter(avatarObject, perfStats, ratingLimit, shouldIgnoreComponent, delegate
12554 CS$<>8__locals0.avatarBlocked =
true;
12555 }, userForcedShow);
12556 if (CS$<>8__locals0.avatarBlocked)
12597 while (((IEnumerator)enumerator).MoveNext())
12608 if (enumerator !=
null)
12610 ((IDisposable)enumerator).Dispose();
12622 while (enumerator.MoveNext())
12624 enumerator.Current?.RunPerformanceScan(avatarObject, perfStats, shouldIgnoreComponent);
12629 ((IDisposable)enumerator).Dispose();
12633 [IteratorStateMachine()]
12639 while (enumerator.MoveNext())
12642 if (current !=
null)
12650 ((IDisposable)enumerator).Dispose();
12794 [Obsolete(
"Use downloadSizeBytes instead")]
12807 return default(Nullable<float>);
12809 return new Nullable<float>((
float)val.GetValueOrDefault() / 1048576f);
12813 [Obsolete(
"Use uncompressedSizeBytes instead")]
12826 return default(Nullable<float>);
12828 return new Nullable<float>((
float)val.GetValueOrDefault() / 1048576f);
12892 aabb = avatarPerformanceStats.
aabb;
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());
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);
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);
13061 val.AppendFormat(
"Cloth Count: {0}\n", (
object)
clothCount);
13066 val.AppendFormat(
"Download Size: {0} MB\n", (
object)(val2.HasValue ?
new Nullable<float>((
float)val2.GetValueOrDefault() / 1048576f) :
default(Nullable<float>)));
13068 val.AppendFormat(
"Uncompressed Size: {0} MB\n", (
object)(val2.HasValue ?
new Nullable<float>((
float)val2.GetValueOrDefault() / 1048576f) :
default(Nullable<float>)));
13071 val.AppendFormat(
"Constraint Depth: {0}\n", (
object)
constraintDepth);
13072 return ((Object)val).ToString();
13138 private bool _analyticsStatsValid;
13140 private List<int> _analyticsStatValues =
new List<int>(_analyticsStatNames.Count);
13142 private static List<string> _analyticsStatNames;
13144 private static readonly ImmutableArray<AvatarPerformanceCategory> _performanceCategories;
13146 private static readonly Dictionary<AvatarPerformanceCategory, string> _performanceCategoryDisplayNames;
13148 private static readonly Dictionary<PerformanceRating, string> _performanceRatingDisplayNames;
13156 [Obsolete(
"Use downloadSizeBytes instead")]
13169 return default(Nullable<float>);
13171 return new Nullable<float>((
float)val.GetValueOrDefault() / 1048576f);
13175 [Obsolete(
"Use uncompressedSizeBytes instead")]
13188 return default(Nullable<float>);
13190 return new Nullable<float>((
float)val.GetValueOrDefault() / 1048576f);
13200 _analyticsStatsValid =
false;
13201 _analyticsStatValues.Clear();
13204 _analyticsStatValues.Add(
polyCount.Value);
13212 _analyticsStatValues.Add(
meshCount.Value);
13224 _analyticsStatValues.Add(
boneCount.Value);
13284 _analyticsStatValues.Add(
physBone.Value.componentCount);
13285 _analyticsStatValues.Add(
physBone.Value.transformCount);
13286 _analyticsStatValues.Add(
physBone.Value.colliderCount);
13287 _analyticsStatValues.Add(
physBone.Value.collisionCheckCount);
13289 _analyticsStatsValid = _analyticsStatValues.Count == _analyticsStatNames.Count;
13294 return _analyticsStatValues[index];
13299 return _analyticsStatNames[index];
13302 [RuntimeInitializeOnLoadMethod()]
13305 _performanceStatsLevelSet_Windows = Resources.Load<
AvatarPerformanceStatsLevelSet>(
"Validation/Performance/StatsLevels/Windows/AvatarPerformanceStatLevels_Windows");
13306 _performanceStatsLevelSet_Mobile = Resources.Load<
AvatarPerformanceStatsLevelSet>(
"Validation/Performance/StatsLevels/Quest/AvatarPerformanceStatLevels_Quest");
13311 if (isMobilePlatform)
13313 return _performanceStatsLevelSet_Mobile;
13315 return _performanceStatsLevelSet_Windows;
13358 aabb =
default(Nullable<Bounds>);
13380 physBone =
default(Nullable<PhysBoneStats>);
13385 for (
int i = 0; i < 32; i++)
13389 _performanceStatsLevelSet =
null;
13491 return _performanceRatingCache[(int)perfCategory];
13500 for (
int i = 0; i < _performanceRatingCache.Length; i++)
13504 Enumerator<AvatarPerformanceCategory> enumerator = _performanceCategories.GetEnumerator();
13505 while (enumerator.MoveNext())
13614 for (
int i = 0; i < _performanceRatingCache.Length; i++)
13618 Enumerator<string, object> enumerator = stats.GetEnumerator();
13621 while (enumerator.MoveNext())
13623 KeyValuePair<string, object> current = enumerator.Current;
13624 string key = current.Key;
13629 switch (key.Length)
13635 if (key ==
"totalPolygons")
13637 polyCount =
new Nullable<int>((
int)(Double)current.Value);
13641 if (key ==
"animatorCount")
13643 animatorCount =
new Nullable<int>((
int)(Double)current.Value);
13652 if (key ==
"skinnedMeshCount")
13658 if (key ==
"physicsColliders")
13664 if (key ==
"audioSourceCount")
13675 if (key ==
"meshCount")
13677 meshCount =
new Nullable<int>((
int)(Double)current.Value);
13681 if (key ==
"boneCount")
13683 boneCount =
new Nullable<int>((
int)(Double)current.Value);
13692 if (key ==
"materialSlotsUsed")
13694 materialCount =
new Nullable<int>((
int)(Double)current.Value);
13698 if (key ==
"totalMaxParticles")
13704 if (key ==
"lineRendererCount")
13710 if (key ==
"totalTextureUsage")
13712 textureMegabytes =
new Nullable<float>((
float)(Double)current.Value / 1048576f);
13721 if (key ==
"physBoneComponentCount")
13724 valueOrDefault.componentCount = (int)(Double)current.Value;
13725 physBone =
new Nullable<PhysBoneStats>(valueOrDefault);
13729 if (key ==
"physBoneTransformCount")
13732 valueOrDefault.transformCount = (int)(Double)current.Value;
13733 physBone =
new Nullable<PhysBoneStats>(valueOrDefault);
13742 if (key ==
"physBoneColliderCount")
13745 valueOrDefault.colliderCount = (int)(Double)current.Value;
13746 physBone =
new Nullable<PhysBoneStats>(valueOrDefault);
13750 if (key ==
"particleTrailsEnabled")
13761 if (key ==
"contactCompleteCount")
13767 if (key ==
"constraintDepthCount")
13778 if (key ==
"lightCount")
13780 lightCount =
new Nullable<int>((
int)(Double)current.Value);
13784 if (key ==
"clothCount")
13786 clothCount =
new Nullable<int>((
int)(Double)current.Value);
13795 if (key ==
"trailRendererCount")
13801 if (key ==
"totalClothVertices")
13807 if (key ==
"physicsRigidbodies")
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])));
13822 if (key ==
"physBoneCollisionCheckCount")
13825 valueOrDefault.collisionCheckCount = (int)(Double)current.Value;
13826 physBone =
new Nullable<PhysBoneStats>(valueOrDefault);
13830 if (key ==
"contactCount")
13832 contactCount =
new Nullable<int>((
int)(Double)current.Value);
13836 if (key ==
"particleSystemCount")
13842 if (key ==
"meshParticleMaxPolygons")
13848 if (key ==
"particleCollisionEnabled")
13854 if (key ==
"constraintCount")
13864 ((IDisposable)enumerator).Dispose();
13872 return _performanceCategoryDisplayNames[category];
13878 return _performanceRatingDisplayNames[rating];
13885 return rating
switch
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,
13901 switch (perfCategory)
13906 Enumerator<AvatarPerformanceCategory> enumerator = _performanceCategories.GetEnumerator();
13907 while (enumerator.MoveNext())
13913 if (performanceRatingForCategory > performanceRating)
13915 performanceRating = performanceRatingForCategory;
13919 return performanceRating;
13928 if (!
aabb.HasValue)
13951 Bounds valueOrDefault = x.
aabb.GetValueOrDefault();
13954 valueOrDefault = x.aabb.GetValueOrDefault();
13955 if (ApproxLessOrEqual(((Bounds)(ref valueOrDefault)).extents.y, ((Bounds)(ref y.aabb)).extents.y))
13957 valueOrDefault = x.aabb.GetValueOrDefault();
13958 if (ApproxLessOrEqual(((Bounds)(ref valueOrDefault)).extents.z, ((Bounds)(ref y.aabb)).extents.z))
14037 return ((val.GetValueOrDefault() == flag) & val.HasValue) ? 0f : ((
float)(x.
particleTrailsEnabled.GetValueOrDefault() ? 1 : (-1)));
14050 return ((val2.GetValueOrDefault() == flag2) & val2.HasValue) ? 0f : ((
float)(x.
particleCollisionEnabled.GetValueOrDefault() ? 1 : (-1)));
14161 if (compareFn(
this, _performanceStatsLevelSet.excellent) <= 0f)
14165 if (compareFn(
this, _performanceStatsLevelSet.good) <= 0f)
14169 if (compareFn(
this, _performanceStatsLevelSet.medium) <= 0f)
14173 if (compareFn(
this, _performanceStatsLevelSet.poor) <= 0f)
14182 float num = x1 - x2;
14185 return Mathf.Approximately(num, 0f);
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;
14272 if ((val2.GetValueOrDefault() > num) & val2.HasValue)
14274 val2 = downloadSizeBytes;
14275 val.AppendFormat(
"Download Size: {0} MB\n", (
object)(val2.HasValue ?
new Nullable<float>((
float)val2.GetValueOrDefault() / 1048576f) :
default(Nullable<float>)));
14277 val2 = uncompressedSizeBytes;
14279 if ((val2.GetValueOrDefault() > num) & val2.HasValue)
14281 val2 = uncompressedSizeBytes;
14282 val.AppendFormat(
"Uncompressed Size: {0} MB\n", (
object)(val2.HasValue ?
new Nullable<float>((
float)val2.GetValueOrDefault() / 1048576f) :
default(Nullable<float>)));
14284 val.AppendFormat(
"Constraint Count: {0}\n", (
object)constraintsCount);
14285 val.AppendFormat(
"Constraint Depth: {0}\n", (
object)constraintDepth);
14286 return ((Object)val).ToString();
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;
14320 Dictionary<AvatarPerformanceCategory, string> obj2 =
new Dictionary<AvatarPerformanceCategory, string>();
14351 _performanceCategoryDisplayNames = obj2;
14352 Dictionary<PerformanceRating, string> obj3 =
new Dictionary<PerformanceRating, string>();
14359 _performanceRatingDisplayNames = obj3;
14360 _performanceStatsLevelSet_Windows =
null;
14361 _performanceStatsLevelSet_Mobile =
null;
14418 [FormerlySerializedAs(
"veryGood")]
14425 [FormerlySerializedAs(
"bad")]
14435 private static int _componentScansThisFrame;
14437 private static int _componentScansFrameNumber;
14439 private readonly Stack<IEnumerator> _coroutines =
new Stack<IEnumerator>();
14441 private bool _limitComponentScansPerFrame =
true;
14447 _limitComponentScansPerFrame =
false;
14451 while (_coroutines.Count > 0)
14453 IEnumerator val = _coroutines.Peek();
14454 if (val.MoveNext())
14456 object current = val.Current;
14457 IEnumerator val2 = (IEnumerator)((current is IEnumerator) ? current :
null);
14460 _coroutines.Push(val2);
14468 _coroutines.Clear();
14472 _limitComponentScansPerFrame =
true;
14476 [IteratorStateMachine()]
14480 destinationBuffer.Clear();
14481 destinationBuffer.AddRange((IEnumerable<Component>)(
object)avatarObject.GetComponentsInChildren(componentType,
true));
14484 [IteratorStateMachine()]
14488 destinationBuffer.Clear();
14489 avatarObject.GetComponentsInChildren<T>(
true, destinationBuffer);
14493 [IteratorStateMachine()]
14496 if (!_limitComponentScansPerFrame)
14500 while (_componentScansThisFrame >= 10)
14502 if (Time.frameCount > _componentScansFrameNumber)
14504 _componentScansFrameNumber = Time.frameCount;
14505 _componentScansThisFrame = 0;
14510 _componentScansThisFrame++;
14520 [CompilerGenerated]
14525 internal bool <RunPerformanceScanEnumerator>
b__0(Animator c)
14527 return shouldIgnoreComponent((Component)(
object)c);
14530 internal bool <RunPerformanceScanEnumerator>
b__1(Animation c)
14532 return shouldIgnoreComponent((Component)(
object)c);
14536 [IteratorStateMachine()]
14541 shouldIgnoreComponent = shouldIgnoreComponent
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)
14548 animatorBuffer.RemoveAll((Predicate<Animator>)((Animator c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)c)));
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)
14555 animationBuffer.RemoveAll((Predicate<Animation>)((Animation c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)c)));
14557 animatorCount3 += animationBuffer.Count;
14558 perfStats.animatorCount =
new Nullable<int>(animatorCount3);
14563 [CompilerGenerated]
14568 internal bool <RunPerformanceScanEnumerator>
b__0(AudioSource c)
14570 return shouldIgnoreComponent((Component)(
object)c);
14574 [IteratorStateMachine()]
14579 shouldIgnoreComponent = shouldIgnoreComponent
14581 List<AudioSource> audioSourceBuffer =
new List<AudioSource>();
14582 yield
return ScanAvatarForComponentsOfType<AudioSource>(avatarObject, audioSourceBuffer);
14583 if (CS$<>8__locals0.shouldIgnoreComponent !=
null)
14585 audioSourceBuffer.RemoveAll((Predicate<AudioSource>)((AudioSource c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)c)));
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();
14593 while (enumerator.MoveNext())
14596 if (Object.op_Implicit((Object)(
object)current) && current.
type == typeof(AudioSource) && !CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)current))
14599 perfStats.audioSourceCount = (audioSourceCount.HasValue ?
new Nullable<int>(audioSourceCount.GetValueOrDefault() + 1) :
default(Nullable<int>));
14605 ((IDisposable)enumerator).Dispose();
14611 [CompilerGenerated]
14616 internal bool <RunPerformanceScanEnumerator>
b__0(Cloth c)
14618 return shouldIgnoreComponent((Component)(
object)c);
14622 [IteratorStateMachine()]
14627 shouldIgnoreComponent = shouldIgnoreComponent
14629 List<Cloth> clothBuffer =
new List<Cloth>();
14630 yield
return ScanAvatarForComponentsOfType<Cloth>(avatarObject, clothBuffer);
14631 if (CS$<>8__locals0.shouldIgnoreComponent !=
null)
14633 clothBuffer.RemoveAll((Predicate<Cloth>)((Cloth c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)c)));
14636 Enumerator<Cloth> enumerator = clothBuffer.GetEnumerator();
14639 while (enumerator.MoveNext())
14641 Cloth current = enumerator.Current;
14642 if (!((Object)(
object)current == (Object)
null) && current.coefficients !=
null)
14644 num += current.coefficients.Length;
14650 ((IDisposable)enumerator).Dispose();
14652 perfStats.clothCount =
new Nullable<int>(clothBuffer.Count);
14653 perfStats.clothMaxVertices =
new Nullable<int>(num);
14658 [CompilerGenerated]
14663 internal bool <RunPerformanceScanEnumerator>
b__0(Light c)
14665 return shouldIgnoreComponent((Component)(
object)c);
14669 [IteratorStateMachine()]
14674 shouldIgnoreComponent = shouldIgnoreComponent
14676 List<Light> lightBuffer =
new List<Light>();
14677 yield
return ScanAvatarForComponentsOfType<Light>(avatarObject, lightBuffer);
14678 if (CS$<>8__locals0.shouldIgnoreComponent !=
null)
14680 lightBuffer.RemoveAll((Predicate<Light>)((Light c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)c)));
14682 perfStats.lightCount =
new Nullable<int>(lightBuffer.Count);
14687 [CompilerGenerated]
14692 internal bool <RunPerformanceScanEnumerator>
b__0(LineRenderer c)
14694 return shouldIgnoreComponent((Component)(
object)c);
14698 [IteratorStateMachine()]
14703 shouldIgnoreComponent = shouldIgnoreComponent
14705 List<LineRenderer> lineRendererBuffer =
new List<LineRenderer>();
14706 yield
return ScanAvatarForComponentsOfType<LineRenderer>(avatarObject, lineRendererBuffer);
14707 if (CS$<>8__locals0.shouldIgnoreComponent !=
null)
14709 lineRendererBuffer.RemoveAll((Predicate<LineRenderer>)((LineRenderer c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)c)));
14711 int count = lineRendererBuffer.Count;
14712 perfStats.lineRendererCount =
new Nullable<int>(count);
14713 perfStats.materialCount =
new Nullable<int>(perfStats.
materialCount.GetValueOrDefault() + count);
14718 [CompilerGenerated]
14723 internal bool <RunPerformanceScanEnumerator>
b__0(Renderer c)
14725 return shouldIgnoreComponent((Component)(
object)c);
14731 private static readonly Dictionary<TextureFormat, float> _texture2DBytesPerPixelLookup;
14735 private static readonly Dictionary<RenderTextureFormat, float> _renderTextureBytesPerPixelLookup;
14737 [IteratorStateMachine()]
14742 shouldIgnoreComponent = shouldIgnoreComponent
14744 List<Renderer> rendererBuffer =
new List<Renderer>(16);
14745 yield
return ScanAvatarForComponentsOfType<Renderer>(avatarObject, rendererBuffer);
14746 if (CS$<>8__locals0.shouldIgnoreComponent !=
null)
14748 rendererBuffer.RemoveAll((Predicate<Renderer>)((Renderer c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)c)));
14750 yield
return AnalyzeGeometry(avatarObject, rendererBuffer, perfStats);
14760 SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(
object)((renderer is SkinnedMeshRenderer) ? renderer :
null);
14761 if ((Object)(object)val2 != (Object)
null)
14763 val = val2.sharedMesh;
14765 if ((Object)(object)val == (Object)
null)
14767 MeshRenderer val3 = (MeshRenderer)(
object)((renderer is MeshRenderer) ? renderer :
null);
14768 if ((Object)(object)val3 != (Object)
null)
14770 MeshFilter component = ((Component)val3).GetComponent<MeshFilter>();
14771 if ((Object)(object)component != (Object)
null)
14773 val = component.sharedMesh;
14777 if ((Object)(object)val == (Object)
null)
14786 MeshRenderer val = (MeshRenderer)(
object)((renderer is MeshRenderer) ? renderer :
null);
14787 if ((Object)(object)val != (Object)
null)
14789 MeshFilter component = ((Component)val).GetComponent<MeshFilter>();
14790 if ((Object)(object)component == (Object)
null)
14794 return (Object)(object)component.sharedMesh != (Object)
null;
14796 SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(
object)((renderer is SkinnedMeshRenderer) ? renderer :
null);
14797 if ((Object)(object)val2 != (Object)
null)
14799 return (Object)(object)val2.sharedMesh != (Object)
null;
14804 [IteratorStateMachine()]
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;
14817 Enumerator<LODGroup> enumerator = lodBuffer.GetEnumerator();
14820 while (enumerator.MoveNext())
14822 LOD[] lODs = enumerator.Current.GetLODs();
14824 LOD[] array = lODs;
14825 foreach (LOD val
in array)
14828 Renderer[] renderers2 = val.renderers;
14829 foreach (Renderer val2
in renderers2)
14831 lodGroupRendererIgnoreBuffer.Add(val2);
14844 ((IDisposable)enumerator).Dispose();
14847 catch (OverflowException)
14849 polyCount = 4294967295uL;
14851 enumerator2 = renderers.GetEnumerator();
14855 while (enumerator2.MoveNext())
14857 Renderer current = enumerator2.Current;
14858 if (current is MeshRenderer || current is SkinnedMeshRenderer)
14864 ((Bounds)(ref bounds)).Encapsulate(current.bounds);
14866 if (!lodGroupRendererIgnoreBuffer.Contains(current))
14874 ((IDisposable)enumerator2).Dispose();
14876 ((Bounds)(ref bounds)).center = ((Bounds)(ref bounds)).center - avatarObject.transform.position;
14877 lodGroupRendererIgnoreBuffer.Clear();
14879 perfStats.polyCount =
new Nullable<int>((
int)((polyCount > 2147483647) ? 2147483647 : polyCount));
14880 perfStats.aabb =
new Nullable<Bounds>(bounds);
14911 ProfilerMarker val =
new ProfilerMarker(
"AnalyzeMaterials");
14912 AutoScope val2 = ((ProfilerMarker)(ref val)).Auto();
14915 HashSet<Material> val3 =
new HashSet<Material>();
14916 List<Material> val4 =
new List<Material>();
14917 Enumerator<Renderer> enumerator = renderers.GetEnumerator();
14920 while (enumerator.MoveNext())
14922 Renderer current = enumerator.Current;
14923 if (!((Object)(
object)current == (Object)
null))
14925 current.GetSharedMaterials(val4);
14926 val3.UnionWith((IEnumerable<Material>)(
object)val4);
14932 ((IDisposable)enumerator).Dispose();
14934 HashSet<Texture> val5 =
new HashSet<Texture>();
14935 List<int> val6 =
new List<int>();
14936 Enumerator<Material> enumerator2 = val3.GetEnumerator();
14939 while (enumerator2.MoveNext())
14941 Material current2 = enumerator2.Current;
14942 if ((Object)(
object)current2 == (Object)
null)
14946 current2.GetTexturePropertyNameIDs(val6);
14947 Enumerator<int> enumerator3 = val6.GetEnumerator();
14950 while (enumerator3.MoveNext())
14952 int current3 = enumerator3.Current;
14953 Texture texture = current2.GetTexture(current3);
14954 if (!((Object)(
object)texture == (Object)
null) && !val5.Contains(texture))
14962 ((IDisposable)enumerator3).Dispose();
14968 ((IDisposable)enumerator2).Dispose();
14971 Enumerator<Texture> enumerator4 = val5.GetEnumerator();
14974 float num2 =
default(
float);
14975 float num4 =
default(
float);
14976 float num6 =
default(
float);
14977 float num8 =
default(
float);
14978 while (enumerator4.MoveNext())
14980 Texture current4 = enumerator4.Current;
14981 Texture2D val7 = (Texture2D)(
object)((current4 is Texture2D) ? current4 :
null);
14984 if (current4 is RenderTexture)
14988 Cubemap val8 = (Cubemap)(
object)((current4 is Cubemap) ? current4 :
null);
14991 Texture2DArray val9 = (Texture2DArray)(
object)((current4 is Texture2DArray) ? current4 :
null);
14994 Texture3D val10 = (Texture3D)(
object)((current4 is Texture3D) ? current4 :
null);
14997 TextureFormat format = val10.format;
14998 if (!_texture2DBytesPerPixelLookup.TryGetValue(format, ref num2))
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);
15011 TextureFormat format2 = val9.format;
15012 if (!_texture2DBytesPerPixelLookup.TryGetValue(format2, ref num4))
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);
15025 TextureFormat format3 = val8.format;
15026 if (!_texture2DBytesPerPixelLookup.TryGetValue(format3, ref num6))
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++)
15036 num += Mathf.RoundToInt((
float)(num7 >> 2 * i) * num6);
15042 TextureFormat format4 = val7.format;
15043 if (!_texture2DBytesPerPixelLookup.TryGetValue(format4, ref num8))
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++)
15053 num += Mathf.RoundToInt((
float)(num9 >> 2 * j) * num8);
15060 ((IDisposable)enumerator4).Dispose();
15062 perfStats.textureMegabytes =
new Nullable<float>((
float)num / 1048576f);
15066 ((IDisposable)(AutoScope)(ref val2)).Dispose();
15083 HashSet<Transform> val =
new HashSet<Transform>();
15084 Enumerator<Renderer> enumerator = renderers.GetEnumerator();
15087 while (enumerator.MoveNext())
15089 Renderer current = enumerator.Current;
15090 SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(
object)((current is SkinnedMeshRenderer) ? current :
null);
15091 if ((Object)(object)val2 == (Object)
null)
15096 Mesh sharedMesh = val2.sharedMesh;
15097 if ((Object)(object)sharedMesh != (Object)
null)
15099 num2 += sharedMesh.subMeshCount;
15101 Transform[] bones = val2.bones;
15102 foreach (Transform val3
in bones)
15104 if (!((Object)(object)val3 == (Object)
null) && !val.Contains(val3))
15114 ((IDisposable)enumerator).Dispose();
15117 perfStats.skinnedMeshCount =
new Nullable<int>(num);
15118 perfStats.boneCount =
new Nullable<int>(num3);
15119 perfStats.materialCount =
new Nullable<int>(perfStats.
materialCount.GetValueOrDefault() + num2);
15130 IEnumerator<Renderer> enumerator = renderers.GetEnumerator();
15133 while (((IEnumerator)enumerator).MoveNext())
15135 Renderer current = enumerator.Current;
15136 MeshRenderer val = (MeshRenderer)(
object)((current is MeshRenderer) ? current :
null);
15137 if ((Object)(object)val == (Object)
null)
15142 MeshFilter component = ((Component)val).GetComponent<MeshFilter>();
15143 if (!((Object)(object)component == (Object)
null))
15145 Mesh sharedMesh = component.sharedMesh;
15146 if ((Object)(object)sharedMesh != (Object)
null)
15148 num2 += sharedMesh.subMeshCount;
15155 if (enumerator !=
null)
15157 ((IDisposable)enumerator).Dispose();
15160 perfStats.meshCount =
new Nullable<int>(num);
15161 perfStats.materialCount =
new Nullable<int>(perfStats.
materialCount.GetValueOrDefault() + num2);
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;
15245 [CompilerGenerated]
15250 internal bool <RunPerformanceScanEnumerator>
b__0(ParticleSystem c)
15252 return shouldIgnoreComponent((Component)(
object)c);
15256 [IteratorStateMachine()]
15261 shouldIgnoreComponent = shouldIgnoreComponent
15263 List<ParticleSystem> particleSystemBuffer =
new List<ParticleSystem>();
15264 yield
return ScanAvatarForComponentsOfType<ParticleSystem>(avatarObject, particleSystemBuffer);
15265 if (CS$<>8__locals0.shouldIgnoreComponent !=
null)
15267 particleSystemBuffer.RemoveAll((Predicate<ParticleSystem>)((ParticleSystem c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)c)));
15341 bool flag2 =
false;
15343 IEnumerator<ParticleSystem> enumerator = particleSystems.GetEnumerator();
15346 while (((IEnumerator)enumerator).MoveNext())
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)
15354 EmissionModule emission = current.emission;
15355 MinMaxCurve val = ((EmissionModule)(ref emission)).rateOverTime;
15356 if (((MinMaxCurve)(ref val)).curve ==
null)
15359 emission = current.emission;
15360 val = ((EmissionModule)(ref emission)).rateOverTime;
15361 num5 = num6 + Mathf.CeilToInt(((MinMaxCurve)(ref val)).constant);
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++)
15371 Keyframe val2 = keys[i];
15372 if (((Keyframe)(ref val2)).value > num7)
15374 num7 = ((Keyframe)(ref val2)).value;
15379 emission = current.emission;
15380 num5 = num8 + Mathf.CeilToInt(num9 * ((EmissionModule)(ref emission)).rateOverTimeMultiplier);
15382 emission = current.emission;
15383 val = ((EmissionModule)(ref emission)).rateOverDistance;
15384 if (((MinMaxCurve)(ref val)).curve ==
null)
15387 emission = current.emission;
15388 val = ((EmissionModule)(ref emission)).rateOverDistance;
15389 num5 = num10 + Mathf.CeilToInt(((MinMaxCurve)(ref val)).constantMax);
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++)
15399 Keyframe val3 = keys[i];
15400 if (((Keyframe)(ref val3)).value > num11)
15402 num11 = ((Keyframe)(ref val3)).value;
15406 float num13 = num11;
15407 emission = current.emission;
15408 num5 = num12 + Mathf.CeilToInt(num13 * ((EmissionModule)(ref emission)).rateOverDistanceMultiplier);
15414 emission = current.emission;
15415 if (num15 < ((EmissionModule)(ref emission)).burstCount)
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));
15426 else if (num5 <= 0)
15431 num2 += (uint)num5;
15432 ParticleSystemRenderer component = ((Component)current).GetComponent<ParticleSystemRenderer>();
15433 if ((Object)(object)component == (Object)
null)
15438 if ((
int)component.renderMode == 4 && component.meshCount > 0)
15441 Mesh[] array = (Mesh[])(
object)
new Mesh[component.meshCount];
15442 int meshes = component.GetMeshes(array);
15443 for (
int j = 0; j < meshes; j++)
15445 Mesh val4 = array[j];
15446 if (!((Object)(object)val4 == (Object)
null))
15449 if (meshTriangleCount > num16)
15451 num16 = meshTriangleCount;
15455 ulong num17 = (uint)num5 * num16;
15458 TrailModule trails = current.trails;
15459 if (((TrailModule)(ref trails)).enabled)
15464 CollisionModule collision = current.collision;
15465 if (((CollisionModule)(ref collision)).enabled)
15473 if (enumerator !=
null)
15475 ((IDisposable)enumerator).Dispose();
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);
15488 [CompilerGenerated]
15493 internal bool <RunPerformanceScanEnumerator>
b__0(Collider o)
15495 if (shouldIgnoreComponent !=
null && shouldIgnoreComponent((Component)(
object)o))
15506 internal bool <RunPerformanceScanEnumerator>
b__1(Rigidbody o)
15508 if (shouldIgnoreComponent !=
null && shouldIgnoreComponent((Component)(
object)o))
15520 [IteratorStateMachine()]
15525 shouldIgnoreComponent = shouldIgnoreComponent
15527 List<Collider> colliderBuffer =
new List<Collider>();
15528 yield
return ScanAvatarForComponentsOfType<Collider>(avatarObject, colliderBuffer);
15529 colliderBuffer.RemoveAll((Predicate<Collider>)delegate(Collider o)
15531 if (CS$<>8__locals0.shouldIgnoreComponent !=
null && CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)o))
15535 return HasStation((Component)(
object)o) ?
true :
false;
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)
15542 if (CS$<>8__locals0.shouldIgnoreComponent !=
null && CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)o))
15546 return HasStation((Component)(
object)o) ?
true :
false;
15548 perfStats.physicsRigidbodyCount =
new Nullable<int>(rigidbodyBuffer.Count);
15554 if (!comp.TryGetComponent<
VRCStation>(ref vRCStation))
15559 return performanceScannerPlaceholder.type == typeof(
VRCStation);
15568 [CompilerGenerated]
15573 internal bool <RunPerformanceScanEnumerator>
b__0(TrailRenderer c)
15575 return shouldIgnoreComponent((Component)(
object)c);
15579 [IteratorStateMachine()]
15584 shouldIgnoreComponent = shouldIgnoreComponent
15586 List<TrailRenderer> trailRendererBuffer =
new List<TrailRenderer>();
15587 yield
return ScanAvatarForComponentsOfType<TrailRenderer>(avatarObject, trailRendererBuffer);
15588 if (CS$<>8__locals0.shouldIgnoreComponent !=
null)
15590 trailRendererBuffer.RemoveAll((Predicate<TrailRenderer>)((TrailRenderer c) => CS$<>8__locals0.shouldIgnoreComponent((Component)(
object)c)));
15592 int count = trailRendererBuffer.Count;
15593 perfStats.trailRendererCount =
new Nullable<int>(count);
15594 perfStats.materialCount =
new Nullable<int>(perfStats.
materialCount.GetValueOrDefault() + count);
15604 [IteratorStateMachine()]
15607 if ((Object)(
object)target == (Object)
null)
15611 T[] componentsInChildren = target.GetComponentsInChildren<T>(
true);
15612 foreach (T val
in componentsInChildren)
15614 if (!((Object)(
object)val == (Object)
null) && !((Object)(
object)((Component)val).gameObject == (Object)
null))
15621 [IteratorStateMachine()]
15625 Object.Destroy((Object)(
object)targetComponent);
15629 [IteratorStateMachine()]
15632 if ((Object)(
object)targetComponent == (Object)
null)
15636 Component[] components = targetComponent.GetComponents<Component>();
15637 if (components ==
null || components.Length == 0)
15641 Type componentType = ((Object)targetComponent).GetType();
15642 Component[] array = components;
15643 foreach (Component val
in array)
15645 if ((Object)(object)val == (Object)
null)
15650 object[] customAttributes = ((MemberInfo)((Object)val).GetType()).GetCustomAttributes(typeof(RequireComponent),
true);
15651 if (customAttributes.Length == 0)
15655 object[] array2 = customAttributes;
15656 foreach (
object obj
in array2)
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)))
15678 [field: CompilerGenerated]
15681 [CompilerGenerated]
15741 this.data1 =
data1;
15742 this.data2 =
data2;
15760 this.value =
value;
15782 string text = (Object.op_Implicit((Object)(
object)
gameObject) ? ((Object)
gameObject).name : String.Empty);
15784 return String.Format(
"{0}: {1} [{2}]", (
object)
ID, (object)text, (
object)text2);
15811 return String.Format(
"{0} at {1}", (
object)
error, (
object)
location);
15815 [CompilerGenerated]
15822 public Dictionary<GameObject, NetworkIDPair>
idMap;
15830 Component val = (Component)((nid is Component) ? nid :
null);
15831 if (val !=
null && Object.op_Implicit((Object)(
object)val.gameObject))
15833 return curScene == val.gameObject.scene;
15840 return Enumerable.Contains<
SetError>((IEnumerable<SetError>)(
object)errorsToIgnore, err.
error);
15845 return idMap[((Component)((nid is Component) ? nid :
null)).gameObject];
15849 [CompilerGenerated]
15858 if (pair.
ID == curId)
15860 return (Object)(object)pair.
gameObject != (Object)(object)source;
15872 string text = ((Object)t).name;
15873 Transform parent = t.parent;
15874 while ((Object)(object)parent != (Object)
null)
15876 text = String.Concat(((Object)parent).name,
"/", text);
15877 parent = parent.parent;
15879 return String.Concat(
"/", text);
15884 return GetSerializedTypes(((Component)((NetworkID is Component) ? NetworkID :
null)).gameObject);
15904 CS$<>8__locals0.errorsToIgnore = errorsToIgnore;
15905 errors =
new List<SetErrorLocation>();
15908 container.NetworkIDCollection =
new List<NetworkIDPair>();
15910 CS$<>8__locals0.curScene = ((Component)((container is Component) ? container :
null)).gameObject.scene;
15912 CS$<>8__locals0.idMap =
new Dictionary<GameObject, NetworkIDPair>();
15913 CS$<>8__locals0.idMapReverse =
new Dictionary<int, GameObject>();
15917 while (enumerator.MoveNext())
15920 if (!Object.op_Implicit((Object)(
object)current.
gameObject) || current.
gameObject.scene != CS$<>8__locals0.curScene)
15929 if (current.
ID < 10 || current.
ID >= 100000)
15938 CS$<>8__locals0.idMap[current.
gameObject] = current;
15939 CS$<>8__locals0.idMapReverse[current.
ID] = current.
gameObject;
15940 if (current.
ID >= num)
15942 num = current.ID + 1;
15948 ((IDisposable)enumerator).Dispose();
15950 Debug.LogWarningFormat(
"Recovered {0} Network IDs from {1}", (
object[])(object)
new Object[2]
15952 (object)CS$<>8__locals0.idMap.Count,
15953 (Object)((Object)((container is Component) ? container :
null)).name
15955 List<INetworkID> val =
new List<INetworkID>();
15956 List<NetworkIDPair> val2 =
new List<NetworkIDPair>();
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)
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();
15969 while (enumerator2.MoveNext())
15972 if (TrySetID(current2, ref num, ref errors, out var newIDPair2) && newIDPair2 !=
null)
15974 val2.Add(newIDPair2);
15980 ((IDisposable)enumerator2).Dispose();
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)
15990 return Enumerable.SequenceEqual<
string>((IEnumerable<string>)(
object)idInfo.
SerializedTypeNames, (IEnumerable<string>)(
object)typeNames);
15994 void findNextFree()
15996 while (CS$<>8__locals0.idMapReverse.ContainsKey(P_0.curId) && P_0.curId < 100000)
16001 int FindNextFreeID(
int curId)
16005 if (curId >= 100000)
16010 if (curId >= 100000)
16012 throw new ApplicationException(
"Ran out of Network IDs!");
16016 bool TrySetID(
INetworkID NetworkID, ref
int refId, ref List<SetErrorLocation> errors, out
NetworkIDPair newIDPair)
16020 source = ((Component)((NetworkID is Component) ? NetworkID :
null)).gameObject
16023 CS$<>8__locals1.curId = refId;
16025 if (CS$<>8__locals1.curId < 10 || CS$<>8__locals1.curId >= 100000)
16032 gameObject = CS$<>8__locals1.source,
16033 ID = CS$<>8__locals1.curId
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)
16046 gameObject = CS$<>8__locals1.source,
16047 ID = CS$<>8__locals1.curId
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))
16054 if (CS$<>8__locals0.idMap.TryGetValue(CS$<>8__locals1.source, ref networkIDPair))
16056 if (!DoTypesMatch(networkIDPair, serializedTypes))
16060 error =
SetError.IncompatibleTypes,
16061 location = networkIDPair
16069 gameObject = CS$<>8__locals1.source,
16070 ID = CS$<>8__locals1.curId,
16071 SerializedTypeNames = serializedTypes
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);
16093 private Type _type;
16107 TypeInfo = ((Object)value).ToString();
void< ExecuteComputeShader > b__0(AsyncGPUReadbackRequest req)
static bool ComputeShaderReady
static int OutputProperty
static DPIDMipmapper Instance
static void GenerateDPIDMipmapsFast(Texture2D texture, bool alphaIsTransparency, bool sRGB, bool conservative=false, bool normalMap=false)
static int TmpGuidanceProperty
static void GenerateDPIDMipmapsQuality(Texture2D input, Texture2D output, bool alphaIsTransparency, bool sRGB, bool conservative=false, bool normalMap=false)
ComputeShader computeShader
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)
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)
static ulong GetUnitSize(this FileSizeUnit unit)
const string UnitPostfixB
const string UnitPostfixKB
static bool TryParse(string unitText, out FileSizeUnit unitLiteral)
static string GetPostfix(this FileSizeUnit unit)
const string UnitPostfixGB
const string UnitPostfixTB
const string UnitPostfixMB
void< DownloadImageInternal > b__0(AsyncOperation _)
Action< ImageLoadError > onImageDownloadFailed
Action< Texture2D > onImageDownload
UnityWebRequest imageRequest
static ImageDownloader Instance
readonly List< string > cachedImageQueue
void TrimCacheInternal(int size)
static void DownloadImage(string imageUrl, int imageSize, Action< Texture2D > onImageDownload=null, Action< ImageLoadError > onImageDownloadFailed=null, string fallbackImageUrl="", bool isRetry=false)
const int MIN_CACHED_IMAGES
void CacheTexture(string cacheRef, Texture2D tex)
void DownloadImageInternal(string imageUrl, int imageSize, Action< Texture2D > onImageDownload, Action< ImageLoadError > onImageDownloadFailed, string fallbackImageUrl="", bool isRetry=false)
const int MAX_CACHED_IMAGES
void DownloadFallbackOrUseErrorImage(string fallbackImageUrl, Action< Texture2D > onImageDownload)
static void TrimCache(int size)
CurveAttribute(float PosX, float PosY, float RangeX, float RangeY)
HelpBoxAttribute(string text, MessageType messageType=MessageType.None)
static float AngleClosestBetweenTwoUnitVectors(Vector3 planeNormal, Vector3 vectorA, Vector3 vectorB)
static float AngleBetweenTwoUnitVectors(Vector3 planeNormal, Vector3 vectorA, Vector3 vectorB)
static float ClosestPointOnLineSegment_Value(Vector3 lineA, Vector3 lineB, Vector3 point)
static Vector3 ClosestPointOnLineSegment(Vector3 lineA, Vector3 lineB, Vector3 point)
static Vector3 ClosestPointOnPlane(Vector3 planeOrigin, Vector3 planeNormal, Vector3 point)
bool< ConfigureNetworkIDs > b__4(SetErrorLocation err)
NetworkIDPair< ConfigureNetworkIDs > b__5(INetworkID nid)
Dictionary< GameObject, NetworkIDPair > idMap
Dictionary< int, GameObject > idMapReverse
bool< ConfigureNetworkIDs > b__0(INetworkID nid)
SetError[] errorsToIgnore
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)
override string ToString()
List< string > SerializedTypeNames
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)
static void ActivateAreaMarkerLabel(Transform targetObject, string text)
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)
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)
static void ActivateControllerLabel(ControllerHand hand, ControllerInputUI controllerPart, string text, float duration, int priority)
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)
static void DeactivateControllerLabel(ControllerHand hand, ControllerInputUI controllerPart)
delegate void DeactivateObjectLabelDelegate(Transform targetObject)
static bool IsValid(object obj)
static void SetIsClient()
static void ShuffleArray(int[] array)
virtual void Execute(VRCUrl parameter)
virtual void Execute(int parameter)
virtual void Execute(string parameter)
static void Blit(Texture source, RenderTexture dest, Material mat)
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties)
static void Blit(Texture source, RenderTexture dest, Material mat, int pass=-1)
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer, Camera camera)
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows)
static void CheckBlitTarget(RenderTexture dest)
static void Blit(Texture source, RenderTexture dest, int sourceDepthSlice, int destDepthSlice)
static void Blit(Texture source, Material mat, int pass, int destDepthSlice)
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows, int layer)
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count, MaterialPropertyBlock properties, ShadowCastingMode castShadows, bool receiveShadows)
static LayerMask GetLayerMask()
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)
static void Blit(Texture source, RenderTexture dest, Vector2 scale, Vector2 offset, int sourceDepthSlice, int destDepthSlice)
static void Blit(Texture source, RenderTexture dest, Vector2 scale, Vector2 offset)
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices)
static void DrawMeshInstanced(Mesh mesh, int submeshIndex, Material material, Matrix4x4[] matrices, int count)
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)
static void Blit(Texture source, RenderTexture dest)
You can interact with Players in your world through the VRCPlayerApi. Each Player has a VRCPlayerApi ...
static BoolDelegate IsGrounded
bool isLocal
Tells you whether the given Player is the local one.
string displayName
Get the name displayed for the Player (can be different than Username, which is used to log into VRCh...
void CombatSetRespawn(bool respawnOnDeath, float respawnTimer, Transform respawnLocation)
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 ...
void SetVoiceGain(float gain)
Add boost to the Player's voice in decibels.
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 ...
bool IsPlayerGrounded()
Get whether the player is touching the ground, which enables Jump.
void SetStrafeSpeed(float speed=2f)
The speed at which a Player can strafe around your world. Players speed when strafing is not affected...
delegate Ray GetLookRayDelegate(VRCPlayerApi player)
float GetWalkSpeed()
The speed at which a Player can walk around your world.
static VRCPlayerApi GetPlayerById(int playerId)
Get a VRCPlayerApi object for the given player Id if it exists.
Quaternion GetBoneRotation(HumanBodyBones tt)
Gets the rotation of the specified Bone in the Player's Avatar, or Quaternion.Identity (0,...
void SetAvatarAudioGain(float gain)
Set the Maximum Gain allowed on Avatar Audio.
void CombatSetDamageGraphic(GameObject prefab)
bool isMaster
Tells you whether the given Player is the instance master.
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...
void SetAvatarAudioForceSpatial(bool force)
If this is on, then Spatialization is enabled for the source, and the spatialBlend is set to 1.
float GetRunSpeed()
The speed at which a Player can run around your world.
IVRC_Destructible CombatGetDestructible()
float GetAvatarEyeHeightMaximumAsMeters()
Returns the maximum eye height that the local player is permitted to scale themselves to in the playe...
float GetVoiceDistanceNear()
VRC_Pickup GetPickupInHand(VRC_Pickup.PickupHand hand)
Gets the pickup a Player is holding in the specified hand. Only works for the Local Player.
void Respawn(int spawnsIndex)
Respawns the player
void SetNamePlateVisibility(bool flag)
Quaternion GetRotation()
Gets the rotation of the Player in world space.
void SetInvisibleToTagged(bool invisible, string tagName, string tagValue="")
void SetWalkSpeed(float speed=2f)
The speed at which a Player can walk around your world.
void SetRunSpeed(float speed=4f)
The speed at which a Player can run around your world.
void SetJumpImpulse(float impulse=3f)
How much force applied when a player jumps. Set this if you want to enable jump in your world....
void SetSilencedToUntagged(int level, string tagName, string tagValue="")
void SetGravityStrength(float strength=1f)
Multiplier for the Gravity force of the world (set to Earth's default).
static List< VRCPlayerApi > sPlayers
void SetAvatarEyeHeightByMultiplier(float scaleMultiplier)
Sets the eye height using a multiplier of the target player's avatar eye height at its prefab scale....
bool IsUserInVR()
Tells you whether a Player is using a VR headset.
void EnablePickups(bool enable)
Turn off the Player's ability to pickup and use VRCPickup objects in the world. This property is on b...
float GetAvatarEyeHeightMinimumAsMeters()
Returns the minimum eye height in meters that the local player is permitted to scale themselves to in...
bool IsOwner(GameObject obj)
Tells you whether a Player is the Owner of a given GameObject, important for Sync.
bool GetManualAvatarScalingAllowed()
Checks if the local player is allowed to control their avatar scale.
void TeleportTo(Vector3 teleportPos, Quaternion teleportRot)
Send a player to a new spot and specified rotation, unless a Station does not allow it.
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...
void ClearPlayerTags()
Remove all tags that you've set on this player.
Transform GetBoneTransform(HumanBodyBones tt)
Gets the transform of a bone in the Player's Avatar. Currently unusable in Udon, use VRC....
void CombatSetMaxHitpoints(float maxHp)
delegate void ClaimNetworkControlDelegate(VRCPlayerApi player, VRC_ObjectApi obj)
void Respawn()
Respawns the player
static List< VRCPlayerApi > AllPlayers
Gets all the players in the instance as a list. Currently unusable in udon
void TakeOwnership(GameObject obj)
bool isInstanceOwner
If the player is the owner of the instance. This isnt as straightforward as it seems,...
void PlayHapticEventInHand(VRC_Pickup.PickupHand hand, float duration, float amplitude, float frequency)
Vibrate the Player's Haptic controllers if they have them.
static SetAnimatorBoolDelegate SetAnimatorBool
void CombatSetCurrentHitpoints(float hp)
string GetPlayerTag(string tagName)
Gets the value of a tag that was set with SetPlayerTag.
static ClaimNetworkControlDelegate ClaimNetworkControl
void SetAvatarAudioCustomCurve(bool allow)
This sets whether the audio source should use a pre-configured custom curve??????
List< int > GetPlayersWithTag(string tagName, string tagValue="")
NOT CURRENTLY FUNCTIONAL! DO NOT USE, WILL THROW EXPOSURE EXCEPTION!
void SetAvatarEyeHeightMaximumByMeters(float scaleMeters)
Sets the maximum eye height in meters that the local player is permitted to scale themselves to in th...
Vector3 GetPosition()
Gets the position of the Player in world space.
void SetAvatarAudioFarRadius(float distance)
This sets the maximum end of the range for hearing the avatar's audio.
float GetStrafeSpeed()
The speed at which a Player can strafe around your world.
void SetVelocity(Vector3 velocity)
Set the speed and direction of the player's movement.
int playerId
Get the cached PlayerId, calls GetPlayerId if it hasn't been cached yet.
void SetManualAvatarScalingAllowed(bool enabled)
Toggles between player-controlled and world-authoritative scaling modes.
void SetSilencedToTagged(int level, string tagName, string tagValue="")
bool isModerator
if the player is a moderator. Currently unusable in udon
void PushAnimations(RuntimeAnimatorController animations)
void UseAttachedStation()
Makes the player get into the Station which is on the same GameObject as this UdonBehaviour.
static VRCPlayerApi GetPlayerByGameObject(GameObject playerGameObject)
void SetAvatarAudioNearRadius(float distance)
This sets the minimum start of the range for hearing the avatar's audio.
static int GetPlayerCount()
Gets the number of Players in the instance when it is called.
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.
static int GetPlayerId(VRCPlayerApi player)
Gets the Player's Network Id from the source.
void SetPickupInHand(VRC_Pickup pickup, VRC_Pickup.PickupHand hand)
GameObject[] GetPlayerObjects()
void RestoreNamePlateColor()
void SetAvatarAudioVolumetricRadius(float radius)
Set the Volumetric Radius of the Avatar's Audio.
void SetVoiceVolumetricRadius(float radius)
A player's voice is normally simulated to be a point source, however changing this value allows the s...
Vector3 GetVelocity()
Get the speed and direction of the player's movement.
void SetAvatarEyeHeightMinimumByMeters(float scaleMeters)
Sets the minimum height in meters that the local player is permitted to scale themselves to in the pl...
float CombatGetCurrentHitpoints()
NOT IMPLEMENTED AND NON-FUNCTIONAL! DO NOT USE!
bool IsValid()
If a player has left since you saved a reference to them, this will return False.
TrackingDataType
The specific type of tracking data to get, IE hand position, head position, etc.
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.
void SetInvisibleToUntagged(bool invisible, string tagName, string tagValue="")
float GetGravityStrength()
Multiplier for the Gravity force of the world (set to Earth's default).
Component FindComponentInPlayerObjects(Component referenceComponent)
static GetLookRayDelegate GetLookRay
bool isSuper
if the player is a super user? Currently unusable in udon
void Immobilize(bool immobile)
Keeps a Player stuck in place, turning off their Locomotion.
static string[] GetAvailableLanguages()
Gets all available languages a player can select, in RFC 5646 format.
void RestoreNamePlateVisibility()
float GetVoiceVolumetricRadius()
void SetVoiceLowpass(bool enabled)
Disables the low-pass filter on the player's voice.
void UseLegacyLocomotion()
WARNING: This method is not recommended to be used. turns on legacy locomotion for this player.
void SetVoiceDistanceNear(float near)
The near radius, in meters, where volume begins to fall off. It is strongly recommended to leave the ...
Vector3 GetBonePosition(HumanBodyBones tt)
Gets the position of the specified Bone in the Player's Avatar, or Vector3.Zero (0,...
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.
float GetAvatarEyeHeightAsMeters()
Returns the configured eye height for the target player's avatar. This function works for the local p...
float GetVoiceDistanceFar()
float GetJumpImpulse()
How much force applied when a player jumps.
void SetNamePlateColor(Color col)
static string GetCurrentLanguage()
Gets the selected language of the local user, in RFC 5646 format.
static Action< RenderTexture > m_OnReleaseTemporaryRenderTexture
static Action< RenderTexture > OnReleaseTemporaryRenderTexture
static void ReleaseTemporary(RenderTexture renderTexture)
static RenderTexture GetTemporary(RenderTextureDescriptor renderTextureDescriptor)
static Action< RenderTexture > OnGetTemporaryRenderTexture
static Action< RenderTexture > m_OnGetTemporaryRenderTexture
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)
static void ValidateAgainstPropertyIDWhitelist(int nameID)
static void ClearGlobalVariableWhitelist()
static int PropertyToID(string name)
static void SetGlobalMatrixArray(int nameID, Matrix4x4[] value)
static void SetGlobalColor(int nameID, Color value)
static void SetGlobalVector(int nameID, Vector4 value)
static Action< int, ShaderVariableType > OnSetGlobalShaderVariable
static void SetGlobalVectorArray(int nameID, Vector4[] value)
static Action< int, ShaderVariableType > m_OnSetGlobalShaderVariable
static void SetGlobalTexture(int nameID, Texture value)
static void SetGlobalMatrix(int nameID, Matrix4x4 value)
static void SetGlobalFloat(int nameID, float value)
static void SetGlobalFloatArray(int nameID, float[] value)
static void SetGlobalInteger(int nameID, int value)
static Action< VRCStation, VRCPlayerApi > useStationDelegate
void UseStation(VRCPlayerApi player)
Transform stationEnterPlayerLocation
Transform stationExitPlayerLocation
VRC_ObjectApi controlsObject
void ExitStation(VRCPlayerApi player)
RuntimeAnimatorController animatorController
static InitializationDelegate Initialize
delegate void InitializationDelegate(VRCStation obj)
static Action< VRCStation, VRCPlayerApi > exitStationDelegate
void OnTriggerExit(Collider col)
void OnTriggerEnter(Collider col)
static Action< VRCTriggerRelay > Initialize
bool< IsAllowlistedUri > b__0(string d)
Represents a URL that can be used to load at runtime. Cannot be constructed at runtime,...
static bool IsAllowlistedUri(Uri uri)
bool Equals(VRCUrl other)
static bool IsNullOrEmpty(VRCUrl vrcUrl)
override bool Equals(object obj)
override int GetHashCode()
override string ToString()
static bool TryCreateAllowlistedVRCUrl(string url, out VRCUrl vrcUrl)
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
delegate void ApplySettingsDelegate(VRC_AnimatorLayerControl control, Animator animator)
static InitializationDelegate Initialize
ApplySettingsDelegate ApplySettings
delegate void InitializationDelegate(VRC_AnimatorLayerControl obj)
static InitializationDelegate Initialize
delegate void ApplySettingsDelegate(VRC_AnimatorLocomotionControl control, Animator animator)
delegate void InitializationDelegate(VRC_AnimatorLocomotionControl obj)
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
ApplySettingsDelegate ApplySettings
This behavior modifies an AudioSource when transitioning to the animation state. It can change the au...
delegate void InitializationDelegate(VRC_AnimatorPlayAudio obj)
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
This is not documented properly yet
AudioClip[] Clips
A list of AudioClips that can be applied to the AudioSource when transitioning to this state.
ApplySettings PitchApplySettings
How to apply the pitch setting
ApplySettings
Determines when the settings are applied to the audio source.
float DelayInSeconds
The delay before "Play On Enter" plays a clip, if enabled. Clamped from 0 to 60 seconds....
ApplySettings ClipsApplySettings
How to apply the clip setting
bool Loop
Whether the AudioSource's looping should be set enabled or disabled when transitioning to this state.
bool StopOnExit
To stop the audio source on exit
bool StopOnEnter
To stop the audio source on enter
ApplySettings VolumeApplySettings
How to apply the volume setting
static InitializationDelegate Initialize
bool ShouldApplyLoop
This is not documented properly yet
EnterStateDelegate EnterState
Order
The order in which audio clips are chosen.
bool PlayOnEnter
To play the audiosource on enter, after possibly stopping it first
string ParameterName
The name of the "int" type avatar parameter that determines which audio clip is chosen....
Order PlaybackOrder
Determines which audio clip is chosen when transitioning to this state.
Vector2 Volume
The random volume range for the AudioSource.
delegate void EnterStateDelegate(VRC_AnimatorPlayAudio control, Animator animator)
bool ShouldApplyClip
This is not documented properly yet
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...
ExitStateDelegate ExitState
string SourcePath
The path to the AudioSource relative to the avatar's root transform. If the AudioSource is not found ...
Vector2 Pitch
The random pitch range for the AudioSource.
int playbackIndex
This is not documented properly yet
ApplySettings LoopApplySettings
How to apply the looping setting
bool ShouldApplyVolume
This is not documented properly yet
override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
This is not documented properly yet
object destParam
This is not documented properly yet
bool ShouldApplySetting(ApplySettings setting)
This is not documented properly yet
bool ShouldApplyPitch
This is not documented properly yet
bool PlayOnExit
To play the audio source on exit
ApplySettingsDelegate ApplySettings
static InitializationDelegate Initialize
override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
delegate void ApplySettingsDelegate(VRC_AnimatorTemporaryPoseSpace view, Animator animator)
delegate void InitializationDelegate(VRC_AnimatorTemporaryPoseSpace obj)
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
TrackingType trackingLeftHand
TrackingType trackingRightFoot
TrackingType trackingLeftFingers
static InitializationDelegate Initialize
TrackingType trackingRightFingers
TrackingType trackingEyes
delegate void ApplySettingsDelegate(VRC_AnimatorTrackingControl control, Animator animator)
TrackingType trackingMouth
TrackingType trackingLeftFoot
TrackingType trackingRightHand
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
delegate void InitializationDelegate(VRC_AnimatorTrackingControl obj)
ApplySettingsDelegate ApplySettings
TrackingType trackingHead
List< NetworkIDPair > NetworkIDCollection
void GetNetworkIDObjects(List< INetworkID > netIds)
void OnDrawGizmosSelected()
string[] VisemeBlendShapes
void PositionPortraitCamera(Transform cam)
string MouthOpenBlendShapeName
GameObject FindNetworkIDGameObject(string path)
Quaternion portraitCameraRotationOffset
List< NetworkIDPair > networkIDs
SkinnedMeshRenderer VisemeSkinnedMesh
Quaternion lipSyncJawOpen
Quaternion lipSyncJawClosed
string GetNetworkIDGameObjectPath(GameObject obj)
Vector3 portraitCameraPositionOffset
List< Parameter > parameters
static Action< VRC_AvatarParameterDriver, Animator > OnApplySettings
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
bool grantBlueprintAccess
virtual void SwitchAvatar(string id)
void SetAvatarUse(VRCPlayerApi instigator)
static InstantiationDelegate Instantiate
virtual void SwitchAvatar(string id, VRCPlayerApi instigator)
Action OnReceiveAvatarImage
delegate Object InstantiationDelegate(Object prefab)
VRC_DataStorage dataStorage
MonoBehaviour serializeComponent
byte[] valueSerializedBytes
delegate void DataElementDelegate(VRC_DataStorage obj, int idx)
static SerializationDelegate Serialize
int GetElementIndex(string name)
delegate void InitializationDelegate(VRC_DataStorage obj)
void OnDataElementChanged(int idx)
static DeserializationDelegate Deserialize
VrcDataElement GetElement(string name)
delegate bool DeserializationDelegate(VrcDataElement ds, out object obj)
static InitializationDelegate Initialize
DataElementDelegate m_ElementChanged
delegate bool SerializationDelegate(VrcDataElement ds, object obj)
VRC_EventHandler.VrcEvent onDestructedEvent
VRC_EventHandler.VrcEvent onFullHealedEvent
void ApplyDamage(float damage)
VRC_EventHandler.VrcEvent spawnerOnDamagedEvent
VRC_Trigger spawnerOnFullHealedTrigger
void ApplyHealing(float healing)
VRC_Trigger onDamagedTrigger
VRC_EventHandler.VrcEvent spawnerOnFullHealedEvent
VRC_Trigger spawnerOnDestructedTrigger
void SetState(object[] state)
VRC_Trigger onDestructedTrigger
VRC_Trigger spawnerOnHealedTrigger
VRC_EventHandler.VrcEvent spawnerOnHealedEvent
VRC_Trigger onFullHealedTrigger
VRC_EventHandler.VrcEvent spawnerOnDestructedEvent
VRC_Trigger spawnerOnDamagedTrigger
void HandleCallbackTrigger(VRC_Trigger trigger, VRC_EventHandler.VrcEvent e)
VRC_EventHandler eventHandler
VRC_EventHandler.VrcEvent onHealedEvent
VRC_EventHandler.VrcEvent onDamagedEvent
VRC_Trigger onHealedTrigger
override void UnregisterEventHandler(VRC_EventHandler handler)
override void TriggerEvent(VRC_EventHandler handler, VRC_EventHandler.VrcEvent e, VRC_EventHandler.VrcBroadcastType broadcast, int instagatorId, float fastForward)
override string GetGameObjectPath(GameObject go)
override void RegisterEventHandler(VRC_EventHandler handler)
override GameObject FindGameObject(string path, bool suppressErrors)
abstract GameObject FindGameObject(string path, bool suppressErrors)
virtual GameObject FindGameObject(string path)
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)
VrcBroadcastType broadcast
bool TakeOwnershipOfTarget
Nullable< int > ParameterBytesVersion
GameObject ParameterObject
VrcBooleanOp ParameterBoolOp
GameObject[] ParameterObjects
static LogEventDelegate LogEvent
long GetCombinedNetworkId()
void VrcAnimationEvent(AnimationEvent aEvent)
void TriggerEvent(VrcEvent e, VrcBroadcastType broadcast, GameObject instagator=null, float fastForward=0f)
Coroutine DeferredEventProcessor
static GetNetworkIdDelegate GetInstigatorId
void TriggerEvent(string eventName, VrcBroadcastType broadcast, GameObject instagator=null, int instagatorId=0)
static bool IsReceiverRequiredForEventType(VrcEventType eventType)
static bool BooleanOp(VrcBooleanOp Op, bool Current)
IEnumerator ProcessDeferredEvents()
void TriggerEvent(string eventName, VrcBroadcastType broadcast, GameObject instagator, int instagatorId, float fastForward)
void DeferEvent(VrcEvent e, VrcBroadcastType broadcast, GameObject instagator, float fastForward)
void InternalTriggerEvent(VrcEvent e, VrcBroadcastType broadcast, int instagatorId, float fastForward)
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)
static bool HasEventTrigger(GameObject go)
GameObject leftHandContact
bool leftHandPositionOnly
delegate void InitializationDelegate(VRC_IKFollower obj)
static InitializationDelegate Initialize
delegate void InitializationDelegate(VRC_Interactable obj)
delegate bool ValidDelegate(VRC_Interactable obj, VRCPlayerApi player)
virtual void OnPickupUseUp()
static InitializationDelegate Initialize
GameObject interactTextGO
bool IsInteractiveForPlayer(VRCPlayerApi player)
static ValidDelegate CheckValid
virtual void OnPickupUseDown()
Transform interactTextPlacement
delegate void InitializationDelegate(VRC_KeyEvents obj)
static InitializationDelegate Initialize
VRC_EventHandler.VrcBroadcastType BroadcastType
This is not documented properly yet
Note note
This is not documented properly yet
VRC_Trigger.CustomTriggerTarget OnNoteOn
This is not documented properly yet
Channel channel
This is not documented properly yet
static InitializationDelegate Initialize
delegate void InitializationDelegate(VRC_MidiNoteIn obj)
Note
The MIDI note. 0-127 range number for the note played.
VRC_Trigger.CustomTriggerTarget OnNoteOff
This is not documented properly yet
readonly RenderTexture[] texture
MaterialPropertyBlock propertyBlock
virtual void UpdateCameraClearing(Camera src, Camera mirrorCamera, Skybox mirrorSkybox)
bool ShouldRenderMonoscopic(Camera cam)
Quaternion GetWorldEyeRot(Camera cam, XRNode eye)
void RenderMirrorCameras(Camera currentCamera)
void RenderMirror(RenderTexture targetTexture, Vector3 camPosition, Quaternion camRotation, Matrix4x4 camProjectionMatrix)
static Vector4 Plane(Vector3 pos, Vector3 normal)
void UpdateCameraModes(Camera src)
static Matrix4x4 CalculateReflectionMatrix(Vector4 plane)
static Vector4 CameraSpacePlane(Camera cam, Vector3 pos, Vector3 normal)
void CameraPostRender(Camera currentCamera)
static RenderMirrorEventDelegate m_PreRenderMirror
delegate void RenderMirrorEventDelegate(VRC_MirrorReflection sender)
void OnWillRenderObject()
ReflectionData GetReflectionData(Camera currentCamera)
static RenderMirrorEventDelegate PreRenderMirror
static Quaternion GetRotation(Matrix4x4 matrix)
Vector3 GetNormalDirection()
static RenderMirrorEventDelegate PostRenderMirror
Vector3 GetWorldEyePos(Camera cam, XRNode eye)
bool ShouldRenderRightEye(Camera cam)
void UpdateParentTransform(Camera cam)
Dimension mirrorResolution
static Vector3 GetPosition(Matrix4x4 matrix)
static RenderMirrorEventDelegate m_PostRenderMirror
Matrix4x4 GetEyeProjectionMatrix(Camera cam, XRNode eye)
static void GetAutoResolution(Camera currentCamera, out int width, out int height)
static float CopySign(float sizeValue, float signValue)
bool ShouldRenderLeftEye(Camera cam)
static InstantiationDelegate Initialize
RuntimeAnimatorController customAnimation
delegate void InstantiationDelegate(VRC_NPCSpawn obj)
void SayThis(AudioClip clip, float volume)
delegate void InitializeDelegate(VRC_NpcApi obj)
void SetMuteStatus(bool canSpeak, bool canHear)
void SetNamePlate(bool visible, string playerName, string vipTag)
void SetSocialStatus(bool friend, bool vip, bool blocked)
static InitializeDelegate Initialize
static VRC_NpcApi GetApiByGameObject(GameObject npcGameObject)
void ActThis(int number, bool loop)
void ClaimControl(VRCPlayerApi player)
delegate void ObjectReaperDelegate()
void SpawnObject(Vector3 position, Quaternion rotation)
ObjectReaperDelegate ReapObjects
delegate void InitializationDelegate(VRC_ObjectSpawn obj)
IEnumerable< VRC_EventHandler.VrcEvent > ProvideEvents()
delegate void InstantiationDelegate(Vector3 position, Quaternion rotation)
InstantiationDelegate Instantiate
void DestroySpawnedObjects()
static InitializationDelegate Initialize
IEnumerator ShowPano(int index)
void ShowPanoAt(int index)
List< PanoSpec > panoramas
GameObject[] PhysicsObjects
VRCPlayerApi currentLocalPlayer
PickupOrientation orientation
delegate void OnDestroyedDelegate(VRC_Pickup obj)
IEnumerable< VRC_EventHandler.VrcEvent > ProvideEvents()
static HapticEventDelegate HapticEvent
bool allowManipulationWhenEquipped
Component currentlyHeldBy
delegate void ForceDropDelegate(VRC_Pickup obj)
delegate void AwakeDelegate(VRC_Pickup obj)
VRC_EventHandler.VrcBroadcastType useEventBroadcastType
static AwakeDelegate OnAwake
float ThrowVelocityBoostScale
delegate void HapticEventDelegate(VRC_Pickup obj, float duration, float amplitude, float frequency)
ForceMode MomentumTransferMethod
VRC_EventHandler.VrcBroadcastType pickupDropEventBroadcastType
static ForceDropDelegate ForceDrop
void GenerateHapticEvent(float duration=0.25f, float amplitude=0.5f, float frequency=0.5f)
VRCPlayerApi currentPlayer
static OnDestroyedDelegate OnDestroyed
void Drop(VRCPlayerApi instigator)
float ThrowVelocityBoostMinSpeed
override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
ApplySettingsDelegate ApplySettings
delegate void InitializationDelegate(VRC_PlayableLayerControl obj)
static InitializationDelegate Initialize
delegate void ApplySettingsDelegate(VRC_PlayableLayerControl control, Animator animator)
delegate void InitializationDelegate(VRC_PortalMarker obj)
static InitializationDelegate Initialize
bool initializedWithRoomId
bool useDefaultPresentation
HumanBodyBones mountPoint
delegate void InitializeDelegate(VRC_PropController obj)
delegate void UpdateDelegate(VRC_PropController obj)
int GetInputIndex(string inputName)
VRCPlayerApi controllingPlayer
static UpdateDelegate UpdateInputs
static InitializeDelegate Initialize
RespawnHeightBehaviour ObjectBehaviourAtRespawnHeight
AmbientMode RenderAmbientMode
bool autoSpatializeAudioSources
Color RenderAmbientEquatorColor
static IntializationDelegate Initialize
Color RenderAmbientSkyColor
float RenderFogLinearStart
string GetNetworkIDGameObjectPath(GameObject obj)
static Dictionary< string, GameObject > sDynamicPrefabs
float RenderReflectionIntensity
float RenderFlareStrength
List< string > udonProducts
static Material GetMaterial(string name)
float RenderAmbientIntensity
Color RenderAmbientGroundColor
Texture2D[] LightMapsNear
GameObject ReferenceCamera
DefaultReflectionMode RenderDefaultReflectionMode
void GetNetworkIDObjects(List< INetworkID > netIds)
static Dictionary< string, Material > sDynamicMaterials
static GameObject GetPrefab(string name)
SphericalHarmonicsL2 RenderAmbientProbe
delegate void IntializationDelegate(VRC_SceneDescriptor sceneDescriptor)
GameObject FindNetworkIDGameObject(string path)
float RenderFlareFadeSpeed
void PositionPortraitCamera(Transform cam)
SpawnOrientation spawnOrientation
int RenderDefaultReflectionResolution
int RenderReflectionBounces
Cubemap RenderCustomReflection
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)
bool< IsAllowedType > b__0(Type t)
bool< IsAllowedType > b__1(Type t)
ISerializationSurrogate GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector)
static bool IsAllowedType(Type type)
ISurrogateSelector GetNextSelector()
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)
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 VRC_Serialization()
static GameObject FindGameObject(string path)
IEnumerator StartAutoplayWithDuration(float duration)
void ShowNextImage(int Instigator=0)
void ShowPreviousImage(int Instigator=0)
void StopAutoplayWithDuration(float duration)
void OnDrawGizmosSelected()
delegate void InitializationDelegate(VRC_SpatialAudioSource obj)
bool UseAudioSourceVolumeCurve
bool EnableSpatialization
static InitializationDelegate Initialize
void OnTriggerEnter(Collider other)
delegate void CollisionExitDelegate(VRC_TriggerColliderEventTrigger obj, Collider other)
delegate void CollisionEnterDelegate(VRC_TriggerColliderEventTrigger obj, Collider other)
void OnTriggerExit(Collider other)
static CollisionEnterDelegate CollisionEnter
static CollisionExitDelegate CollisionExit
List< VRC_EventHandler.VrcEvent > Events
VRC_EventHandler.VrcBroadcastType BroadcastType
static TriggerType[] KeyTypes
static TriggerType[] InteractiveTypes
static TriggerType[] TriggerTypes
static TriggerType[] ColliderTypes
static TriggerType[] TimerTypes
static TriggerType[] DataStorageTypes
static TriggerType[] PickupTypes
bool< ExecuteTriggerType > b__0(TriggerEvent t)
bool< ExecuteCustomTrigger > b__0(TriggerEvent t)
void ExecuteCustomTrigger(string name)
List< TriggerEvent > Triggers
void ExecuteTriggerType(TriggerType triggerType)
bool TakesOwnershipIfNecessary
static void TriggerCustom(CustomTriggerTarget target)
override void OnPickupUseDown()
static Action< VRC_Trigger > InitializeTrigger
void OnDrawGizmosSelected()
void ExecuteTriggers(IEnumerable< TriggerEvent > triggers)
static EditorTriggerLineMode EditorGlobalTriggerLineMode
Action< TriggerEvent > ExecuteTrigger
void ResetClock(TriggerEvent timer)
static void Trigger(GameObject obj, TriggerType type)
override void OnPickupUseUp()
static void TriggerCustom(GameObject obj, string name)
void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, ControllerActionUI action, string textSecondary, ControllerActionUI actionSecondary, float duration, int priority, AttachMode attachMode, bool showOffscreen)
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)
void DeactivateObjectLabel(Transform targetObject)
void ActivateObjectLabel(Transform targetObject, TutorialLabelType type, ControllerHand hand, string text, float duration=0.1f, int priority=0, AttachMode attachMode=AttachMode.PositionOnly, bool showOffscreen=false)
void ActivateAreaMarkerLabel(Transform targetObject, string text)
void ActivateControllerLabel(ControllerHand hand, ControllerInputUI controllerPart, string text, float duration, int priority)
void DeactivateControllerLabel(ControllerHand hand, ControllerInputUI controllerPart)
void ShowLabel(bool show)
bool DisableWhenPlayerInRange
delegate Camera GetEventCameraDelegate(GameObject obj)
void OnRectTransformDimensionsChange()
static GetEventCameraDelegate GetEventCamera
static UpdateDelegate UpdateUse
delegate void UpdateDelegate(VRC_UseEvents obj)
void HideDamageIndicator()
void SetDamagePercent(float damagePercent)
void ShowDamageIndicator()
static void CalculateReflectionMatrix(ref Matrix4x4 reflectionMat, Vector4 plane)
void UpdateCameraModes(Camera src, Camera dest)
void CreateWaterObjects(Camera currentCamera, out Camera reflectionCamera, out Camera refractionCamera)
Vector4 CameraSpacePlane(Camera cam, Vector3 pos, Vector3 normal, float sideSign)
int m_OldReflectionTextureSize
static bool s_InsideWater
int m_OldRefractionTextureSize
RenderTexture m_ReflectionTexture
WaterMode FindHardwareWaterSupport()
RenderTexture m_RefractionTexture
void OnWillRenderObject()
void NavigateTo(string uri)
void ReadData(string root, int junk)
Material[] extraVideoScreens
IEnumerable< VRC_EventHandler.VrcEvent > ProvideEvents()
static new InitializeDelegate Initialize
bool BindCall(string function, Delegate handler)
delegate void InitializeDelegate(VRC_WebPanel obj)
AvatarPerformance.IgnoreDelegate shouldIgnoreComponent
bool< RunPerformanceScanEnumerator > b__0(ParticleSystem c)
static void AnalyzeParticleSystemRenderers(IEnumerable< ParticleSystem > particleSystems, AvatarPerformanceStats perfStats)
override IEnumerator RunPerformanceScanEnumerator(GameObject avatarObject, AvatarPerformanceStats perfStats, AvatarPerformance.IgnoreDelegate shouldIgnoreComponent)
bool< FindDerivedTypes > b__0(Type t)
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)
List< Shader > illegalShaders
void< FindIllegalShaders > b__0(Shader c)
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)
const int CONTENT_AVATAR_UNCOMPRESSED_ASSET_BUNDLE_SIZE_LIMIT_PC
static string GetAssetBundleOverSizeLimitMessageSDKWarning(ContentType contentType, int contentSize, bool mobilePlatform, bool compressed=true)
const int CONTENT_AVATAR_UNCOMPRESSED_ASSET_BUNDLE_SIZE_LIMIT_MOBILE
const int CONTENT_AVATAR_ASSET_BUNDLE_SIZE_LIMIT_PC
const int CONTENT_WORLD_UNCOMPRESSED_ASSET_BUNDLE_SIZE_LIMIT_MOBILE
static int GetAssetBundleSizeLimit(ContentType contentType, bool mobilePlatform, bool compressed=true)
const int CONTENT_WORLD_ASSET_BUNDLE_SIZE_LIMIT_MOBILE
const int CONTENT_WORLD_UNCOMPRESSED_ASSET_BUNDLE_SIZE_LIMIT_PC
static string GetAssetBundleOverSizeLimitMessage(ContentType contentType, bool mobilePlatform, bool compressed=true)
const int CONTENT_AVATAR_ASSET_BUNDLE_SIZE_LIMIT_MOBILE
const int CONTENT_WORLD_ASSET_BUNDLE_SIZE_LIMIT_PC
static string GetAssetBundleOverSizeLimitMessage(ContentType contentType, int contentSize, bool mobilePlatform, bool compressed=true)
string GetNetworkIDGameObjectPath(GameObject obj)
GameObject FindNetworkIDGameObject(string path)
List< NetworkIDPair > NetworkIDCollection
void GetNetworkIDObjects(List< INetworkID > netIds)
IEnumerable< VRC_EventHandler.VrcEvent > ProvideEvents()
void ApplyDamage(float damage)
void SetState(object[] state)
void ApplyHealing(float healing)
delegate void MidiRawMessageDelegate(object sender, MidiRawEventArgs args)
delegate void MidiVoiceMessageDelegate(object sender, MidiVoiceEventArgs args)
bool Equals(DisposableJobHandle other)
static IList< DisposableJobHandle > GetIncompleteDisposableJobs()
static void CullCompleteJobs()
static bool operator!=(DisposableJobHandle a, DisposableJobHandle b)
override bool Equals(object obj)
static bool operator==(DisposableJobHandle a, DisposableJobHandle b)
override int GetHashCode()
DisposableJobHandle(JobHandle jobHandle)
MidiRawEventArgs(byte status, byte data1, byte data2)
MidiVoiceEventArgs(int command, int channel, byte number, byte value)
override string ToString()
NetworkIDPair relatedLocation
A struct containing separate Position and Rotation data relating to a player's tracking
Quaternion rotation
The rotation of the player's tracking data
TrackingData(Vector3 pos, Quaternion rot)
Vector3 position
The position of the player's tracking data