diff --git a/Assets/DefaultPrefabObjects.asset b/Assets/DefaultPrefabObjects.asset new file mode 100644 index 0000000..3dee5c0 --- /dev/null +++ b/Assets/DefaultPrefabObjects.asset @@ -0,0 +1,26 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3ad70174b079c2f4ebc7931d3dd1af6f, type: 3} + m_Name: DefaultPrefabObjects + m_EditorClassIdentifier: + _prefabs: + - {fileID: 4320456058255827552, guid: 65cd4fa5e050652409dd9b062365c7e8, type: 3} + - {fileID: 394654179909484550, guid: 46f84e56340e83e4ba7c6abbccd2ae3f, type: 3} + - {fileID: 8475222101369129519, guid: 8cf33e8e99a9b0c4c8f29ff725650de6, type: 3} + - {fileID: 4512293259955182956, guid: 44611030e61220d42ab7c37ba3c0ea92, type: 3} + - {fileID: 4512293259955182956, guid: 0d6d0f48b03b17f49a6340103cd9b9d0, type: 3} + - {fileID: 4512293259955182956, guid: f32d4c19de900e64cb73cedcb8ba6f70, type: 3} + - {fileID: 4512293259955182956, guid: 300370bdf7819da41937e0beac65b32c, type: 3} + - {fileID: 611616139817875448, guid: bf5f023b4017a5e41a9815ec5745df3d, type: 3} + - {fileID: 201277550, guid: 5b712878ecece354ba4ffb026c0a221c, type: 3} + - {fileID: 201277550, guid: 8ef354bfc16ca8a459074c3fa9b6727e, type: 3} + - {fileID: 8192566354860284824, guid: 6331b3542e64a564c81bc39cedf70c8d, type: 3} diff --git a/Assets/DefaultPrefabObjects.asset.meta b/Assets/DefaultPrefabObjects.asset.meta new file mode 100644 index 0000000..e59e552 --- /dev/null +++ b/Assets/DefaultPrefabObjects.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bb50798712a8fcd40b22abbc470201fb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor.meta b/Assets/Editor.meta new file mode 100644 index 0000000..9c8ae2d --- /dev/null +++ b/Assets/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 38a7f445babd57442af500242aa934ed +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet.meta b/Assets/FishNet.meta new file mode 100644 index 0000000..5e5a228 --- /dev/null +++ b/Assets/FishNet.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f1525dbf8ebd59e438b504fa19c4fd6c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating.meta b/Assets/FishNet/CodeGenerating.meta new file mode 100644 index 0000000..e7902b4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a03c3ea914b8ed649a14606e1430e404 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Extension.meta b/Assets/FishNet/CodeGenerating/Extension.meta new file mode 100644 index 0000000..20b1a5c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c2e223f21744b544bbb7e93020199efb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Extension/FieldDefinitionExtensions.cs b/Assets/FishNet/CodeGenerating/Extension/FieldDefinitionExtensions.cs new file mode 100644 index 0000000..14259c8 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/FieldDefinitionExtensions.cs @@ -0,0 +1,22 @@ +using MonoFN.Cecil; + +namespace FishNet.CodeGenerating.Helping.Extension +{ + + internal static class FieldDefinitionExtensions + { + + /// + /// Makes a FieldDefinition generic if it has generic parameters. + /// + public static FieldReference TryMakeGenericInstance(this FieldDefinition fd, CodegenSession session) + { + FieldReference fr = session.ImportReference(fd); + return fr.TryMakeGenericInstance(); + } + + + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Extension/FieldDefinitionExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Extension/FieldDefinitionExtensions.cs.meta new file mode 100644 index 0000000..7d51133 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/FieldDefinitionExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de84fa9739ed55945b58147a773e1740 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Extension/FieldReferenceExtensions.cs b/Assets/FishNet/CodeGenerating/Extension/FieldReferenceExtensions.cs new file mode 100644 index 0000000..bc56f43 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/FieldReferenceExtensions.cs @@ -0,0 +1,40 @@ +using FishNet.CodeGenerating.Extension; +using MonoFN.Cecil; + +namespace FishNet.CodeGenerating.Helping.Extension +{ + + internal static class FieldReferenceExtensions + { + + /// + /// Gets a Resolve favoring cached results first. + /// + internal static FieldDefinition CachedResolve(this FieldReference fieldRef, CodegenSession session) + { + return session.GetClass().GetFieldReferenceResolve(fieldRef); + } + + /// + /// Makes a FieldReference generic if it has generic parameters. + /// + public static FieldReference TryMakeGenericInstance(this FieldReference fr) + { + TypeReference declaringTr = fr.DeclaringType; + + if (declaringTr.HasGenericParameters) + { + GenericInstanceType git = declaringTr.MakeGenericInstanceType(); + FieldReference result = new FieldReference(fr.Name, fr.FieldType, git); + return result; + } + else + { + return fr; + } + } + + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Extension/FieldReferenceExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Extension/FieldReferenceExtensions.cs.meta new file mode 100644 index 0000000..c868340 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/FieldReferenceExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d983ebd0c9e1b745902030c2f7a8e99 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Extension/ILProcessorExtensions.cs b/Assets/FishNet/CodeGenerating/Extension/ILProcessorExtensions.cs new file mode 100644 index 0000000..9d2ecc3 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/ILProcessorExtensions.cs @@ -0,0 +1,28 @@ +using FishNet.CodeGenerating.Helping.Extension; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; + +namespace FishNet.CodeGenerating.Extension +{ + + + internal static class ILProcessorExtensions + { + /// + /// Creates a variable type within the body and returns it's VariableDef. + /// + internal static VariableDefinition CreateVariable(this ILProcessor processor, CodegenSession session, System.Type variableType) + { + return processor.Body.Method.CreateVariable(session, variableType); + } + /// + /// Creates a variable type within the body and returns it's VariableDef. + /// + internal static VariableDefinition CreateVariable(this ILProcessor processor, CodegenSession session, TypeReference variableTr) + { + return processor.Body.Method.CreateVariable(variableTr); + } + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Extension/ILProcessorExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Extension/ILProcessorExtensions.cs.meta new file mode 100644 index 0000000..01e9737 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/ILProcessorExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 127d8312da53b3e49ba9e3e4c6348857 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Extension/MethodDefinitionExtensions.cs b/Assets/FishNet/CodeGenerating/Extension/MethodDefinitionExtensions.cs new file mode 100644 index 0000000..6ec84e9 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/MethodDefinitionExtensions.cs @@ -0,0 +1,235 @@ +using FishNet.CodeGenerating.Helping; +using FishNet.CodeGenerating.Helping.Extension; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Rocks; +using MonoFN.Collections.Generic; +using System.Collections.Generic; + +namespace FishNet.CodeGenerating.Extension +{ + + + internal static class MethodDefinitionExtensions + { + public const MethodAttributes PUBLIC_VIRTUAL_ATTRIBUTES = (MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.HideBySig); + public const MethodAttributes PROTECTED_VIRTUAL_ATTRIBUTES = (MethodAttributes.Family | MethodAttributes.Virtual | MethodAttributes.HideBySig); + + /// + /// Returns a custom attribute. + /// + public static CustomAttribute GetCustomAttribute(this MethodDefinition md, string attributeFullName) + { + if (md == null) + return null; + + foreach (CustomAttribute item in md.CustomAttributes) + { + if (item.AttributeType.FullName == attributeFullName) + return item; + } + + //Not found. + return null; + } + + /// + /// Clears the method content and returns ret. + /// + internal static void ClearMethodWithRet(this MethodDefinition md, CodegenSession session, ModuleDefinition importReturnModule = null) + { + md.Body.Instructions.Clear(); + ILProcessor processor = md.Body.GetILProcessor(); + processor.Add(session.GetClass().CreateRetDefault(md, importReturnModule)); + } + + /// + /// Returns the ParameterDefinition index from end of parameters. + /// + /// + /// + /// + internal static ParameterDefinition GetEndParameter(this MethodDefinition md, int index) + { + //Not enough parameters. + if (md.Parameters.Count < (index + 1)) + return null; + + return md.Parameters[md.Parameters.Count - (index + 1)]; + } + + + /// + /// Creates a variable type within the body and returns it's VariableDef. + /// + internal static VariableDefinition CreateVariable(this MethodDefinition methodDef, TypeReference variableTypeRef) + { + VariableDefinition variableDef = new VariableDefinition(variableTypeRef); + methodDef.Body.Variables.Add(variableDef); + return variableDef; + } + + /// + /// Creates a variable type within the body and returns it's VariableDef. + /// + internal static VariableDefinition CreateVariable(this MethodDefinition methodDef, CodegenSession session, System.Type variableType) + { + return CreateVariable(methodDef, session.GetClass().GetTypeReference(variableType)); + } + + /// + /// Returns the proper OpCode to use for call methods. + /// + public static MonoFN.Cecil.Cil.OpCode GetCallOpCode(this MethodDefinition md) + { + if (md.Attributes.HasFlag(MethodAttributes.Virtual)) + return MonoFN.Cecil.Cil.OpCodes.Callvirt; + else + return MonoFN.Cecil.Cil.OpCodes.Call; + } + /// + /// Returns the proper OpCode to use for call methods. + /// + public static MonoFN.Cecil.Cil.OpCode GetCallOpCode(this MethodReference mr, CodegenSession session) + { + return mr.CachedResolve(session).GetCallOpCode(); + } + + /// + /// Adds a parameter and returns added parameters. + /// + public static ParameterDefinition CreateParameter(this MethodDefinition thisMr, CodegenSession session, ParameterAttributes attr, System.Type type) + { + TypeReference parameterTypeRef = session.ImportReference(type); + ParameterDefinition pd = new ParameterDefinition($"p{thisMr.Parameters.Count}", attr, parameterTypeRef); + thisMr.Parameters.Add(pd); + return pd; + } + /// + /// Adds otherMd parameters to thisMR and returns added parameters. + /// + public static List CreateParameters(this MethodReference thisMr, CodegenSession session, MethodDefinition otherMd) + { + return thisMr.CachedResolve(session).CreateParameters(session, otherMd); + } + /// + /// Adds otherMr parameters to thisMR and returns added parameters. + /// + public static List CreateParameters(this MethodReference thisMr, CodegenSession session, MethodReference otherMr) + { + return thisMr.CachedResolve(session).CreateParameters(session, otherMr.CachedResolve(session)); + } + + /// + /// Adds otherMd parameters to thisMd and returns added parameters. + /// + public static List CreateParameters(this MethodDefinition thisMd, CodegenSession session, MethodDefinition otherMd) + { + List results = new List(); + + foreach (ParameterDefinition pd in otherMd.Parameters) + { + session.ImportReference(pd.ParameterType); + int currentCount = thisMd.Parameters.Count; + string name = (pd.Name + currentCount); + ParameterDefinition parameterDef = new ParameterDefinition(name, pd.Attributes, pd.ParameterType); + //Set any default values. + parameterDef.Constant = pd.Constant; + parameterDef.IsReturnValue = pd.IsReturnValue; + parameterDef.IsOut = pd.IsOut; + foreach (CustomAttribute item in pd.CustomAttributes) + parameterDef.CustomAttributes.Add(item); + parameterDef.HasConstant = pd.HasConstant; + parameterDef.HasDefault = pd.HasDefault; + + thisMd.Parameters.Add(parameterDef); + + results.Add(parameterDef); + } + + return results; + } + + /// + /// Returns a method reference while considering if declaring type is generic. + /// + public static MethodReference GetMethodReference(this MethodDefinition md, CodegenSession session) + { + MethodReference methodRef = session.ImportReference(md); + + //Is generic. + if (md.DeclaringType.HasGenericParameters) + { + GenericInstanceType git = methodRef.DeclaringType.MakeGenericInstanceType(); + MethodReference result = new MethodReference(md.Name, md.ReturnType) + { + HasThis = md.HasThis, + ExplicitThis = md.ExplicitThis, + DeclaringType = git, + CallingConvention = md.CallingConvention, + }; + foreach (ParameterDefinition pd in md.Parameters) + { + session.ImportReference(pd.ParameterType); + result.Parameters.Add(pd); + } + return result; + } + else + { + return methodRef; + } + } + + + /// + /// Returns a method reference for a generic method. + /// + public static MethodReference GetMethodReference(this MethodDefinition md, CodegenSession session, TypeReference typeReference) + { + MethodReference methodRef = session.ImportReference(md); + return methodRef.GetMethodReference(session, typeReference); + } + + /// + /// Removes ret if it exist at the end of the method. Returns if ret was removed. + /// + internal static bool RemoveEndRet(this MethodDefinition md, CodegenSession session) + { + int count = md.Body.Instructions.Count; + if (count > 0 && md.Body.Instructions[count - 1].OpCode == OpCodes.Ret) + { + md.Body.Instructions.RemoveAt(count - 1); + return true; + } + else + { + return false; + } + } + + + /// + /// Returns a method reference for a generic method. + /// + public static MethodReference GetMethodReference(this MethodDefinition md, CodegenSession session, TypeReference[] typeReferences) + { + MethodReference methodRef = session.ImportReference(md); + return methodRef.GetMethodReference(session, typeReferences); + } + + /// + /// Makes a method definition public. + /// + public static void SetPublicAttributes(this MethodDefinition md) + { + md.Attributes = PUBLIC_VIRTUAL_ATTRIBUTES; + } + public static void SetProtectedAttributes(this MethodDefinition md) + { + md.Attributes = PROTECTED_VIRTUAL_ATTRIBUTES; + } + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Extension/MethodDefinitionExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Extension/MethodDefinitionExtensions.cs.meta new file mode 100644 index 0000000..784e564 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/MethodDefinitionExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 866ed457fe28c3e4b9698d87b9abd709 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Extension/TypeDefinitionExtensions.cs b/Assets/FishNet/CodeGenerating/Extension/TypeDefinitionExtensions.cs new file mode 100644 index 0000000..387c79d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/TypeDefinitionExtensions.cs @@ -0,0 +1,315 @@ +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Object.Prediction; +using FishNet.Utility.Performance; +using MonoFN.Cecil; +using System.Collections.Generic; + +namespace FishNet.CodeGenerating.Extension +{ + + + internal static class TypeDefinitionExtensions + { + + + /// + /// Returns if a TypeDefinition is nullable. + /// + public static bool IsNullable(this TypeDefinition td) + { + return (td.Name == typeof(System.Nullable<>).Name); + } + + /// + /// Finds the first method by a given name. + /// + /// + /// + /// + internal static MethodDefinition GetMethod(this TypeDefinition typeDef, string methodName) + { + foreach (MethodDefinition md in typeDef.Methods) + { + if (md.Name == methodName) + return md; + } + + return null; + } + + + public static MethodReference GetMethodReferenceInBase(this TypeDefinition td, CodegenSession session, string methodName) + { + MethodDefinition baseMd = td.GetMethodDefinitionInBase(session, methodName); + if (baseMd == null) + return null; + + + MethodReference baseMr; + TypeReference baseTr = td.BaseType; + if (baseTr.CachedResolve(session).HasGenericParameters) + { + GenericInstanceType git = (GenericInstanceType)baseTr; + baseMr = new MethodReference(baseMd.Name, baseMd.ReturnType, git) + { + HasThis = baseMd.HasThis, + CallingConvention = baseMd.CallingConvention, + ExplicitThis = baseMd.ExplicitThis, + }; + foreach (ParameterDefinition pd in baseMd.Parameters) + { + session.ImportReference(pd.ParameterType); + baseMr.Parameters.Add(pd); + } + } + else + { + baseMr = session.ImportReference(baseMd); + } + + return baseMr; + } + /// + /// Returns a method in the next base class. + /// + public static MethodDefinition GetMethodDefinitionInBase(this TypeDefinition td, CodegenSession session, string methodName) + { + if (td.BaseType == null) + { + session.LogError($"BaseType for {td.FullName} is null."); + return null; + } + + TypeDefinition baseTd = td.BaseType.CachedResolve(session); + return baseTd.GetMethod(methodName); + } + + + /// + /// Returns a method in the next base class. + /// + public static MethodReference GetMethodReference(this TypeDefinition td, CodegenSession session, string methodName) + { + MethodDefinition md = td.GetMethod(methodName); + //Not found. + if (md == null) + return null; + + return md.GetMethodReference(session); + } + + /// + /// Gets a MethodReference or creates one if missing. + /// + public static MethodReference GetOrCreateMethodReference(this TypeDefinition td, CodegenSession session, string methodName, MethodAttributes attributes, TypeReference returnType, out bool created) + { + MethodDefinition md = td.GetMethod(methodName); + //Not found. + if (md == null) + { + md = new MethodDefinition(methodName, attributes, returnType); + td.Methods.Add(md); + created = true; + } + else + { + created = false; + } + + return md.GetMethodReference(session); + } + + + /// + /// Gets a MethodDefinition or creates one if missing. + /// + public static MethodDefinition GetOrCreateMethodDefinition(this TypeDefinition td, CodegenSession session, string methodName, MethodAttributes attributes, TypeReference returnType, out bool created) + { + MethodDefinition md = td.GetMethod(methodName); + //Not found. + if (md == null) + { + md = new MethodDefinition(methodName, attributes, returnType); + td.Methods.Add(md); + created = true; + } + else + { + created = false; + } + + return md; + } + + /// + /// Gets a MethodDefinition or creates one if missing. + /// + public static MethodDefinition GetOrCreateMethodDefinition(this TypeDefinition td, CodegenSession session, string methodName, MethodDefinition methodTemplate, bool copyParameters, out bool created) + { + MethodDefinition md = td.GetMethod(methodName); + //Not found. + if (md == null) + { + TypeReference returnType = session.ImportReference(methodTemplate.ReturnType); + md = new MethodDefinition(methodName, methodTemplate.Attributes, returnType) + { + ExplicitThis = methodTemplate.ExplicitThis, + AggressiveInlining = methodTemplate.AggressiveInlining, + Attributes = methodTemplate.Attributes, + CallingConvention = methodTemplate.CallingConvention, + HasThis = methodTemplate.HasThis, + }; + md.Body.InitLocals = methodTemplate.Body.InitLocals; + + if (copyParameters) + { + foreach (ParameterDefinition pd in methodTemplate.Parameters) + { + session.ImportReference(pd.ParameterType.CachedResolve(session)); + md.Parameters.Add(pd); + } + } + + foreach (GenericParameter item in methodTemplate.GenericParameters) + { + session.ImportReference(item); + md.GenericParameters.Add(item); + } + + td.Methods.Add(md); + created = true; + } + else + { + created = false; + } + + return md; + } + + + + /// + /// Returns a method in any inherited classes. The first found method is returned. + /// + public static MethodDefinition GetMethodDefinitionInAnyBase(this TypeDefinition td, CodegenSession session, string methodName) + { + while (td != null) + { + foreach (MethodDefinition md in td.Methods) + { + if (md.Name == methodName) + return md; + } + + try + { + td = td.GetNextBaseTypeDefinition(session); + } + catch + { + return null; + } + } + + return null; + } + + /// + /// Returns a TypeDefintiion found in typeDef or up it's hierarchy. + /// + /// True to check if typeDef equals fullName. + /// + public static TypeDefinition GetTypeDefinitionInBase(this TypeDefinition typeDef, CodegenSession session, string targetFullName, bool checkTypeDef) + { + if (typeDef == null) + return null; + if (!checkTypeDef) + typeDef = typeDef.GetNextBaseTypeDefinition(session); + + while (typeDef != null) + { + if (typeDef.FullName == targetFullName) + return typeDef; + + typeDef = typeDef.GetNextBaseTypeDefinition(session); + } + + return null; + } + + /// + /// Returns the next base type. + /// + public static TypeDefinition GetNextBaseTypeDefinition(this TypeDefinition typeDef, CodegenSession session) + { + return (typeDef.BaseType == null) ? null : typeDef.BaseType.CachedResolve(session); + } + + /// + /// Creates a FieldReference. + /// + public static FieldReference CreateFieldReference(this FieldDefinition fd, CodegenSession session) + { + FieldReference fr; + TypeDefinition declaringType = fd.DeclaringType; + //Is generic. + if (declaringType.HasGenericParameters) + { + GenericInstanceType git = new GenericInstanceType(declaringType); + foreach (GenericParameter item in declaringType.GenericParameters) + git.GenericArguments.Add(item); + fr = new FieldReference(fd.Name, fd.FieldType, git); + return fr; + } + //Not generic. + else + { + return session.ImportReference(fd); + } + } + + /// + /// Gets a FieldReference or creates it if missing. + /// + public static FieldReference GetOrCreateFieldReference(this TypeDefinition td, CodegenSession session, string fieldName, FieldAttributes attributes, TypeReference fieldTypeRef, out bool created) + { + FieldReference fr = td.GetFieldReference(fieldName, session); + if (fr == null) + { + fr = td.CreateFieldDefinition(session, fieldName, attributes, fieldTypeRef); + created = true; + } + else + { + created = false; + } + + return fr; + } + + /// + /// Creates a FieldReference. + /// + public static FieldReference CreateFieldDefinition(this TypeDefinition td, CodegenSession session, string fieldName, FieldAttributes attributes, TypeReference fieldTypeRef) + { + FieldDefinition fd = new FieldDefinition(fieldName, attributes, fieldTypeRef); + td.Fields.Add(fd); + return fd.CreateFieldReference(session); + } + + + /// + /// Makes a GenericInstanceType. + /// + public static GenericInstanceType MakeGenericInstanceType(this TypeDefinition self, CodegenSession session) + { + TypeReference tr = session.ImportReference(self); + return tr.MakeGenericInstanceType(); + } + + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Extension/TypeDefinitionExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Extension/TypeDefinitionExtensions.cs.meta new file mode 100644 index 0000000..dfb8256 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/TypeDefinitionExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c9f00cf3dc8b90b469c3c9cb8b87fc88 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Extension/TypeReferenceExtensions.cs b/Assets/FishNet/CodeGenerating/Extension/TypeReferenceExtensions.cs new file mode 100644 index 0000000..fc5d862 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/TypeReferenceExtensions.cs @@ -0,0 +1,52 @@ + +using FishNet.CodeGenerating.Helping; +using FishNet.CodeGenerating.Helping.Extension; +using MonoFN.Cecil; +using UnityEngine; + +namespace FishNet.CodeGenerating.Extension +{ + + + internal static class TypeReferenceExtensions + { + + /// + /// Returns if a TypeReference is nullable. + /// + public static bool IsNullable(this TypeReference tr, CodegenSession session) + { + TypeDefinition td = tr.CachedResolve(session); + return td.IsNullable(); + } + + /// + /// Returns the fullname of a TypeReference without <>. + /// + /// + /// + public static string GetFullnameWithoutBrackets(this TypeReference tr) + { + string str = tr.FullName; + str = str.Replace("<", ""); + str = str.Replace(">", ""); + return str; + } + + + /// + /// Makes a GenericInstanceType. + /// + public static GenericInstanceType MakeGenericInstanceType(this TypeReference self) + { + GenericInstanceType instance = new GenericInstanceType(self); + foreach (GenericParameter argument in self.GenericParameters) + instance.GenericArguments.Add(argument); + + return instance; + } + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Extension/TypeReferenceExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Extension/TypeReferenceExtensions.cs.meta new file mode 100644 index 0000000..19d7526 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Extension/TypeReferenceExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 239b1b10db80c594d93b7ba4ee2c1ec5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/FN_README.txt b/Assets/FishNet/CodeGenerating/FN_README.txt new file mode 100644 index 0000000..3efe3cf --- /dev/null +++ b/Assets/FishNet/CodeGenerating/FN_README.txt @@ -0,0 +1,9 @@ +After updating a custom Cecil to fix conflict with Unity.Burst in 2021 perform the following: + +- Open cecil in it's own project; eg: do not place directly in FN. +- Rename namespace.Mono to namespace.MonoFN. +- Current project rename strings, "Mono to "MonoFN +- Replace current project #if INSIDE_ROCKS to #if UNITY_EDITOR +- Comment out `[assembly: AssemblyTitle ("MonoFN.Cecil.Rocks")]` within rocks\Mono.Cecil.Rocks\AssemblyInfo.cs. +- Delete obj/bin/tests folders. +- Copy into FN project. diff --git a/Assets/FishNet/CodeGenerating/FN_README.txt.meta b/Assets/FishNet/CodeGenerating/FN_README.txt.meta new file mode 100644 index 0000000..04e8428 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/FN_README.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9133eb285bd7f3c4f89f4d7a2a079c6b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers.meta b/Assets/FishNet/CodeGenerating/Helpers.meta new file mode 100644 index 0000000..b0764dd --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d27bb367daea26d46a8fa5f6ca02865e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/AttributeHelper.cs b/Assets/FishNet/CodeGenerating/Helpers/AttributeHelper.cs new file mode 100644 index 0000000..5a7c233 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/AttributeHelper.cs @@ -0,0 +1,74 @@ +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Object; +using FishNet.Object.Helping; +using FishNet.Object.Prediction; +using FishNet.Object.Synchronizing; +using MonoFN.Cecil; + + +namespace FishNet.CodeGenerating.Helping +{ + internal class AttributeHelper : CodegenBase + { + #region Reflection references. + internal string ReplicateAttribute_FullName; + internal string ReconcileAttribute_FullName; + private string ServerAttribute_FullName; + private string ClientAttribute_FullName; + private string ServerRpcAttribute_FullName; + private string ObserversRpcAttribute_FullName; + private string TargetRpcAttribute_FullName; + #endregion + + public override bool ImportReferences() + { + ServerAttribute_FullName = typeof(ServerAttribute).FullName; + ClientAttribute_FullName = typeof(ClientAttribute).FullName; + ServerRpcAttribute_FullName = typeof(ServerRpcAttribute).FullName; + ObserversRpcAttribute_FullName = typeof(ObserversRpcAttribute).FullName; + TargetRpcAttribute_FullName = typeof(TargetRpcAttribute).FullName; +#if PREDICTION_1 + ReplicateAttribute_FullName = typeof(ReplicateAttribute).FullName; + ReconcileAttribute_FullName = typeof(ReconcileAttribute).FullName; +#else + ReplicateAttribute_FullName = typeof(ReplicateAttribute).FullName; + ReconcileAttribute_FullName = typeof(ReconcileAttribute).FullName; +#endif + return true; + } + + /// + /// Returns type of Rpc attributeFullName is for. + /// + /// + /// + public RpcType GetRpcAttributeType(CustomAttribute ca) + { + if (ca.Is(ServerRpcAttribute_FullName)) + return RpcType.Server; + else if (ca.Is(ObserversRpcAttribute_FullName)) + return RpcType.Observers; + else if (ca.Is(TargetRpcAttribute_FullName)) + return RpcType.Target; + else + return RpcType.None; + } + + + /// + /// Returns type of Rpc attributeFullName is for. + /// + /// + /// + internal QolAttributeType GetQolAttributeType(string attributeFullName) + { + if (attributeFullName == ServerAttribute_FullName) + return QolAttributeType.Server; + else if (attributeFullName == ClientAttribute_FullName) + return QolAttributeType.Client; + else + return QolAttributeType.None; + } + } + +} diff --git a/Assets/FishNet/CodeGenerating/Helpers/AttributeHelper.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/AttributeHelper.cs.meta new file mode 100644 index 0000000..d84b8e4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/AttributeHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d32f3dc23b55598429c5cfe6156e6243 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/CodegenSession.cs b/Assets/FishNet/CodeGenerating/Helpers/CodegenSession.cs new file mode 100644 index 0000000..6312e42 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/CodegenSession.cs @@ -0,0 +1,184 @@ +using FishNet.CodeGenerating.Helping; +using FishNet.CodeGenerating.ILCore; +using FishNet.CodeGenerating.Processing; +using FishNet.CodeGenerating.Processing.Rpc; +using MonoFN.Cecil; +using System.Collections.Generic; +using System.Linq; +using Unity.CompilationPipeline.Common.Diagnostics; +#if !UNITY_2020_1_OR_NEWER +using UnityEngine; +#endif +using SR = System.Reflection; + + +namespace FishNet.CodeGenerating +{ + + internal class CodegenSession + { + /// + /// Current module for this session. + /// + internal ModuleDefinition Module; + /// + /// Outputs errors when codegen fails. + /// + internal List Diagnostics; + /// + /// SyncVars that are being accessed from an assembly other than the currently being processed one. + /// + internal List DifferentAssemblySyncVars = new List(); + + + /// + /// CodegenBase classes for processing a module. + /// + private List _bases; + /// + /// Quick lookup of base classes. + /// + private Dictionary _basesCache = new Dictionary(); + + /// + /// Returns class of type if found within CodegenBase classes. + /// + /// + /// + internal T GetClass() where T : CodegenBase + { + string tName = typeof(T).Name; + return (T)_basesCache[tName]; + } + /// + /// Resets all helpers while importing any information needed by them. + /// + /// + /// + internal bool Initialize(ModuleDefinition module) + { + Module = module; + Diagnostics = new List(); + + _bases = new List() + { + new ReaderImports(), new ReaderProcessor() + ,new WriterImports(), new WriterProcessor() + , new PhysicsHelper(), new TimeManagerHelper(), new AttributeHelper(), new GeneralHelper() + , new ObjectHelper(), new NetworkBehaviourHelper() + , new TransportHelper() + , new NetworkConnectionImports(), new PredictedObjectHelper(), new GeneratorHelper() + , new CustomSerializerProcessor() + , new NetworkBehaviourProcessor() + , new QolAttributeProcessor() + , new RpcProcessor() + , new SyncTypeProcessor() + , new PredictionProcessor() + }; + + //Add all to dictionary first, then import. + foreach (CodegenBase item in _bases) + { + string tName = item.GetType().Name; + _basesCache.Add(tName, item); + } + + //Initialize. + foreach (CodegenBase item in _bases) + { + item.Initialize(this); + if (!item.ImportReferences()) + return false; + } + + return true; + } + + + #region Logging. + /// + /// Logs a warning. + /// + /// + internal void LogWarning(string msg) + { + Diagnostics.AddWarning(msg); + } + /// + /// Logs an error. + /// + /// + internal void LogError(string msg) + { + Diagnostics.AddError(msg); + } + #endregion + + #region ImportReference. + + public MethodReference ImportReference(SR.MethodBase method) + { + return Module.ImportReference(method); + } + + public MethodReference ImportReference(SR.MethodBase method, IGenericParameterProvider context) + { + return Module.ImportReference(method, context); + } + + public TypeReference ImportReference(TypeReference type) + { + return Module.ImportReference(type); + } + + public TypeReference ImportReference(TypeReference type, IGenericParameterProvider context) + { + return Module.ImportReference(type, context); + } + + public FieldReference ImportReference(FieldReference field) + { + return Module.ImportReference(field); + } + + public FieldReference ImportReference(FieldReference field, IGenericParameterProvider context) + { + return Module.ImportReference(field, context); + } + public MethodReference ImportReference(MethodReference method) + { + return Module.ImportReference(method); + } + + public MethodReference ImportReference(MethodReference method, IGenericParameterProvider context) + { + return Module.ImportReference(method, context); + } + public TypeReference ImportReference(System.Type type) + { + return ImportReference(type, null); + } + + + public TypeReference ImportReference(System.Type type, IGenericParameterProvider context) + { + return Module.ImportReference(type, context); + } + + + public FieldReference ImportReference(SR.FieldInfo field) + { + return Module.ImportReference(field); + } + + public FieldReference ImportReference(SR.FieldInfo field, IGenericParameterProvider context) + { + return Module.ImportReference(field, context); + } + + #endregion + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/CodegenSession.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/CodegenSession.cs.meta new file mode 100644 index 0000000..3373edc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/CodegenSession.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e8416eee3308f54fa942003de975420 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/CreatedSyncVarGenerator.cs b/Assets/FishNet/CodeGenerating/Helpers/CreatedSyncVarGenerator.cs new file mode 100644 index 0000000..cae9beb --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/CreatedSyncVarGenerator.cs @@ -0,0 +1,120 @@ +//using FishNet.CodeGenerating.Helping.Extension; +//using FishNet.CodeGenerating.Processing; +//using FishNet.Object.Synchronizing; +//using FishNet.Object.Synchronizing.Internal; +//using MonoFN.Cecil; +//using MonoFN.Cecil.Rocks; +//using System; +//using System.Collections.Generic; + +//namespace FishNet.CodeGenerating.Helping +//{ +// internal class CreatedSyncVarGenerator : CodegenBase +// { +// private readonly Dictionary _createdSyncVars = new Dictionary(); + +// #region Relfection references. +// private TypeReference _syncBase_TypeRef; +// internal TypeReference SyncVar_TypeRef; +// private MethodReference _syncVar_InitializeOnce_MethodRef; +// #endregion + +// #region Const. +// private const string GETVALUE_NAME = "GetValue"; +// private const string SETVALUE_NAME = "SetValue"; +// #endregion + +// /* //feature add and test the dirty boolean changes +// * eg... instead of base.Dirty() +// * do if (!base.Dirty()) return false; +// * See synclist for more info. */ + +// /// +// /// Imports references needed by this helper. +// /// +// /// +// /// +// public override bool ImportReferences() +// { +// Type svType = typeof(SyncVar<>); +// SyncVar_TypeRef = base.ImportReference(svType); +// _syncVar_InitializeOnce_MethodRef = base.ImportReference(svType.GetMethod(nameof(SyncVar.InitializeOnce))); +// Type syncBaseType = typeof(SyncBase); +// _syncBase_TypeRef = base.ImportReference(syncBaseType); + +// return true; +// } + +// /// +// /// Gets and optionally creates data for SyncVar +// /// +// /// +// /// +// internal DeclaredSyncType GetCreatedSyncVar(FieldDefinition originalFd, bool createMissing) +// { +// TypeReference dataTr = originalFd.FieldType; +// TypeDefinition dataTd = dataTr.CachedResolve(base.Session); + +// string typeHash = dataTr.FullName + dataTr.IsArray.ToString(); + +// if (_createdSyncVars.TryGetValue(typeHash, out DeclaredSyncType createdSyncVar)) +// { +// return createdSyncVar; +// } +// else +// { +// if (!createMissing) +// return null; + +// base.ImportReference(dataTd); + +// GenericInstanceType originalFdGit = SyncVar_TypeRef.MakeGenericInstanceType(new TypeReference[] { dataTr }); +// TypeReference genericDataTr = originalFdGit.GenericArguments[0]; + +// //Make sure can serialize. +// bool canSerialize = base.GetClass().HasSerializerAndDeserializer(genericDataTr, true); +// if (!canSerialize) +// { +// base.LogError($"SyncVar {originalFd.Name} data type {genericDataTr.FullName} does not support serialization. Use a supported type or create a custom serializer."); +// return null; +// } + +// //Set needed methods from syncbase. +// MethodReference setSyncIndexMr; +// MethodReference initializeOnceMrGit = _syncVar_InitializeOnce_MethodRef.MakeHostInstanceGeneric(base.Session, originalFdGit); + +// if (!base.GetClass().SetSyncBaseMethods(_syncBase_TypeRef.CachedResolve(base.Session), out setSyncIndexMr, out _)) +// return null; + +// MethodReference setValueMr = null; +// MethodReference getValueMr = null; +// foreach (MethodDefinition md in SyncVar_TypeRef.CachedResolve(base.Session).Methods) +// { +// //GetValue. +// if (md.Name == GETVALUE_NAME) +// { +// MethodReference mr = base.ImportReference(md); +// getValueMr = mr.MakeHostInstanceGeneric(base.Session, originalFdGit); +// } +// //SetValue. +// else if (md.Name == SETVALUE_NAME) +// { +// MethodReference mr = base.ImportReference(md); +// setValueMr = mr.MakeHostInstanceGeneric(base.Session, originalFdGit); +// } +// } + +// if (setValueMr == null || getValueMr == null) +// return null; + +// DeclaredSyncType csv = new DeclaredSyncType(originalFd, originalFdGit, dataTd, initializeOnceMrGit, null); +// _createdSyncVars.Add(typeHash, csv); +// return csv; +// } +// } + + +// } + + +//} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/CreatedSyncVarGenerator.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/CreatedSyncVarGenerator.cs.meta new file mode 100644 index 0000000..086dc59 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/CreatedSyncVarGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 935ec97b96b35b94f8c6880c6908304c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension.meta b/Assets/FishNet/CodeGenerating/Helpers/Extension.meta new file mode 100644 index 0000000..4e7333c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6fee1744ec071184db72fc2443e77ece +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/CustomAttributeExtensions.cs b/Assets/FishNet/CodeGenerating/Helpers/Extension/CustomAttributeExtensions.cs new file mode 100644 index 0000000..b11e91c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/CustomAttributeExtensions.cs @@ -0,0 +1,54 @@ +using MonoFN.Cecil; +using System.Linq; + +namespace FishNet.CodeGenerating.Helping.Extension +{ + + internal static class CustomAttributeExtensions + { + /// + /// Finds a field within an attribute. + /// + /// + /// + /// + /// + /// + internal static T GetField(this CustomAttribute customAttr, string field, T defaultValue) + { + foreach (CustomAttributeNamedArgument customField in customAttr.Fields) + { + if (customField.Name == field) + { + return (T)customField.Argument.Value; + } + } + + return defaultValue; + } + + /// + /// Returns if any of the attributes match IAtrribute. + /// + /// + /// + /// + internal static bool HasCustomAttribute(this ICustomAttributeProvider attributeProvider) + { + return attributeProvider.CustomAttributes.Any(attr => attr.AttributeType.Is()); + } + + /// + /// Returns if ca is of type target. + /// + /// + /// + /// + internal static bool Is(this CustomAttribute ca, string targetFullName) + { + return ca.AttributeType.FullName == targetFullName; + } + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/CustomAttributeExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Extension/CustomAttributeExtensions.cs.meta new file mode 100644 index 0000000..87b14e3 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/CustomAttributeExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a66d771ab331fae408142a5c04abd74e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/Diagnostics.cs b/Assets/FishNet/CodeGenerating/Helpers/Extension/Diagnostics.cs new file mode 100644 index 0000000..5fda8fe --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/Diagnostics.cs @@ -0,0 +1,41 @@ +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Unity.CompilationPipeline.Common.Diagnostics; + +namespace FishNet.CodeGenerating.Helping +{ + internal static class Diagnostics + { + internal static void AddError(this List diagnostics, string message) + { + diagnostics.AddMessage(DiagnosticType.Error, (SequencePoint)null, message); + } + + internal static void AddWarning(this List diagnostics, string message) + { + diagnostics.AddMessage(DiagnosticType.Warning, (SequencePoint)null, message); + } + + internal static void AddError(this List diagnostics, MethodDefinition methodDef, string message) + { + diagnostics.AddMessage(DiagnosticType.Error, methodDef.DebugInformation.SequencePoints.FirstOrDefault(), message); + } + + internal static void AddMessage(this List diagnostics, DiagnosticType diagnosticType, SequencePoint sequencePoint, string message) + { + diagnostics.Add(new DiagnosticMessage + { + DiagnosticType = diagnosticType, + File = sequencePoint?.Document.Url.Replace($"{Environment.CurrentDirectory}{Path.DirectorySeparatorChar}", ""), + Line = sequencePoint?.StartLine ?? 0, + Column = sequencePoint?.StartColumn ?? 0, + MessageData = $" - {message}" + }); + } + + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/Diagnostics.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Extension/Diagnostics.cs.meta new file mode 100644 index 0000000..a70954f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/Diagnostics.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb7b65b572b01444cbe3c9d830cd3587 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/GetConstructor.cs b/Assets/FishNet/CodeGenerating/Helpers/Extension/GetConstructor.cs new file mode 100644 index 0000000..9498f23 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/GetConstructor.cs @@ -0,0 +1,191 @@ +using FishNet.CodeGenerating.Helping.Extension; +using MonoFN.Cecil; +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FishNet.CodeGenerating.Helping +{ + internal static class Constructors + { + + /// + /// Gets the first constructor that optionally has, or doesn't have parameters. + /// + /// + /// + public static MethodDefinition GetFirstConstructor(this TypeReference typeRef, CodegenSession session, bool requireParameters) + { + return typeRef.CachedResolve(session).GetFirstConstructor(requireParameters); + } + /// + /// Gets the first constructor that optionally has, or doesn't have parameters. + /// + /// + /// + public static MethodDefinition GetFirstConstructor(this TypeDefinition typeDef, bool requireParameters) + { + + foreach (MethodDefinition methodDef in typeDef.Methods) + { + if (methodDef.IsConstructor && methodDef.IsPublic) + { + if (requireParameters && methodDef.Parameters.Count > 0) + return methodDef; + else if (!requireParameters && methodDef.Parameters.Count == 0) + return methodDef; + } + + } + + return null; + } + + /// + /// Gets the first public constructor with no parameters. + /// + /// + public static MethodDefinition GetDefaultConstructor(this TypeReference typeRef, CodegenSession session) + { + return typeRef.CachedResolve(session).GetDefaultConstructor(); + } + /// + /// Gets the first public constructor with no parameters. + /// + /// + public static MethodDefinition GetDefaultConstructor(this TypeDefinition typeDef) + { + foreach (MethodDefinition methodDef in typeDef.Methods) + { + if (methodDef.IsConstructor && methodDef.IsPublic && methodDef.Parameters.Count == 0) + return methodDef; + } + + return null; + } + + /// + /// Gets all constructors on typeDef. + /// + /// + public static List GetConstructors(this TypeDefinition typeDef) + { + List lst = new List(); + foreach (MethodDefinition methodDef in typeDef.Methods) + { + if (methodDef.IsConstructor) + lst.Add(methodDef); + } + + return lst; + } + + + /// + /// Gets constructor which has arguments. + /// + /// + /// + public static MethodDefinition GetConstructor(this TypeReference typeRef, CodegenSession session, Type[] arguments) + { + return typeRef.CachedResolve(session).GetConstructor(arguments); + } + + /// + /// Gets constructor which has arguments. + /// + /// + /// + public static MethodDefinition GetConstructor(this TypeDefinition typeDef, Type[] arguments) + { + Type[] argsCopy = (arguments == null) ? new Type[0] : arguments; + foreach (MethodDefinition methodDef in typeDef.Methods) + { + if (methodDef.IsConstructor && methodDef.IsPublic && methodDef.Parameters.Count == argsCopy.Length) + { + bool match = true; + for (int i = 0; i < argsCopy.Length; i++) + { + if (methodDef.Parameters[0].ParameterType.FullName != argsCopy[i].FullName) + { + match = false; + break; + } + } + + if (match) + return methodDef; + } + } + return null; + } + + + /// + /// Gets constructor which has arguments. + /// + /// + /// + public static MethodDefinition GetConstructor(this TypeReference typeRef, CodegenSession session, TypeReference[] arguments) + { + return typeRef.CachedResolve(session).GetConstructor(arguments); + } + + /// + /// Gets constructor which has arguments. + /// + /// + /// + public static MethodDefinition GetConstructor(this TypeDefinition typeDef, TypeReference[] arguments) + { + TypeReference[] argsCopy = (arguments == null) ? new TypeReference[0] : arguments; + foreach (MethodDefinition methodDef in typeDef.Methods) + { + if (methodDef.IsConstructor && methodDef.IsPublic && methodDef.Parameters.Count == argsCopy.Length) + { + bool match = true; + for (int i = 0; i < argsCopy.Length; i++) + { + if (methodDef.Parameters[0].ParameterType.FullName != argsCopy[i].FullName) + { + match = false; + break; + } + } + + if (match) + return methodDef; + } + } + return null; + } + + /// + /// Resolves the constructor with parameterCount for typeRef. + /// + /// + /// + public static MethodDefinition GetConstructor(this TypeReference typeRef, CodegenSession session, int parameterCount) + { + return typeRef.CachedResolve(session).GetConstructor(parameterCount); + } + + + /// + /// Resolves the constructor with parameterCount for typeRef. + /// + /// + /// + public static MethodDefinition GetConstructor(this TypeDefinition typeDef, int parameterCount) + { + foreach (MethodDefinition methodDef in typeDef.Methods) + { + if (methodDef.IsConstructor && methodDef.IsPublic && methodDef.Parameters.Count == parameterCount) + return methodDef; + } + return null; + } + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/GetConstructor.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Extension/GetConstructor.cs.meta new file mode 100644 index 0000000..c66fc8f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/GetConstructor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1a7e03137ca78704e999f3a3dc68b953 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/ILProcessorExtensions.cs b/Assets/FishNet/CodeGenerating/Helpers/Extension/ILProcessorExtensions.cs new file mode 100644 index 0000000..6f819fb --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/ILProcessorExtensions.cs @@ -0,0 +1,198 @@ +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using System.Collections.Generic; + +namespace FishNet.CodeGenerating.Helping.Extension +{ + + internal static class ILProcessorExtensions + { + + /// + /// Creates a debug log for text without any conditions. + /// + public static List DebugLog(this ILProcessor processor, CodegenSession session, string txt) + { + List insts = new List(); + insts.Add(processor.Create(OpCodes.Ldstr, txt)); + insts.Add(processor.Create(OpCodes.Call, session.GetClass().Debug_LogCommon_MethodRef)); + return insts; + } + /// + /// Creates a debug log for vd without any conditions. + /// + public static List DebugLog(this ILProcessor processor, CodegenSession session, VariableDefinition vd) + { + List insts = new List(); + insts.Add(processor.Create(OpCodes.Ldloc, vd)); + insts.Add(processor.Create(OpCodes.Box, vd.VariableType)); + insts.Add(processor.Create(OpCodes.Call, session.GetClass().Debug_LogCommon_MethodRef)); + return insts; + } + /// + /// Creates a debug log for vd without any conditions. + /// + public static List DebugLog(this ILProcessor processor, CodegenSession session, FieldDefinition fd, bool loadArg0) + { + List insts = new List(); + if (loadArg0) + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Ldfld, fd)); + insts.Add(processor.Create(OpCodes.Box, fd.FieldType)); + insts.Add(processor.Create(OpCodes.Call, session.GetClass().Debug_LogCommon_MethodRef)); + return insts; + } + /// + /// Creates a debug log for pd without any conditions. + /// + public static List DebugLog(this ILProcessor processor, CodegenSession session, ParameterDefinition pd) + { + List insts = new List(); + insts.Add(processor.Create(OpCodes.Ldloc, pd)); + insts.Add(processor.Create(OpCodes.Box, pd.ParameterType)); + insts.Add(processor.Create(OpCodes.Call, session.GetClass().Debug_LogCommon_MethodRef)); + return insts; + } + + /// + /// Removes Ret if the last instruction. + /// + /// True if ret was removed. + public static bool RemoveEndRet(this ILProcessor processor) + { + int instCount = processor.Body.Instructions.Count; + if (instCount == 0) + return false; + + if (processor.Body.Instructions[instCount-1].OpCode == OpCodes.Ret) + { + processor.Body.Instructions.RemoveAt(instCount - 1); + return true; + } + else + { + return false; + } + } + + ///// + ///// Creates a debug log for mr without any conditions. + ///// + //public static void DebugLog(this ILProcessor processor, MethodReference mr) + //{ + // processor.Emit(OpCodes.Call, mr); + // processor.Emit(OpCodes.Box, mr.ReturnType); + // processor.Emit(OpCodes.Call, base.GetClass().Debug_LogCommon_MethodRef); + //} + + + /// + /// Inserts instructions at the beginning. + /// + /// + /// + public static void InsertAt(this ILProcessor processor, int target, List instructions) + { + for (int i = 0; i < instructions.Count; i++) + processor.Body.Instructions.Insert(i + target, instructions[i]); + } + + + /// + /// Inserts instructions at the beginning. + /// + /// + /// + public static void InsertFirst(this ILProcessor processor, List instructions) + { + for (int i = 0; i < instructions.Count; i++) + processor.Body.Instructions.Insert(i, instructions[i]); + } + + /// + /// Inserts instructions at the end while also moving Ret down. + /// + /// + /// + public static void InsertLast(this ILProcessor processor, List instructions) + { + bool retRemoved = false; + int startingCount = processor.Body.Instructions.Count; + //Remove ret if it exist and add it back in later. + if (startingCount > 0) + { + if (processor.Body.Instructions[startingCount - 1].OpCode == OpCodes.Ret) + { + processor.Body.Instructions.RemoveAt(startingCount - 1); + retRemoved = true; + } + } + + foreach (Instruction inst in instructions) + processor.Append(inst); + + //Add ret back if it was removed. + if (retRemoved) + processor.Emit(OpCodes.Ret); + } + + /// + /// Inserts instructions before target. + /// + /// + /// + public static void InsertBefore(this ILProcessor processor, Instruction target, List instructions) + { + int index = processor.Body.Instructions.IndexOf(target); + for (int i = 0; i < instructions.Count; i++) + processor.Body.Instructions.Insert(index + i, instructions[i]); + } + + /// + /// Adds instructions to the end of processor. + /// + /// + /// + public static void Add(this ILProcessor processor, List instructions) + { + for (int i = 0; i < instructions.Count; i++) + processor.Body.Instructions.Add(instructions[i]); + } + + /// + /// Inserts instructions before returns. Only works on void types. + /// + /// + /// + public static void InsertBeforeReturns(this ILProcessor processor, CodegenSession session, List instructions) + { + if (processor.Body.Method.ReturnType.FullName != session.Module.TypeSystem.Void.FullName) + { + session.LogError($"Cannot insert instructions before returns on {processor.Body.Method.FullName} because it does not return void."); + return; + } + + /* Insert at the end of the method + * and get the first instruction that was inserted. + * Any returns or breaks which would exit the method + * will jump to this instruction instead. */ + processor.InsertLast(instructions); + Instruction startInst = processor.Body.Instructions[processor.Body.Instructions.Count - instructions.Count]; + + //Look for anything that jumps to rets. + for (int i = 0; i < processor.Body.Instructions.Count; i++) + { + Instruction inst = processor.Body.Instructions[i]; + if (inst.Operand is Instruction operInst) + { + if (operInst.OpCode == OpCodes.Ret) + inst.Operand = startInst; + } + } + } + + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/ILProcessorExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Extension/ILProcessorExtensions.cs.meta new file mode 100644 index 0000000..dfed3f0 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/ILProcessorExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 820cf8401d4d71c4196dda444559ef8a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/InstructionExtensions.cs b/Assets/FishNet/CodeGenerating/Helpers/Extension/InstructionExtensions.cs new file mode 100644 index 0000000..aefd42c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/InstructionExtensions.cs @@ -0,0 +1,12 @@ +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using System; +using System.Collections.Generic; + +namespace FishNet.CodeGenerating.Helping +{ + public static class Instructions + { + } + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/InstructionExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Extension/InstructionExtensions.cs.meta new file mode 100644 index 0000000..ba87cbb --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/InstructionExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 360667149f16b6c4aba61fd05427cbfb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/MethodReferenceExtensions.cs b/Assets/FishNet/CodeGenerating/Helpers/Extension/MethodReferenceExtensions.cs new file mode 100644 index 0000000..d30decc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/MethodReferenceExtensions.cs @@ -0,0 +1,174 @@ +using FishNet.CodeGenerating.Extension; +using MonoFN.Cecil; +using MonoFN.Cecil.Rocks; +using System; + +namespace FishNet.CodeGenerating.Helping.Extension +{ + + internal static class MethodReferenceExtensions + { + + /// + /// Returns a custom attribute. + /// + public static CustomAttribute GetCustomAttribute(this MethodReference mr, string attributeFullName) + { + MethodDefinition md = mr.Resolve(); + return MethodDefinitionExtensions.GetCustomAttribute(md, attributeFullName); + } + + /// + /// Makes a generic method with specified arguments. + /// + /// + /// + /// + public static GenericInstanceMethod MakeGenericMethod(this MethodReference method, params TypeReference[] genericArguments) + { + GenericInstanceMethod result = new GenericInstanceMethod(method); + foreach (TypeReference argument in genericArguments) + result.GenericArguments.Add(argument); + return result; + } + + /// + /// Makes a generic method with the same arguments as the original. + /// + /// + /// + public static GenericInstanceMethod MakeGenericMethod(this MethodReference method) + { + GenericInstanceMethod result = new GenericInstanceMethod(method); + foreach (ParameterDefinition pd in method.Parameters) + result.GenericArguments.Add(pd.ParameterType); + + return result; + } + + /// + /// Returns a method reference for a generic method. + /// + public static MethodReference GetMethodReference(this MethodReference mr, CodegenSession session, TypeReference typeReference) + { + return mr.GetMethodReference(session, new TypeReference[] { typeReference }); + } + + /// + /// Returns a method reference for a generic method. + /// + public static MethodReference GetMethodReference(this MethodReference mr, CodegenSession session, TypeReference[] typeReferences) + { + if (mr.HasGenericParameters) + { + if (typeReferences == null || typeReferences.Length == 0) + { + session.LogError($"Method {mr.Name} has generic parameters but TypeReferences are null or 0 length."); + return null; + } + else + { + GenericInstanceMethod gim = mr.MakeGenericMethod(typeReferences); + return gim; + } + } + else + { + return mr; + } + } + + + /// + /// Gets a Resolve favoring cached results first. + /// + internal static MethodDefinition CachedResolve(this MethodReference methodRef, CodegenSession session) + { + return session.GetClass().GetMethodReferenceResolve(methodRef); + } + + /// + /// Removes ret if it exist at the end of the method. Returns if ret was removed. + /// + internal static bool RemoveEndRet(this MethodReference mr, CodegenSession session) + { + MethodDefinition md = mr.CachedResolve(session); + return MethodDefinitionExtensions.RemoveEndRet(md, session); + } + /// + /// Given a method of a generic class such as ArraySegment`T.get_Count, + /// and a generic instance such as ArraySegment`int + /// Creates a reference to the specialized method ArraySegment`int`.get_Count + /// Note that calling ArraySegment`T.get_Count directly gives an invalid IL error + /// + /// + /// + /// + public static MethodReference MakeHostInstanceGeneric(this MethodReference self, CodegenSession session, GenericInstanceType instanceType) + { + MethodReference reference = new MethodReference(self.Name, self.ReturnType, instanceType) + { + CallingConvention = self.CallingConvention, + HasThis = self.HasThis, + ExplicitThis = self.ExplicitThis + }; + + foreach (ParameterDefinition parameter in self.Parameters) + reference.Parameters.Add(new ParameterDefinition(parameter.ParameterType)); + + foreach (GenericParameter generic_parameter in self.GenericParameters) + reference.GenericParameters.Add(new GenericParameter(generic_parameter.Name, reference)); + + return session.ImportReference(reference); + } + /// + /// Given a method of a generic class such as ArraySegment`T.get_Count, + /// and a generic instance such as ArraySegment`int + /// Creates a reference to the specialized method ArraySegment`int`.get_Count + /// Note that calling ArraySegment`T.get_Count directly gives an invalid IL error + /// + /// + /// + /// + public static MethodReference MakeHostInstanceGeneric(this MethodReference self, TypeReference typeRef, params TypeReference[] args) + { + GenericInstanceType git = typeRef.MakeGenericInstanceType(args); + MethodReference reference = new MethodReference(self.Name, self.ReturnType, git) + { + CallingConvention = self.CallingConvention, + HasThis = self.HasThis, + ExplicitThis = self.ExplicitThis + }; + + foreach (ParameterDefinition parameter in self.Parameters) + reference.Parameters.Add(new ParameterDefinition(parameter.ParameterType)); + + foreach (GenericParameter generic_parameter in self.GenericParameters) + reference.GenericParameters.Add(new GenericParameter(generic_parameter.Name, reference)); + + return reference; + } + public static bool Is(this MethodReference method, string name) + { + return method.DeclaringType.Is() && method.Name == name; + } + public static bool Is(this TypeReference td) + { + return Is(td, typeof(T)); + } + + public static bool Is(this TypeReference td, Type t) + { + if (t.IsGenericType) + { + return td.GetElementType().FullName == t.FullName; + } + return td.FullName == t.FullName; + } + + + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/MethodReferenceExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Extension/MethodReferenceExtensions.cs.meta new file mode 100644 index 0000000..1a5c3a8 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/MethodReferenceExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee1c15a06ab386e439ec5aa41e3496f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/ModuleDefinitionExtensions.cs b/Assets/FishNet/CodeGenerating/Helpers/Extension/ModuleDefinitionExtensions.cs new file mode 100644 index 0000000..e52e04b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/ModuleDefinitionExtensions.cs @@ -0,0 +1,63 @@ +using FishNet.CodeGenerating.ILCore; +using MonoFN.Cecil; +using System; +using System.Linq.Expressions; +using System.Reflection; + +namespace FishNet.CodeGenerating.Helping.Extension +{ + + public static class ModuleDefinitionExtensions + { + /// + /// Gets a class within a module. + /// + /// + /// + public static TypeDefinition GetClass(this ModuleDefinition moduleDef, string className, string namespaceName = "") + { + if (namespaceName.Length == 0) + namespaceName = FishNetILPP.RUNTIME_ASSEMBLY_NAME; + + return moduleDef.GetType(namespaceName, className); + } + + public static MethodReference ImportReference(this ModuleDefinition moduleDef, Expression expression) + { + return ImportReference(moduleDef, (LambdaExpression)expression); + } + public static MethodReference ImportReference(this ModuleDefinition module, Expression> expression) + { + return ImportReference(module, (LambdaExpression)expression); + } + + public static MethodReference ImportReference(this ModuleDefinition module, LambdaExpression expression) + { + if (expression.Body is MethodCallExpression outermostExpression) + { + MethodInfo methodInfo = outermostExpression.Method; + return module.ImportReference(methodInfo); + } + + if (expression.Body is NewExpression newExpression) + { + ConstructorInfo methodInfo = newExpression.Constructor; + // constructor is null when creating an ArraySegment + methodInfo = methodInfo ?? newExpression.Type.GetConstructors()[0]; + return module.ImportReference(methodInfo); + } + + if (expression.Body is MemberExpression memberExpression) + { + var property = memberExpression.Member as PropertyInfo; + return module.ImportReference(property.GetMethod); + } + + throw new ArgumentException($"Invalid Expression {expression.Body.GetType()}"); + } + + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/ModuleDefinitionExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Extension/ModuleDefinitionExtensions.cs.meta new file mode 100644 index 0000000..a712e78 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/ModuleDefinitionExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42648785493390646898f5fa13e1dfd6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/ParameterDefinitionExtensions.cs b/Assets/FishNet/CodeGenerating/Helpers/Extension/ParameterDefinitionExtensions.cs new file mode 100644 index 0000000..542524a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/ParameterDefinitionExtensions.cs @@ -0,0 +1,24 @@ +using MonoFN.Cecil; +using System; + +namespace FishNet.CodeGenerating.Helping.Extension +{ + + internal static class ParameterDefinitionExtensions + { + /// + /// Returns if parameterDef is Type. + /// + /// + /// + /// + public static bool Is(this ParameterDefinition parameterDef, Type type) + { + return parameterDef.ParameterType.FullName == type.FullName; + } + + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/ParameterDefinitionExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Extension/ParameterDefinitionExtensions.cs.meta new file mode 100644 index 0000000..bcb2358 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/ParameterDefinitionExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31071055a2e388141b8f11e1ba4e147e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeDefinitionExtensions.cs b/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeDefinitionExtensions.cs new file mode 100644 index 0000000..37a1aaf --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeDefinitionExtensions.cs @@ -0,0 +1,500 @@ +using FishNet.CodeGenerating.Extension; +using MonoFN.Cecil; +using MonoFN.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace FishNet.CodeGenerating.Helping.Extension +{ + + + internal static class TypeDefinitionExtensionsOld + { + + /// + /// Creates a GenericInstanceType and adds parameters. + /// + internal static GenericInstanceType CreateGenericInstanceType(this TypeDefinition type, Collection parameters) + { + GenericInstanceType git = new GenericInstanceType(type); + foreach (GenericParameter gp in parameters) + git.GenericArguments.Add(gp); + + return git; + } + + /// + /// Finds public fields in type and base type + /// + /// + /// + public static IEnumerable FindAllPublicFields(this TypeDefinition typeDef, CodegenSession session + , System.Type[] excludedBaseTypes = null, string[] excludedAssemblyPrefixes = null) + { + + GeneralHelper gh = session.GetClass(); + while (typeDef != null) + { + if (IsExcluded(typeDef, excludedBaseTypes, excludedAssemblyPrefixes)) + break; + + foreach (FieldDefinition fd in typeDef.Fields) + { + if (fd.IsStatic) + continue; + if (fd.IsNotSerialized) + continue; + if (gh.HasExcludeSerializationAttribute(fd)) + continue; + if (fd.IsPrivate) + continue; + + yield return fd; + } + + try { typeDef = typeDef.BaseType?.CachedResolve(session); } + catch { break; } + } + } + + /// + /// Finds public properties on typeDef and all base types which have a public get/set accessor. + /// + /// + /// + public static IEnumerable FindAllPublicProperties(this TypeDefinition typeDef, CodegenSession session + , System.Type[] excludedBaseTypes = null, string[] excludedAssemblyPrefixes = null) + { + GeneralHelper gh = session.GetClass(); + while (typeDef != null) + { + if (IsExcluded(typeDef, excludedBaseTypes, excludedAssemblyPrefixes)) + break; + + foreach (PropertyDefinition pd in typeDef.Properties) + { + //Missing get or set method. + if (pd.GetMethod == null || pd.SetMethod == null) + continue; + if (gh.HasExcludeSerializationAttribute(pd)) + continue; + if (pd.GetMethod.IsPrivate) + continue; + if (pd.SetMethod.IsPrivate) + continue; + if (pd.GetMethod.ReturnType.IsGenericParameter) + continue; + + yield return pd; + } + + try { typeDef = typeDef.BaseType?.CachedResolve(session); } + catch { break; } + } + } + + /// + /// Returns if typeDef is excluded. + /// + private static bool IsExcluded(TypeDefinition typeDef, System.Type[] excludedBaseTypes = null, string[] excludedAssemblyPrefixes = null) + { + if (excludedBaseTypes != null) + { + foreach (System.Type t in excludedBaseTypes) + { + if (typeDef.FullName == t.FullName) + return true; + } + } + if (excludedAssemblyPrefixes != null) + { + foreach (string s in excludedAssemblyPrefixes) + { + int len = s.Length; + string tdAsmName = typeDef.Module.Assembly.FullName; + if (tdAsmName.Length >= len && tdAsmName.Substring(0, len).ToLower() == s.ToLower()) + return true; + } + } + + //Fall through, not excluded. + return false; + } + + + /// + /// Returns if typeDef is excluded. + /// + public static bool IsExcluded(this TypeDefinition typeDef, string excludedAssemblyPrefix) + { + + int len = excludedAssemblyPrefix.Length; + string tdAsmName = typeDef.Module.Assembly.FullName; + if (tdAsmName.Length >= len && tdAsmName.Substring(0, len).ToLower() == excludedAssemblyPrefix.ToLower()) + return true; + + //Fall through, not excluded. + return false; + } + + /// + /// Returns if typeDef or any of it's parents inherit from NetworkBehaviour. + /// + /// + /// + internal static bool InheritsNetworkBehaviour(this TypeDefinition typeDef, CodegenSession session) + { + string nbFullName = session.GetClass().FullName; + + TypeDefinition copyTd = typeDef; + while (copyTd != null) + { + if (copyTd.FullName == nbFullName) + return true; + + copyTd = copyTd.GetNextBaseTypeDefinition(session); + } + + //Fall through, network behaviour not found. + return false; + } + + /// + /// Returns a nested TypeDefinition of name. + /// + internal static TypeDefinition GetNestedType(this TypeDefinition typeDef, string name) + { + foreach (TypeDefinition nestedTd in typeDef.NestedTypes) + { + if (nestedTd.Name == name) + return nestedTd; + } + + return null; + } + + /// + /// Returns if the BaseType for TypeDef exist and is not NetworkBehaviour, + /// + /// + /// + internal static bool CanProcessBaseType(this TypeDefinition typeDef, CodegenSession session) + { + return (typeDef != null && typeDef.BaseType != null && typeDef.BaseType.FullName != session.GetClass().FullName); + } + /// + /// Returns if the BaseType for TypeDef exist and is not NetworkBehaviour, + /// + /// + /// + internal static TypeDefinition GetNextBaseClassToProcess(this TypeDefinition typeDef, CodegenSession session) + { + if (typeDef.BaseType != null && typeDef.BaseType.FullName != session.GetClass().FullName) + return typeDef.BaseType.CachedResolve(session); + else + return null; + } + + internal static TypeDefinition GetLastBaseClass(this TypeDefinition typeDef, CodegenSession session) + { + TypeDefinition copyTd = typeDef; + while (copyTd.BaseType != null) + copyTd = copyTd.BaseType.CachedResolve(session); + + return copyTd; + } + + /// + /// Searches for a type in current and inherited types. + /// + internal static TypeDefinition GetClassInInheritance(this TypeDefinition typeDef, CodegenSession session, string typeFullName) + { + TypeDefinition copyTd = typeDef; + do + { + if (copyTd.FullName == typeFullName) + return copyTd; + + if (copyTd.BaseType != null) + copyTd = copyTd.BaseType.CachedResolve(session); + else + copyTd = null; + + } while (copyTd != null); + + //Not found. + return null; + } + + /// + /// Searches for a type in current and inherited types. + /// + internal static TypeDefinition GetClassInInheritance(this TypeDefinition typeDef, CodegenSession session, TypeDefinition targetTypeDef) + { + if (typeDef == null) + return null; + + TypeDefinition copyTd = typeDef; + do + { + if (copyTd == targetTypeDef) + return copyTd; + + if (copyTd.BaseType != null) + copyTd = copyTd.BaseType.CachedResolve(session); + else + copyTd = null; + + } while (copyTd != null); + + //Not found. + return null; + } + + + + /// + /// Returns if typeDef is static (abstract, sealed). + /// + internal static bool IsStatic(this TypeDefinition typeDef) + { + //Combining flags in a single check some reason doesn't work right with HasFlag. + return (typeDef.Attributes.HasFlag(TypeAttributes.Abstract) && typeDef.Attributes.HasFlag(TypeAttributes.Sealed)); + } + + /// + /// Gets an enum underlying type for typeDef. + /// + /// + /// + internal static TypeReference GetEnumUnderlyingTypeReference(this TypeDefinition typeDef) + { + foreach (FieldDefinition field in typeDef.Fields) + { + if (!field.IsStatic) + return field.FieldType; + } + throw new ArgumentException($"Invalid enum {typeDef.FullName}"); + } + + /// + /// Returns if typeDef is derived from type. + /// + /// + /// + /// + internal static bool InheritsFrom(this TypeDefinition typeDef, CodegenSession session) + { + return typeDef.InheritsFrom(session, typeof(T)); + } + + /// + /// Returns if typeDef is derived from type. + /// + /// + /// + /// + internal static bool InheritsFrom(this TypeDefinition typeDef, CodegenSession session, Type type) + { + if (!typeDef.IsClass) + return false; + + TypeDefinition copyTd = typeDef; + while (copyTd.BaseType != null) + { + if (copyTd.BaseType.IsType(type)) + return true; + + copyTd = copyTd.GetNextBaseTypeDefinition(session); + } + + //Fall through. + return false; + } + + /// + /// Adds a method to typeDef. + /// + /// + /// + /// + /// + internal static MethodDefinition AddMethod(this TypeDefinition typDef, string methodName, MethodAttributes attributes) + { + return AddMethod(typDef, methodName, attributes, typDef.Module.ImportReference(typeof(void))); + } + /// + /// Adds a method to typeDef. + /// + /// + /// + /// + /// + /// + internal static MethodDefinition AddMethod(this TypeDefinition typeDef, string methodName, MethodAttributes attributes, TypeReference typeReference) + { + var method = new MethodDefinition(methodName, attributes, typeReference); + typeDef.Methods.Add(method); + return method; + } + + /// + /// Returns if a type is a subclass of another. + /// + /// + /// + /// + internal static bool IsSubclassOf(this TypeDefinition typeDef,CodegenSession session, string ClassTypeFullName) + { + if (!typeDef.IsClass) return false; + + TypeReference baseTypeRef = typeDef.BaseType; + while (baseTypeRef != null) + { + if (baseTypeRef.FullName == ClassTypeFullName) + { + return true; + } + + try + { + baseTypeRef = baseTypeRef.CachedResolve(session).BaseType; + } + catch + { + return false; + } + } + + return false; + } + + /// + /// Gets a field reference by name. + /// + /// + /// + /// + public static FieldReference GetFieldReference(this TypeDefinition typeDef, string fieldName, CodegenSession session) + { + if (typeDef.HasFields) + { + for (int i = 0; i < typeDef.Fields.Count; i++) + { + if (typeDef.Fields[i].Name == fieldName) + return session.ImportReference(typeDef.Fields[i]); + } + } + + return null; + } + + + /// + /// Returns if the TypeDefinition implements TInterface. + /// + /// + /// + /// + public static bool ImplementsInterface(this TypeDefinition typeDef) + { + if (typeDef.Interfaces == null) + return false; + for (int i = 0; i < typeDef.Interfaces.Count; i++) + { + if (typeDef.Interfaces[i].InterfaceType.Is()) + return true; + } + + return false; + } + + /// + /// Returns if the TypeDefinition implements TInterface. + /// + /// + /// + /// + public static bool ImplementsInterface(this TypeDefinition typeDef, string interfaceName) + { + for (int i = 0; i < typeDef.Interfaces.Count; i++) + { + if (typeDef.Interfaces[i].InterfaceType.FullName == interfaceName) + return true; + } + + return false; + } + + + + + /// + /// Returns if the TypeDefinition implements TInterface. + /// + /// + /// + /// + public static bool ImplementsInterfaceRecursive(this TypeDefinition typeDef, CodegenSession session) + { + TypeDefinition climbTypeDef = typeDef; + + while (climbTypeDef != null) + { + if (climbTypeDef.Interfaces.Any(i => i.InterfaceType.Is())) + return true; + + try + { + if (climbTypeDef.BaseType != null) + climbTypeDef = climbTypeDef.BaseType.CachedResolve(session); + else + climbTypeDef = null; + } + //Could not resolve assembly; can happen for assemblies being checked outside FishNet/csharp. + catch (AssemblyResolutionException) + { + break; + } + } + + return false; + } + + /// + /// Returns if the TypeDefinition implements TInterface. + /// + /// + /// + /// + public static bool ImplementsInterfaceRecursive(this TypeDefinition typeDef, CodegenSession session, string interfaceName) + { + TypeDefinition climbTypeDef = typeDef; + + while (climbTypeDef != null) + { + if (climbTypeDef.Interfaces.Any(i => i.InterfaceType.FullName == interfaceName)) + return true; + + try + { + if (climbTypeDef.BaseType != null) + climbTypeDef = climbTypeDef.BaseType.CachedResolve(session); + else + climbTypeDef = null; + } + //Could not resolve assembly; can happen for assemblies being checked outside FishNet/csharp. + catch (AssemblyResolutionException) + { + break; + } + } + + return false; + } + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeDefinitionExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeDefinitionExtensions.cs.meta new file mode 100644 index 0000000..da8687a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeDefinitionExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 645e49fe7eeff3a4e9eb65d77fc6e2ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeReferenceExtensions.cs b/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeReferenceExtensions.cs new file mode 100644 index 0000000..6b4112e --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeReferenceExtensions.cs @@ -0,0 +1,138 @@ +using MonoFN.Cecil; +using MonoFN.Cecil.Rocks; +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FishNet.CodeGenerating.Helping.Extension +{ + + internal static class TypeReferenceExtensionsOld + { + + /// + /// Gets a Resolve favoring cached results first. + /// + internal static TypeDefinition CachedResolve(this TypeReference typeRef, CodegenSession session) + { + return session.GetClass().GetTypeReferenceResolve(typeRef); + } + + /// + /// Returns if typeRef is a class or struct. + /// + internal static bool IsClassOrStruct(this TypeReference typeRef, CodegenSession session) + { + TypeDefinition typeDef = typeRef.CachedResolve(session); + return (!typeDef.IsPrimitive && !typeDef.IsEnum && (typeDef.IsClass || typeDef.IsValueType)); + } + + /// + /// Returns all properties on typeRef and all base types which have a public get/set accessor. + /// + /// + /// + public static IEnumerable FindAllSerializableProperties(this TypeReference typeRef, CodegenSession session, System.Type[] excludedBaseTypes = null, string[] excludedAssemblyPrefixes = null) + { + return typeRef.CachedResolve(session).FindAllPublicProperties(session, excludedBaseTypes, excludedAssemblyPrefixes); + } + + + /// + /// Gets all public fields in typeRef and base type. + /// + /// + /// + public static IEnumerable FindAllSerializableFields(this TypeReference typeRef, CodegenSession session, + System.Type[] excludedBaseTypes = null, string[] excludedAssemblyPrefixes = null) + { + return typeRef.Resolve().FindAllPublicFields(session, excludedBaseTypes, excludedAssemblyPrefixes); + } + + + /// + /// Returns if a typeRef is type. + /// + /// + /// + /// + public static bool IsType(this TypeReference typeRef, Type type) + { + if (type.IsGenericType) + return typeRef.GetElementType().FullName == type.FullName; + else + return typeRef.FullName == type.FullName; + } + + + + /// + /// Returns if typeRef is a multidimensional array. + /// + /// + /// + public static bool IsMultidimensionalArray(this TypeReference typeRef) + { + return typeRef is ArrayType arrayType && arrayType.Rank > 1; + } + + + /// + /// Returns if typeRef can be resolved. + /// + /// + /// + public static bool CanBeResolved(this TypeReference typeRef, CodegenSession session) + { + while (typeRef != null) + { + if (typeRef.Scope.Name == "Windows") + { + return false; + } + + if (typeRef.Scope.Name == "mscorlib") + { + TypeDefinition resolved = typeRef.CachedResolve(session); + return resolved != null; + } + + try + { + typeRef = typeRef.CachedResolve(session).BaseType; + } + catch + { + return false; + } + } + return true; + } + + /// + /// Creates a generic type out of another type, if needed. + /// + /// + /// + public static TypeReference ConvertToGenericIfNeeded(this TypeDefinition type) + { + if (type.HasGenericParameters) + { + // get all the generic parameters and make a generic instance out of it + TypeReference[] genericTypes = new TypeReference[type.GenericParameters.Count]; + for (int i = 0; i < type.GenericParameters.Count; i++) + { + genericTypes[i] = type.GenericParameters[i].GetElementType(); + } + + return type.MakeGenericInstanceType(genericTypes); + } + else + { + return type; + } + } + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeReferenceExtensions.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeReferenceExtensions.cs.meta new file mode 100644 index 0000000..5edaeb9 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Extension/TypeReferenceExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2344f5ab0fda07b498c03fbe0e082c14 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/GeneralHelper.cs b/Assets/FishNet/CodeGenerating/Helpers/GeneralHelper.cs new file mode 100644 index 0000000..bb308fc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/GeneralHelper.cs @@ -0,0 +1,1353 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.CodeGenerating.ILCore; +using FishNet.Managing; +using FishNet.Managing.Logging; +using FishNet.Object; +using FishNet.Object.Helping; +using FishNet.Serializing; +using FishNet.Serializing.Helping; +using FishNet.Utility.Performance; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Rocks; +using System; +using System.Collections.Generic; +using UnityEngine; +using SR = System.Reflection; + +namespace FishNet.CodeGenerating.Helping +{ + internal class GeneralHelper : CodegenBase + { + #region Reflection references. + public string ExcludeSerializationAttribute_FullName; + public string NotSerializerAttribute_FullName; + public MethodReference Extension_Attribute_Ctor_MethodRef; + public MethodReference BasicQueue_Clear_MethodRef; + public TypeReference List_TypeRef; + public MethodReference List_Clear_MethodRef; + public MethodReference List_get_Item_MethodRef; + public MethodReference List_get_Count_MethodRef; + public MethodReference List_Add_MethodRef; + public MethodReference List_RemoveRange_MethodRef; + public GenericInstanceType ArraySegment_Byte_Git; + public MethodReference InstanceFinder_NetworkManager_MethodRef; + public MethodReference NetworkBehaviour_CanLog_MethodRef; + public MethodReference NetworkBehaviour_NetworkManager_MethodRef; + public MethodReference NetworkManager_Log_MethodRef; + public MethodReference NetworkManager_LogWarning_MethodRef; + public MethodReference NetworkManager_LogError_MethodRef; + public MethodReference Debug_LogCommon_MethodRef; + public MethodReference Debug_LogWarning_MethodRef; + public MethodReference Debug_LogError_MethodRef; + public MethodReference IsServer_MethodRef; + public MethodReference IsClient_MethodRef; + public MethodReference NetworkObject_Deinitializing_MethodRef; + public MethodReference Application_IsPlaying_MethodRef; + public string NonSerialized_Attribute_FullName; + public string Single_FullName; + public TypeReference FunctionT2TypeRef; + public TypeReference FunctionT3TypeRef; + public MethodReference FunctionT2ConstructorMethodRef; + public MethodReference FunctionT3ConstructorMethodRef; + //GeneratedComparer + public MethodReference PublicPropertyComparer_Compare_Set_MethodRef; + public MethodReference PublicPropertyComparer_IsDefault_Set_MethodRef; + public TypeReference GeneratedComparer_TypeRef; + public TypeDefinition GeneratedComparer_ClassTypeDef; + public MethodDefinition GeneratedComparer_OnLoadMethodDef; + public TypeReference IEquatable_TypeRef; + //Actions. + public TypeReference ActionT2_TypeRef; + public TypeReference ActionT3_TypeRef; + public MethodReference ActionT2Constructor_MethodRef; + public MethodReference ActionT3Constructor_MethodRef; + + private Dictionary _importedTypeReferences = new Dictionary(); + private Dictionary _importedFieldReferences = new Dictionary(); + private Dictionary _methodReferenceResolves = new Dictionary(); + private Dictionary _typeReferenceResolves = new Dictionary(); + private Dictionary _fieldReferenceResolves = new Dictionary(); + private Dictionary _comparerDelegates = new Dictionary(); + #endregion + + #region Const. + public const string UNITYENGINE_ASSEMBLY_PREFIX = "UnityEngine."; + #endregion + + public override bool ImportReferences() + { + Type tmpType; + TypeReference tmpTr; + SR.PropertyInfo tmpPi; + + NonSerialized_Attribute_FullName = typeof(NonSerializedAttribute).FullName; + Single_FullName = typeof(float).FullName; + + ActionT2_TypeRef = base.ImportReference(typeof(Action<,>)); + ActionT3_TypeRef = base.ImportReference(typeof(Action<,,>)); + ActionT2Constructor_MethodRef = base.ImportReference(typeof(Action<,>).GetConstructors()[0]); + ActionT3Constructor_MethodRef = base.ImportReference(typeof(Action<,,>).GetConstructors()[0]); + + ExcludeSerializationAttribute_FullName = typeof(ExcludeSerializationAttribute).FullName; + NotSerializerAttribute_FullName = typeof(NotSerializerAttribute).FullName; + + tmpType = typeof(BasicQueue<>); + base.ImportReference(tmpType); + foreach (SR.MethodInfo mi in tmpType.GetMethods()) + { + if (mi.Name == nameof(BasicQueue.Clear)) + BasicQueue_Clear_MethodRef = base.ImportReference(mi); + } + + /* MISC */ + // + tmpType = typeof(UnityEngine.Application); + tmpPi = tmpType.GetProperty(nameof(UnityEngine.Application.isPlaying)); + if (tmpPi != null) + Application_IsPlaying_MethodRef = base.ImportReference(tmpPi.GetMethod); + // + tmpType = typeof(System.Runtime.CompilerServices.ExtensionAttribute); + tmpTr = base.ImportReference(tmpType); + Extension_Attribute_Ctor_MethodRef = base.ImportReference(tmpTr.GetDefaultConstructor(base.Session)); + + //Networkbehaviour. + Type networkBehaviourType = typeof(NetworkBehaviour); + foreach (SR.MethodInfo methodInfo in networkBehaviourType.GetMethods()) + { + if (methodInfo.Name == nameof(NetworkBehaviour.CanLog)) + NetworkBehaviour_CanLog_MethodRef = base.ImportReference(methodInfo); + } + foreach (SR.PropertyInfo propertyInfo in networkBehaviourType.GetProperties()) + { + if (propertyInfo.Name == nameof(NetworkBehaviour.NetworkManager)) + NetworkBehaviour_NetworkManager_MethodRef = base.ImportReference(propertyInfo.GetMethod); + } + + //Instancefinder. + Type instanceFinderType = typeof(InstanceFinder); + SR.PropertyInfo getNetworkManagerPropertyInfo = instanceFinderType.GetProperty(nameof(InstanceFinder.NetworkManager)); + InstanceFinder_NetworkManager_MethodRef = base.ImportReference(getNetworkManagerPropertyInfo.GetMethod); + + //NetworkManager debug logs. + Type networkManagerExtensionsType = typeof(NetworkManagerExtensions); + foreach (SR.MethodInfo methodInfo in networkManagerExtensionsType.GetMethods()) + { + //These extension methods will have two parameters: the type extension is for, and value. + if (methodInfo.GetParameters().Length == 2) + { + if (methodInfo.Name == nameof(NetworkManagerExtensions.Log)) + NetworkManager_Log_MethodRef = base.ImportReference(methodInfo); + else if (methodInfo.Name == nameof(NetworkManagerExtensions.LogWarning)) + NetworkManager_LogWarning_MethodRef = base.ImportReference(methodInfo); + else if (methodInfo.Name == nameof(NetworkManagerExtensions.LogError)) + NetworkManager_LogError_MethodRef = base.ImportReference(methodInfo); + } + } + + //ArraySegment + TypeReference arraySegmentTr = base.ImportReference(typeof(ArraySegment<>)); + ArraySegment_Byte_Git = arraySegmentTr.MakeGenericInstanceType(new TypeReference[] { GetTypeReference(typeof(byte)) }); + + //Lists. + tmpType = typeof(List<>); + List_TypeRef = base.ImportReference(tmpType); + SR.MethodInfo lstMi; + lstMi = tmpType.GetMethod("Add"); + List_Add_MethodRef = base.ImportReference(lstMi); + lstMi = tmpType.GetMethod("RemoveRange"); + List_RemoveRange_MethodRef = base.ImportReference(lstMi); + lstMi = tmpType.GetMethod("get_Count"); + List_get_Count_MethodRef = base.ImportReference(lstMi); + lstMi = tmpType.GetMethod("get_Item"); + List_get_Item_MethodRef = base.ImportReference(lstMi); + lstMi = tmpType.GetMethod("Clear"); + List_Clear_MethodRef = base.ImportReference(lstMi); + + //Unity debug logs. + Type debugType = typeof(UnityEngine.Debug); + foreach (SR.MethodInfo methodInfo in debugType.GetMethods()) + { + if (methodInfo.Name == nameof(Debug.LogWarning) && methodInfo.GetParameters().Length == 1) + Debug_LogWarning_MethodRef = base.ImportReference(methodInfo); + else if (methodInfo.Name == nameof(Debug.LogError) && methodInfo.GetParameters().Length == 1) + Debug_LogError_MethodRef = base.ImportReference(methodInfo); + else if (methodInfo.Name == nameof(Debug.Log) && methodInfo.GetParameters().Length == 1) + Debug_LogCommon_MethodRef = base.ImportReference(methodInfo); + } + + Type codegenHelper = typeof(CodegenHelper); + foreach (SR.MethodInfo methodInfo in codegenHelper.GetMethods()) + { + if (methodInfo.Name == nameof(CodegenHelper.NetworkObject_Deinitializing)) + NetworkObject_Deinitializing_MethodRef = base.ImportReference(methodInfo); + else if (methodInfo.Name == nameof(CodegenHelper.IsClient)) + IsClient_MethodRef = base.ImportReference(methodInfo); + else if (methodInfo.Name == nameof(CodegenHelper.IsServer)) + IsServer_MethodRef = base.ImportReference(methodInfo); + } + + //Generic functions. + FunctionT2TypeRef = base.ImportReference(typeof(Func<,>)); + FunctionT3TypeRef = base.ImportReference(typeof(Func<,,>)); + FunctionT2ConstructorMethodRef = base.ImportReference(typeof(Func<,>).GetConstructors()[0]); + FunctionT3ConstructorMethodRef = base.ImportReference(typeof(Func<,,>).GetConstructors()[0]); + + GeneratedComparers(); + + //Sets up for generated comparers. + void GeneratedComparers() + { + GeneralHelper gh = base.GetClass(); + GeneratedComparer_ClassTypeDef = gh.GetOrCreateClass(out _, WriterProcessor.GENERATED_TYPE_ATTRIBUTES, "GeneratedComparers___Internal", null, WriterProcessor.GENERATED_WRITER_NAMESPACE); + bool created; + GeneratedComparer_OnLoadMethodDef = gh.GetOrCreateMethod(GeneratedComparer_ClassTypeDef, out created, WriterProcessor.INITIALIZEONCE_METHOD_ATTRIBUTES, WriterProcessor.INITIALIZEONCE_METHOD_NAME, base.Module.TypeSystem.Void); + if (created) + { + gh.CreateRuntimeInitializeOnLoadMethodAttribute(GeneratedComparer_OnLoadMethodDef); + GeneratedComparer_OnLoadMethodDef.Body.GetILProcessor().Emit(OpCodes.Ret); + } + + System.Type ppComparerType = typeof(PublicPropertyComparer<>); + GeneratedComparer_TypeRef = base.ImportReference(ppComparerType); + System.Reflection.PropertyInfo pi; + pi = ppComparerType.GetProperty(nameof(PublicPropertyComparer.Compare)); + PublicPropertyComparer_Compare_Set_MethodRef = base.ImportReference(pi.GetSetMethod()); + pi = ppComparerType.GetProperty(nameof(PublicPropertyComparer.IsDefault)); + PublicPropertyComparer_IsDefault_Set_MethodRef = base.ImportReference(pi.GetSetMethod()); + + System.Type iEquatableType = typeof(IEquatable<>); + IEquatable_TypeRef = base.ImportReference(iEquatableType); + } + + return true; + } + + + + #region Resolves. + /// + /// Adds a typeRef to TypeReferenceResolves. + /// + public void AddTypeReferenceResolve(TypeReference typeRef, TypeDefinition typeDef) + { + _typeReferenceResolves[typeRef] = typeDef; + } + + /// + /// Gets a TypeDefinition for typeRef. + /// + public TypeDefinition GetTypeReferenceResolve(TypeReference typeRef) + { + TypeDefinition result; + if (_typeReferenceResolves.TryGetValue(typeRef, out result)) + { + return result; + } + else + { + result = typeRef.Resolve(); + AddTypeReferenceResolve(typeRef, result); + } + + return result; + } + + /// + /// Adds a methodRef to MethodReferenceResolves. + /// + public void AddMethodReferenceResolve(MethodReference methodRef, MethodDefinition methodDef) + { + _methodReferenceResolves[methodRef] = methodDef; + } + + /// + /// Gets a TypeDefinition for typeRef. + /// + public MethodDefinition GetMethodReferenceResolve(MethodReference methodRef) + { + MethodDefinition result; + if (_methodReferenceResolves.TryGetValue(methodRef, out result)) + { + return result; + } + else + { + result = methodRef.Resolve(); + AddMethodReferenceResolve(methodRef, result); + } + + return result; + } + + + /// + /// Adds a fieldRef to FieldReferenceResolves. + /// + public void AddFieldReferenceResolve(FieldReference fieldRef, FieldDefinition fieldDef) + { + _fieldReferenceResolves[fieldRef] = fieldDef; + } + + /// + /// Gets a FieldDefinition for fieldRef. + /// + public FieldDefinition GetFieldReferenceResolve(FieldReference fieldRef) + { + FieldDefinition result; + if (_fieldReferenceResolves.TryGetValue(fieldRef, out result)) + { + return result; + } + else + { + result = fieldRef.Resolve(); + AddFieldReferenceResolve(fieldRef, result); + } + + return result; + } + #endregion + + + /// + /// Makes a method an extension method. + /// + public void MakeExtensionMethod(MethodDefinition md) + { + if (md.Parameters.Count == 0) + { + base.LogError($"Method {md.FullName} cannot be made an extension method because it has no parameters."); + return; + } + + md.Attributes |= (MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig); + CustomAttribute ca = new CustomAttribute(Extension_Attribute_Ctor_MethodRef); + md.CustomAttributes.Add(ca); + } + + #region HasExcludeSerializationAttribute + /// + /// Returns if typeDef should be ignored. + /// + /// + /// + public bool HasExcludeSerializationAttribute(TypeDefinition typeDef) + { + foreach (CustomAttribute item in typeDef.CustomAttributes) + { + if (item.AttributeType.FullName == ExcludeSerializationAttribute_FullName) + return true; + } + + return false; + } + + /// + /// Returns if type uses CodegenExcludeAttribute. + /// + public bool HasExcludeSerializationAttribute(SR.MethodInfo methodInfo) + { + foreach (SR.CustomAttributeData item in methodInfo.CustomAttributes) + { + if (item.AttributeType.FullName == ExcludeSerializationAttribute_FullName) + return true; + } + + return false; + } + + /// + /// Returns if type uses CodegenExcludeAttribute. + /// + public bool HasExcludeSerializationAttribute(MethodDefinition methodDef) + { + foreach (CustomAttribute item in methodDef.CustomAttributes) + { + if (item.AttributeType.FullName == ExcludeSerializationAttribute_FullName) + return true; + } + + return false; + } + + /// + /// Returns if type uses CodegenExcludeAttribute. + /// + public bool HasExcludeSerializationAttribute(FieldDefinition fieldDef) + { + foreach (CustomAttribute item in fieldDef.CustomAttributes) + { + if (item.AttributeType.FullName == ExcludeSerializationAttribute_FullName) + return true; + } + + return false; + } + + /// + /// Returns if type uses CodegenExcludeAttribute. + /// + public bool HasExcludeSerializationAttribute(PropertyDefinition propDef) + { + foreach (CustomAttribute item in propDef.CustomAttributes) + { + if (item.AttributeType.FullName == ExcludeSerializationAttribute_FullName) + return true; + } + + return false; + } + #endregion + + #region NotSerializableAttribute + /// + /// Returns if type uses CodegenExcludeAttribute. + /// + public bool HasNotSerializableAttribute(SR.MethodInfo methodInfo) + { + foreach (SR.CustomAttributeData item in methodInfo.CustomAttributes) + { + if (item.AttributeType.FullName == NotSerializerAttribute_FullName) + return true; + } + + return false; + } + + /// + /// Returns if type uses CodegenExcludeAttribute. + /// + public bool HasNotSerializableAttribute(MethodDefinition methodDef) + { + foreach (CustomAttribute item in methodDef.CustomAttributes) + { + if (item.AttributeType.FullName == NotSerializerAttribute_FullName) + return true; + } + + return false; + } + #endregion + + /// + /// Calls copiedMd with the assumption md shares the same parameters. + /// + public void CallCopiedMethod(MethodDefinition md, MethodDefinition copiedMd) + { + ILProcessor processor = md.Body.GetILProcessor(); + processor.Emit(OpCodes.Ldarg_0); + foreach (var item in copiedMd.Parameters) + processor.Emit(OpCodes.Ldarg, item); + + MethodReference mr = copiedMd.GetMethodReference(base.Session); + processor.Emit(OpCodes.Call, mr); + + } + + /// + /// Removes countVd from list of dataFd starting at index 0. + /// + public List ListRemoveRange(MethodDefinition methodDef, FieldDefinition dataFd, TypeReference dataTr, VariableDefinition countVd) + { + /* Remove entries which exceed maximum buffer. */ + //Method references for uint/data list: + //get_count, RemoveRange. */ + GenericInstanceType dataListGit; + GetGenericList(dataTr, out dataListGit); + MethodReference lstDataRemoveRangeMr = base.GetClass().List_RemoveRange_MethodRef.MakeHostInstanceGeneric(base.Session, dataListGit); + + List insts = new List(); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + //Index 1 is the uint, 0 is the data. + insts.Add(processor.Create(OpCodes.Ldarg_0));//this. + insts.Add(processor.Create(OpCodes.Ldfld, dataFd)); + insts.Add(processor.Create(OpCodes.Ldc_I4_0)); + insts.Add(processor.Create(OpCodes.Ldloc, countVd)); + insts.Add(processor.Create(lstDataRemoveRangeMr.GetCallOpCode(base.Session), lstDataRemoveRangeMr)); + + return insts; + } + /// + /// Outputs generic lists for dataTr and uint. + /// + public void GetGenericList(TypeReference dataTr, out GenericInstanceType lstData) + { + TypeReference listDataTr = base.ImportReference(typeof(List<>)); + lstData = listDataTr.MakeGenericInstanceType(new TypeReference[] { dataTr }); + } + /// + /// Outputs generic lists for dataTr and uint. + /// + public void GetGenericBasicQueue(TypeReference dataTr, out GenericInstanceType queueData) + { + TypeReference queueDataTr = base.ImportReference(typeof(BasicQueue<>)); + queueData = queueDataTr.MakeGenericInstanceType(new TypeReference[] { dataTr }); + } + + /// + /// Copies one method to another while transferring diagnostic paths. + /// + public MethodDefinition CopyIntoNewMethod(MethodDefinition originalMd, string toMethodName, out bool alreadyCreated) + { + TypeDefinition typeDef = originalMd.DeclaringType; + + MethodDefinition md = typeDef.GetOrCreateMethodDefinition(base.Session, toMethodName, originalMd, true, out bool created); + alreadyCreated = !created; + if (alreadyCreated) + return md; + + (md.Body, originalMd.Body) = (originalMd.Body, md.Body); + //Move over all the debugging information + foreach (SequencePoint sequencePoint in originalMd.DebugInformation.SequencePoints) + md.DebugInformation.SequencePoints.Add(sequencePoint); + originalMd.DebugInformation.SequencePoints.Clear(); + + foreach (CustomDebugInformation customInfo in originalMd.CustomDebugInformations) + md.CustomDebugInformations.Add(customInfo); + originalMd.CustomDebugInformations.Clear(); + //Swap debuginformation scope. + (originalMd.DebugInformation.Scope, md.DebugInformation.Scope) = (md.DebugInformation.Scope, originalMd.DebugInformation.Scope); + + return md; + } + + /// + /// Copies one method to another while transferring diagnostic paths. + /// + public MethodDefinition CopyMethodSignature(MethodDefinition originalMd, string toMethodName, out bool alreadyCreated) + { + TypeDefinition typeDef = originalMd.DeclaringType; + + MethodDefinition md = typeDef.GetOrCreateMethodDefinition(base.Session, toMethodName, originalMd, true, out bool created); + alreadyCreated = !created; + if (alreadyCreated) + return md; + + return md; + } + + + /// + /// Creates the RuntimeInitializeOnLoadMethod attribute for a method. + /// + public void CreateRuntimeInitializeOnLoadMethodAttribute(MethodDefinition methodDef, string loadType = "") + { + TypeReference attTypeRef = GetTypeReference(typeof(RuntimeInitializeOnLoadMethodAttribute)); + foreach (CustomAttribute item in methodDef.CustomAttributes) + { + //Already exist. + if (item.AttributeType.FullName == attTypeRef.FullName) + return; + } + + int parameterRequirement = (loadType.Length == 0) ? 0 : 1; + MethodDefinition constructorMethodDef = attTypeRef.GetConstructor(base.Session, parameterRequirement); + MethodReference constructorMethodRef = base.ImportReference(constructorMethodDef); + CustomAttribute ca = new CustomAttribute(constructorMethodRef); + /* If load type isn't null then it + * has to be passed in as the first argument. */ + if (loadType.Length > 0) + { + Type t = typeof(RuntimeInitializeLoadType); + foreach (UnityEngine.RuntimeInitializeLoadType value in t.GetEnumValues()) + { + if (loadType == value.ToString()) + { + TypeReference tr = base.ImportReference(t); + CustomAttributeArgument arg = new CustomAttributeArgument(tr, value); + ca.ConstructorArguments.Add(arg); + } + } + } + + methodDef.CustomAttributes.Add(ca); + } + + /// + /// Gets the default AutoPackType to use for typeRef. + /// + /// + /// + public AutoPackType GetDefaultAutoPackType(TypeReference typeRef) + { + //Singles are defauled to unpacked. + if (typeRef.FullName == Single_FullName) + return AutoPackType.Unpacked; + else + return AutoPackType.Packed; + } + + /// + /// Gets the InitializeOnce method in typeDef or creates the method should it not exist. + /// + /// + /// + public MethodDefinition GetOrCreateMethod(TypeDefinition typeDef, out bool created, MethodAttributes methodAttr, string methodName, TypeReference returnType) + { + MethodDefinition result = typeDef.GetMethod(methodName); + if (result == null) + { + created = true; + result = new MethodDefinition(methodName, methodAttr, returnType); + typeDef.Methods.Add(result); + } + else + { + created = false; + } + + return result; + } + + + /// + /// Gets a class within moduleDef or creates and returns the class if it does not already exist. + /// + /// + /// + public TypeDefinition GetOrCreateClass(out bool created, TypeAttributes typeAttr, string className, TypeReference baseTypeRef, string namespaceName = WriterProcessor.GENERATED_WRITER_NAMESPACE) + { + if (namespaceName.Length == 0) + namespaceName = FishNetILPP.RUNTIME_ASSEMBLY_NAME; + + TypeDefinition type = base.Module.GetClass(className, namespaceName); + if (type != null) + { + created = false; + return type; + } + else + { + created = true; + type = new TypeDefinition(namespaceName, className, + typeAttr, base.ImportReference(typeof(object))); + //Add base class if specified. + if (baseTypeRef != null) + type.BaseType = base.ImportReference(baseTypeRef); + + base.Module.Types.Add(type); + return type; + } + } + + #region HasNonSerializableAttribute + /// + /// Returns if fieldDef has a NonSerialized attribute. + /// + /// + /// + public bool HasNonSerializableAttribute(FieldDefinition fieldDef) + { + foreach (CustomAttribute customAttribute in fieldDef.CustomAttributes) + { + if (customAttribute.AttributeType.FullName == NonSerialized_Attribute_FullName) + return true; + } + + //Fall through, no matches. + return false; + } + /// + /// Returns if typeDef has a NonSerialized attribute. + /// + /// + /// + public bool HasNonSerializableAttribute(TypeDefinition typeDef) + { + foreach (CustomAttribute customAttribute in typeDef.CustomAttributes) + { + if (customAttribute.AttributeType.FullName == NonSerialized_Attribute_FullName) + return true; + } + + //Fall through, no matches. + return false; + } + #endregion + + /// + /// Gets a TypeReference for a type. + /// + /// + public TypeReference GetTypeReference(Type type) + { + TypeReference result; + if (!_importedTypeReferences.TryGetValue(type, out result)) + { + result = base.ImportReference(type); + _importedTypeReferences.Add(type, result); + } + + return result; + } + + /// + /// Gets a FieldReference for a type. + /// + /// + public FieldReference GetFieldReference(FieldDefinition fieldDef) + { + FieldReference result; + if (!_importedFieldReferences.TryGetValue(fieldDef, out result)) + { + result = base.ImportReference(fieldDef); + _importedFieldReferences.Add(fieldDef, result); + } + + return result; + } + + /// + /// Gets the current constructor for typeDef, or makes a new one if constructor doesn't exist. + /// + /// + /// + public MethodDefinition GetOrCreateConstructor(TypeDefinition typeDef, out bool created, bool makeStatic) + { + // find constructor + MethodDefinition constructorMethodDef = typeDef.GetMethod(".cctor"); + if (constructorMethodDef == null) + constructorMethodDef = typeDef.GetMethod(".ctor"); + + //Constructor already exist. + if (constructorMethodDef != null) + { + if (!makeStatic) + constructorMethodDef.Attributes &= ~MethodAttributes.Static; + + created = false; + } + //Static constructor does not exist yet. + else + { + created = true; + MethodAttributes methodAttr = (MonoFN.Cecil.MethodAttributes.HideBySig | + MonoFN.Cecil.MethodAttributes.SpecialName | + MonoFN.Cecil.MethodAttributes.RTSpecialName); + if (makeStatic) + methodAttr |= MonoFN.Cecil.MethodAttributes.Static; + + //Create a constructor. + constructorMethodDef = new MethodDefinition(".ctor", methodAttr, + typeDef.Module.TypeSystem.Void + ); + + typeDef.Methods.Add(constructorMethodDef); + + //Add ret. + ILProcessor processor = constructorMethodDef.Body.GetILProcessor(); + processor.Emit(OpCodes.Ret); + } + + return constructorMethodDef; + } + + /// + /// Creates a return of boolean type. + /// + /// + /// + public void CreateRetBoolean(ILProcessor processor, bool result) + { + OpCode code = (result) ? OpCodes.Ldc_I4_1 : OpCodes.Ldc_I4_0; + processor.Emit(code); + processor.Emit(OpCodes.Ret); + } + + #region Debug logging. + /// + /// Creates instructions to log using a NetworkManager or Unity logging. + /// + public List LogMessage(MethodDefinition md, string message, LoggingType loggingType) + { + ILProcessor processor = md.Body.GetILProcessor(); + List instructions = new List(); + if (loggingType == LoggingType.Off) + { + base.LogError($"LogMessage called with LoggingType.Off."); + return instructions; + } + + /* Try to store NetworkManager from base to a variable. + * If the base does not exist, such as not inheriting from NetworkBehaviour, + * or if null because the object is not initialized, then use InstanceFinder to + * retrieve the NetworkManager. Then if NetworkManager was found, perform the log. */ + VariableDefinition networkManagerVd = CreateVariable(processor.Body.Method, typeof(NetworkManager)); + + bool useStatic = (md.IsStatic || !md.DeclaringType.InheritsFrom(base.Session)); + //If does not inherit NB then use InstanceFinder. + if (useStatic) + { + instructions.Add(processor.Create(OpCodes.Ldnull)); + instructions.Add(processor.Create(OpCodes.Stloc, networkManagerVd)); + } + //Inherits NB, load from base.NetworkManager. + else + { + instructions.Add(processor.Create(OpCodes.Ldarg_0)); + instructions.Add(processor.Create(OpCodes.Call, NetworkBehaviour_NetworkManager_MethodRef)); + instructions.Add(processor.Create(OpCodes.Stloc, networkManagerVd)); + } + + MethodReference methodRef; + if (loggingType == LoggingType.Common) + methodRef = NetworkManager_Log_MethodRef; + else if (loggingType == LoggingType.Warning) + methodRef = NetworkManager_LogWarning_MethodRef; + else + methodRef = NetworkManager_LogError_MethodRef; + + instructions.Add(processor.Create(OpCodes.Ldloc, networkManagerVd)); + instructions.Add(processor.Create(OpCodes.Ldstr, message)); + instructions.Add(processor.Create(OpCodes.Call, methodRef)); + + return instructions; + } + + /// + /// Returns if logging can be done using a LoggingType. + /// + public bool CanUseLogging(LoggingType lt) + { + if (lt == LoggingType.Off) + { + base.LogError($"Log attempt called with LoggingType.Off."); + return false; + } + + return true; + } + #endregion + + #region CreateVariable / CreateParameter. + /// + /// Creates a parameter within methodDef and returns it's ParameterDefinition. + /// + /// + /// + /// + public ParameterDefinition CreateParameter(MethodDefinition methodDef, TypeDefinition parameterTypeDef, string name = "", ParameterAttributes attributes = ParameterAttributes.None, int index = -1) + { + TypeReference typeRef = methodDef.Module.ImportReference(parameterTypeDef); + return CreateParameter(methodDef, typeRef, name, attributes, index); + } + + /// + /// Creates a parameter within methodDef as the next index, with the same data as passed in parameter definition. + /// + public ParameterDefinition CreateParameter(MethodDefinition methodDef, ParameterDefinition parameterTypeDef) + { + base.ImportReference(parameterTypeDef.ParameterType); + + int currentCount = methodDef.Parameters.Count; + string name = (parameterTypeDef.Name + currentCount); + ParameterDefinition parameterDef = new ParameterDefinition(name, parameterTypeDef.Attributes, parameterTypeDef.ParameterType); + methodDef.Parameters.Add(parameterDef); + + return parameterDef; + } + + /// + /// Creates a parameter within methodDef and returns it's ParameterDefinition. + /// + /// + /// + /// + public ParameterDefinition CreateParameter(MethodDefinition methodDef, TypeReference parameterTypeRef, string name = "", ParameterAttributes attributes = ParameterAttributes.None, int index = -1) + { + int currentCount = methodDef.Parameters.Count; + if (string.IsNullOrEmpty(name)) + name = (parameterTypeRef.Name + currentCount); + ParameterDefinition parameterDef = new ParameterDefinition(name, attributes, parameterTypeRef); + if (index == -1) + methodDef.Parameters.Add(parameterDef); + else + methodDef.Parameters.Insert(index, parameterDef); + return parameterDef; + } + /// + /// Creates a parameter within methodDef and returns it's ParameterDefinition. + /// + /// + /// + /// + public ParameterDefinition CreateParameter(MethodDefinition methodDef, Type parameterType, string name = "", ParameterAttributes attributes = ParameterAttributes.None, int index = -1) + { + return CreateParameter(methodDef, GetTypeReference(parameterType), name, attributes, index); + } + /// + /// Creates a variable type within the body and returns it's VariableDef. + /// + /// + /// + /// + public VariableDefinition CreateVariable(MethodDefinition methodDef, TypeReference variableTypeRef) + { + VariableDefinition variableDef = new VariableDefinition(variableTypeRef); + methodDef.Body.Variables.Add(variableDef); + return variableDef; + } + /// Creates a variable type within the body and returns it's VariableDef. + /// + /// + /// + /// + /// + public VariableDefinition CreateVariable(MethodDefinition methodDef, Type variableType) + { + return CreateVariable(methodDef, GetTypeReference(variableType)); + } + #endregion + + #region SetVariableDef. + /// + /// Initializes variableDef as a new object or collection of typeDef. + /// + /// + /// + /// + public void SetVariableDefinitionFromObject(ILProcessor processor, VariableDefinition variableDef, TypeDefinition typeDef) + { + TypeReference type = variableDef.VariableType; + if (type.IsValueType) + { + // structs are created with Initobj + processor.Emit(OpCodes.Ldloca, variableDef); + processor.Emit(OpCodes.Initobj, type); + } + else if (typeDef.InheritsFrom(base.Session)) + { + MethodReference soCreateInstanceMr = processor.Body.Method.Module.ImportReference(() => UnityEngine.ScriptableObject.CreateInstance()); + GenericInstanceMethod genericInstanceMethod = soCreateInstanceMr.GetElementMethod().MakeGenericMethod(new TypeReference[] { type }); + processor.Emit(OpCodes.Call, genericInstanceMethod); + processor.Emit(OpCodes.Stloc, variableDef); + } + else + { + MethodDefinition constructorMethodDef = type.GetDefaultConstructor(base.Session); + if (constructorMethodDef == null) + { + base.LogError($"{type.Name} can't be deserialized because a default constructor could not be found. Create a default constructor or a custom serializer/deserializer."); + return; + } + + MethodReference constructorMethodRef = processor.Body.Method.Module.ImportReference(constructorMethodDef); + processor.Emit(OpCodes.Newobj, constructorMethodRef); + processor.Emit(OpCodes.Stloc, variableDef); + } + } + + /// + /// Assigns value to a VariableDef. + /// + /// + /// + /// + public void SetVariableDefinitionFromInt(ILProcessor processor, VariableDefinition variableDef, int value) + { + processor.Emit(OpCodes.Ldc_I4, value); + processor.Emit(OpCodes.Stloc, variableDef); + } + /// + /// Assigns value to a VariableDef. + /// + /// + /// + /// + public void SetVariableDefinitionFromParameter(ILProcessor processor, VariableDefinition variableDef, ParameterDefinition value) + { + processor.Emit(OpCodes.Ldarg, value); + processor.Emit(OpCodes.Stloc, variableDef); + } + #endregion. + + /// + /// Returns if an instruction is a call to a method. + /// + /// + /// + /// + public bool IsCallToMethod(Instruction instruction, out MethodDefinition calledMethod) + { + if (instruction.OpCode == OpCodes.Call && instruction.Operand is MethodDefinition method) + { + calledMethod = method; + return true; + } + else + { + calledMethod = null; + return false; + } + } + + + /// + /// Returns if a serializer and deserializer exist for typeRef. + /// + /// + /// True to create if missing. + /// + public bool HasSerializerAndDeserializer(TypeReference typeRef, bool create) + { + //Make sure it's imported into current module. + typeRef = base.ImportReference(typeRef); + //Can be serialized/deserialized. + bool hasWriter = base.GetClass().HasSerializer(typeRef, create); + bool hasReader = base.GetClass().HasDeserializer(typeRef, create); + + return (hasWriter && hasReader); + } + + /// + /// Creates a return of default value for methodDef. + /// + /// + public List CreateRetDefault(MethodDefinition methodDef, ModuleDefinition importReturnModule = null) + { + ILProcessor processor = methodDef.Body.GetILProcessor(); + List instructions = new List(); + //If requires a value return. + if (methodDef.ReturnType != methodDef.Module.TypeSystem.Void) + { + //Import type first. + methodDef.Module.ImportReference(methodDef.ReturnType); + if (importReturnModule != null) + importReturnModule.ImportReference(methodDef.ReturnType); + VariableDefinition vd = base.GetClass().CreateVariable(methodDef, methodDef.ReturnType); + instructions.Add(processor.Create(OpCodes.Ldloca_S, vd)); + instructions.Add(processor.Create(OpCodes.Initobj, vd.VariableType)); + instructions.Add(processor.Create(OpCodes.Ldloc, vd)); + } + instructions.Add(processor.Create(OpCodes.Ret)); + + return instructions; + } + + #region GeneratedComparers + /// + /// Creates an equality comparer for dataTr. + /// + public MethodDefinition CreateEqualityComparer(TypeReference dataTr) + { + bool created; + MethodDefinition comparerMd; + if (!_comparerDelegates.TryGetValue(dataTr.FullName, out comparerMd)) + { + comparerMd = GetOrCreateMethod(GeneratedComparer_ClassTypeDef, out created, WriterProcessor.GENERATED_METHOD_ATTRIBUTES, + $"Comparer___{dataTr.FullName}", base.Module.TypeSystem.Boolean); + + /* Nullables are not yet supported for automatic + * comparers. Let user know they must make their own. */ + if (dataTr.IsGenericInstance) + { + base.LogError($"Equality comparers cannot be automatically generated for generic types. Create a custom comparer for {dataTr.FullName}."); + return null; + } + if (dataTr.IsArray) + { + base.LogError($"Equality comparers cannot be automatically generated for arrays. Create a custom comparer for {dataTr.FullName}."); + return null; + } + + RegisterComparerDelegate(comparerMd, dataTr); + CreateComparerMethod(); + CreateComparerDelegate(comparerMd, dataTr); + } + + return comparerMd; + + void CreateComparerMethod() + { + //Add parameters. + ParameterDefinition v0Pd = CreateParameter(comparerMd, dataTr, "value0"); + ParameterDefinition v1Pd = CreateParameter(comparerMd, dataTr, "value1"); + ILProcessor processor = comparerMd.Body.GetILProcessor(); + comparerMd.Body.InitLocals = true; + + /* If type is a Unity type do not try to + * create a comparer other than ref comparer, as Unity will have built in ones. */ + if (dataTr.CachedResolve(base.Session).Module.Name.Contains("UnityEngine")) + { + CreateValueOrReferenceComparer(); + } + /* Generic types must have a comparer created for the + * generic encapulation as well the argument types. */ + else if (dataTr.IsGenericInstance) + { + CreateGenericInstanceComparer(); + //Create a class or struct comparer for the container. + if (!dataTr.IsClassOrStruct(base.Session)) + { + base.Session.LogError($"Generic data type {dataTr} was expected to be in a container but is not."); + return; + } + else + { + CreateClassOrStructComparer(); + } + } + //Class or struct. + else if (dataTr.IsClassOrStruct(base.Session)) + { + CreateClassOrStructComparer(); + } + //Value type. + else if (dataTr.IsValueType) + { + CreateValueOrReferenceComparer(); + } + //Unhandled type. + else + { + base.Session.LogError($"Comparer data type {dataTr.FullName} is unhandled."); + return; + } + + void CreateGenericInstanceComparer() + { + /* Create for arguments first. */ + GenericInstanceType git = dataTr as GenericInstanceType; + if (git == null || git.GenericArguments.Count == 0) + { + base.LogError($"Comparer data is generic but generic type returns null, or has no generic arguments."); + return; + } + foreach (TypeReference tr in git.GenericArguments) + { + TypeReference trImported = base.ImportReference(tr); + CreateEqualityComparer(trImported); + } + } + + + + void CreateClassOrStructComparer() + { + //Class or struct. + Instruction exitMethodInst = processor.Create(OpCodes.Ldc_I4_0); + + //Fields. + foreach (FieldDefinition fieldDef in dataTr.FindAllSerializableFields(base.Session + , null, WriterProcessor.EXCLUDED_ASSEMBLY_PREFIXES)) + { + FieldReference fr = base.ImportReference(fieldDef); + MethodDefinition recursiveMd = CreateEqualityComparer(fieldDef.FieldType); + if (recursiveMd == null) + break; + processor.Append(GetLoadParameterInstruction(comparerMd, v0Pd)); + processor.Emit(OpCodes.Ldfld, fr); + processor.Append(GetLoadParameterInstruction(comparerMd, v1Pd)); + processor.Emit(OpCodes.Ldfld, fr); + FinishTypeReferenceCompare(fieldDef.FieldType); + } + + //Properties. + foreach (PropertyDefinition propertyDef in dataTr.FindAllSerializableProperties(base.Session + , null, WriterProcessor.EXCLUDED_ASSEMBLY_PREFIXES)) + { + MethodReference getMr = base.Module.ImportReference(propertyDef.GetMethod); + MethodDefinition recursiveMd = CreateEqualityComparer(getMr.ReturnType); + if (recursiveMd == null) + break; + processor.Append(GetLoadParameterInstruction(comparerMd, v0Pd)); + processor.Emit(OpCodes.Call, getMr); + processor.Append(GetLoadParameterInstruction(comparerMd, v1Pd)); + processor.Emit(OpCodes.Call, getMr); + FinishTypeReferenceCompare(propertyDef.PropertyType); + } + + //Return true; + processor.Emit(OpCodes.Ldc_I4_1); + processor.Emit(OpCodes.Ret); + processor.Append(exitMethodInst); + processor.Emit(OpCodes.Ret); + + + void FinishTypeReferenceCompare(TypeReference tr) + { + /* If a class or struct see if it already has a comparer + * using IEquatable. If so then call the comparer method. + * Otherwise make a new comparer and call it. */ + if (tr.IsClassOrStruct(base.Session)) + { + //Make equatable for type. + GenericInstanceType git = IEquatable_TypeRef.MakeGenericInstanceType(tr); + bool createNestedComparer = !tr.CachedResolve(base.Session).ImplementsInterface(git.FullName); + //Create new. + if (createNestedComparer) + { + MethodDefinition cMd = CreateEqualityComparer(tr); + processor.Emit(OpCodes.Call, cMd); + processor.Emit(OpCodes.Brfalse, exitMethodInst); + } + //Call existing. + else + { + MethodDefinition cMd = tr.CachedResolve(base.Session).GetMethod("op_Equality"); + if (cMd == null) + { + base.LogError($"Type {tr.FullName} implements IEquatable but the comparer method could not be found."); + return; + } + else + { + MethodReference mr = base.ImportReference(cMd); + processor.Emit(OpCodes.Call, mr); + processor.Emit(OpCodes.Brfalse, exitMethodInst); + } + } + } + //Value types do not need to check custom comparers. + else + { + processor.Emit(OpCodes.Bne_Un, exitMethodInst); + } + + } + } + + void CreateValueOrReferenceComparer() + { + base.ImportReference(dataTr); + processor.Append(GetLoadParameterInstruction(comparerMd, v0Pd)); + processor.Append(GetLoadParameterInstruction(comparerMd, v1Pd)); + processor.Emit(OpCodes.Ceq); + processor.Emit(OpCodes.Ret); + } + + } + + } + + /// + /// Registers a comparer method. + /// + /// + /// + public void RegisterComparerDelegate(MethodDefinition methodDef, TypeReference dataTr) + { + _comparerDelegates.Add(dataTr.FullName, methodDef); + } + /// + /// Creates a delegate for GeneratedComparers. + /// + public void CreateComparerDelegate(MethodDefinition comparerMd, TypeReference dataTr) + { + dataTr = base.ImportReference(dataTr); + //Initialize delegate for made comparer. + List insts = new List(); + ILProcessor processor = GeneratedComparer_OnLoadMethodDef.Body.GetILProcessor(); + //Create a Func delegate + insts.Add(processor.Create(OpCodes.Ldnull)); + insts.Add(processor.Create(OpCodes.Ldftn, comparerMd)); + + GenericInstanceType git; + git = FunctionT3TypeRef.MakeGenericInstanceType(dataTr, dataTr, GetTypeReference(typeof(bool))); + MethodReference functionConstructorInstanceMethodRef = FunctionT3ConstructorMethodRef.MakeHostInstanceGeneric(base.Session, git); + insts.Add(processor.Create(OpCodes.Newobj, functionConstructorInstanceMethodRef)); + + //Call delegate to ReplicateComparer.Compare(T, T); + git = GeneratedComparer_TypeRef.MakeGenericInstanceType(dataTr); + MethodReference comparerMr = PublicPropertyComparer_Compare_Set_MethodRef.MakeHostInstanceGeneric(base.Session, git); + insts.Add(processor.Create(OpCodes.Call, comparerMr)); + processor.InsertFirst(insts); + } + + + + /// + /// Returns an OpCode for loading a parameter. + /// + public OpCode GetLoadParameterOpCode(ParameterDefinition pd) + { + TypeReference tr = pd.ParameterType; + return (tr.IsValueType && tr.IsClassOrStruct(base.Session)) ? OpCodes.Ldarga : OpCodes.Ldarg; + } + + /// + /// Returns an instruction for loading a parameter.s + /// + public Instruction GetLoadParameterInstruction(MethodDefinition md, ParameterDefinition pd) + { + ILProcessor processor = md.Body.GetILProcessor(); + OpCode oc = GetLoadParameterOpCode(pd); + return processor.Create(oc, pd); + } + + /// + /// Creates an IsDefault comparer for dataTr. + /// + public void CreateIsDefaultComparer(TypeReference dataTr, MethodDefinition compareMethodDef) + { + GeneralHelper gh = base.GetClass(); + + MethodDefinition isDefaultMd = gh.GetOrCreateMethod(GeneratedComparer_ClassTypeDef, out bool created, WriterProcessor.GENERATED_METHOD_ATTRIBUTES, + $"IsDefault___{dataTr.FullName}", base.Module.TypeSystem.Boolean); + //Already done. This can happen if the same replicate data is used in multiple places. + if (!created) + return; + + MethodReference compareMr = base.ImportReference(compareMethodDef); + CreateIsDefaultMethod(); + CreateIsDefaultDelegate(); + + void CreateIsDefaultMethod() + { + //Add parameters. + ParameterDefinition v0Pd = gh.CreateParameter(isDefaultMd, dataTr, "value0"); + ILProcessor processor = isDefaultMd.Body.GetILProcessor(); + isDefaultMd.Body.InitLocals = true; + + + processor.Emit(OpCodes.Ldarg, v0Pd); + //If a struct. + if (dataTr.IsValueType) + { + //Init a default local. + VariableDefinition defaultVd = gh.CreateVariable(isDefaultMd, dataTr); + processor.Emit(OpCodes.Ldloca, defaultVd); + processor.Emit(OpCodes.Initobj, dataTr); + processor.Emit(OpCodes.Ldloc, defaultVd); + } + //If a class. + else + { + processor.Emit(OpCodes.Ldnull); + } + + processor.Emit(OpCodes.Call, compareMr); + processor.Emit(OpCodes.Ret); + + + } + + //Creates a delegate to compare two of replicateTr. + void CreateIsDefaultDelegate() + { + //Initialize delegate for made comparer. + List insts = new List(); + ILProcessor processor = GeneratedComparer_OnLoadMethodDef.Body.GetILProcessor(); + //Create a Func delegate + insts.Add(processor.Create(OpCodes.Ldnull)); + insts.Add(processor.Create(OpCodes.Ldftn, isDefaultMd)); + + GenericInstanceType git; + git = gh.FunctionT2TypeRef.MakeGenericInstanceType(dataTr, gh.GetTypeReference(typeof(bool))); + MethodReference funcCtorMethodRef = gh.FunctionT2ConstructorMethodRef.MakeHostInstanceGeneric(base.Session, git); + insts.Add(processor.Create(OpCodes.Newobj, funcCtorMethodRef)); + + //Call delegate to ReplicateComparer.IsDefault(T). + git = GeneratedComparer_TypeRef.MakeGenericInstanceType(dataTr); + MethodReference isDefaultMr = PublicPropertyComparer_IsDefault_Set_MethodRef.MakeHostInstanceGeneric(base.Session, git); + insts.Add(processor.Create(OpCodes.Call, isDefaultMr)); + processor.InsertFirst(insts); + } + + } + #endregion + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/GeneralHelper.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/GeneralHelper.cs.meta new file mode 100644 index 0000000..804c6a0 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/GeneralHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6139ff104f3c24442b26dbc4e40d5ce5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/NetworkBehaviourHelper.cs b/Assets/FishNet/CodeGenerating/Helpers/NetworkBehaviourHelper.cs new file mode 100644 index 0000000..7d44c7c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/NetworkBehaviourHelper.cs @@ -0,0 +1,507 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.CodeGenerating.Processing; +using FishNet.Configuring; +using FishNet.Managing.Logging; +using FishNet.Object; +using FishNet.Object.Delegating; +using FishNet.Object.Helping; +using FishNet.Object.Prediction.Delegating; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace FishNet.CodeGenerating.Helping +{ + internal class NetworkBehaviourHelper : CodegenBase + { + #region Reflection references. + //Names. + internal string FullName; + //Prediction. + +#if PREDICTION_1 + public string ClearReplicateCache_MethodName = nameof(NetworkBehaviour.ClearReplicateCache_Virtual); +#else + public string Reconcile_Client_Start_MethodName = nameof(NetworkBehaviour.Reconcile_Client_Start); + public string Replicate_Replay_Start_MethodName = nameof(NetworkBehaviour.Replicate_Replay_Start); + public MethodReference Replicate_NonAuthoritative_MethodRef; + public MethodReference Replicate_Authortative_MethodRef; +#endif +#if PREDICTION_1 + public MethodReference Replicate_Owner_MethodRef; + public MethodReference Replicate_NonOwner_MethodRef; +#endif + public MethodReference Replicate_Reader_MethodRef; +#if PREDICTION_1 + public MethodReference Replicate_ExitEarly_A_MethodRef; + public MethodReference Reconcile_ExitEarly_A_MethodRef; +#endif + public MethodReference Reconcile_Server_MethodRef; + //public FieldReference UsesPrediction_FieldRef; + public MethodReference Replicate_Replay_Start_MethodRef; + public MethodReference Reconcile_Client_MethodRef; + public MethodReference Replicate_Replay_MethodRef; + public MethodReference Reconcile_Reader_MethodRef; + public MethodReference RegisterReplicateRpc_MethodRef; + public MethodReference RegisterReconcileRpc_MethodRef; + public MethodReference ReplicateRpcDelegate_Ctor_MethodRef; + public MethodReference ReconcileRpcDelegate_Ctor_MethodRef; + //public MethodReference Replicate_Server_SendToSpectators_MethodRef; + //RPCs. + public MethodReference SendServerRpc_MethodRef; + public MethodReference SendObserversRpc_MethodRef; + public MethodReference SendTargetRpc_MethodRef; + public MethodReference DirtySyncType_MethodRef; + public MethodReference RegisterServerRpc_MethodRef; + public MethodReference RegisterObserversRpc_MethodRef; + public MethodReference RegisterTargetRpc_MethodRef; + public MethodReference ServerRpcDelegate_Ctor_MethodRef; + public MethodReference ClientRpcDelegate_Ctor_MethodRef; + //Is checks. + public MethodReference IsClientInitialized_MethodRef; + public MethodReference IsOwner_MethodRef; + public MethodReference IsServerInitialized_MethodRef; + public MethodReference IsHost_MethodRef; + public MethodReference IsNetworked_MethodRef; + //Misc. + public TypeReference TypeRef; + public MethodReference OwnerMatches_MethodRef; + public MethodReference LocalConnection_MethodRef; + public MethodReference Owner_MethodRef; + public MethodReference NetworkInitializeIfDisabled_MethodRef; + //TimeManager. + public MethodReference TimeManager_MethodRef; + #endregion + + #region Const. + internal const uint MAX_SYNCTYPE_ALLOWANCE = byte.MaxValue; + internal const uint MAX_RPC_ALLOWANCE = ushort.MaxValue; + internal const uint MAX_PREDICTION_ALLOWANCE = byte.MaxValue; + internal const string AWAKE_METHOD_NAME = "Awake"; + internal const string DISABLE_LOGGING_TEXT = "This message may be disabled by setting the Logging field in your attribute to LoggingType.Off"; + #endregion + + public override bool ImportReferences() + { + Type networkBehaviourType = typeof(NetworkBehaviour); + TypeRef = base.ImportReference(networkBehaviourType); + FullName = networkBehaviourType.FullName; + base.ImportReference(networkBehaviourType); + + //ServerRpcDelegate and ClientRpcDelegate constructors. + ServerRpcDelegate_Ctor_MethodRef = base.ImportReference(typeof(ServerRpcDelegate).GetConstructors().First()); + ClientRpcDelegate_Ctor_MethodRef = base.ImportReference(typeof(ClientRpcDelegate).GetConstructors().First()); + //Prediction Rpc delegate constructors. + ReplicateRpcDelegate_Ctor_MethodRef = base.ImportReference(typeof(ReplicateRpcDelegate).GetConstructors().First()); + ReconcileRpcDelegate_Ctor_MethodRef = base.ImportReference(typeof(ReconcileRpcDelegate).GetConstructors().First()); + + foreach (MethodInfo mi in networkBehaviourType.GetMethods((BindingFlags.Static | BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic))) + { + //CreateDelegates. + if (mi.Name == nameof(NetworkBehaviour.RegisterServerRpc)) + RegisterServerRpc_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.RegisterObserversRpc)) + RegisterObserversRpc_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.RegisterTargetRpc)) + RegisterTargetRpc_MethodRef = base.ImportReference(mi); + //Prediction delegates. + else if (mi.Name == nameof(NetworkBehaviour.RegisterReplicateRpc)) + RegisterReplicateRpc_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.RegisterReconcileRpc)) + RegisterReconcileRpc_MethodRef = base.ImportReference(mi); + //SendRpcs. + else if (mi.Name == nameof(NetworkBehaviour.SendServerRpc)) + SendServerRpc_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.SendObserversRpc)) + SendObserversRpc_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.SendTargetRpc)) + SendTargetRpc_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.Replicate_Reader)) + Replicate_Reader_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.Reconcile_Reader)) + Reconcile_Reader_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.Reconcile_Server)) + Reconcile_Server_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.Reconcile_Client)) + Reconcile_Client_MethodRef = base.ImportReference(mi); + //#if !PREDICTION_1 + // else if (mi.Name == nameof(NetworkBehaviour.Replicate_Server_SendToSpectators_Internal)) + // Replicate_Server_SendToSpectators_MethodRef = base.ImportReference(mi); + //#endif + //Misc. + else if (mi.Name == nameof(NetworkBehaviour.OwnerMatches)) + OwnerMatches_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.DirtySyncType)) + DirtySyncType_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.NetworkInitializeIfDisabled)) + NetworkInitializeIfDisabled_MethodRef = base.ImportReference(mi); + //Prediction +#if PREDICTION_1 + else if (mi.Name == nameof(NetworkBehaviour.Replicate_ExitEarly_A)) + Replicate_ExitEarly_A_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.Reconcile_ExitEarly_A)) + Reconcile_ExitEarly_A_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.Replicate_Owner)) + Replicate_Owner_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.Replicate_NonOwner)) + Replicate_NonOwner_MethodRef = base.ImportReference(mi); +#else + else if (mi.Name == nameof(NetworkBehaviour.Replicate_Authoritative)) + Replicate_Authortative_MethodRef = base.ImportReference(mi); + else if (mi.Name == Replicate_Replay_Start_MethodName) + Replicate_Replay_Start_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.Replicate_Replay)) + Replicate_Replay_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(NetworkBehaviour.Replicate_NonAuthoritative)) + Replicate_NonAuthoritative_MethodRef = base.ImportReference(mi); +#endif + } + + foreach (PropertyInfo pi in networkBehaviourType.GetProperties((BindingFlags.Static | BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic))) + { + //Server/Client states. + if (pi.Name == nameof(NetworkBehaviour.IsClientInitialized)) + IsClientInitialized_MethodRef = base.ImportReference(pi.GetMethod); + else if (pi.Name == nameof(NetworkBehaviour.IsServerInitialized)) + IsServerInitialized_MethodRef = base.ImportReference(pi.GetMethod); + else if (pi.Name == nameof(NetworkBehaviour.IsHostStarted)) + IsHost_MethodRef = base.ImportReference(pi.GetMethod); + else if (pi.Name == nameof(NetworkBehaviour.IsOwner)) + IsOwner_MethodRef = base.ImportReference(pi.GetMethod); + else if (pi.Name == nameof(NetworkBehaviour.IsNetworked)) + IsNetworked_MethodRef = base.ImportReference(pi.GetMethod); + //Owner. + else if (pi.Name == nameof(NetworkBehaviour.Owner)) + Owner_MethodRef = base.ImportReference(pi.GetMethod); + else if (pi.Name == nameof(NetworkBehaviour.LocalConnection)) + LocalConnection_MethodRef = base.ImportReference(pi.GetMethod); + //Misc. + else if (pi.Name == nameof(NetworkBehaviour.TimeManager)) + TimeManager_MethodRef = base.ImportReference(pi.GetMethod); + } + +//#if !PREDICTION_1 +// foreach (FieldInfo fi in networkBehaviourType.GetFields((BindingFlags.Static | BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic))) +// { +// if (fi.Name == nameof(NetworkBehaviour.UsesPrediction)) +// { +// UsesPrediction_FieldRef = base.ImportReference(fi); +// break; +// } +// } +//#endif + + return true; + } + + /// + /// Returnsthe child most Awake by iterating up childMostTypeDef. + /// + /// + /// + /// + internal MethodDefinition GetAwakeMethodDefinition(TypeDefinition typeDef) + { + return typeDef.GetMethod(AWAKE_METHOD_NAME); + } + + + /// + /// Creates a replicate delegate. + /// + /// + /// + /// + /// + internal void CreateReplicateDelegate(MethodDefinition originalMethodDef, MethodDefinition readerMethodDef, uint methodHash) + { + MethodDefinition methodDef = originalMethodDef.DeclaringType.GetMethod(NetworkBehaviourProcessor.NETWORKINITIALIZE_EARLY_INTERNAL_NAME); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + List insts = new List(); + insts.Add(processor.Create(OpCodes.Ldarg_0)); + + insts.Add(processor.Create(OpCodes.Ldc_I4, (int)methodHash)); + + /* Create delegate and call NetworkBehaviour method. */ + insts.Add(processor.Create(OpCodes.Ldnull)); + insts.Add(processor.Create(OpCodes.Ldftn, readerMethodDef)); + + /* Has to be done last. This allows the NetworkBehaviour to + * initialize it's fields first. */ + processor.InsertLast(insts); + } + + + + /// + /// Creates a RPC delegate for rpcType. + /// + /// + /// + /// + /// + internal void CreateRpcDelegate(bool runLocally, TypeDefinition typeDef, MethodDefinition readerMethodDef, RpcType rpcType, uint methodHash, CustomAttribute rpcAttribute) + { + + + MethodDefinition methodDef = typeDef.GetMethod(NetworkBehaviourProcessor.NETWORKINITIALIZE_EARLY_INTERNAL_NAME); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + List insts = new List(); + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Ldc_I4, (int)methodHash)); + + /* Create delegate and call NetworkBehaviour method. */ + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Ldftn, readerMethodDef)); + //Server. + if (rpcType == RpcType.Server) + { + insts.Add(processor.Create(OpCodes.Newobj, ServerRpcDelegate_Ctor_MethodRef)); + insts.Add(processor.Create(OpCodes.Call, RegisterServerRpc_MethodRef)); + } + //Observers. + else if (rpcType == RpcType.Observers) + { + insts.Add(processor.Create(OpCodes.Newobj, ClientRpcDelegate_Ctor_MethodRef)); + insts.Add(processor.Create(OpCodes.Call, RegisterObserversRpc_MethodRef)); + } + //Target + else if (rpcType == RpcType.Target) + { + insts.Add(processor.Create(OpCodes.Newobj, ClientRpcDelegate_Ctor_MethodRef)); + insts.Add(processor.Create(OpCodes.Call, RegisterTargetRpc_MethodRef)); + } + + /* Has to be done last. This allows the NetworkBehaviour to + * initialize it's fields first. */ + processor.InsertLast(insts); + } + + /// + /// Creates exit method condition if local client is not owner. + /// + /// True if to ret when owner, false to ret when not owner. + /// Returns Ret instruction. + internal Instruction CreateLocalClientIsOwnerCheck(MethodDefinition methodDef, LoggingType loggingType, bool notifyMessageCanBeDisabled, bool retIfOwner, bool insertFirst) + { + List instructions = new List(); + /* This is placed after the if check. + * Should the if check pass then code + * jumps to this instruction. */ + ILProcessor processor = methodDef.Body.GetILProcessor(); + Instruction endIf = processor.Create(OpCodes.Nop); + + instructions.Add(processor.Create(OpCodes.Ldarg_0)); //argument: this + //If !base.IsOwner endIf. + instructions.Add(processor.Create(OpCodes.Call, IsOwner_MethodRef)); + if (retIfOwner) + instructions.Add(processor.Create(OpCodes.Brfalse, endIf)); + else + instructions.Add(processor.Create(OpCodes.Brtrue, endIf)); + //If logging is not disabled. + if (loggingType != LoggingType.Off) + { + string disableLoggingText = (notifyMessageCanBeDisabled) ? DISABLE_LOGGING_TEXT : string.Empty; + string msg = (retIfOwner) ? + $"Cannot complete action because you are the owner of this object. {disableLoggingText}." : + $"Cannot complete action because you are not the owner of this object. {disableLoggingText}."; + + instructions.AddRange(base.GetClass().LogMessage(methodDef, msg, loggingType)); + } + //Return block. + Instruction retInst = processor.Create(OpCodes.Ret); + instructions.Add(retInst); + //After if statement, jumped to when successful check. + instructions.Add(endIf); + + if (insertFirst) + { + processor.InsertFirst(instructions); + } + else + { + foreach (Instruction inst in instructions) + processor.Append(inst); + } + + return retInst; + } + + /// + /// Creates exit method condition if remote client is not owner. + /// + /// + internal Instruction CreateRemoteClientIsOwnerCheck(ILProcessor processor, ParameterDefinition connectionParameterDef) + { + /* This is placed after the if check. + * Should the if check pass then code + * jumps to this instruction. */ + Instruction endIf = processor.Create(OpCodes.Nop); + + processor.Emit(OpCodes.Ldarg_0); //argument: this + //If !base.IsOwner endIf. + processor.Emit(OpCodes.Ldarg, connectionParameterDef); + processor.Emit(OpCodes.Call, OwnerMatches_MethodRef); + processor.Emit(OpCodes.Brtrue, endIf); + //Return block. + Instruction retInst = processor.Create(OpCodes.Ret); + processor.Append(retInst); + + //After if statement, jumped to when successful check. + processor.Append(endIf); + + return retInst; + } + + /// + /// Creates exit method condition if not client. + /// + /// When true InstanceFinder.IsClient is used, when false base.IsClientInitialized is used. + internal void CreateIsClientCheck(MethodDefinition methodDef, LoggingType loggingType, bool useStatic, bool insertFirst, bool checkIsNetworked) + { + /* This is placed after the if check. + * Should the if check pass then code + * jumps to this instruction. */ + ILProcessor processor = methodDef.Body.GetILProcessor(); + Instruction endIf = processor.Create(OpCodes.Nop); + + List instructions = new List(); + + if (checkIsNetworked) + instructions.AddRange(CreateIsNetworkedCheck(methodDef, endIf)); + + //Checking against the NetworkObject. + if (!useStatic) + { + instructions.Add(processor.Create(OpCodes.Ldarg_0)); //argument: this + //If (!base.IsClient) + instructions.Add(processor.Create(OpCodes.Call, IsClientInitialized_MethodRef)); + } + //Checking instanceFinder. + else + { + instructions.Add(processor.Create(OpCodes.Call, base.GetClass().InstanceFinder_IsClient_MethodRef)); + } + instructions.Add(processor.Create(OpCodes.Brtrue, endIf)); + //If warning then also append warning text. + if (loggingType != LoggingType.Off) + { + string msg = $"Cannot complete action because client is not active. This may also occur if the object is not yet initialized, has deinitialized, or if it does not contain a NetworkObject component."; + instructions.AddRange(base.GetClass().LogMessage(methodDef, msg, loggingType)); + } + //Add return. + instructions.AddRange(CreateRetDefault(methodDef)); + //After if statement, jumped to when successful check. + instructions.Add(endIf); + + if (insertFirst) + { + processor.InsertFirst(instructions); + } + else + { + foreach (Instruction inst in instructions) + processor.Append(inst); + } + } + + /// + /// Creates exit method condition if not server. + /// + /// When true InstanceFinder.IsServer is used, when false base.IsServerInitialized is used. + internal void CreateIsServerCheck(MethodDefinition methodDef, LoggingType loggingType, bool useStatic, bool insertFirst, bool checkIsNetworked) + { + /* This is placed after the if check. + * Should the if check pass then code + * jumps to this instruction. */ + ILProcessor processor = methodDef.Body.GetILProcessor(); + Instruction endIf = processor.Create(OpCodes.Nop); + + List instructions = new List(); + + if (checkIsNetworked) + instructions.AddRange(CreateIsNetworkedCheck(methodDef, endIf)); + + if (!useStatic) + { + instructions.Add(processor.Create(OpCodes.Ldarg_0)); //argument: this + //If (!base.IsServer) + instructions.Add(processor.Create(OpCodes.Call, IsServerInitialized_MethodRef)); + } + //Checking instanceFinder. + else + { + instructions.Add(processor.Create(OpCodes.Call, base.GetClass().InstanceFinder_IsServer_MethodRef)); + } + instructions.Add(processor.Create(OpCodes.Brtrue, endIf)); + //If warning then also append warning text. + if (loggingType != LoggingType.Off) + { + string msg = $"Cannot complete action because server is not active. This may also occur if the object is not yet initialized, has deinitialized, or if it does not contain a NetworkObject component."; + instructions.AddRange(base.GetClass().LogMessage(methodDef, msg, loggingType)); + } + //Add return. + instructions.AddRange(CreateRetDefault(methodDef)); + //After if statement, jumped to when successful check. + instructions.Add(endIf); + + if (insertFirst) + { + processor.InsertFirst(instructions); + } + else + { + foreach (Instruction inst in instructions) + processor.Append(inst); + } + } + + /// + /// Creates a call to base.IsNetworked and returns instructions. + /// + private List CreateIsNetworkedCheck(MethodDefinition methodDef, Instruction endIfInst) + { + List insts = new List(); + ILProcessor processor = methodDef.Body.GetILProcessor(); + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Call, base.GetClass().IsNetworked_MethodRef)); + insts.Add(processor.Create(OpCodes.Brfalse, endIfInst)); + + return insts; + } + + + /// + /// Creates a return using the ReturnType for methodDef. + /// + /// + /// + /// + public List CreateRetDefault(MethodDefinition methodDef, ModuleDefinition importReturnModule = null) + { + ILProcessor processor = methodDef.Body.GetILProcessor(); + List instructions = new List(); + //If requires a value return. + if (methodDef.ReturnType != methodDef.Module.TypeSystem.Void) + { + //Import type first. + methodDef.Module.ImportReference(methodDef.ReturnType); + if (importReturnModule != null) + importReturnModule.ImportReference(methodDef.ReturnType); + VariableDefinition vd = base.GetClass().CreateVariable(methodDef, methodDef.ReturnType); + instructions.Add(processor.Create(OpCodes.Ldloca_S, vd)); + instructions.Add(processor.Create(OpCodes.Initobj, vd.VariableType)); + instructions.Add(processor.Create(OpCodes.Ldloc, vd)); + } + instructions.Add(processor.Create(OpCodes.Ret)); + + return instructions; + } + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/NetworkBehaviourHelper.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/NetworkBehaviourHelper.cs.meta new file mode 100644 index 0000000..55c1c3c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/NetworkBehaviourHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c42e06349d6890459a155a2afe17d41 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/NetworkConnectionImports.cs b/Assets/FishNet/CodeGenerating/Helpers/NetworkConnectionImports.cs new file mode 100644 index 0000000..30871f1 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/NetworkConnectionImports.cs @@ -0,0 +1,42 @@ +using FishNet.Connection; +using MonoFN.Cecil; +using System; +using System.Reflection; + +namespace FishNet.CodeGenerating.Helping +{ + internal class NetworkConnectionImports : CodegenBase + { + #region Reflection references. + //Names. + internal string FullName; + public MethodReference IsLocalClient_Get_MethodRef; + #endregion + + #region Const. + internal const uint MAX_RPC_ALLOWANCE = ushort.MaxValue; + internal const string AWAKE_METHOD_NAME = "Awake"; + internal const string DISABLE_LOGGING_TEXT = "This message may be disabled by setting the Logging field in your attribute to LoggingType.Off"; + #endregion + + public override bool ImportReferences() + { + Type type = typeof(NetworkConnection); + base.ImportReference(type); + + FullName = type.FullName; + + foreach (PropertyInfo pi in type.GetProperties()) + { + if (pi.Name == nameof(NetworkConnection.IsLocalClient)) + { + IsLocalClient_Get_MethodRef = base.ImportReference(pi.GetMethod); + break; + } + } + + return true; + } + + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/NetworkConnectionImports.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/NetworkConnectionImports.cs.meta new file mode 100644 index 0000000..f8b4ff2 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/NetworkConnectionImports.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d061dda8ed87ed48a08020942ad63f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/ObjectHelper.cs b/Assets/FishNet/CodeGenerating/Helpers/ObjectHelper.cs new file mode 100644 index 0000000..cdad964 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/ObjectHelper.cs @@ -0,0 +1,99 @@ +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Connection; +using FishNet.Object; +using FishNet.Object.Synchronizing; +using FishNet.Object.Synchronizing.Internal; +using MonoFN.Cecil; +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace FishNet.CodeGenerating.Helping +{ + internal class ObjectHelper : CodegenBase + { + #region Reflection references. + //Fullnames. + public string SyncVar_Name { get; private set; } + public string SyncList_Name { get; private set; } + public string SyncDictionary_Name { get; private set; } + public string SyncHashSet_Name { get; private set; } + //Is checks. + public MethodReference InstanceFinder_IsServer_MethodRef { get; private set; } + public MethodReference InstanceFinder_IsClient_MethodRef { get; private set; } + //Misc. + public TypeReference NetworkBehaviour_TypeRef { get; private set; } + public MethodReference NetworkConnection_IsValid_MethodRef { get; private set; } + public MethodReference NetworkConnection_IsActive_MethodRef { get; private set; } + public MethodReference Dictionary_Add_UShort_SyncBase_MethodRef { get; private set; } + public MethodReference NetworkConnection_GetIsLocalClient_MethodRef { get; private set; } + #endregion + + public override bool ImportReferences() + { + Type tmpType; + /* SyncType names */ + //SyncVar. + tmpType = typeof(SyncVar<>); + base.ImportReference(tmpType); + SyncVar_Name = tmpType.Name; + //SyncList. + tmpType = typeof(SyncList<>); + base.ImportReference(tmpType); + SyncList_Name = tmpType.Name; + //SyncDictionary. + tmpType = typeof(SyncDictionary<,>); + base.ImportReference(tmpType); + SyncDictionary_Name = tmpType.Name; + //SyncHashSet. + tmpType = typeof(SyncHashSet<>); + base.ImportReference(tmpType); + SyncHashSet_Name = tmpType.Name; + + NetworkBehaviour_TypeRef = base.ImportReference(typeof(NetworkBehaviour)); + + tmpType = typeof(NetworkConnection); + TypeReference networkConnectionTr = base.ImportReference(tmpType); + foreach (PropertyDefinition item in networkConnectionTr.CachedResolve(base.Session).Properties) + { + if (item.Name == nameof(NetworkConnection.IsLocalClient)) + NetworkConnection_GetIsLocalClient_MethodRef = base.ImportReference(item.GetMethod); + } + + //Dictionary.Add(ushort, SyncBase). + Type dictType = typeof(Dictionary); + TypeReference dictTypeRef = base.ImportReference(dictType); + //Dictionary_Add_UShort_SyncBase_MethodRef = dictTypeRef.CachedResolve(base.Session).GetMethod("add_Item", ) + foreach (MethodDefinition item in dictTypeRef.CachedResolve(base.Session).Methods) + { + if (item.Name == nameof(Dictionary.Add)) + { + Dictionary_Add_UShort_SyncBase_MethodRef = base.ImportReference(item); + break; + } + } + + //InstanceFinder infos. + Type instanceFinderType = typeof(InstanceFinder); + foreach (PropertyInfo pi in instanceFinderType.GetProperties()) + { + if (pi.Name == nameof(InstanceFinder.IsClientStarted)) + InstanceFinder_IsClient_MethodRef = base.ImportReference(pi.GetMethod); + else if (pi.Name == nameof(InstanceFinder.IsServerStarted)) + InstanceFinder_IsServer_MethodRef = base.ImportReference(pi.GetMethod); + } + + //NetworkConnection. + foreach (PropertyInfo pi in typeof(NetworkConnection).GetProperties((BindingFlags.Static | BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic))) + { + if (pi.Name == nameof(NetworkConnection.IsValid)) + NetworkConnection_IsValid_MethodRef = base.ImportReference(pi.GetMethod); + else if (pi.Name == nameof(NetworkConnection.IsActive)) + NetworkConnection_IsActive_MethodRef = base.ImportReference(pi.GetMethod); + } + + return true; + } + + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/ObjectHelper.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/ObjectHelper.cs.meta new file mode 100644 index 0000000..4e50b5f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/ObjectHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 033da35314653aa4689b4582e7929295 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/PhysicsHelper.cs b/Assets/FishNet/CodeGenerating/Helpers/PhysicsHelper.cs new file mode 100644 index 0000000..25224b0 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/PhysicsHelper.cs @@ -0,0 +1,117 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Connection; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using System.Collections.Generic; +using UnityEngine; +using SR = System.Reflection; + + +namespace FishNet.CodeGenerating.Helping +{ + internal class PhysicsHelper : CodegenBase + { + #region Reflection references. + public MethodReference GetScene_MethodRef; + public MethodReference GetPhysicsScene2D_MethodRef; + public MethodReference GetPhysicsScene3D_MethodRef; + public MethodReference Physics3D_Simulate_MethodRef; + public MethodReference Physics2D_Simulate_MethodRef; + public MethodReference Physics3D_SyncTransforms_MethodRef; + public MethodReference Physics2D_SyncTransforms_MethodRef; + #endregion + + public override bool ImportReferences() + { + SR.MethodInfo locMi; + //GetScene. + locMi = typeof(GameObject).GetMethod("get_scene"); + GetScene_MethodRef = base.ImportReference(locMi); + + //Physics.SyncTransform. + foreach (SR.MethodInfo mi in typeof(Physics).GetMethods()) + { + if (mi.Name == nameof(Physics.SyncTransforms)) + { + Physics3D_SyncTransforms_MethodRef = base.ImportReference(mi); + break; + } + } + foreach (SR.MethodInfo mi in typeof(Physics2D).GetMethods()) + { + if (mi.Name == nameof(Physics2D.SyncTransforms)) + { + Physics2D_SyncTransforms_MethodRef = base.ImportReference(mi); + break; + } + } + + //PhysicsScene.Simulate. + foreach (SR.MethodInfo mi in typeof(PhysicsScene).GetMethods()) + { + if (mi.Name == nameof(PhysicsScene.Simulate)) + { + Physics3D_Simulate_MethodRef = base.ImportReference(mi); + break; + } + } + foreach (SR.MethodInfo mi in typeof(PhysicsScene2D).GetMethods()) + { + if (mi.Name == nameof(PhysicsScene2D.Simulate)) + { + Physics2D_Simulate_MethodRef = base.ImportReference(mi); + break; + } + } + + //GetPhysicsScene. + foreach (SR.MethodInfo mi in typeof(PhysicsSceneExtensions).GetMethods()) + { + if (mi.Name == nameof(PhysicsSceneExtensions.GetPhysicsScene)) + { + GetPhysicsScene3D_MethodRef = base.ImportReference(mi); + break; + } + } + foreach (SR.MethodInfo mi in typeof(PhysicsSceneExtensions2D).GetMethods()) + { + if (mi.Name == nameof(PhysicsSceneExtensions2D.GetPhysicsScene2D)) + { + GetPhysicsScene2D_MethodRef = base.ImportReference(mi); + break; + } + } + + return true; + } + + + /// + /// Returns instructions to get a physics scene from a gameObject. + /// + public List GetPhysicsScene(MethodDefinition md, VariableDefinition gameObjectVd, bool threeDimensional) + { + ILProcessor processor = md.Body.GetILProcessor(); + return GetPhysicsScene(processor, gameObjectVd, threeDimensional); + } + + /// + /// Returns instructions to get a physics scene from a gameObject. + /// + public List GetPhysicsScene(ILProcessor processor, VariableDefinition gameObjectVd, bool threeDimensional) + { + List insts = new List(); + + //gameObject.scene.GetPhysics... + insts.Add(processor.Create(OpCodes.Ldloc, gameObjectVd)); + insts.Add(processor.Create(GetScene_MethodRef.GetCallOpCode(base.Session), GetScene_MethodRef)); + if (threeDimensional) + insts.Add(processor.Create(OpCodes.Call, GetPhysicsScene3D_MethodRef)); + else + insts.Add(processor.Create(OpCodes.Call, GetPhysicsScene2D_MethodRef)); + + return insts; + } + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/PhysicsHelper.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/PhysicsHelper.cs.meta new file mode 100644 index 0000000..1f43ee9 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/PhysicsHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 28ae27f7bc8e89547a606262508fdd36 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/PredictedObjectHelper.cs b/Assets/FishNet/CodeGenerating/Helpers/PredictedObjectHelper.cs new file mode 100644 index 0000000..b8e119d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/PredictedObjectHelper.cs @@ -0,0 +1,15 @@ +using FishNet.Component.Prediction; +using MonoFN.Cecil; +using System; +using System.Reflection; + +namespace FishNet.CodeGenerating.Helping +{ + internal class PredictedObjectHelper : CodegenBase + { + public override bool ImportReferences() + { + return true; + } + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/PredictedObjectHelper.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/PredictedObjectHelper.cs.meta new file mode 100644 index 0000000..ff446ca --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/PredictedObjectHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9a06c812bf785a44a38a5852ff866d8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/ReaderImports.cs b/Assets/FishNet/CodeGenerating/Helpers/ReaderImports.cs new file mode 100644 index 0000000..1fda87c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/ReaderImports.cs @@ -0,0 +1,66 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Connection; +using FishNet.Serializing; +using MonoFN.Cecil; +using System; +using System.Reflection; + +namespace FishNet.CodeGenerating.Helping +{ + internal class ReaderImports : CodegenBase + { + #region Reflection references. + public TypeReference PooledReader_TypeRef; + public TypeReference Reader_TypeRef; + public TypeReference NetworkConnection_TypeRef; + public MethodReference PooledReader_ReadNetworkBehaviour_MethodRef; + public MethodReference Reader_ReadPackedWhole_MethodRef; + public MethodReference Reader_ReadDictionary_MethodRef; + public MethodReference Reader_ReadList_MethodRef; + public MethodReference Reader_ReadArray_MethodRef; + public TypeReference GenericReader_TypeRef; + + public MethodReference GenericReader_ReadUnpacked_MethodRef; + public MethodReference GenericReader_ReadAutoPacked_MethodRef; + #endregion + + /// + /// Imports references needed by this helper. + /// + /// + /// + public override bool ImportReferences() + { + ReaderProcessor rp = base.GetClass(); + + PooledReader_TypeRef = base.ImportReference(typeof(PooledReader)); + Reader_TypeRef = base.ImportReference(typeof(Reader)); + NetworkConnection_TypeRef = base.ImportReference(typeof(NetworkConnection)); + GenericReader_TypeRef = base.ImportReference(typeof(GenericReader<>)); + + TypeDefinition genericWriterTd = GenericReader_TypeRef.CachedResolve(base.Session); + GenericReader_ReadUnpacked_MethodRef = base.ImportReference(genericWriterTd.GetMethod(nameof(GenericReader.SetReadUnpacked))); + GenericReader_ReadAutoPacked_MethodRef = base.ImportReference(genericWriterTd.GetMethod(nameof(GenericReader.SetReadAutoPacked))); + + + Type pooledReaderType = typeof(PooledReader); + foreach (MethodInfo methodInfo in pooledReaderType.GetMethods()) + { + int parameterCount = methodInfo.GetParameters().Length; + /* Special methods. */ + if (methodInfo.Name == nameof(PooledReader.ReadPackedWhole)) + Reader_ReadPackedWhole_MethodRef = base.ImportReference(methodInfo); + //Relay readers. + else if (parameterCount == 0 && methodInfo.Name == nameof(PooledReader.ReadDictionaryAllocated)) + Reader_ReadDictionary_MethodRef = base.ImportReference(methodInfo); + else if (parameterCount == 0 && methodInfo.Name == nameof(PooledReader.ReadListAllocated)) + Reader_ReadList_MethodRef = base.ImportReference(methodInfo); + else if (parameterCount == 0 && methodInfo.Name == nameof(PooledReader.ReadArrayAllocated)) + Reader_ReadArray_MethodRef = base.ImportReference(methodInfo); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/ReaderImports.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/ReaderImports.cs.meta new file mode 100644 index 0000000..e491410 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/ReaderImports.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 350861dcbcbabc447acd37e4310b0697 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/TimeManagerHelper.cs b/Assets/FishNet/CodeGenerating/Helpers/TimeManagerHelper.cs new file mode 100644 index 0000000..21f2106 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/TimeManagerHelper.cs @@ -0,0 +1,22 @@ +using FishNet.Managing.Timing; +using MonoFN.Cecil; +using System; +using UnityEngine; + +namespace FishNet.CodeGenerating.Helping +{ + + internal class TimeManagerHelper : CodegenBase + { + + #region Reflection references. + #endregion + + public override bool ImportReferences() + { + return true; + } + + + } +} diff --git a/Assets/FishNet/CodeGenerating/Helpers/TimeManagerHelper.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/TimeManagerHelper.cs.meta new file mode 100644 index 0000000..a247b73 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/TimeManagerHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 11dbcc0798e079e4a85fe98dfc9fe23a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/TransportHelper.cs b/Assets/FishNet/CodeGenerating/Helpers/TransportHelper.cs new file mode 100644 index 0000000..4816ab4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/TransportHelper.cs @@ -0,0 +1,36 @@ +using FishNet.Transporting; +using MonoFN.Cecil; + +namespace FishNet.CodeGenerating.Helping +{ + internal class TransportHelper : CodegenBase + { + #region Reflection references. + internal TypeReference Channel_TypeRef; + #endregion + + /// + /// Resets cached values. + /// + private void ResetValues() + { + Channel_TypeRef = null; + } + + + /// + /// Imports references needed by this helper. + /// + /// + /// + public override bool ImportReferences() + { + ResetValues(); + + Channel_TypeRef = base.ImportReference(typeof(Channel)); + + return true; + } + + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/TransportHelper.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/TransportHelper.cs.meta new file mode 100644 index 0000000..9821f2c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/TransportHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6ced44bfdb3068f4cb7513c9be85729a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed.meta b/Assets/FishNet/CodeGenerating/Helpers/Typed.meta new file mode 100644 index 0000000..e2860e4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c480d34b00248444d91a61e015b14e2a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/Comparers.cs b/Assets/FishNet/CodeGenerating/Helpers/Typed/Comparers.cs new file mode 100644 index 0000000..429a0d4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/Comparers.cs @@ -0,0 +1,34 @@ +using MonoFN.Cecil; +using System.Collections.Generic; + +namespace FishNet.CodeGenerating.Helping +{ + internal class TypeDefinitionComparer : IEqualityComparer + { + public bool Equals(TypeDefinition a, TypeDefinition b) + { + return a.FullName == b.FullName; + } + + public int GetHashCode(TypeDefinition obj) + { + return obj.FullName.GetHashCode(); + } + } + + + internal class TypeReferenceComparer : IEqualityComparer + { + public bool Equals(TypeReference a, TypeReference b) + { + return a.FullName == b.FullName; + } + + public int GetHashCode(TypeReference obj) + { + return obj.FullName.GetHashCode(); + } + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/Comparers.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Typed/Comparers.cs.meta new file mode 100644 index 0000000..dff182e --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/Comparers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2b30600f0fdb27c4fb86c310b08f43b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/GeneratorHelper.cs b/Assets/FishNet/CodeGenerating/Helpers/Typed/GeneratorHelper.cs new file mode 100644 index 0000000..399d900 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/GeneratorHelper.cs @@ -0,0 +1,186 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Object; +using FishNet.Serializing.Helping; +using FishNet.Utility.Performance; +using MonoFN.Cecil; +using System.Collections.Generic; + +namespace FishNet.CodeGenerating.Helping +{ + + + internal class GeneratorHelper : CodegenBase + { + /// + /// Gets what objectTypeRef will be serialized as. + /// + public SerializerType GetSerializerType(TypeReference objectTr, bool writer, out TypeDefinition objectTd) + { + string errorPrefix = (writer) ? "CreateWrite: " : "CreateRead: "; + objectTd = null; + + /* Check if already has a serializer. */ + if (writer) + { + if (base.GetClass().GetWriteMethodReference(objectTr) != null) + { + base.LogError($"Writer already exist for {objectTr.FullName}."); + return SerializerType.Invalid; + } + } + else + { + if (base.GetClass().GetReadMethodReference(objectTr) != null) + { + base.LogError($"Reader already exist for {objectTr.FullName}."); + return SerializerType.Invalid; + } + } + + objectTd = objectTr.CachedResolve(base.Session); + //Invalid typeDef. + if (objectTd == null) + { + base.LogError($"{errorPrefix}{objectTd.FullName} could not be resolved."); + return SerializerType.Invalid; + } + //Intentionally excluded. + if (objectTd.CustomAttributes.Count > 0) + { + foreach (CustomAttribute item in objectTd.CustomAttributes) + { + if (item.AttributeType.Is(typeof(ExcludeSerializationAttribute))) + return SerializerType.Invalid; + } + } + + //By reference. + if (objectTr.IsByReference) + { + base.LogError($"{errorPrefix}Cannot pass {objectTr.Name} by reference"); + return SerializerType.Invalid; + } + /* Arrays have to be processed first because it's possible for them to meet other conditions + * below and be processed wrong. */ + else if (objectTr.IsArray) + { + if (objectTr.IsMultidimensionalArray()) + { + base.LogError($"{errorPrefix}{objectTr.Name} is an unsupported type. Multidimensional arrays are not supported"); + return SerializerType.Invalid; + } + else + { + return SerializerType.Array; + } + } + //Enum. + else if (objectTd.IsEnum) + { + return SerializerType.Enum; + } + else if (objectTd.Is(typeof(Dictionary<,>))) + { + return SerializerType.Dictionary; + } + else if (objectTd.Is(typeof(List<>))) + { + return SerializerType.List; + } + else if (objectTd.InheritsFrom(base.Session)) + { + return SerializerType.NetworkBehaviour; + } + else if (objectTr.IsNullable(base.Session)) + { + GenericInstanceType git = objectTr as GenericInstanceType; + if (git == null || git.GenericArguments.Count != 1) + return SerializerType.Invalid; + else + return SerializerType.Nullable; + } + //Invalid type. This must be called after trying to generate everything but class. + else if (!CanGenerateSerializer(objectTd)) + { + return SerializerType.Invalid; + } + //If here then the only type left is struct or class. + else if (objectTr.IsClassOrStruct(base.Session)) + { + return SerializerType.ClassOrStruct; + } + //Unknown type. + else + { + base.LogError($"{errorPrefix}{objectTr.Name} is an unsupported type. Mostly because we don't know what the heck it is. Please let us know so we can fix this."); + return SerializerType.Invalid; + } + } + + + /// + /// Returns if objectTd can have a serializer generated for it. + /// + private bool CanGenerateSerializer(TypeDefinition objectTd) + { + string errorText = $"{objectTd.Name} is not a supported type. Use a supported type or provide a custom serializer"; + + System.Type unityObjectType = typeof(UnityEngine.Object); + //Unable to determine type, cannot generate for. + if (objectTd == null) + { + base.LogError(errorText); + return false; + } + //Component. + if (objectTd.InheritsFrom(base.Session)) + { + base.LogError(errorText); + return false; + } + //Unity Object. + if (objectTd.Is(unityObjectType)) + { + base.LogError(errorText); + return false; + } + //ScriptableObject. + if (objectTd.Is(typeof(UnityEngine.ScriptableObject))) + { + base.LogError(errorText); + return false; + } + //Has generic parameters. + if (objectTd.HasGenericParameters) + { + base.LogError(errorText); + return false; + } + //Is an interface. + if (objectTd.IsInterface) + { + base.LogError(errorText); + return false; + } + //Is abstract. + if (objectTd.IsAbstract) + { + base.LogError(errorText); + return false; + } + if (objectTd.InheritsFrom(base.Session, unityObjectType) && objectTd.IsExcluded(GeneralHelper.UNITYENGINE_ASSEMBLY_PREFIX)) + { + base.LogError(errorText); + return false; + } + + //If here type is valid. + return true; + } + + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/GeneratorHelper.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Typed/GeneratorHelper.cs.meta new file mode 100644 index 0000000..bf4c3fa --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/GeneratorHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b1882eac63e3d94aad8f41915bc1ab8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/QOLAttributeType.cs b/Assets/FishNet/CodeGenerating/Helpers/Typed/QOLAttributeType.cs new file mode 100644 index 0000000..314c3d2 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/QOLAttributeType.cs @@ -0,0 +1,12 @@ +namespace FishNet.CodeGenerating.Helping +{ + + internal enum QolAttributeType + { + None, + Server, + Client + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/QOLAttributeType.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Typed/QOLAttributeType.cs.meta new file mode 100644 index 0000000..f6a473d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/QOLAttributeType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 357a22940018b8e49976e13272c5b2ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/SerializatierType.cs b/Assets/FishNet/CodeGenerating/Helpers/Typed/SerializatierType.cs new file mode 100644 index 0000000..787d647 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/SerializatierType.cs @@ -0,0 +1,19 @@ +namespace FishNet.CodeGenerating.Helping +{ + + internal enum SerializerType + { + Invalid, + Enum, + Array, + List, + NetworkBehaviour, + ClassOrStruct, + Nullable, + Dictionary, + Null, + ByReference, + MultiDimensionalArray + } + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/SerializatierType.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Typed/SerializatierType.cs.meta new file mode 100644 index 0000000..a993edc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/SerializatierType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e7f1bbf5c398c3e4e92e53ec3e49d5e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncIndexData.cs b/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncIndexData.cs new file mode 100644 index 0000000..ecede30 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncIndexData.cs @@ -0,0 +1,17 @@ +using MonoFN.Cecil.Cil; +using System.Collections.Generic; + +namespace FishNet.CodeGenerating.Helping +{ + + /// + /// Data used to modify an RpcIndex should the class have to be rebuilt. + /// + internal class SyncIndexData + { + public uint SyncCount = 0; + public List DelegateInstructions = new List(); + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncIndexData.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncIndexData.cs.meta new file mode 100644 index 0000000..a2adbd2 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncIndexData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 55f2e751e4788464b8394f6b8bdb548a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncType.cs b/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncType.cs new file mode 100644 index 0000000..11592b6 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncType.cs @@ -0,0 +1,14 @@ +namespace FishNet.CodeGenerating.Helping +{ + public enum SyncType + { + Unset, + Variable, + List, + Dictionary, + HashSet, + Custom, + Unhandled, + } + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncType.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncType.cs.meta new file mode 100644 index 0000000..b60f670 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/Typed/SyncType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44c753d6ac0c7864c9962d91703b2afe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Helpers/WriterImports.cs b/Assets/FishNet/CodeGenerating/Helpers/WriterImports.cs new file mode 100644 index 0000000..bcc5c03 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/WriterImports.cs @@ -0,0 +1,97 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Object; +using FishNet.Serializing; +using MonoFN.Cecil; +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace FishNet.CodeGenerating.Helping +{ + internal class WriterImports : CodegenBase + { + #region Reflection references. + public MethodReference WriterPool_GetWriter_MethodRef; + public MethodReference WriterPool_GetWriterLength_MethodRef; + public MethodReference Writer_WritePackedWhole_MethodRef; + public TypeReference PooledWriter_TypeRef; + public TypeReference Writer_TypeRef; + public MethodReference PooledWriter_Dispose_MethodRef; + public MethodReference Writer_WriteDictionary_MethodRef; + public MethodReference Writer_WriteList_MethodRef; + public MethodReference Writer_WriteArray_MethodRef; + public TypeReference AutoPackTypeRef; + + public TypeReference GenericWriter_TypeRef; + public MethodReference GenericWriter_WriteUnpacked_MethodRef; + public MethodReference GenericWriter_WriteAutoPacked_MethodRef; + public MethodReference Writer_WriteUnpacked_MethodRef; + #endregion + + /// + /// Imports references needed by this helper. + /// + /// + /// + public override bool ImportReferences() + { + PooledWriter_TypeRef = base.ImportReference(typeof(PooledWriter)); + Writer_TypeRef = base.ImportReference(typeof(Writer)); + AutoPackTypeRef = base.ImportReference(typeof(AutoPackType)); + GenericWriter_TypeRef = base.ImportReference(typeof(GenericWriter<>)); + Writer_WriteUnpacked_MethodRef = Writer_TypeRef.CachedResolve(base.Session).GetMethodReference(base.Session, nameof(Writer.WriteUnpacked)); + + + TypeDefinition genericWriterTd = GenericWriter_TypeRef.CachedResolve(base.Session); + GenericWriter_WriteUnpacked_MethodRef = base.ImportReference(genericWriterTd.GetMethod(nameof(GenericWriter.SetWriteUnpacked))); + GenericWriter_WriteAutoPacked_MethodRef = base.ImportReference(genericWriterTd.GetMethod(nameof(GenericWriter.SetWriteAutoPacked))); + + //WriterPool.GetWriter + Type writerPoolType = typeof(WriterPool); + base.ImportReference(writerPoolType); + foreach (var methodInfo in writerPoolType.GetMethods()) + { + if (methodInfo.Name == nameof(WriterPool.Retrieve)) + { + //GetWriter(). + if (methodInfo.GetParameters().Length == 0) + { + WriterPool_GetWriter_MethodRef = base.ImportReference(methodInfo); + } + //GetWriter(?). + else if (methodInfo.GetParameters().Length == 1) + { + ParameterInfo pi = methodInfo.GetParameters()[0]; + //GetWriter(int). + if (pi.ParameterType == typeof(int)) + WriterPool_GetWriterLength_MethodRef = base.ImportReference(methodInfo); + } + } + } + + WriterProcessor gwh = base.GetClass(); + Type pooledWriterType = typeof(PooledWriter); + foreach (MethodInfo methodInfo in pooledWriterType.GetMethods()) + { + int parameterCount = methodInfo.GetParameters().Length; + + if (methodInfo.Name == nameof(PooledWriter.Store)) + PooledWriter_Dispose_MethodRef = base.ImportReference(methodInfo); + else if (methodInfo.Name == nameof(PooledWriter.WritePackedWhole)) + Writer_WritePackedWhole_MethodRef = base.ImportReference(methodInfo); + //Relay writers. + else if (parameterCount == 1 && methodInfo.Name == nameof(PooledWriter.WriteDictionary)) + Writer_WriteDictionary_MethodRef = base.ImportReference(methodInfo); + else if (parameterCount == 1 && methodInfo.Name == nameof(PooledWriter.WriteList)) + Writer_WriteList_MethodRef = base.ImportReference(methodInfo); + else if (parameterCount == 1 && methodInfo.Name == nameof(PooledWriter.WriteArray)) + Writer_WriteArray_MethodRef = base.ImportReference(methodInfo); + } + + return true; + } + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Helpers/WriterImports.cs.meta b/Assets/FishNet/CodeGenerating/Helpers/WriterImports.cs.meta new file mode 100644 index 0000000..43c69fa --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Helpers/WriterImports.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 425638e29bab6f1488e8865c9e3f8b57 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/ILCore.meta b/Assets/FishNet/CodeGenerating/ILCore.meta new file mode 100644 index 0000000..584749a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/ILCore.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b1808ca0399d069499d3ecb4e031c3e2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/ILCore/FishNetILPP.cs b/Assets/FishNet/CodeGenerating/ILCore/FishNetILPP.cs new file mode 100644 index 0000000..7fcbe3b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/ILCore/FishNetILPP.cs @@ -0,0 +1,401 @@ +using FishNet.Broadcast; +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.CodeGenerating.Processing; +using FishNet.CodeGenerating.Processing.Rpc; +using FishNet.Configuring; +using FishNet.Editing.Upgrading; +using FishNet.Serializing.Helping; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using Unity.CompilationPipeline.Common.ILPostProcessing; + +namespace FishNet.CodeGenerating.ILCore +{ + public class FishNetILPP : ILPostProcessor + { + #region Const. + internal const string RUNTIME_ASSEMBLY_NAME = "FishNet.Runtime"; + #endregion + + public override bool WillProcess(ICompiledAssembly compiledAssembly) + { + if (compiledAssembly.Name.StartsWith("Unity.")) + return false; + if (compiledAssembly.Name.StartsWith("UnityEngine.")) + return false; + if (compiledAssembly.Name.StartsWith("UnityEditor.")) + return false; + if (compiledAssembly.Name.Contains("Editor")) + return false; + + /* This line contradicts the one below where referencesFishNet + * becomes true if the assembly is FishNetAssembly. This is here + * intentionally to stop codegen from running on the runtime + * fishnet assembly, but the option below is for debugging. I would + * comment out this check if I wanted to compile fishnet runtime. */ + //if (CODEGEN_THIS_NAMESPACE.Length == 0) + //{ + // if (compiledAssembly.Name == RUNTIME_ASSEMBLY_NAME) + // return false; + //} + bool referencesFishNet = FishNetILPP.IsFishNetAssembly(compiledAssembly) || compiledAssembly.References.Any(filePath => Path.GetFileNameWithoutExtension(filePath) == RUNTIME_ASSEMBLY_NAME); + return referencesFishNet; + } + public override ILPostProcessor GetInstance() => this; + public override ILPostProcessResult Process(ICompiledAssembly compiledAssembly) + { + AssemblyDefinition assemblyDef = ILCoreHelper.GetAssemblyDefinition(compiledAssembly); + if (assemblyDef == null) + return null; + + //Check WillProcess again; somehow certain editor scripts skip the WillProcess check. + if (!WillProcess(compiledAssembly)) + return null; + + CodegenSession session = new CodegenSession(); + if (!session.Initialize(assemblyDef.MainModule)) + return null; + + bool modified = false; + + bool fnAssembly = IsFishNetAssembly(compiledAssembly); + if (fnAssembly) + modified |= ModifyMakePublicMethods(session); + /* If one or more scripts use RPCs but don't inherit NetworkBehaviours + * then don't bother processing the rest. */ + if (session.GetClass().NonNetworkBehaviourHasInvalidAttributes(session.Module.Types)) + return new ILPostProcessResult(null, session.Diagnostics); + + modified |= session.GetClass().Process(); + modified |= session.GetClass().Process(); + modified |= CreateDeclaredSerializerDelegates(session); + modified |= CreateDeclaredSerializers(session); + modified |= CreateDeclaredComparerDelegates(session); + modified |= CreateIBroadcast(session); +#if !DISABLE_QOL_ATTRIBUTES + modified |= CreateQOLAttributes(session); +#endif + modified |= CreateNetworkBehaviours(session); + modified |= CreateSerializerInitializeDelegates(session); + + if (fnAssembly) + { + AssemblyNameReference anr = session.Module.AssemblyReferences.FirstOrDefault(x => x.FullName == session.Module.Assembly.FullName); + if (anr != null) + session.Module.AssemblyReferences.Remove(anr); + } + + /* If there are warnings about SyncVars being in different assemblies. + * This is awful ... codegen would need to be reworked to save + * syncvars across all assemblies so that scripts referencing them from + * another assembly can have it's instructions changed. This however is an immense + * amount of work so it will have to be put on hold, for... a long.. long while. */ + if (session.DifferentAssemblySyncVars.Count > 0) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"Assembly {session.Module.Name} has inherited access to SyncVars in different assemblies. When accessing SyncVars across assemblies be sure to use Get/Set methods withinin the inherited assembly script to change SyncVars. Accessible fields are:"); + + foreach (FieldDefinition item in session.DifferentAssemblySyncVars) + sb.AppendLine($"Field {item.Name} within {item.DeclaringType.FullName} in assembly {item.Module.Name}."); + + session.LogWarning("v------- IMPORTANT -------v"); + session.LogWarning(sb.ToString()); + session.DifferentAssemblySyncVars.Clear(); + } + + //session.LogWarning($"Assembly {compiledAssembly.Name} took {stopwatch.ElapsedMilliseconds}."); + if (!modified) + { + return null; + } + else + { + TryLogV3ToV4Helpers(session); + + MemoryStream pe = new MemoryStream(); + MemoryStream pdb = new MemoryStream(); + WriterParameters writerParameters = new WriterParameters + { + SymbolWriterProvider = new PortablePdbWriterProvider(), + SymbolStream = pdb, + WriteSymbols = true + }; + assemblyDef.Write(pe, writerParameters); + return new ILPostProcessResult(new InMemoryAssembly(pe.ToArray(), pdb.ToArray()), session.Diagnostics); + } + } + + /// + /// Logs warning if v3 to v4 helpers are enabled. + /// + private void TryLogV3ToV4Helpers(CodegenSession session) + { +#if !FISHNET_DISABLE_V3TOV4_HELPERS + /* There is no way to check if this has run already once per codegen + * so the only option is to print per session, which means + * a print will occur every time an assembly compiles. This means + * several prints will potentially occur per script change. + * + * However, these warnings typically only print when all errors are gone. + * When this is true the user may go ahead and disable this warning + * as instructed. */ + session.LogWarning(UpgradeFromV3ToV4Menu.EnabledWarning); +#endif + } + + + /// + /// Makees methods public scope which use CodegenMakePublic attribute. + /// + /// + private bool ModifyMakePublicMethods(CodegenSession session) + { + string makePublicTypeFullName = typeof(MakePublicAttribute).FullName; + foreach (TypeDefinition td in session.Module.Types) + { + foreach (MethodDefinition md in td.Methods) + { + foreach (CustomAttribute ca in md.CustomAttributes) + { + if (ca.AttributeType.FullName == makePublicTypeFullName) + { + md.Attributes &= ~MethodAttributes.Assembly; + md.Attributes |= MethodAttributes.Public; + } + } + } + } + + //There is always at least one modified. + return true; + } + /// + /// Creates delegates for user declared serializers. + /// + internal bool CreateDeclaredSerializerDelegates(CodegenSession session) + { + bool modified = false; + + List allTypeDefs = session.Module.Types.ToList(); + foreach (TypeDefinition td in allTypeDefs) + { + if (session.GetClass().HasExcludeSerializationAttribute(td)) + continue; + + if (td.Attributes.HasFlag(WriterProcessor.CUSTOM_SERIALIZER_TYPEDEF_ATTRIBUTES)) + modified |= session.GetClass().CreateSerializerDelegates(td, true); + } + + return modified; + } + + /// + /// Creates serializers for custom types within user declared serializers. + /// + private bool CreateDeclaredSerializers(CodegenSession session) + { + bool modified = false; + + List allTypeDefs = session.Module.Types.ToList(); + foreach (TypeDefinition td in allTypeDefs) + { + if (session.GetClass().HasExcludeSerializationAttribute(td)) + continue; + + if (td.Attributes.HasFlag(WriterProcessor.CUSTOM_SERIALIZER_TYPEDEF_ATTRIBUTES)) + modified |= session.GetClass().CreateSerializers(td); + } + + return modified; + } + + /// + /// Creates delegates for user declared comparers. + /// + internal bool CreateDeclaredComparerDelegates(CodegenSession session) + { + bool modified = false; + List allTypeDefs = session.Module.Types.ToList(); + foreach (TypeDefinition td in allTypeDefs) + { + if (session.GetClass().HasExcludeSerializationAttribute(td)) + continue; + + modified |= session.GetClass().CreateComparerDelegates(td); + } + + return modified; + } + + + /// + /// Creaters serializers and calls for IBroadcast. + /// + /// + /// + private bool CreateIBroadcast(CodegenSession session) + { + bool modified = false; + + string networkBehaviourFullName = session.GetClass().FullName; + HashSet typeDefs = new HashSet(); + foreach (TypeDefinition td in session.Module.Types) + { + TypeDefinition climbTd = td; + do + { + //Reached NetworkBehaviour class. + if (climbTd.FullName == networkBehaviourFullName) + break; + + ///* Check initial class as well all types within + // * the class. Then check all of it's base classes. */ + if (climbTd.ImplementsInterface()) + typeDefs.Add(climbTd); + //7ms + + //Add nested. Only going to go a single layer deep. + foreach (TypeDefinition nestedTypeDef in td.NestedTypes) + { + if (nestedTypeDef.ImplementsInterface()) + typeDefs.Add(nestedTypeDef); + } + //0ms + + climbTd = climbTd.GetNextBaseTypeDefinition(session); + //this + name check 40ms + } while (climbTd != null); + + } + + + //Create reader/writers for found typeDefs. + foreach (TypeDefinition td in typeDefs) + { + TypeReference typeRef = session.ImportReference(td); + bool canSerialize = session.GetClass().HasSerializerAndDeserializer(typeRef, true); + if (!canSerialize) + session.LogError($"Broadcast {td.Name} does not support serialization. Use a supported type or create a custom serializer."); + else + modified = true; + } + + return modified; + } + + /// + /// Handles QOLAttributes such as [Server]. + /// + /// + private bool CreateQOLAttributes(CodegenSession session) + { + bool modified = false; + + bool codeStripping = false; + + List allTypeDefs = session.Module.Types.ToList(); + + /* First pass, potentially only pass. + * If code stripping them this will be run again. The first iteration + * is to ensure things are removed in the proper order. */ + foreach (TypeDefinition td in allTypeDefs) + { + if (session.GetClass().HasExcludeSerializationAttribute(td)) + continue; + + modified |= session.GetClass().Process(td, codeStripping); + } + + + + return modified; + } + + /// + /// Creates NetworkBehaviour changes. + /// + private bool CreateNetworkBehaviours(CodegenSession session) + { + //Get all network behaviours to process. + List networkBehaviourTypeDefs = session.Module.Types + .Where(td => td.IsSubclassOf(session, session.GetClass().FullName)) + .ToList(); + + /* Remove types which are inherited. This gets the child most networkbehaviours. + * Since processing iterates upward from each child there is no reason + * to include any inherited NBs. */ + RemoveInheritedTypeDefinitions(networkBehaviourTypeDefs); + + foreach (TypeDefinition typeDef in networkBehaviourTypeDefs) + { + session.ImportReference(typeDef); + session.GetClass().ProcessLocal(typeDef); + } + + //Call base methods on RPCs. + foreach (TypeDefinition td in session.Module.Types) + session.GetClass().RedirectBaseCalls(); + + /* Removes typedefinitions which are inherited by + * another within tds. For example, if the collection + * td contains A, B, C and our structure is + * A : B : C then B and C will be removed from the collection + * Since they are both inherited by A. */ + void RemoveInheritedTypeDefinitions(List tds) + { + HashSet inheritedTds = new HashSet(); + /* Remove any networkbehaviour typedefs which are inherited by + * another networkbehaviour typedef. */ + for (int i = 0; i < tds.Count; i++) + { + /* Iterates all base types and + * adds them to inheritedTds so long + * as the base type is not a NetworkBehaviour. */ + TypeDefinition copyTd = tds[i].GetNextBaseTypeDefinition(session); + while (copyTd != null) + { + //Class is NB. + if (copyTd.FullName == session.GetClass().FullName) + break; + + inheritedTds.Add(copyTd); + copyTd = copyTd.GetNextBaseTypeDefinition(session); + } + } + + //Remove all inherited types. + foreach (TypeDefinition item in inheritedTds) + tds.Remove(item); + } + + //Moment a NetworkBehaviour exist the assembly is considered modified. + bool modified = (networkBehaviourTypeDefs.Count > 0); + return modified; + } + + /// + /// Creates generic delegates for all read and write methods. + /// + /// + /// + private bool CreateSerializerInitializeDelegates(CodegenSession session) + { + session.GetClass().CreateInitializeDelegates(); + session.GetClass().CreateInitializeDelegates(); + + return true; + } + + internal static bool IsFishNetAssembly(ICompiledAssembly assembly) => (assembly.Name == FishNetILPP.RUNTIME_ASSEMBLY_NAME); + internal static bool IsFishNetAssembly(CodegenSession session) => (session.Module.Assembly.Name.Name == FishNetILPP.RUNTIME_ASSEMBLY_NAME); + internal static bool IsFishNetAssembly(ModuleDefinition moduleDef) => (moduleDef.Assembly.Name.Name == FishNetILPP.RUNTIME_ASSEMBLY_NAME); + + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/ILCore/FishNetILPP.cs.meta b/Assets/FishNet/CodeGenerating/ILCore/FishNetILPP.cs.meta new file mode 100644 index 0000000..38eb26f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/ILCore/FishNetILPP.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f03d76b376c1d5b4591039af6fd4c9e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/ILCore/ILCoreHelper.cs b/Assets/FishNet/CodeGenerating/ILCore/ILCoreHelper.cs new file mode 100644 index 0000000..054dc56 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/ILCore/ILCoreHelper.cs @@ -0,0 +1,38 @@ +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using System.IO; +using Unity.CompilationPipeline.Common.ILPostProcessing; + +namespace FishNet.CodeGenerating.ILCore +{ + internal static class ILCoreHelper + { + + /// + /// Returns AssembleDefinition for compiledAssembly. + /// + /// + /// + internal static AssemblyDefinition GetAssemblyDefinition(ICompiledAssembly compiledAssembly) + { + PostProcessorAssemblyResolver assemblyResolver = new PostProcessorAssemblyResolver(compiledAssembly); + ReaderParameters readerParameters = new ReaderParameters + { + SymbolStream = new MemoryStream(compiledAssembly.InMemoryAssembly.PdbData), + SymbolReaderProvider = new PortablePdbReaderProvider(), + AssemblyResolver = assemblyResolver, + ReflectionImporterProvider = new PostProcessorReflectionImporterProvider(), + ReadingMode = ReadingMode.Immediate + }; + + AssemblyDefinition assemblyDefinition = AssemblyDefinition.ReadAssembly(new MemoryStream(compiledAssembly.InMemoryAssembly.PeData), readerParameters); + //Allows us to resolve inside FishNet assembly, such as for components. + assemblyResolver.AddAssemblyDefinitionBeingOperatedOn(assemblyDefinition); + + return assemblyDefinition; + } + + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/ILCore/ILCoreHelper.cs.meta b/Assets/FishNet/CodeGenerating/ILCore/ILCoreHelper.cs.meta new file mode 100644 index 0000000..63a163d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/ILCore/ILCoreHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dfcfb917dd9268744962ae61aa0115b7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/ILCore/PostProcessorAssemblyResolver.cs b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorAssemblyResolver.cs new file mode 100644 index 0000000..6a9ca63 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorAssemblyResolver.cs @@ -0,0 +1,139 @@ +using MonoFN.Cecil; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading; +using Unity.CompilationPipeline.Common.ILPostProcessing; + +namespace FishNet.CodeGenerating +{ + internal class PostProcessorAssemblyResolver : IAssemblyResolver + { + private readonly string[] m_AssemblyReferences; + private readonly Dictionary m_AssemblyCache = new Dictionary(); + private readonly ICompiledAssembly m_CompiledAssembly; + private AssemblyDefinition m_SelfAssembly; + + public PostProcessorAssemblyResolver(ICompiledAssembly compiledAssembly) + { + m_CompiledAssembly = compiledAssembly; + m_AssemblyReferences = compiledAssembly.References; + } + + public void Dispose() { } + + public AssemblyDefinition Resolve(AssemblyNameReference name) => Resolve(name, new ReaderParameters(ReadingMode.Deferred)); + + public AssemblyDefinition Resolve(AssemblyNameReference name, ReaderParameters parameters) + { + lock (m_AssemblyCache) + { + if (name.Name == m_CompiledAssembly.Name) + { + return m_SelfAssembly; + } + + var fileName = FindFile(name); + if (fileName == null) + { + return null; + } + + var lastWriteTime = File.GetLastWriteTime(fileName); + var cacheKey = $"{fileName}{lastWriteTime}"; + if (m_AssemblyCache.TryGetValue(cacheKey, out var result)) + { + return result; + } + + parameters.AssemblyResolver = this; + + var ms = MemoryStreamFor(fileName); + var pdb = $"{fileName}.pdb"; + if (File.Exists(pdb)) + { + parameters.SymbolStream = MemoryStreamFor(pdb); + } + + var assemblyDefinition = AssemblyDefinition.ReadAssembly(ms, parameters); + m_AssemblyCache.Add(cacheKey, assemblyDefinition); + + return assemblyDefinition; + } + } + + private string FindFile(AssemblyNameReference name) + { + var fileName = m_AssemblyReferences.FirstOrDefault(r => Path.GetFileName(r) == $"{name.Name}.dll"); + if (fileName != null) + { + return fileName; + } + + // perhaps the type comes from an exe instead + fileName = m_AssemblyReferences.FirstOrDefault(r => Path.GetFileName(r) == $"{name.Name}.exe"); + if (fileName != null) + { + return fileName; + } + + //Unfortunately the current ICompiledAssembly API only provides direct references. + //It is very much possible that a postprocessor ends up investigating a type in a directly + //referenced assembly, that contains a field that is not in a directly referenced assembly. + //if we don't do anything special for that situation, it will fail to resolve. We should fix this + //in the ILPostProcessing API. As a workaround, we rely on the fact here that the indirect references + //are always located next to direct references, so we search in all directories of direct references we + //got passed, and if we find the file in there, we resolve to it. + return m_AssemblyReferences + .Select(Path.GetDirectoryName) + .Distinct() + .Select(parentDir => Path.Combine(parentDir, $"{name.Name}.dll")) + .FirstOrDefault(File.Exists); + } + + private static MemoryStream MemoryStreamFor(string fileName) + { + return Retry(10, TimeSpan.FromSeconds(1), () => + { + byte[] byteArray; + using (var fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + byteArray = new byte[fs.Length]; + var readLength = fs.Read(byteArray, 0, (int)fs.Length); + if (readLength != fs.Length) + { + throw new InvalidOperationException("File read length is not full length of file."); + } + } + + return new MemoryStream(byteArray); + }); + } + + private static MemoryStream Retry(int retryCount, TimeSpan waitTime, Func func) + { + try + { + return func(); + } + catch (IOException) + { + if (retryCount == 0) + { + throw; + } + + Console.WriteLine($"Caught IO Exception, trying {retryCount} more times"); + Thread.Sleep(waitTime); + + return Retry(retryCount - 1, waitTime, func); + } + } + + public void AddAssemblyDefinitionBeingOperatedOn(AssemblyDefinition assemblyDefinition) + { + m_SelfAssembly = assemblyDefinition; + } + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/ILCore/PostProcessorAssemblyResolver.cs.meta b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorAssemblyResolver.cs.meta new file mode 100644 index 0000000..1a05af5 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorAssemblyResolver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2c247f4266b2864eb96e6a9ae6557d31 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporter.cs b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporter.cs new file mode 100644 index 0000000..32b9e8c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporter.cs @@ -0,0 +1,22 @@ +using MonoFN.Cecil; +using System.Linq; +using System.Reflection; + +namespace FishNet.CodeGenerating.ILCore +{ + internal class PostProcessorReflectionImporter : DefaultReflectionImporter + { + private const string k_SystemPrivateCoreLib = "System.Private.CoreLib"; + private readonly AssemblyNameReference m_CorrectCorlib; + + public PostProcessorReflectionImporter(ModuleDefinition module) : base(module) + { + m_CorrectCorlib = module.AssemblyReferences.FirstOrDefault(a => a.Name == "mscorlib" || a.Name == "netstandard" || a.Name == k_SystemPrivateCoreLib); + } + + public override AssemblyNameReference ImportReference(AssemblyName reference) + { + return m_CorrectCorlib != null && reference.Name == k_SystemPrivateCoreLib ? m_CorrectCorlib : base.ImportReference(reference); + } + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporter.cs.meta b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporter.cs.meta new file mode 100644 index 0000000..8dca5f1 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 484e8ad8c4dde382ea67036b32935ef1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporterProvider.cs b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporterProvider.cs new file mode 100644 index 0000000..7d38602 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporterProvider.cs @@ -0,0 +1,12 @@ +using MonoFN.Cecil; + +namespace FishNet.CodeGenerating.ILCore +{ + internal class PostProcessorReflectionImporterProvider : IReflectionImporterProvider + { + public IReflectionImporter GetReflectionImporter(ModuleDefinition moduleDef) + { + return new PostProcessorReflectionImporter(moduleDef); + } + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporterProvider.cs.meta b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporterProvider.cs.meta new file mode 100644 index 0000000..12a58b8 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/ILCore/PostProcessorReflectionImporterProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f9273a5dad109ab0783891e36c983080 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing.meta b/Assets/FishNet/CodeGenerating/Processing.meta new file mode 100644 index 0000000..361cc40 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 15ff4c71a3c972440810ac633b69764d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/CodegenBase.cs b/Assets/FishNet/CodeGenerating/Processing/CodegenBase.cs new file mode 100644 index 0000000..9634513 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/CodegenBase.cs @@ -0,0 +1,61 @@ +using MonoFN.Cecil; +using SR = System.Reflection; + + +namespace FishNet.CodeGenerating +{ + internal abstract class CodegenBase + { + //Lazy debug checks. + public bool IsIsolatedAsm => (Module.Name.Contains("IsolatedAsm")); + public bool IsRuntimeAsm => (Module.Name.Contains("FishNet.Runtime")); + + public CodegenSession Session { get; private set; } + public ModuleDefinition Module { get; private set; } + + public virtual bool ImportReferences() { return true; } + + public void Initialize(CodegenSession session) + { + Session = session; + Module = session.Module; + } + + /// + /// Returns class of type if found within Session. + /// + /// + /// + internal T GetClass() where T : CodegenBase => Session.GetClass(); + + #region Logging. + /// + /// Logs a warning. + /// + /// + internal void LogWarning(string msg) => Session.LogWarning(msg); + /// + /// Logs an error. + /// + /// + internal void LogError(string msg) => Session.LogError(msg); + #endregion + + #region ImportReference. + public MethodReference ImportReference(SR.MethodBase method) => Session.ImportReference(method); + public MethodReference ImportReference(SR.MethodBase method, IGenericParameterProvider context) => Session.ImportReference(method, context); + public TypeReference ImportReference(TypeReference type) => Session.ImportReference(type); + public TypeReference ImportReference(TypeReference type, IGenericParameterProvider context) => Session.ImportReference(type, context); + public FieldReference ImportReference(FieldReference field) => Session.ImportReference(field); + public FieldReference ImportReference(FieldReference field, IGenericParameterProvider context) => Session.ImportReference(field, context); + public FieldReference ImportReference(SR.FieldInfo field) => Session.ImportReference(field); + public FieldReference ImportReference(SR.FieldInfo field, IGenericParameterProvider context) => Session.ImportReference(field, context); + public MethodReference ImportReference(MethodReference method) => Session.ImportReference(method); + public MethodReference ImportReference(MethodReference method, IGenericParameterProvider context) => Session.ImportReference(method, context); + public TypeReference ImportReference(System.Type type) => Session.ImportReference(type, null); + public TypeReference ImportReference(System.Type type, IGenericParameterProvider context) => Session.ImportReference(type, context); + #endregion + + } + +} diff --git a/Assets/FishNet/CodeGenerating/Processing/CodegenBase.cs.meta b/Assets/FishNet/CodeGenerating/Processing/CodegenBase.cs.meta new file mode 100644 index 0000000..90b497e --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/CodegenBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8462034e5255191499a018bd8fbbf751 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/CustomSerializerProcessor.cs b/Assets/FishNet/CodeGenerating/Processing/CustomSerializerProcessor.cs new file mode 100644 index 0000000..117ba0f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/CustomSerializerProcessor.cs @@ -0,0 +1,367 @@ + +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Serializing; +using FishNet.Serializing.Helping; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using System.Collections.Generic; +using UnityEngine; + +namespace FishNet.CodeGenerating.Processing +{ + internal class CustomSerializerProcessor : CodegenBase + { + + #region Types. + internal enum ExtensionType + { + None, + Write, + Read + } + + #endregion + + internal bool CreateSerializerDelegates(TypeDefinition typeDef, bool replace) + { + bool modified = false; + /* Find all declared methods and register delegates to them. + * After they are all registered create any custom writers + * needed to complete the declared methods. It's important to + * make generated writers after so that a generated method + * isn't made for a type when the user has already made a declared one. */ + foreach (MethodDefinition methodDef in typeDef.Methods) + { + ExtensionType extensionType = GetExtensionType(methodDef); + if (extensionType == ExtensionType.None) + continue; + if (base.GetClass().HasNotSerializableAttribute(methodDef)) + continue; + + MethodReference methodRef = base.ImportReference(methodDef); + if (extensionType == ExtensionType.Write) + { + base.GetClass().AddWriterMethod(methodRef.Parameters[1].ParameterType, methodRef, false, !replace); + modified = true; + } + else if (extensionType == ExtensionType.Read) + { + base.GetClass().AddReaderMethod(methodRef.ReturnType, methodRef, false, !replace); + modified = true; + } + } + + return modified; + } + + /// + /// Creates serializers for any custom types for declared methods. + /// + /// + /// + internal bool CreateSerializers(TypeDefinition typeDef) + { + bool modified = false; + + List<(MethodDefinition, ExtensionType)> declaredMethods = new List<(MethodDefinition, ExtensionType)>(); + /* Go through all custom serializers again and see if + * they use any types that the user didn't make a serializer for + * and that there isn't a built-in type for. Create serializers + * for these types. */ + foreach (MethodDefinition methodDef in typeDef.Methods) + { + ExtensionType extensionType = GetExtensionType(methodDef); + if (extensionType == ExtensionType.None) + continue; + if (base.GetClass().HasNotSerializableAttribute(methodDef)) + continue; + + declaredMethods.Add((methodDef, extensionType)); + modified = true; + } + //Now that all declared are loaded see if any of them need generated serializers. + foreach ((MethodDefinition methodDef, ExtensionType extensionType) in declaredMethods) + CreateSerializers(extensionType, methodDef); + + return modified; + } + + + /// + /// Creates a custom serializer for any types not handled within users declared. + /// + /// + /// + /// + /// + private void CreateSerializers(ExtensionType extensionType, MethodDefinition methodDef) + { + for (int i = 0; i < methodDef.Body.Instructions.Count; i++) + CheckToModifyInstructions(extensionType, methodDef, ref i); + } + + /// + /// Creates delegates for custom comparers. + /// + internal bool CreateComparerDelegates(TypeDefinition typeDef) + { + bool modified = false; + GeneralHelper gh = base.GetClass(); + /* Find all declared methods and register delegates to them. + * After they are all registered create any custom writers + * needed to complete the declared methods. It's important to + * make generated writers after so that a generated method + * isn't made for a type when the user has already made a declared one. */ + foreach (MethodDefinition methodDef in typeDef.Methods) + { + if (gh.HasNotSerializableAttribute(methodDef)) + continue; + if (!methodDef.HasCustomAttribute()) + continue; + //Validate return type. + if (methodDef.ReturnType.FullName != gh.GetTypeReference(typeof(bool)).FullName) + { + base.LogError($"Comparer method {methodDef.Name} in type {typeDef.FullName} must return bool."); + continue; + } + /* Make sure parameters are correct. */ + //Invalid count. + if (methodDef.Parameters.Count != 2) + { + base.LogError($"Comparer method {methodDef.Name} in type {typeDef.FullName} must have exactly two parameters, each of the same type which is being compared."); + continue; + } + TypeReference p0Tr = methodDef.Parameters[0].ParameterType; + TypeReference p1Tr = methodDef.Parameters[0].ParameterType; + //Not the same types. + if (p0Tr != p1Tr) + { + base.LogError($"Both parameters must be the same type in comparer method {methodDef.Name} in type {typeDef.FullName}."); + continue; + } + + base.ImportReference(methodDef); + base.ImportReference(p0Tr); + gh.RegisterComparerDelegate(methodDef, p0Tr); + gh.CreateComparerDelegate(methodDef, p0Tr); + } + + return modified; + } + + + /// + /// Checks if instructions need to be modified and does so. + /// + /// + /// + private void CheckToModifyInstructions(ExtensionType extensionType, MethodDefinition methodDef, ref int instructionIndex) + { + Instruction instruction = methodDef.Body.Instructions[instructionIndex]; + //Fields. + if (instruction.OpCode == OpCodes.Ldsfld || instruction.OpCode == OpCodes.Ldfld) + CheckFieldReferenceInstruction(extensionType, methodDef, ref instructionIndex); + //Method calls. + else if (instruction.OpCode == OpCodes.Call || instruction.OpCode == OpCodes.Callvirt) + CheckCallInstruction(extensionType, methodDef, ref instructionIndex, (MethodReference)instruction.Operand); + } + + + /// + /// Checks if a reader or writer must be generated for a field type. + /// + /// + /// + private void CheckFieldReferenceInstruction(ExtensionType extensionType, MethodDefinition methodDef, ref int instructionIndex) + { + Instruction instruction = methodDef.Body.Instructions[instructionIndex]; + FieldReference field = (FieldReference)instruction.Operand; + TypeReference typeRef = field.DeclaringType; + + if (typeRef.IsType(typeof(GenericWriter<>)) || typeRef.IsType(typeof(GenericReader<>)) && typeRef.IsGenericInstance) + { + GenericInstanceType typeGenericInst = (GenericInstanceType)typeRef; + TypeReference parameterType = typeGenericInst.GenericArguments[0]; + CreateReaderOrWriter(extensionType, methodDef, ref instructionIndex, parameterType); + } + } + + + /// + /// Checks if a reader or writer must be generated for a call type. + /// + /// + /// + /// + /// + /// + private void CheckCallInstruction(ExtensionType extensionType, MethodDefinition methodDef, ref int instructionIndex, MethodReference method) + { + if (!method.IsGenericInstance) + return; + + //True if call is to read/write. + bool canCreate = ( + method.Is(nameof(Writer.Write)) || + method.Is(nameof(Reader.Read)) + ); + + if (canCreate) + { + GenericInstanceMethod instanceMethod = (GenericInstanceMethod)method; + TypeReference parameterType = instanceMethod.GenericArguments[0]; + if (parameterType.IsGenericParameter) + return; + + CreateReaderOrWriter(extensionType, methodDef, ref instructionIndex, parameterType); + } + } + + + /// + /// Creates a reader or writer for parameterType if needed. Otherwise calls existing reader. + /// + private void CreateReaderOrWriter(ExtensionType extensionType, MethodDefinition methodDef, ref int instructionIndex, TypeReference parameterType) + { + ReaderProcessor rp = base.GetClass(); + WriterProcessor wp = base.GetClass(); + ////If parameterType has user declared do nothing. + //if (wp.IsGlobalSerializer(parameterType)) + // return; + + if (!parameterType.IsGenericParameter && parameterType.CanBeResolved(base.Session)) + { + TypeDefinition typeDefinition = parameterType.CachedResolve(base.Session); + //If class and not value type check for accessible constructor. + if (typeDefinition.IsClass && !typeDefinition.IsValueType) + { + MethodDefinition constructor = typeDefinition.GetDefaultConstructor(base.Session); + //Constructor is inaccessible, cannot create serializer for type. + if (constructor != null && !constructor.IsPublic) + { + base.LogError($"Unable to generator serializers for {typeDefinition.FullName} because it's constructor is not public."); + return; + } + } + + ILProcessor processor = methodDef.Body.GetILProcessor(); + + //Find already existing read or write method. + MethodReference createdMethodRef = (extensionType == ExtensionType.Write) ? + wp.GetWriteMethodReference(parameterType) : + rp.GetReadMethodReference(parameterType); + + //If a created method already exist nothing further is required. + if (createdMethodRef != null) + { + TryInsertAutoPack(ref instructionIndex); + //Replace call to generic with already made serializer. + Instruction newInstruction = processor.Create(OpCodes.Call, createdMethodRef); + methodDef.Body.Instructions[instructionIndex] = newInstruction; + return; + } + else + { + createdMethodRef = (extensionType == ExtensionType.Write) ? + wp.CreateWriter(parameterType) : + rp.CreateReader(parameterType); + } + + //If method was created. + if (createdMethodRef != null) + { + TryInsertAutoPack(ref instructionIndex); + //Set new instruction. + Instruction newInstruction = processor.Create(OpCodes.Call, createdMethodRef); + methodDef.Body.Instructions[instructionIndex] = newInstruction; + } + } + + void TryInsertAutoPack(ref int insertIndex) + { + if (IsAutoPackMethod(parameterType, extensionType)) + { + ILProcessor processor = methodDef.Body.GetILProcessor(); + AutoPackType packType = base.GetClass().GetDefaultAutoPackType(parameterType); + Instruction autoPack = processor.Create(OpCodes.Ldc_I4, (int)packType); + methodDef.Body.Instructions.Insert(insertIndex, autoPack); + insertIndex++; + } + } + } + + /// + /// Returns if a typeRef serializer requires or uses autopacktype. + /// + private bool IsAutoPackMethod(TypeReference typeRef, ExtensionType extensionType) + { + if (extensionType == ExtensionType.Write) + return base.GetClass().IsAutoPackedType(typeRef); + else if (extensionType == ExtensionType.Read) + return base.GetClass().IsAutoPackedType(typeRef); + else + return false; + + } + /// + /// Returns the RPC attribute on a method, if one exist. Otherwise returns null. + /// + /// + /// + private ExtensionType GetExtensionType(MethodDefinition methodDef) + { + bool hasExtensionAttribute = methodDef.HasCustomAttribute(); + if (!hasExtensionAttribute) + return ExtensionType.None; + + bool write = (methodDef.ReturnType == methodDef.Module.TypeSystem.Void); + + //Return None for Mirror types. +#if MIRROR + if (write) + { + if (methodDef.Parameters.Count > 0 && methodDef.Parameters[0].ParameterType.FullName == "Mirror.NetworkWriter") + return ExtensionType.None; + } + else + { + if (methodDef.Parameters.Count > 0 && methodDef.Parameters[0].ParameterType.FullName == "Mirror.NetworkReader") + return ExtensionType.None; + } +#endif + + + string prefix = (write) ? WriterProcessor.CUSTOM_WRITER_PREFIX : ReaderProcessor.CUSTOM_READER_PREFIX; + + //Does not contain prefix. + if (methodDef.Name.Length < prefix.Length || methodDef.Name.Substring(0, prefix.Length) != prefix) + return ExtensionType.None; + + //Make sure first parameter is right. + if (methodDef.Parameters.Count >= 1) + { + TypeReference tr = methodDef.Parameters[0].ParameterType; + if (tr.FullName != base.GetClass().Writer_TypeRef.FullName && + tr.FullName != base.GetClass().Reader_TypeRef.FullName) + return ExtensionType.None; + } + + if (write && methodDef.Parameters.Count < 2) + { + base.LogError($"{methodDef.FullName} must have at least two parameters, the first being PooledWriter, and second value to write."); + return ExtensionType.None; + } + else if (!write && methodDef.Parameters.Count < 1) + { + base.LogError($"{methodDef.FullName} must have at least one parameters, the first being PooledReader."); + return ExtensionType.None; + } + + return (write) ? ExtensionType.Write : ExtensionType.Read; + } + + + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Processing/CustomSerializerProcessor.cs.meta b/Assets/FishNet/CodeGenerating/Processing/CustomSerializerProcessor.cs.meta new file mode 100644 index 0000000..8235bda --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/CustomSerializerProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9269fd8a62199e24c965b4c99b641244 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/NetworkBehaviourProcessor.cs b/Assets/FishNet/CodeGenerating/Processing/NetworkBehaviourProcessor.cs new file mode 100644 index 0000000..a39c13e --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/NetworkBehaviourProcessor.cs @@ -0,0 +1,543 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.CodeGenerating.Processing.Rpc; +using FishNet.Configuring; +using FishNet.Object; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using MonoFN.Collections.Generic; +using System.Collections.Generic; +using System.Linq; + +namespace FishNet.CodeGenerating.Processing +{ + internal class NetworkBehaviourProcessor : CodegenBase + { + #region Private. + /// + /// Classes which have been processed for all NetworkBehaviour features. + /// + private HashSet _processedClasses = new HashSet(); + #endregion + + #region Const. + internal const string EARLY_INITIALIZED_NAME = "NetworkInitializeEarly_"; + internal const string LATE_INITIALIZED_NAME = "NetworkInitializeLate_"; + internal const string NETWORKINITIALIZE_EARLY_INTERNAL_NAME = "NetworkInitialize___Early"; + internal const string NETWORKINITIALIZE_LATE_INTERNAL_NAME = "NetworkInitialize__Late"; + #endregion + + internal bool ProcessLocal(TypeDefinition typeDef) + { + bool modified = false; + TypeDefinition copyTypeDef = typeDef; + + //TypeDefs which are using prediction. + List _usesPredictionTypeDefs = new List(); + + //Make collection of NBs to processor. + List typeDefs = new List(); + do + { + if (!HasClassBeenProcessed(copyTypeDef)) + { + //Disallow nested network behaviours. + ICollection nestedTds = copyTypeDef.NestedTypes; + foreach (TypeDefinition item in nestedTds) + { + if (item.InheritsNetworkBehaviour(base.Session)) + { + base.LogError($"{copyTypeDef.FullName} contains nested NetworkBehaviours. These are not supported."); + return modified; + } + } + + typeDefs.Add(copyTypeDef); + } + copyTypeDef = TypeDefinitionExtensionsOld.GetNextBaseClassToProcess(copyTypeDef, base.Session); + } while (copyTypeDef != null); + + /* Reverse type definitions so that the parent + * is first. This counts indexes up as we go further + * down the children. By doing so we do not have to + * rebuild rpc or synctype indexes when a parent is inherited + * multiple times. EG: with this solution if parent had 1 sync type + * and childA had 2 the parent would be index 0, and childA would have 1 and 2. + * But also, if childB inherited childA it would have 3+. + * + * Going in reverse also gaurantees the awake method will already be created + * or modified in any class a child inherits. This lets us call it appropriately + * as well error if the awake does not exist, such as could not be created. */ + typeDefs.Reverse(); + + foreach (TypeDefinition td in typeDefs) + { + /* Create NetworkInitialize before-hand so the other procesors + * can use it. */ + MethodDefinition networkInitializeIfDisabledMd; + CreateNetworkInitializeMethods(td, out networkInitializeIfDisabledMd); + CallNetworkInitializesFromNetworkInitializeIfDisabled(networkInitializeIfDisabledMd); + + + + /* Prediction. */ + /* Run prediction first since prediction will modify + * user data passed into prediction methods. Because of this + * other RPCs should use the modified version and reader/writers + * made for prediction. */ + if (base.GetClass().Process(td)) + { + _usesPredictionTypeDefs.Add(td); + modified = true; + } + //25ms + + /* RPCs. */ + modified |= base.GetClass().ProcessLocal(td); + //30ms + /* //perf rpcCounts can be optimized by having different counts + * for target, observers, server, replicate, and reoncile rpcs. Since + * each registers to their own delegates this is possible. */ + + /* SyncTypes. */ + modified |= base.GetClass().ProcessLocal(td); + + //Call base networkinitialize early/late. + CallBaseOnNetworkInitializeMethods(td); + //Add networkinitialize executed check to early/late. + AddNetworkInitializeExecutedChecks(td); + + //Copy user logic from awake into a new method. + CopyAwakeUserLogic(td); + /* Create awake method or if already exist make + * it public virtual. */ + if (!ModifyAwakeMethod(td, out bool awakeCreated)) + { + //This is a hard fail and will break the solution so throw here. + base.LogError($"{td.FullName} has an Awake method which could not be modified, or could not be found. This often occurs when a child class is in an assembly different from the parent, and the parent does not implement Awake. To resolve this make an Awake in {td.Name} public virtual."); + return modified; + } + + //Calls NetworkInitializeEarly from awake. + CallMethodFromAwake(td, NETWORKINITIALIZE_EARLY_INTERNAL_NAME); + //Only call base if awake was created. Otherwise let the users implementation handle base calling. + if (awakeCreated) + CallBaseAwake(td); + //Call logic user may have put in awake. + CallAwakeUserLogic(td); + //NetworkInitializeLate from awake. + CallMethodFromAwake(td, NETWORKINITIALIZE_LATE_INTERNAL_NAME); + //Since awake methods are erased ret has to be added at the end. + AddReturnToAwake(td); + + //70ms + _processedClasses.Add(td); + } + + /* If here then all inerited classes for firstTypeDef have + * been processed. */ + //Sets UsesPrediction in NetworkBehaviours. + SetUsesPrediction(_usesPredictionTypeDefs); + + return modified; + } + + /// + /// Gets the name to use for user awake logic method. + /// + internal string GetAwakeUserLogicMethodDefinition(TypeDefinition td) => $"Awake_UserLogic_{td.FullName}_{base.Module.Name}"; + + + /// + /// Returns if a class has been processed. + /// + /// + /// + private bool HasClassBeenProcessed(TypeDefinition typeDef) + { + return _processedClasses.Contains(typeDef); + } + + /// + /// Returns if any typeDefs have attributes which are not allowed to be used outside NetworkBehaviour. + /// + /// + /// + internal bool NonNetworkBehaviourHasInvalidAttributes(Collection typeDefs) + { + SyncTypeProcessor stProcessor = base.GetClass(); + RpcProcessor rpcProcessor = base.GetClass(); + + foreach (TypeDefinition typeDef in typeDefs) + { + //Inherits, don't need to check. + if (typeDef.InheritsNetworkBehaviour(base.Session)) + continue; + + //Check each method for attribute. + foreach (MethodDefinition md in typeDef.Methods) + { + //Has RPC attribute but doesn't inherit from NB. + if (rpcProcessor.Attributes.HasRpcAttributes(md)) + { + base.LogError($"{typeDef.FullName} has one or more RPC attributes but does not inherit from NetworkBehaviour."); + return true; + } + } + //Check fields for attribute. + foreach (FieldDefinition fd in typeDef.Fields) + { + if (stProcessor.IsSyncType(fd)) + { + base.LogError($"{typeDef.FullName} implements one or more SyncTypes but does not inherit from NetworkBehaviour."); + return true; + } + } + } + + //Fallthrough / pass. + return false; + } + + + + /// + /// Calls the next awake method if the nested awake was created by codegen. + /// + /// + private void CallBaseAwake(TypeDefinition td) + { + /* If base is not a class which can be processed then there + * is no need to continue. */ + if (!td.CanProcessBaseType(base.Session)) + return; + + //Base Awake. + MethodReference baseAwakeMr = td.GetMethodReferenceInBase(base.Session, NetworkBehaviourHelper.AWAKE_METHOD_NAME); + //This Awake. + MethodDefinition tdAwakeMd = td.GetMethod(NetworkBehaviourHelper.AWAKE_METHOD_NAME); + + ILProcessor processor = tdAwakeMd.Body.GetILProcessor(); + processor.Emit(OpCodes.Ldarg_0); //base. + processor.Emit(OpCodes.Call, baseAwakeMr); + } + + + /// + /// Calls the next awake method if the nested awake was created by codegen. + /// + /// + private void CallAwakeUserLogic(TypeDefinition td) + { + //UserLogic. + MethodDefinition userLogicMd = td.GetMethod(GetAwakeUserLogicMethodDefinition(td)); + /* Userlogic may be null if Awake was created. + * If so, there's no need to proceed. */ + if (userLogicMd == null) + return; + + //This Awake. + MethodDefinition awakeMd = td.GetMethod(NetworkBehaviourHelper.AWAKE_METHOD_NAME); + //Call logic. + base.GetClass().CallCopiedMethod(awakeMd, userLogicMd); + } + + + /// + /// Adds a check to NetworkInitialize to see if it has already run. + /// + /// + private void AddNetworkInitializeExecutedChecks(TypeDefinition typeDef) + { + AddCheck(NETWORKINITIALIZE_EARLY_INTERNAL_NAME); + AddCheck(NETWORKINITIALIZE_LATE_INTERNAL_NAME); + + void AddCheck(string methodName) + { + string fieldName = $"{methodName}{typeDef.FullName}{typeDef.Module.Name}_Excuted"; + MethodDefinition md = typeDef.GetMethod(methodName); + if (md == null) + return; + + TypeReference boolTr = base.GetClass().GetTypeReference(typeof(bool)); + FieldReference fr = typeDef.GetOrCreateFieldReference(base.Session, fieldName, FieldAttributes.Private, boolTr, out bool created); + + if (created) + { + List insts = new List(); + ILProcessor processor = md.Body.GetILProcessor(); + //Add check if already called. + //if (alreadyInitialized) return; + Instruction skipFirstRetInst = processor.Create(OpCodes.Nop); + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Ldfld, fr)); + insts.Add(processor.Create(OpCodes.Brfalse_S, skipFirstRetInst)); + insts.Add(processor.Create(OpCodes.Ret)); + insts.Add(skipFirstRetInst); + //Set field to true. + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Ldc_I4_1)); + insts.Add(processor.Create(OpCodes.Stfld, fr)); + processor.InsertFirst(insts); + } + } + } + + /// + /// Calls base for NetworkInitializeEarly/Late on a TypeDefinition. + /// + private void CallBaseOnNetworkInitializeMethods(TypeDefinition typeDef) + { + //If base class cannot have a networkinitialize no reason to continue. + if (!typeDef.CanProcessBaseType(base.Session)) + return; + + string[] initializeMethodNames = new string[] { NETWORKINITIALIZE_EARLY_INTERNAL_NAME, NETWORKINITIALIZE_LATE_INTERNAL_NAME }; + foreach (string mdName in initializeMethodNames) + { + /* Awake will always exist because it was added previously. + * Get awake for copy and base of copy. */ + MethodDefinition thisMd = typeDef.GetMethod(mdName); + ILProcessor processor = thisMd.Body.GetILProcessor(); + + /* Awake will always exist because it was added previously. + * Get awake for copy and base of copy. */ + MethodReference baseMr = typeDef.GetMethodReferenceInBase(base.Session, mdName); + MethodDefinition baseMd = baseMr.CachedResolve(base.Session); + + bool alreadyHasBaseCall = false; + //Check if already calls baseAwake. + foreach (Instruction item in thisMd.Body.Instructions) + { + //If a call or call virt. Although, callvirt should never occur. + if (item.OpCode == OpCodes.Call || item.OpCode == OpCodes.Callvirt) + { + if (item.Operand != null && item.Operand.GetType().Name == nameof(MethodDefinition)) + { + MethodDefinition md = (MethodDefinition)item.Operand; + if (md == baseMd) + { + alreadyHasBaseCall = true; + break; + } + } + } + } + + if (!alreadyHasBaseCall) + { + //Create instructions for base call. + List instructions = new List + { + processor.Create(OpCodes.Ldarg_0), //this. + processor.Create(OpCodes.Call, baseMr) + }; + processor.InsertFirst(instructions); + } + } + } + + + /// + /// Sets UsesPrediction to true on NetworkBehaviours. + /// + private void SetUsesPrediction(List typeDefs) + { +//#if !PREDICTION_1 +// NetworkBehaviourHelper nbh = base.GetClass(); + +// foreach (TypeDefinition td in typeDefs) +// { +// MethodDefinition md = td.GetMethod(NETWORKINITIALIZE_EARLY_INTERNAL_NAME); +// ILProcessor processor = md.Body.GetILProcessor(); + +// int lastInstructionIndex = (md.Body.Instructions.Count - 1); +// //Remove opcode if present. It will be added back on after. +// if (lastInstructionIndex >= 0 && md.Body.Instructions[lastInstructionIndex].OpCode == OpCodes.Ret) +// md.Body.Instructions.RemoveAt(lastInstructionIndex); + +// //Set field. +// processor.Emit(OpCodes.Ldarg_0); //base. +// processor.Emit(OpCodes.Ldc_I4_1); //true. +// processor.Emit(OpCodes.Stfld, nbh.UsesPrediction_FieldRef); +// processor.Emit(OpCodes.Ret); +// } +//#endif + } + + /// + /// Adds returns awake method definitions within awakeDatas. + /// + private void AddReturnToAwake(TypeDefinition td) + { + //This Awake. + MethodDefinition awakeMd = td.GetMethod(NetworkBehaviourHelper.AWAKE_METHOD_NAME); + ILProcessor processor = awakeMd.Body.GetILProcessor(); + //If no instructions or the last instruction isnt ret. + if (processor.Body.Instructions.Count == 0 + || processor.Body.Instructions[processor.Body.Instructions.Count - 1].OpCode != OpCodes.Ret) + { + processor.Emit(OpCodes.Ret); + } + } + + /// + /// Calls a method by name from awake. + /// + private void CallMethodFromAwake(TypeDefinition typeDef, string methodName) + { + //Will never be null because we added it previously. + MethodDefinition awakeMethodDef = typeDef.GetMethod(NetworkBehaviourHelper.AWAKE_METHOD_NAME); + MethodReference networkInitMr = typeDef.GetMethodReference(base.Session, methodName); + + ILProcessor processor = awakeMethodDef.Body.GetILProcessor(); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(networkInitMr.GetCallOpCode(base.Session), networkInitMr); + } + + /// + /// Creates an 'NetworkInitialize' method which is called by the childmost class to initialize scripts on Awake. + /// + private void CreateNetworkInitializeMethods(TypeDefinition typeDef, out MethodDefinition networkInitializeIfDisabledMd) + { + CreateMethod(NETWORKINITIALIZE_EARLY_INTERNAL_NAME); + CreateMethod(NETWORKINITIALIZE_LATE_INTERNAL_NAME); + networkInitializeIfDisabledMd = CreateMethod(nameof(NetworkBehaviour.NetworkInitializeIfDisabled)); + + MethodDefinition CreateMethod(string name, MethodDefinition copied = null) + { + bool created; + MethodDefinition md = typeDef.GetOrCreateMethodDefinition(base.Session, name, MethodDefinitionExtensions.PUBLIC_VIRTUAL_ATTRIBUTES, typeDef.Module.TypeSystem.Void, out created); + + if (created) + { + //Emit ret into new method. + ILProcessor processor = md.Body.GetILProcessor(); + //End of method return. + processor.Emit(OpCodes.Ret); + } + + return md; + } + } + + + /// + /// Creates an 'NetworkInitialize' method which is called by the childmost class to initialize scripts on Awake. + /// + private void CallNetworkInitializesFromNetworkInitializeIfDisabled(MethodDefinition networkInitializeIfDisabledMd) + { + ILProcessor processor = networkInitializeIfDisabledMd.Body.GetILProcessor(); + + networkInitializeIfDisabledMd.Body.Instructions.Clear(); + CallMethod(NETWORKINITIALIZE_EARLY_INTERNAL_NAME); + CallMethod(NETWORKINITIALIZE_LATE_INTERNAL_NAME); + processor.Emit(OpCodes.Ret); + + void CallMethod(string name) + { + MethodReference initIfDisabledMr = networkInitializeIfDisabledMd.DeclaringType.GetMethodReference(base.Session, name); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(initIfDisabledMr.GetCallOpCode(base.Session), initIfDisabledMr); + } + } + + /// + /// Copies logic from users Awake if present, to a new method. + /// + private void CopyAwakeUserLogic(TypeDefinition typeDef) + { + MethodDefinition awakeMd = typeDef.GetMethod(NetworkBehaviourHelper.AWAKE_METHOD_NAME); + //If found copy. + if (awakeMd != null) + base.GetClass().CopyIntoNewMethod(awakeMd, GetAwakeUserLogicMethodDefinition(typeDef), out _); + } + + /// + /// Erases content in awake if it already exist, otherwise makes a new Awake. + /// Makes Awake public and virtual. + /// + /// True if successful. + private bool ModifyAwakeMethod(TypeDefinition typeDef, out bool created) + { + MethodDefinition awakeMd = typeDef.GetOrCreateMethodDefinition(base.Session, NetworkBehaviourHelper.AWAKE_METHOD_NAME, MethodDefinitionExtensions.PUBLIC_VIRTUAL_ATTRIBUTES, typeDef.Module.TypeSystem.Void, out created); + + //Awake is found. Check for invalid return type. + if (!created) + { + if (awakeMd.ReturnType != typeDef.Module.TypeSystem.Void) + { + base.LogError($"IEnumerator Awake methods are not supported within NetworkBehaviours."); + return false; + } + //Make public if good. + awakeMd.SetPublicAttributes(); + } + //Already was made. + else + { + ILProcessor processor = awakeMd.Body.GetILProcessor(); + processor.Emit(OpCodes.Ret); + } + + //Clear original awake. + awakeMd.Body.Instructions.Clear(); + + return true; + } + + /// + /// Makes all Awake methods within typeDef and base classes public and virtual. + /// + /// + internal void CreateFirstNetworkInitializeCall(TypeDefinition typeDef, MethodDefinition firstUserAwakeMethodDef, MethodDefinition firstNetworkInitializeMethodDef) + { + ILProcessor processor; + //Get awake for current method. + MethodDefinition thisAwakeMethodDef = typeDef.GetMethod(NetworkBehaviourHelper.AWAKE_METHOD_NAME); + bool created = false; + + //If no awake then make one. + if (thisAwakeMethodDef == null) + { + created = true; + + thisAwakeMethodDef = new MethodDefinition(NetworkBehaviourHelper.AWAKE_METHOD_NAME, MethodDefinitionExtensions.PUBLIC_VIRTUAL_ATTRIBUTES, + typeDef.Module.TypeSystem.Void); + thisAwakeMethodDef.Body.InitLocals = true; + typeDef.Methods.Add(thisAwakeMethodDef); + + processor = thisAwakeMethodDef.Body.GetILProcessor(); + processor.Emit(OpCodes.Ret); + } + + //MethodRefs for networkinitialize and awake. + MethodReference networkInitializeMethodRef = typeDef.Module.ImportReference(firstNetworkInitializeMethodDef); + + processor = thisAwakeMethodDef.Body.GetILProcessor(); + //Create instructions for base call. + List instructions = new List + { + processor.Create(OpCodes.Ldarg_0), //this. + processor.Create(OpCodes.Call, networkInitializeMethodRef) + }; + + /* If awake was created then make a call to the users + * first awake. There's no reason to do this if awake + * already existed because the user would have control + * over making that call. */ + if (created && firstUserAwakeMethodDef != null) + { + MethodReference baseAwakeMethodRef = typeDef.Module.ImportReference(firstUserAwakeMethodDef); + instructions.Add(processor.Create(OpCodes.Ldarg_0));//this. + instructions.Add(processor.Create(OpCodes.Call, baseAwakeMethodRef)); + } + + processor.InsertFirst(instructions); + } + + + + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Processing/NetworkBehaviourProcessor.cs.meta b/Assets/FishNet/CodeGenerating/Processing/NetworkBehaviourProcessor.cs.meta new file mode 100644 index 0000000..1efbb02 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/NetworkBehaviourProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 23866e4d620216745a837fa99e801164 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/Prediction.meta b/Assets/FishNet/CodeGenerating/Processing/Prediction.meta new file mode 100644 index 0000000..75873ae --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Prediction.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +<<<<<<<< HEAD:Assets/FishNet/CodeGenerating/Processing/Prediction.meta +guid: 98f6937bb72a7254b92b4656f28b7333 +folderAsset: yes +======== +guid: 89b00a3741f72ac4e861a08cf1202228 +>>>>>>>> origin/3-pre-3.1:Assets/Test/InitializeOrder/InitializeOrder_Test.unity.meta +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/Prediction/PredictionProcessor.cs b/Assets/FishNet/CodeGenerating/Processing/Prediction/PredictionProcessor.cs new file mode 100644 index 0000000..8350f28 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Prediction/PredictionProcessor.cs @@ -0,0 +1,1597 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.CodeGenerating.Processing.Rpc; +using FishNet.Connection; +using FishNet.Object; +using FishNet.Object.Prediction; +using FishNet.Object.Prediction.Delegating; +using FishNet.Serializing; +using FishNet.Transporting; +using FishNet.Utility.Performance; +using GameKit.Dependencies.Utilities; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Rocks; +using System.Collections.Generic; +using SR = System.Reflection; + +namespace FishNet.CodeGenerating.Processing +{ + internal class PredictionProcessor : CodegenBase + { + #region Types. + private class PredictionAttributedMethods + { + public MethodDefinition ReplicateMethod; + public MethodDefinition ReconcileMethod; + + public PredictionAttributedMethods(MethodDefinition replicateMethod, MethodDefinition reconcileMethod) + { + ReplicateMethod = replicateMethod; + ReconcileMethod = reconcileMethod; + } + } + private enum InsertType + { + First, + Last, + Current + } +#if PREDICTION_1 + private class CreatedPredictionFields + { + /// + /// TypeReference of replicate data. + /// + public readonly TypeReference ReplicateDataTypeRef; + /// + /// Delegate for calling replicate user logic. + /// + public readonly FieldReference ReplicateULDelegate; + /// + /// Delegate for calling replicate user logic. + /// + public readonly FieldReference ReconcileULDelegate; + /// + /// Replicate data buffered on the server. + /// + public readonly FieldReference ServerReplicateDatas; + /// + /// Replicate data buffered on the client. + /// + public readonly FieldReference ClientReplicateDatas; + /// + /// Last reconcile data received from the server. + /// + public readonly FieldReference ReconcileData; + /// + /// A buffer to read replicates into. + /// + public readonly FieldReference ServerReplicateReaderBuffer; + + public CreatedPredictionFields(TypeReference replicateDataTypeRef, FieldReference replicateULDelegate, FieldReference reconcileULDelegate, FieldReference serverReplicateDatas, FieldReference clientReplicateDatas, FieldReference reconcileData, + FieldReference serverReplicateReaderBuffer) + { + ReplicateDataTypeRef = replicateDataTypeRef; + ReplicateULDelegate = replicateULDelegate; + ReconcileULDelegate = reconcileULDelegate; + ServerReplicateDatas = serverReplicateDatas; + ClientReplicateDatas = clientReplicateDatas; + ReconcileData = reconcileData; + ServerReplicateReaderBuffer = serverReplicateReaderBuffer; + } + } +#else + private class CreatedPredictionFields + { + /// + /// TypeReference of replicate data. + /// + public readonly TypeReference ReplicateDataTypeRef; + /// + /// Delegate for calling replicate user logic. + /// + public readonly FieldReference ReplicateULDelegate; + /// + /// Delegate for calling replicate user logic. + /// + public readonly FieldReference ReconcileULDelegate; + /// + /// Replicate data which has not run yet and is in queue to do so. + /// + public readonly FieldReference ReplicateDatasQueue; + /// + /// Replicate data which has already run and is used to reconcile/replay. + /// + public readonly FieldReference ReplicateDatasHistory; + /// + /// Last reconcile data received from the server. + /// + public readonly FieldReference ReconcileData; + /// + /// A buffer to read replicates into. + /// + public readonly FieldReference ServerReplicateReaderBuffer; + + public CreatedPredictionFields(TypeReference replicateDataTypeRef, FieldReference replicateULDelegate, FieldReference reconcileULDelegate, FieldReference replicateDatasQueue, FieldReference replicateDatasHistory, FieldReference reconcileData, + FieldReference serverReplicateReaderBuffer) + { + ReplicateDataTypeRef = replicateDataTypeRef; + ReplicateULDelegate = replicateULDelegate; + ReconcileULDelegate = reconcileULDelegate; + ReplicateDatasQueue = replicateDatasQueue; + ReplicateDatasHistory = replicateDatasHistory; + ReconcileData = reconcileData; + ServerReplicateReaderBuffer = serverReplicateReaderBuffer; + } + } +#endif + private class PredictionReaders + { + public MethodReference ReplicateReader; + public MethodReference ReconcileReader; + + public PredictionReaders(MethodReference replicateReader, MethodReference reconcileReader) + { + ReplicateReader = replicateReader; + ReconcileReader = reconcileReader; + } + } + + #endregion + + #region Public. + public string IReplicateData_FullName = typeof(IReplicateData).FullName; + public string IReconcileData_FullName = typeof(IReconcileData).FullName; + public TypeReference ReplicateULDelegate_TypeRef; + public TypeReference ReconcileULDelegate_TypeRef; + public MethodReference IReplicateData_GetTick_MethodRef; + public MethodReference IReplicateData_SetTick_MethodRef; + public MethodReference IReconcileData_GetTick_MethodRef; + public MethodReference IReconcileData_SetTick_MethodRef; + public MethodReference Unity_GetGameObject_MethodRef; + #endregion + + #region Const. + public const string REPLICATE_LOGIC_PREFIX = "Logic_Replicate___"; + public const string REPLICATE_READER_PREFIX = "Reader_Replicate___"; + public const string RECONCILE_LOGIC_PREFIX = "Logic_Reconcile___"; + public const string RECONCILE_READER_PREFIX = "Reader_Reconcile___"; + #endregion + + public override bool ImportReferences() + { + System.Type locType; + SR.MethodInfo locMi; + + base.ImportReference(typeof(BasicQueue<>)); + ReplicateULDelegate_TypeRef = base.ImportReference(typeof(ReplicateUserLogicDelegate<>)); + ReconcileULDelegate_TypeRef = base.ImportReference(typeof(ReconcileUserLogicDelegate<>)); + + //GetGameObject. + locMi = typeof(UnityEngine.Component).GetMethod("get_gameObject"); + Unity_GetGameObject_MethodRef = base.ImportReference(locMi); + + //Get/Set tick. + locType = typeof(IReplicateData); + foreach (SR.MethodInfo mi in locType.GetMethods()) + { + if (mi.Name == nameof(IReplicateData.GetTick)) + IReplicateData_GetTick_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(IReplicateData.SetTick)) + IReplicateData_SetTick_MethodRef = base.ImportReference(mi); + } + + locType = typeof(IReconcileData); + foreach (SR.MethodInfo mi in locType.GetMethods()) + { + if (mi.Name == nameof(IReconcileData.GetTick)) + IReconcileData_GetTick_MethodRef = base.ImportReference(mi); + else if (mi.Name == nameof(IReconcileData.SetTick)) + IReconcileData_SetTick_MethodRef = base.ImportReference(mi); + } + + return true; + } + + #region Setup and checks. + /// + /// Gets number of predictions by checking for prediction attributes. This does not perform error checking. + /// + /// + /// + internal uint GetPredictionCount(TypeDefinition typeDef) + { + /* Currently only one prediction method is allowed per typeDef. + * Return 1 soon as a method is found. */ + foreach (MethodDefinition methodDef in typeDef.Methods) + { + foreach (CustomAttribute customAttribute in methodDef.CustomAttributes) + { + if (customAttribute.Is(base.GetClass().ReplicateAttribute_FullName)) + return 1; + } + } + + return 0; + } + + /// + /// Gets number of predictions by checking for prediction attributes in typeDef parents, excluding typerDef. + /// + /// + /// + internal uint GetPredictionCountInParents(TypeDefinition typeDef) + { + uint count = 0; + do + { + typeDef = typeDef.GetNextBaseClassToProcess(base.Session); + if (typeDef != null) + count += GetPredictionCount(typeDef); + + } while (typeDef != null); + + return count; + } + +#if !PREDICTION_1 + /// + /// Ensures only one prediction and reconile method exist per typeDef, and outputs finding. + /// + /// True if there is only one set of prediction methods. False if none, or more than one set. + internal bool GetPredictionMethods(TypeDefinition typeDef, out MethodDefinition replicateMd, out MethodDefinition reconcileMd) + { + replicateMd = null; + reconcileMd = null; + + string replicateAttributeFullName = base.GetClass().ReplicateAttribute_FullName; + string reconcileAttributeFullName = base.GetClass().ReconcileAttribute_FullName; + + bool error = false; + foreach (MethodDefinition methodDef in typeDef.Methods) + { + foreach (CustomAttribute customAttribute in methodDef.CustomAttributes) + { + if (customAttribute.Is(replicateAttributeFullName)) + { + if (!MethodIsPrivate(methodDef) || AlreadyFound(replicateMd)) + error = true; + else + replicateMd = methodDef; + } + else if (customAttribute.Is(reconcileAttributeFullName)) + { + if (!MethodIsPrivate(methodDef) || AlreadyFound(reconcileMd)) + { + error = true; + } + else + { + reconcileMd = methodDef; + if (!CheckCreateReconcile(reconcileMd)) + error = true; + } + } + if (error) + break; + } + if (error) + break; + } + + //Checks to make sure the CreateReconcile method exist and calls reconcile. + bool CheckCreateReconcile(MethodDefinition reconcileMd) + { + string crName = nameof(NetworkBehaviour.CreateReconcile); + MethodDefinition createReconcileMd = reconcileMd.DeclaringType.GetMethod(crName); + //Does not exist. + if (createReconcileMd == null) + { + base.LogError($"{reconcileMd.DeclaringType.Name} does not implement method {crName}. Override method {crName} and use it to create your reconcile data, and call your reconcile method {reconcileMd.Name}. Call "); + return false; + } + //Exists, check for call. + else + { + //Check for call instructions. + foreach (Instruction inst in createReconcileMd.Body.Instructions) + { + if (inst.OpCode == OpCodes.Call || inst.OpCode == OpCodes.Callvirt) + { + if (inst.Operand is MethodReference mr) + { + if (mr.FullName == reconcileMd.FullName) + return true; + } + } + } + + base.LogError($"{reconcileMd.DeclaringType.Name} implements {crName} but does not call reconcile method {reconcileMd.Name}."); + //Fallthrough. + return false; + } + } + + bool MethodIsPrivate(MethodDefinition md) + { + bool isPrivate = md.Attributes.HasFlag(MethodAttributes.Private); + if (!isPrivate) + base.LogError($"Method {md.Name} within {typeDef.Name} is a prediction method and must be private."); + return isPrivate; + } + + bool AlreadyFound(MethodDefinition md) + { + bool alreadyFound = (md != null); + if (alreadyFound) + base.LogError($"{typeDef.Name} contains multiple prediction sets; currently only one set is allowed."); + + return alreadyFound; + } + + if (!error && ((replicateMd == null) != (reconcileMd == null))) + { + base.LogError($"{typeDef.Name} must contain both a [Replicate] and [Reconcile] method when using prediction."); + error = true; + } + + if (error || (replicateMd == null) || (reconcileMd == null)) + return false; + else + return true; + } +#else + + /// + /// Ensures only one prediction and reconile method exist per typeDef, and outputs finding. + /// + /// True if there is only one set of prediction methods. False if none, or more than one set. + internal bool GetPredictionMethods(TypeDefinition typeDef, out MethodDefinition replicateMd, out MethodDefinition reconcileMd) + { + replicateMd = null; + reconcileMd = null; + + string replicateAttributeFullName = base.GetClass().ReplicateAttribute_FullName; + string reconcileAttributeFullName = base.GetClass().ReconcileAttribute_FullName; + + bool error = false; + foreach (MethodDefinition methodDef in typeDef.Methods) + { + foreach (CustomAttribute customAttribute in methodDef.CustomAttributes) + { + if (customAttribute.Is(replicateAttributeFullName)) + { + if (!MethodIsPrivate(methodDef) || AlreadyFound(replicateMd)) + error = true; + else + replicateMd = methodDef; + } + else if (customAttribute.Is(reconcileAttributeFullName)) + { + if (!MethodIsPrivate(methodDef) || AlreadyFound(reconcileMd)) + error = true; + } + if (error) + break; + } + if (error) + break; + } + + bool MethodIsPrivate(MethodDefinition md) + { + bool isPrivate = md.Attributes.HasFlag(MethodAttributes.Private); + if (!isPrivate) + base.LogError($"Method {md.Name} within {typeDef.Name} is a prediction method and must be private."); + return isPrivate; + } + + bool AlreadyFound(MethodDefinition md) + { + bool alreadyFound = (md != null); + if (alreadyFound) + base.LogError($"{typeDef.Name} contains multiple prediction sets; currently only one set is allowed."); + + return alreadyFound; + } + + if (!error && ((replicateMd == null) != (reconcileMd == null))) + { + base.LogError($"{typeDef.Name} must contain both a [Replicate] and [Reconcile] method when using prediction."); + error = true; + } + + if (error || (replicateMd == null) || (reconcileMd == null)) + return false; + else + return true; + } +#endif +#endregion + + internal bool Process(TypeDefinition typeDef) + { + //Set prediction count in parents here. Increase count after each predictionAttributeMethods iteration. + //Do a for each loop on predictionAttributedMethods. + /* NOTES: for predictionv2 get all prediction attributed methods up front and store them inside predictionAttributedMethods. + * To find the proper reconciles for replicates add an attribute field allowing users to assign Ids. EG ReplicateV2.Id = 1. Default + * value will be 0. */ + + MethodDefinition replicateMd; + MethodDefinition reconcileMd; + //Not using prediction methods. + if (!GetPredictionMethods(typeDef, out replicateMd, out reconcileMd)) + return false; + + RpcProcessor rp = base.GetClass(); + uint predictionRpcCount = GetPredictionCountInParents(typeDef) + rp.GetRpcCountInParents(typeDef); ; + //If replication methods found but this hierarchy already has max. + if (predictionRpcCount >= NetworkBehaviourHelper.MAX_RPC_ALLOWANCE) + { + base.LogError($"{typeDef.FullName} and inherited types exceed {NetworkBehaviourHelper.MAX_PREDICTION_ALLOWANCE} replicated methods. Only {NetworkBehaviourHelper.MAX_PREDICTION_ALLOWANCE} replicated methods are supported per inheritance hierarchy."); + return false; + } + + bool parameterError = false; + parameterError |= HasParameterError(replicateMd, typeDef, true); + parameterError |= HasParameterError(reconcileMd, typeDef, false); + if (parameterError) + return false; + + TypeDefinition replicateDataTd = replicateMd.Parameters[0].ParameterType.CachedResolve(base.Session); + TypeDefinition reconcileDataTd = reconcileMd.Parameters[0].ParameterType.CachedResolve(base.Session); + //Ensure datas implement interfaces. + bool interfacesImplemented = true; + DataImplementInterfaces(replicateMd, true, ref interfacesImplemented); + DataImplementInterfaces(reconcileMd, false, ref interfacesImplemented); + if (!interfacesImplemented) + return false; + if (!TickFieldIsNonSerializable(replicateDataTd, true)) + return false; + if (!TickFieldIsNonSerializable(reconcileDataTd, false)) + return false; + + /* Make sure data can serialize. Use array type, this will + * generate a serializer for element type as well. */ + bool canSerialize; + //Make sure replicate data can serialize. + canSerialize = base.GetClass().HasSerializerAndDeserializer(replicateDataTd.MakeArrayType(), true); + if (!canSerialize) + { + base.LogError($"Replicate data type {replicateDataTd.Name} does not support serialization. Use a supported type or create a custom serializer."); + return false; + } + //Make sure reconcile data can serialize. + canSerialize = base.GetClass().HasSerializerAndDeserializer(reconcileDataTd, true); + if (!canSerialize) + { + base.LogError($"Reconcile data type {reconcileDataTd.Name} does not support serialization. Use a supported type or create a custom serializer."); + return false; + } + //Creates fields for buffers. + CreatedPredictionFields predictionFields; + CreateFields(typeDef, replicateMd, reconcileMd, out predictionFields); + + PredictionReaders predictionReaders; + MethodDefinition replicateULMd; + MethodDefinition reconcileULMd; + CreatePredictionMethods(typeDef, replicateMd, reconcileMd, predictionFields, predictionRpcCount, out predictionReaders, out replicateULMd, out reconcileULMd); + InitializeCollections(typeDef, replicateMd, predictionFields); + InitializeULDelegates(typeDef, predictionFields, replicateMd, reconcileMd, replicateULMd, reconcileULMd); + RegisterPredictionRpcs(typeDef, predictionRpcCount, predictionReaders); + + return true; + } + + /// + /// Ensures the tick field for GetTick is non-serializable. + /// + /// + /// + private bool TickFieldIsNonSerializable(TypeDefinition dataTd, bool replicate) + { + string methodName = (replicate) ? IReplicateData_GetTick_MethodRef.Name : IReconcileData_GetTick_MethodRef.Name; + MethodDefinition getMd = dataTd.GetMethod(methodName); + + //Try to find ldFld. + Instruction ldFldInst = null; + foreach (Instruction item in getMd.Body.Instructions) + { + if (item.OpCode == OpCodes.Ldfld) + { + ldFldInst = item; + break; + } + } + + //If ldFld not found. + if (ldFldInst == null) + { + base.LogError($"{dataTd.FullName} method {getMd.Name} does not return a field type for the Tick. Make a new private field of uint type and return it's value within {getMd.Name}."); + return false; + } + //Make sure the field is private. + else + { + FieldDefinition fd = (FieldDefinition)ldFldInst.Operand; + if (!fd.Attributes.HasFlag(FieldAttributes.Private)) + { + base.LogError($"{dataTd.FullName} method {getMd.Name} returns a tick field but it's not marked as private. Make the field {fd.Name} private."); + return false; + } + } + + //All checks pass. + return true; + } + + private void DataImplementInterfaces(MethodDefinition methodDef, bool isReplicate, ref bool interfacesImplemented) + { + TypeReference dataTr = methodDef.Parameters[0].ParameterType; + string interfaceName = (isReplicate) ? IReplicateData_FullName : IReconcileData_FullName; + //If does not implement. + if (!dataTr.CachedResolve(base.Session).ImplementsInterfaceRecursive(base.Session, interfaceName)) + { + string name = (isReplicate) ? typeof(IReplicateData).Name : typeof(IReconcileData).Name; + base.LogError($"Prediction data type {dataTr.Name} for method {methodDef.Name} in class {methodDef.DeclaringType.Name} must implement the {name} interface."); + interfacesImplemented = false; + } + } + + /// + /// Registers RPCs that prediction uses. + /// + private void RegisterPredictionRpcs(TypeDefinition typeDef, uint hash, PredictionReaders readers) + { + MethodDefinition injectionMethodDef = typeDef.GetMethod(NetworkBehaviourProcessor.NETWORKINITIALIZE_EARLY_INTERNAL_NAME); + ILProcessor processor = injectionMethodDef.Body.GetILProcessor(); + List insts = new List(); + + Register(readers.ReplicateReader.CachedResolve(base.Session), true); + Register(readers.ReconcileReader.CachedResolve(base.Session), false); + + void Register(MethodDefinition readerMd, bool replicate) + { + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Ldc_I4, (int)hash)); + /* Create delegate and call NetworkBehaviour method. */ + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Ldftn, readerMd)); + + MethodReference ctorMr; + MethodReference callMr; + if (replicate) + { + ctorMr = base.GetClass().ReplicateRpcDelegate_Ctor_MethodRef; + callMr = base.GetClass().RegisterReplicateRpc_MethodRef; + } + else + { + ctorMr = base.GetClass().ReconcileRpcDelegate_Ctor_MethodRef; + callMr = base.GetClass().RegisterReconcileRpc_MethodRef; + } + + insts.Add(processor.Create(OpCodes.Newobj, ctorMr)); + insts.Add(processor.Create(OpCodes.Call, callMr)); + } + + processor.InsertLast(insts); + } + +#if PREDICTION_1 + /// + /// Initializes collection fields made during this process. + /// + /// + private void InitializeCollections(TypeDefinition typeDef, MethodDefinition replicateMd, CreatedPredictionFields predictionFields) + { + GeneralHelper gh = base.GetClass(); + TypeReference replicateDataTr = replicateMd.Parameters[0].ParameterType; + MethodDefinition injectionMethodDef = typeDef.GetMethod(NetworkBehaviourProcessor.NETWORKINITIALIZE_EARLY_INTERNAL_NAME); + ILProcessor processor = injectionMethodDef.Body.GetILProcessor(); + + Generate(predictionFields.ClientReplicateDatas, true); + Generate(predictionFields.ServerReplicateDatas, false); + + void Generate(FieldReference fr, bool isList) + { + MethodDefinition ctorMd = base.GetClass().List_TypeRef.CachedResolve(base.Session).GetDefaultConstructor(); + GenericInstanceType collectionGit; + if (isList) + gh.GetGenericList(replicateDataTr, out collectionGit); + else + gh.GetGenericBasicQueue(replicateDataTr, out collectionGit); + MethodReference ctorMr = ctorMd.MakeHostInstanceGeneric(base.Session, collectionGit); + + List insts = new List(); + + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Newobj, ctorMr)); + insts.Add(processor.Create(OpCodes.Stfld, fr)); + processor.InsertFirst(insts); + } + } +#else + /// + /// Initializes collection fields made during this process. + /// + /// + private void InitializeCollections(TypeDefinition typeDef, MethodDefinition replicateMd, CreatedPredictionFields predictionFields) + { + GeneralHelper gh = base.GetClass(); + TypeReference replicateDataTr = replicateMd.Parameters[0].ParameterType; + MethodDefinition injectionMethodDef = typeDef.GetMethod(NetworkBehaviourProcessor.NETWORKINITIALIZE_EARLY_INTERNAL_NAME); + ILProcessor processor = injectionMethodDef.Body.GetILProcessor(); + + Generate(predictionFields.ReplicateDatasQueue, false); + Generate(predictionFields.ReplicateDatasHistory, true); + void Generate(FieldReference fr, bool isList) + { + MethodDefinition ctorMd = base.GetClass().List_TypeRef.CachedResolve(base.Session).GetDefaultConstructor(base.Session); + GenericInstanceType collectionGit; + if (isList) + gh.GetGenericList(replicateDataTr, out collectionGit); + else + gh.GetGenericBasicQueue(replicateDataTr, out collectionGit); + MethodReference ctorMr = ctorMd.MakeHostInstanceGeneric(base.Session, collectionGit); + + List insts = new List(); + + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Newobj, ctorMr)); + insts.Add(processor.Create(OpCodes.Stfld, fr)); + + processor.InsertFirst(insts); + } + } + +#endif + + /// + /// Initializes collection fields made during this process. + /// + /// + private void InitializeULDelegates(TypeDefinition typeDef, CreatedPredictionFields predictionFields, MethodDefinition replicateMd, MethodDefinition reconcileMd, MethodDefinition replicateULMd, MethodDefinition reconcileULMd) + { + TypeReference replicateDataTr = replicateMd.Parameters[0].ParameterType; + TypeReference reconcileDataTr = reconcileMd.Parameters[0].ParameterType; + MethodDefinition injectionMethodDef = typeDef.GetMethod(NetworkBehaviourProcessor.NETWORKINITIALIZE_EARLY_INTERNAL_NAME); + ILProcessor processor = injectionMethodDef.Body.GetILProcessor(); + List insts = new List(); + + Generate(replicateULMd, replicateDataTr, predictionFields.ReplicateULDelegate, typeof(ReplicateUserLogicDelegate<>), ReplicateULDelegate_TypeRef); + Generate(reconcileULMd, reconcileDataTr, predictionFields.ReconcileULDelegate, typeof(ReconcileUserLogicDelegate<>), ReconcileULDelegate_TypeRef); + + void Generate(MethodDefinition ulMd, TypeReference dataTr, FieldReference fr, System.Type delegateType, TypeReference delegateTr) + { + insts.Clear(); + + MethodDefinition ctorMd = delegateTr.CachedResolve(base.Session).GetFirstConstructor(base.Session, true); + GenericInstanceType collectionGit; + GetGenericULDelegate(dataTr, delegateType, out collectionGit); + MethodReference ctorMr = ctorMd.MakeHostInstanceGeneric(base.Session, collectionGit); + + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Ldftn, ulMd)); + insts.Add(processor.Create(OpCodes.Newobj, ctorMr)); + insts.Add(processor.Create(OpCodes.Stfld, fr)); + processor.InsertFirst(insts); + } + } + + +#if PREDICTION_1 + /// + /// Creates field buffers for replicate datas. + /// + /// + /// + /// + /// + private void CreateFields(TypeDefinition typeDef, MethodDefinition replicateMd, MethodDefinition reconcileMd, out CreatedPredictionFields predictionFields) + { + GeneralHelper gh = base.GetClass(); + TypeReference replicateDataTr = replicateMd.Parameters[0].ParameterType; + TypeReference replicateDataArrTr = replicateDataTr.MakeArrayType(); + TypeReference reconcileDataTr = reconcileMd.Parameters[0].ParameterType; + + GenericInstanceType replicateULDelegateGit; + GenericInstanceType reconcileULDelegateGit; + GenericInstanceType lstDataGit; + GenericInstanceType queueDataGit; + GetGenericULDelegate(replicateDataTr, typeof(ReplicateUserLogicDelegate<>), out replicateULDelegateGit); + GetGenericULDelegate(reconcileDataTr, typeof(ReconcileUserLogicDelegate<>), out reconcileULDelegateGit); + gh.GetGenericList(replicateDataTr, out lstDataGit); + gh.GetGenericBasicQueue(replicateDataTr, out queueDataGit); + + /* Data buffer. */ + FieldDefinition replicateULDelegateFd = new FieldDefinition($"_replicateULDelegate___{replicateMd.Name}", FieldAttributes.Private, replicateULDelegateGit); + FieldDefinition reconcileULDelegateFd = new FieldDefinition($"_reconcileULDelegate___{reconcileMd.Name}", FieldAttributes.Private, reconcileULDelegateGit); + FieldDefinition serverReplicatesFd = new FieldDefinition($"_serverReplicates___{replicateMd.Name}", FieldAttributes.Private, queueDataGit); + FieldDefinition clientReplicatesFd = new FieldDefinition($"_clientReplicates___{replicateMd.Name}", FieldAttributes.Private, lstDataGit); + FieldDefinition reconcileDataFd = new FieldDefinition($"_reconcileData___{replicateMd.Name}", FieldAttributes.Private, reconcileDataTr); + FieldDefinition serverReplicatesReadBufferFd = new FieldDefinition($"{replicateMd.Name}___serverReplicateReadBuffer", FieldAttributes.Private, replicateDataArrTr); + + typeDef.Fields.Add(replicateULDelegateFd); + typeDef.Fields.Add(reconcileULDelegateFd); + typeDef.Fields.Add(serverReplicatesFd); + typeDef.Fields.Add(clientReplicatesFd); + typeDef.Fields.Add(reconcileDataFd); + typeDef.Fields.Add(serverReplicatesReadBufferFd); + + predictionFields = new CreatedPredictionFields(replicateDataTr, replicateULDelegateFd, reconcileULDelegateFd, serverReplicatesFd, clientReplicatesFd, reconcileDataFd, + serverReplicatesReadBufferFd); + } +#else + /// + /// Creates field buffers for replicate datas. + /// + /// + /// + /// + /// + private void CreateFields(TypeDefinition typeDef, MethodDefinition replicateMd, MethodDefinition reconcileMd, out CreatedPredictionFields predictionFields) + { + GeneralHelper gh = base.GetClass(); + TypeReference replicateDataTr = replicateMd.Parameters[0].ParameterType; + TypeReference replicateDataArrTr = replicateDataTr.MakeArrayType(); + TypeReference reconcileDataTr = reconcileMd.Parameters[0].ParameterType; + + GenericInstanceType replicateULDelegateGit; + GenericInstanceType reconcileULDelegateGit; + GenericInstanceType lstDataGit; + GenericInstanceType queueDataGit; + GetGenericULDelegate(replicateDataTr, typeof(ReplicateUserLogicDelegate<>), out replicateULDelegateGit); + GetGenericULDelegate(reconcileDataTr, typeof(ReconcileUserLogicDelegate<>), out reconcileULDelegateGit); + gh.GetGenericList(replicateDataTr, out lstDataGit); + gh.GetGenericBasicQueue(replicateDataTr, out queueDataGit); + + base.ImportReference(lstDataGit); + /* Data buffer. */ + FieldDefinition replicateULDelegateFd = new FieldDefinition($"_replicateULDelegate___{replicateMd.Name}", FieldAttributes.Private, replicateULDelegateGit); + FieldDefinition reconcileULDelegateFd = new FieldDefinition($"_reconcileULDelegate___{reconcileMd.Name}", FieldAttributes.Private, reconcileULDelegateGit); + FieldDefinition replicatesQueueFd = new FieldDefinition($"_replicatesQueue___{replicateMd.Name}", FieldAttributes.Private, queueDataGit); + FieldDefinition replicatesListFd = new FieldDefinition($"_replicatesHistory___{replicateMd.Name}", FieldAttributes.Private, lstDataGit); + FieldDefinition reconcileDataFd = new FieldDefinition($"_reconcileData___{replicateMd.Name}", FieldAttributes.Private, reconcileDataTr); + FieldDefinition serverReplicatesReadBufferFd = new FieldDefinition($"{replicateMd.Name}___serverReplicateReadBuffer", FieldAttributes.Private, replicateDataArrTr); + + typeDef.Fields.Add(replicateULDelegateFd); + typeDef.Fields.Add(reconcileULDelegateFd); + typeDef.Fields.Add(replicatesQueueFd); + typeDef.Fields.Add(replicatesListFd); + typeDef.Fields.Add(reconcileDataFd); + typeDef.Fields.Add(serverReplicatesReadBufferFd); + + predictionFields = new CreatedPredictionFields(replicateDataTr, replicateULDelegateFd, reconcileULDelegateFd, replicatesQueueFd, replicatesListFd, reconcileDataFd, + serverReplicatesReadBufferFd); + } +#endif + +#if PREDICTION_1 + /// + /// Returns if there are any errors with the prediction methods parameters and will print if so. + /// + private bool HasParameterError(MethodDefinition methodDef, TypeDefinition typeDef, bool replicateMethod) + { + //Replicate: data, asServer, channel, replaying. + //Reconcile: data, asServer, channel. + int count = (replicateMethod) ? 4 : 3; + + //Check parameter count. + if (methodDef.Parameters.Count != count) + { + PrintParameterExpectations(); + return true; + } + + //Data check. + if (!methodDef.Parameters[0].ParameterType.IsClassOrStruct(base.Session)) + { + base.LogError($"Prediction methods must use a class or structure as the first parameter type. Structures are recommended to avoid allocations."); + return true; + } + //asServer + if (methodDef.Parameters[1].ParameterType.Name != typeof(bool).Name) + { + PrintParameterExpectations(); + return true; + } + //Channel. + if (methodDef.Parameters[2].ParameterType.Name != typeof(Channel).Name) + { + PrintParameterExpectations(); + return true; + } + if (replicateMethod) + { + //replaying + if (methodDef.Parameters[3].ParameterType.Name != typeof(bool).Name) + { + PrintParameterExpectations(); + return true; + } + + } + + void PrintParameterExpectations() + { + if (replicateMethod) + base.LogError($"Replicate method {methodDef.Name} within {typeDef.Name} requires exactly {count} parameters. In order: replicate data, asServer boolean, channel = Channel.Unreliable, replaying boolean."); + else + base.LogError($"Reconcile method {methodDef.Name} within {typeDef.Name} requires exactly {count} parameters. In order: replicate data, asServer boolean, channel = Channel.Unreliable."); + } + + //No errors with parameters. + return false; + } +#else + /// + /// Returns if there are any errors with the prediction methods parameters and will print if so. + /// + private bool HasParameterError(MethodDefinition methodDef, TypeDefinition typeDef, bool replicateMethod) + { + //Replicate: data, state, channel. + //Reconcile: data, asServer, channel. + int count = (replicateMethod) ? 3 : 2; + + //Check parameter count. + if (methodDef.Parameters.Count != count) + { + PrintParameterExpectations(); + return true; + } + + string expectedName; + //Data check. + if (!methodDef.Parameters[0].ParameterType.IsClassOrStruct(base.Session)) + { + base.LogError($"Prediction methods must use a class or structure as the first parameter type. Structures are recommended to avoid allocations."); + return true; + } + + expectedName = (replicateMethod) ? typeof(ReplicateState).Name : typeof(Channel).Name; + if (methodDef.Parameters[1].ParameterType.Name != expectedName) + { + PrintParameterExpectations(); + return true; + } + + //Only replicate uses more than 2 parameters. + if (replicateMethod) + { + //Channel. + if (methodDef.Parameters[2].ParameterType.Name != typeof(Channel).Name) + { + PrintParameterExpectations(); + return true; + } + } + + void PrintParameterExpectations() + { + if (replicateMethod) + base.LogError($"Replicate method {methodDef.Name} within {typeDef.Name} requires exactly {count} parameters. In order: replicate data, state = ReplicateState.Invalid, channel = Channel.Unreliable"); + else + base.LogError($"Reconcile method {methodDef.Name} within {typeDef.Name} requires exactly {count} parameters. In order: reconcile data, channel = Channel.Unreliable."); + } + + //No errors with parameters. + return false; + } +#endif + +#if PREDICTION_1 + /// + /// Creates all methods needed for a RPC. + /// + /// + /// + /// + private bool CreatePredictionMethods(TypeDefinition typeDef, MethodDefinition replicateMd, MethodDefinition reconcileMd, CreatedPredictionFields predictionFields, uint predictionRpcCount, out PredictionReaders predictionReaders, out MethodDefinition replicateULMd, out MethodDefinition reconcileULMd) + { + GeneralHelper gh = base.GetClass(); + NetworkBehaviourHelper nbh = base.GetClass(); + predictionReaders = null; + + string copySuffix = "___UL"; + replicateULMd = base.GetClass().CopyIntoNewMethod(replicateMd, $"{replicateMd.Name}{copySuffix}", out _); + reconcileULMd = base.GetClass().CopyIntoNewMethod(reconcileMd, $"{reconcileMd.Name}{copySuffix}", out _); + replicateMd.Body.Instructions.Clear(); + reconcileMd.Body.Instructions.Clear(); + + MethodDefinition replicateReader; + MethodDefinition reconcileReader; + + //Used to process local methods. + uint startingRpcCount = predictionRpcCount; + if (!CreateReplicate()) + return false; + if (!CreateReconcile()) + return false; + + CreateClearReplicateCacheMethod(typeDef, replicateMd.Parameters[0].ParameterType, predictionFields); + CreateReplicateReader(typeDef, predictionRpcCount, replicateMd, predictionFields, out replicateReader); + CreateReconcileReader(typeDef, reconcileMd, predictionFields, out reconcileReader); + predictionReaders = new PredictionReaders(replicateReader, reconcileReader); + + bool CreateReplicate() + { + CustomAttribute replicateAttribute = replicateMd.GetCustomAttribute(base.GetClass().ReplicateAttribute_FullName); + bool allowServerControl = replicateAttribute.GetField(nameof(ReplicateAttribute.AllowServerControl), false); + + ILProcessor processor = replicateMd.Body.GetILProcessor(); + ParameterDefinition replicateDataPd = replicateMd.Parameters[0]; + MethodDefinition comparerMd = gh.CreateEqualityComparer(replicateDataPd.ParameterType); + gh.CreateIsDefaultComparer(replicateDataPd.ParameterType, comparerMd); + ParameterDefinition asServerPd = replicateMd.Parameters[1]; + ParameterDefinition replayingPd = replicateMd.Parameters[3]; + + Instruction exitMethodInst = processor.Create(OpCodes.Nop); + + //Exit early conditions. + processor.Emit(OpCodes.Ldarg_0); //base. + processor.Emit(OpCodes.Ldarg, asServerPd); + processor.Emit(OpCodes.Ldarg, replayingPd); + processor.Emit(OpCodes.Ldc_I4, allowServerControl.ToInt()); + processor.Emit(OpCodes.Call, base.GetClass().Replicate_ExitEarly_A_MethodRef); + processor.Emit(OpCodes.Brtrue, exitMethodInst); + + //Wrap server content in an asServer if statement. + Instruction notAsServerInst = processor.Create(OpCodes.Nop); + processor.Emit(OpCodes.Ldarg, asServerPd); + processor.Emit(OpCodes.Brfalse, notAsServerInst); + /***************************/ + ServerCreateReplicate(replicateMd, predictionFields, allowServerControl); + processor.Emit(OpCodes.Br, exitMethodInst); + /***************************/ + + //Wrap client content in an !asServer if statement. + processor.Append(notAsServerInst); + /***************************/ + ClientCreateReplicate(replicateMd, predictionFields, startingRpcCount); + /***************************/ + + processor.Append(exitMethodInst); + processor.Emit(OpCodes.Ret); + + return true; + } + + + bool CreateReconcile() + { + ILProcessor processor = reconcileMd.Body.GetILProcessor(); + ParameterDefinition reconcileDataPd = reconcileMd.Parameters[0]; + ParameterDefinition asServerPd = reconcileMd.Parameters[1]; + ParameterDefinition channelPd = reconcileMd.Parameters[2]; + TypeReference replicateDataTr = replicateMd.Parameters[0].ParameterType; + + //ExitEarly A. + Instruction exitMethodInst = processor.Create(OpCodes.Nop); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldarg, asServerPd); + processor.Emit(OpCodes.Ldarga, channelPd); + processor.Emit(OpCodes.Call, base.GetClass().Reconcile_ExitEarly_A_MethodRef); + processor.Emit(OpCodes.Brtrue, exitMethodInst); + + //Wrap server content in an asServer if statement. + Instruction notAsServerInst = processor.Create(OpCodes.Nop); + processor.Emit(OpCodes.Ldarg, asServerPd); + processor.Emit(OpCodes.Brfalse, notAsServerInst); + /***************************/ + ServerCreateReconcile(reconcileMd, predictionFields, startingRpcCount); + /***************************/ + processor.Emit(OpCodes.Br, exitMethodInst); + + processor.Append(notAsServerInst); + + MethodReference reconcileClientGim = nbh.Reconcile_Client_MethodRef.GetMethodReference( + base.Session, new TypeReference[] { reconcileDataPd.ParameterType, replicateDataTr }); + //(ReplicateULDelegate replicateDel, ReconcileULDelegate reconcileDel, List collection, + //T data, Channel channel) where T : IReconcileData + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReconcileULDelegate); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateULDelegate); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ClientReplicateDatas); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReconcileData); + processor.Emit(OpCodes.Ldarg, channelPd); + processor.Emit(OpCodes.Call, reconcileClientGim); + + processor.Append(exitMethodInst); + processor.Emit(OpCodes.Ret); + return true; + } + + return true; + } +#else + /// + /// Creates all methods needed for a RPC. + /// + /// + /// + /// + private bool CreatePredictionMethods(TypeDefinition typeDef, MethodDefinition replicateMd, MethodDefinition reconcileMd, CreatedPredictionFields predictionFields, uint rpcCount, out PredictionReaders predictionReaders, out MethodDefinition replicateULMd, out MethodDefinition reconcileULMd) + { + GeneralHelper gh = base.GetClass(); + NetworkBehaviourHelper nbh = base.GetClass(); + predictionReaders = null; + + uint startingRpcCount = rpcCount; + string copySuffix = "___UL"; + replicateULMd = base.GetClass().CopyIntoNewMethod(replicateMd, $"{replicateMd.Name}{copySuffix}", out _); + reconcileULMd = base.GetClass().CopyIntoNewMethod(reconcileMd, $"{reconcileMd.Name}{copySuffix}", out _); + replicateMd.Body.Instructions.Clear(); + reconcileMd.Body.Instructions.Clear(); + + MethodDefinition replicateReader; + MethodDefinition reconcileReader; + if (!CreateReplicate()) + return false; + if (!CreateReconcile()) + return false; + if (!CreateReconcileStart()) + return false; + if (!CreateReplicateReplayStart()) + return false; + + CreateClearReplicateCacheMethod(typeDef, replicateMd.Parameters[0].ParameterType, predictionFields); + CreateReplicateReader(typeDef, startingRpcCount, replicateMd, predictionFields, out replicateReader); + CreateReconcileReader(typeDef, reconcileMd, predictionFields, out reconcileReader); + predictionReaders = new PredictionReaders(replicateReader, reconcileReader); + + bool CreateReplicate() + { + ILProcessor processor = replicateMd.Body.GetILProcessor(); + ParameterDefinition replicateDataPd = replicateMd.Parameters[0]; + MethodDefinition comparerMd = gh.CreateEqualityComparer(replicateDataPd.ParameterType); + gh.CreateIsDefaultComparer(replicateDataPd.ParameterType, comparerMd); + + Instruction exitMethodInst = processor.Create(OpCodes.Nop); + //Call both and let the called method sort out permissions. + CallNonAuthoritativeReplicate(replicateMd, predictionFields); + CallAuthoritativeReplicate(replicateMd, predictionFields, rpcCount); + + processor.Append(exitMethodInst); + processor.Emit(OpCodes.Ret); + + return true; + } + + + bool CreateReconcile() + { + ILProcessor processor = reconcileMd.Body.GetILProcessor(); + ServerCreateReconcile(reconcileMd, predictionFields, ref rpcCount); + processor.Emit(OpCodes.Ret); + return true; + } + + //Overrides reconcile start to call reconcile_client_internal. + bool CreateReconcileStart() + { + MethodDefinition reconcileStartMd = typeDef.GetMethod(nbh.Reconcile_Client_Start_MethodName); + if (reconcileStartMd != null) + { + base.Session.LogError($"Reconcile_Client_Start method has already been created. This should not be possible."); + return false; + } + reconcileStartMd = new MethodDefinition(nbh.Reconcile_Client_Start_MethodName + , MethodDefinitionExtensions.PUBLIC_VIRTUAL_ATTRIBUTES, base.Module.TypeSystem.Void); + typeDef.Methods.Add(reconcileStartMd); + + ILProcessor processor = reconcileStartMd.Body.GetILProcessor(); + + MethodReference reconcileClientGim = nbh.Reconcile_Client_MethodRef.GetMethodReference( + base.Session, new TypeReference[] { predictionFields.ReconcileData.FieldType, predictionFields.ReplicateDataTypeRef }); + + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReconcileULDelegate); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateDatasHistory); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReconcileData); + processor.Emit(OpCodes.Call, reconcileClientGim); + processor.Emit(OpCodes.Ret); + + return true; + } + + bool CreateReplicateReplayStart() + { + MethodDefinition replicateStartMd = typeDef.GetMethod(nbh.Replicate_Replay_Start_MethodName); + if (replicateStartMd != null) + { + base.Session.LogError($"Replicate_Replay_Start method has already been created. This should not be possible."); + return false; + } + replicateStartMd = new MethodDefinition(nbh.Replicate_Replay_Start_MethodName + , MethodDefinitionExtensions.PUBLIC_VIRTUAL_ATTRIBUTES, base.Module.TypeSystem.Void); + //Add parameters. + replicateStartMd.CreateParameters(base.Session, nbh.Replicate_Replay_Start_MethodRef.CachedResolve(base.Session)); + typeDef.Methods.Add(replicateStartMd); + + ParameterDefinition replayTickPd = replicateStartMd.Parameters[0]; + ILProcessor processor = replicateStartMd.Body.GetILProcessor(); + + MethodReference replicateReplayGim = nbh.Replicate_Replay_MethodRef.GetMethodReference( + base.Session, new TypeReference[] { predictionFields.ReplicateDataTypeRef }); + + //uint replicateTick, ReplicateUserLogicDelegate del, List replicates, Channel channel) where T : IReplicateData + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldarg, replayTickPd); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateULDelegate); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateDatasHistory); + processor.Emit(OpCodes.Ldc_I4, (int)Channel.Unreliable); //Channel does not really matter when replaying. At least not until someone needs it. + processor.Emit(OpCodes.Call, replicateReplayGim); + processor.Emit(OpCodes.Ret); + + return true; + } + + return true; + } +#endif + +#region Universal prediction. +#if PREDICTION_1 + /// + /// Creates an override for the method responsible for resetting replicates. + /// + /// + /// + private void CreateClearReplicateCacheMethod(TypeDefinition typeDef, TypeReference dataTr, CreatedPredictionFields predictionFields) + { + GeneralHelper gh = base.GetClass(); + string clearDatasName = base.GetClass().ClearReplicateCache_MethodName; + MethodDefinition md = typeDef.GetMethod(clearDatasName); + + //Already exist when it shouldn't. + if (md != null) + { + base.LogWarning($"{typeDef.Name} overrides method {md.Name} when it should not. Logic within {md.Name} will be replaced by code generation."); + md.Body.Instructions.Clear(); + } + else + { + md = new MethodDefinition(clearDatasName, (MethodAttributes.Public | MethodAttributes.Virtual), base.Module.TypeSystem.Void); + gh.CreateParameter(md, typeof(bool), "asServer"); + typeDef.Methods.Add(md); + base.ImportReference(md); + } + + ILProcessor processor = md.Body.GetILProcessor(); + + GenericInstanceType dataListGit; + GenericInstanceType dataQueueGit; + gh.GetGenericList(dataTr, out dataListGit); + gh.GetGenericBasicQueue(dataTr, out dataQueueGit); + //Get clear method. + MethodReference lstClearMr = gh.List_Clear_MethodRef.MakeHostInstanceGeneric(base.Session, dataListGit); + MethodReference queueClearMr = gh.BasicQueue_Clear_MethodRef.MakeHostInstanceGeneric(base.Session, dataQueueGit); + ParameterDefinition asServerPd = md.Parameters[0]; + + Instruction afterAsServerInst = processor.Create(OpCodes.Nop); + Instruction resetTicksInst = processor.Create(OpCodes.Nop); + + processor.Emit(OpCodes.Ldarg, asServerPd); + processor.Emit(OpCodes.Brfalse_S, afterAsServerInst); + processor.Emit(OpCodes.Ldarg_0); + //processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ServerReplicateDatas); + processor.Emit(queueClearMr.GetCallOpCode(base.Session), queueClearMr); + processor.Emit(OpCodes.Br_S, resetTicksInst); + processor.Append(afterAsServerInst); + //Clear on client replicates. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ClientReplicateDatas); + processor.Emit(lstClearMr.GetCallOpCode(base.Session), lstClearMr); + + processor.Append(resetTicksInst); + processor.Emit(OpCodes.Ret); + } +#else + /// + /// Creates an override for the method responsible for resetting replicates. + /// + /// + /// + private void CreateClearReplicateCacheMethod(TypeDefinition typeDef, TypeReference dataTr, CreatedPredictionFields predictionFields) + { + GeneralHelper gh = base.GetClass(); + NetworkBehaviourHelper nbh = base.GetClass(); + + string methodName = nameof(NetworkBehaviour.ClearReplicateCache); + MethodDefinition baseClearMd = typeDef.GetMethodDefinitionInAnyBase(base.Session, methodName); + MethodDefinition clearMd = typeDef.GetOrCreateMethodDefinition(base.Session, methodName, baseClearMd,true, out bool created); + clearMd.Attributes = MethodDefinitionExtensions.PUBLIC_VIRTUAL_ATTRIBUTES; + //This class already has the method created when it should not. + if (baseClearMd.DeclaringType == typeDef) + { + base.LogError($"{typeDef.Name} overrides method {methodName} when it should not."); + return; + } + + ILProcessor processor = clearMd.Body.GetILProcessor(); + //Call the base class first. + processor.Emit(OpCodes.Ldarg_0); + MethodReference baseClearMr = base.ImportReference(baseClearMd); + processor.Emit(OpCodes.Call, baseClearMr); + + //Call the actual clear method. + TypeDefinition nbTypeDef = typeDef.GetTypeDefinitionInBase(base.Session, typeof(NetworkBehaviour).FullName, false); + MethodReference internalClearMr = base.Session.ImportReference(nbTypeDef.GetMethod(nameof(NetworkBehaviour.ClearReplicateCache_Internal))); + GenericInstanceMethod internalClearGim = internalClearMr.MakeGenericMethod(new TypeReference[] { dataTr }); + + processor.Emit(OpCodes.Ldarg_0); //Base. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateDatasQueue); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateDatasHistory); + processor.Emit(OpCodes.Call, internalClearGim); + processor.Emit(OpCodes.Ret); + } +#endif + + /// + /// Outputs generic ReplicateULDelegate for dataTr. + /// + private void GetGenericULDelegate(TypeReference dataTr, System.Type delegateType, out GenericInstanceType git) + { + TypeReference delDataTr = base.ImportReference(delegateType); + git = delDataTr.MakeGenericInstanceType(new TypeReference[] { dataTr }); + } + + /// + /// Subtracts 1 from a field. + /// + private List SubtractFromField(MethodDefinition methodDef, FieldDefinition fieldDef) + { + List insts = new List(); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + // _field--; + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Ldarg_0)); + insts.Add(processor.Create(OpCodes.Ldfld, fieldDef)); + insts.Add(processor.Create(OpCodes.Ldc_I4_1)); + insts.Add(processor.Create(OpCodes.Sub)); + insts.Add(processor.Create(OpCodes.Stfld, fieldDef)); + + return insts; + } + /// + /// Subtracts 1 from a variable. + /// + private List SubtractFromVariable(MethodDefinition methodDef, VariableDefinition variableDef) + { + List insts = new List(); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + // variable--; + insts.Add(processor.Create(OpCodes.Ldloc, variableDef)); + insts.Add(processor.Create(OpCodes.Ldc_I4_1)); + insts.Add(processor.Create(OpCodes.Sub)); + insts.Add(processor.Create(OpCodes.Stloc, variableDef)); + + return insts; + } + + /// + /// Subtracts 1 from a variable. + /// + private List SubtractOneVariableFromAnother(MethodDefinition methodDef, VariableDefinition srcVd, VariableDefinition modifierVd) + { + List insts = new List(); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + // variable -= v2; + insts.Add(processor.Create(OpCodes.Ldloc, srcVd)); + insts.Add(processor.Create(OpCodes.Ldloc, modifierVd)); + insts.Add(processor.Create(OpCodes.Sub)); + insts.Add(processor.Create(OpCodes.Stloc, srcVd)); + + return insts; + } +#endregion + +#region Server side. +#if PREDICTION_1 + /// + /// Creates replicate code for client. + /// + private void ServerCreateReplicate(MethodDefinition replicateMd, CreatedPredictionFields predictionFields, bool allowServerControl) + { + ILProcessor processor = replicateMd.Body.GetILProcessor(); + + ParameterDefinition replicateDataPd = replicateMd.Parameters[0]; + ParameterDefinition channelPd = replicateMd.Parameters[2]; + TypeReference replicateDataTr = replicateDataPd.ParameterType; + + GenericInstanceMethod replicateGim = base.GetClass().Replicate_NonOwner_MethodRef.MakeGenericMethod(new TypeReference[] { replicateDataTr }); + + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateULDelegate); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ServerReplicateDatas); + + //Used for allowServerControl. + processor.Emit(OpCodes.Ldarg, replicateDataPd); + processor.Emit(OpCodes.Ldc_I4, allowServerControl.ToInt()); + + processor.Emit(OpCodes.Ldarg, channelPd); + processor.Emit(OpCodes.Call, replicateGim); + } +#else + /// + /// Creates replicate code for client. + /// + private void CallNonAuthoritativeReplicate(MethodDefinition replicateMd, CreatedPredictionFields predictionFields) + { + ILProcessor processor = replicateMd.Body.GetILProcessor(); + + ParameterDefinition replicateDataPd = replicateMd.Parameters[0]; + ParameterDefinition channelPd = replicateMd.Parameters[2]; + TypeReference replicateDataTr = replicateDataPd.ParameterType; + + GenericInstanceMethod replicateGim = base.GetClass().Replicate_NonAuthoritative_MethodRef.MakeGenericMethod(new TypeReference[] { replicateDataTr }); + + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateULDelegate); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateDatasQueue); + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateDatasHistory); + processor.Emit(OpCodes.Ldarg, channelPd); + processor.Emit(OpCodes.Call, replicateGim); + } +#endif + +#if PREDICTION_1 + /// + /// Creates a reader for replicate data received from clients. + /// + private bool CreateReplicateReader(TypeDefinition typeDef, uint hash, MethodDefinition replicateMd, CreatedPredictionFields predictionFields, out MethodDefinition result) + { + string methodName = $"{REPLICATE_READER_PREFIX}{replicateMd.Name}"; + MethodDefinition createdMd = new MethodDefinition(methodName, + MethodAttributes.Private, + replicateMd.Module.TypeSystem.Void); + typeDef.Methods.Add(createdMd); + createdMd.Body.InitLocals = true; + + ILProcessor processor = createdMd.Body.GetILProcessor(); + + GeneralHelper gh = base.GetClass(); + NetworkBehaviourHelper nbh = base.GetClass(); + + TypeReference dataTr = replicateMd.Parameters[0].ParameterType; + //Create parameters. + ParameterDefinition readerPd = gh.CreateParameter(createdMd, typeof(PooledReader)); + ParameterDefinition networkConnectionPd = gh.CreateParameter(createdMd, typeof(NetworkConnection)); + ParameterDefinition channelPd = gh.CreateParameter(createdMd, typeof(Channel)); + + MethodReference replicateReaderGim = nbh.Replicate_Reader_MethodRef.GetMethodReference(base.Session, dataTr); + + processor.Emit(OpCodes.Ldarg_0); + //Reader, NetworkConnection. + processor.Emit(OpCodes.Ldarg, readerPd); + processor.Emit(OpCodes.Ldarg, networkConnectionPd); + //arrBuffer. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ServerReplicateReaderBuffer); + //replicates. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ServerReplicateDatas); + //Channel. + processor.Emit(OpCodes.Ldarg, channelPd); + processor.Emit(OpCodes.Call, replicateReaderGim); + + processor.Emit(OpCodes.Ret); + result = createdMd; + return true; + } +#else + + /// + /// Creates a reader for replicate data received from clients. + /// + private bool CreateReplicateReader(TypeDefinition typeDef, uint hash, MethodDefinition replicateMd, CreatedPredictionFields predictionFields, out MethodDefinition result) + { + string methodName = $"{REPLICATE_READER_PREFIX}{replicateMd.Name}"; + MethodDefinition createdMd = new MethodDefinition(methodName, + MethodAttributes.Private, + replicateMd.Module.TypeSystem.Void); + typeDef.Methods.Add(createdMd); + createdMd.Body.InitLocals = true; + + ILProcessor processor = createdMd.Body.GetILProcessor(); + + GeneralHelper gh = base.GetClass(); + NetworkBehaviourHelper nbh = base.GetClass(); + + TypeReference dataTr = replicateMd.Parameters[0].ParameterType; + //Create parameters. + ParameterDefinition readerPd = gh.CreateParameter(createdMd, typeof(PooledReader)); + ParameterDefinition networkConnectionPd = gh.CreateParameter(createdMd, typeof(NetworkConnection)); + ParameterDefinition channelPd = gh.CreateParameter(createdMd, typeof(Channel)); + + MethodReference replicateReaderGim = nbh.Replicate_Reader_MethodRef.GetMethodReference(base.Session, dataTr); + + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldc_I4, (int)hash); + //Reader, NetworkConnection. + processor.Emit(OpCodes.Ldarg, readerPd); + processor.Emit(OpCodes.Ldarg, networkConnectionPd); + //arrBuffer. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldflda, predictionFields.ServerReplicateReaderBuffer); + //Replicates queue. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateDatasQueue); + //Replicates history. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateDatasHistory); + //Channel. + processor.Emit(OpCodes.Ldarg, channelPd); + processor.Emit(OpCodes.Call, replicateReaderGim); + + processor.Emit(OpCodes.Ret); + result = createdMd; + return true; + } +#endif + +#if PREDICTION_1 + /// + /// Creates server side code for reconcileMd. + /// + /// + /// + private void ServerCreateReconcile(MethodDefinition reconcileMd, CreatedPredictionFields predictionFields, uint rpcCount) + { + ParameterDefinition reconcileDataPd = reconcileMd.Parameters[0]; + ParameterDefinition channelPd = reconcileMd.Parameters[2]; + ILProcessor processor = reconcileMd.Body.GetILProcessor(); + + GenericInstanceMethod methodGim = base.GetClass().Reconcile_Server_MethodRef.MakeGenericMethod(new TypeReference[] { reconcileDataPd.ParameterType }); + + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldc_I4, (int)rpcCount); + processor.Emit(OpCodes.Ldarg, reconcileDataPd); + processor.Emit(OpCodes.Ldarg, channelPd); + processor.Emit(OpCodes.Call, methodGim); + } +#else + /// + /// Creates server side code for reconcileMd. + /// + /// + /// + private void ServerCreateReconcile(MethodDefinition reconcileMd, CreatedPredictionFields predictionFields, ref uint rpcCount) + { + ParameterDefinition reconcileDataPd = reconcileMd.Parameters[0]; + ParameterDefinition channelPd = reconcileMd.Parameters[1]; + ILProcessor processor = reconcileMd.Body.GetILProcessor(); + + GenericInstanceMethod methodGim = base.GetClass().Reconcile_Server_MethodRef.MakeGenericMethod(new TypeReference[] { reconcileDataPd.ParameterType }); + + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldc_I4, (int)rpcCount); + processor.Emit(OpCodes.Ldarg, reconcileDataPd); + processor.Emit(OpCodes.Ldarg, channelPd); + processor.Emit(OpCodes.Call, methodGim); + + rpcCount++; + } +#endif +#endregion + +#region Client side. +#if PREDICTION_1 + /// + /// Creates replicate code for client. + /// + private void ClientCreateReplicate(MethodDefinition replicateMd, CreatedPredictionFields predictionFields, uint rpcCount) + { + ParameterDefinition dataPd = replicateMd.Parameters[0]; + ParameterDefinition channelPd = replicateMd.Parameters[2]; + TypeReference dataTr = dataPd.ParameterType; + + ILProcessor processor = replicateMd.Body.GetILProcessor(); + + //Make method reference NB.SendReplicateRpc + GenericInstanceMethod replicateClientGim = base.GetClass().Replicate_Owner_MethodRef.MakeGenericMethod(new TypeReference[] { dataTr }); + processor.Emit(OpCodes.Ldarg_0);//base. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateULDelegate); + processor.Emit(OpCodes.Ldc_I4, (int)rpcCount); + processor.Emit(OpCodes.Ldarg_0);//this. + processor.Emit(OpCodes.Ldfld, predictionFields.ClientReplicateDatas); + processor.Emit(OpCodes.Ldarg, dataPd); + processor.Emit(OpCodes.Ldarg, channelPd); + processor.Emit(OpCodes.Call, replicateClientGim); + } +#else + /// + /// Creates replicate code for client. + /// + private void CallAuthoritativeReplicate(MethodDefinition replicateMd, CreatedPredictionFields predictionFields, uint rpcCount) + { + ParameterDefinition dataPd = replicateMd.Parameters[0]; + ParameterDefinition channelPd = replicateMd.Parameters[2]; + TypeReference dataTr = dataPd.ParameterType; + + ILProcessor processor = replicateMd.Body.GetILProcessor(); + + //Make method reference NB.SendReplicateRpc + GenericInstanceMethod replicateOwnerGim = base.GetClass().Replicate_Authortative_MethodRef.MakeGenericMethod(new TypeReference[] { dataTr }); + processor.Emit(OpCodes.Ldarg_0);//base. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateULDelegate); + processor.Emit(OpCodes.Ldc_I4, (int)rpcCount); + //Replicates queue. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateDatasQueue); + //Replicates history. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldfld, predictionFields.ReplicateDatasHistory); + processor.Emit(OpCodes.Ldarg, dataPd); + processor.Emit(OpCodes.Ldarg, channelPd); + processor.Emit(OpCodes.Call, replicateOwnerGim); + } +#endif + /// + /// Creates a reader for replicate data received from clients. + /// + private bool CreateReconcileReader(TypeDefinition typeDef, MethodDefinition reconcileMd, CreatedPredictionFields predictionFields, out MethodDefinition result) + { + string methodName = $"{RECONCILE_READER_PREFIX}{reconcileMd.Name}"; + MethodDefinition createdMd = new MethodDefinition(methodName, + MethodAttributes.Private, + reconcileMd.Module.TypeSystem.Void); + typeDef.Methods.Add(createdMd); + createdMd.Body.InitLocals = true; + + ILProcessor processor = createdMd.Body.GetILProcessor(); + + GeneralHelper gh = base.GetClass(); + NetworkBehaviourHelper nbh = base.GetClass(); + + TypeReference dataTr = reconcileMd.Parameters[0].ParameterType; + //Create parameters. + ParameterDefinition readerPd = gh.CreateParameter(createdMd, typeof(PooledReader)); + ParameterDefinition channelPd = gh.CreateParameter(createdMd, typeof(Channel)); + + MethodReference methodGim = nbh.Reconcile_Reader_MethodRef.GetMethodReference(base.Session, dataTr); + + processor.Emit(OpCodes.Ldarg_0); + //Reader, data, channel. + processor.Emit(OpCodes.Ldarg, readerPd); + //Data to assign read value to. + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Ldflda, predictionFields.ReconcileData); + //Channel. + processor.Emit(OpCodes.Ldarg, channelPd); + processor.Emit(OpCodes.Call, methodGim); + //Add end of method. + processor.Emit(OpCodes.Ret); + + result = createdMd; + return true; + } +#endregion + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Processing/Prediction/PredictionProcessor.cs.meta b/Assets/FishNet/CodeGenerating/Processing/Prediction/PredictionProcessor.cs.meta new file mode 100644 index 0000000..c8266bc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Prediction/PredictionProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d0663606e86b0b34bae85df164747e72 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/QOLAttributeProcessor.cs b/Assets/FishNet/CodeGenerating/Processing/QOLAttributeProcessor.cs new file mode 100644 index 0000000..d27d3ba --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/QOLAttributeProcessor.cs @@ -0,0 +1,165 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.CodeGenerating.Processing.Rpc; +using FishNet.Configuring; +using FishNet.Managing.Logging; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using System.Collections.Generic; +using System.Linq; + +namespace FishNet.CodeGenerating.Processing +{ + internal class QolAttributeProcessor : CodegenBase + { + + internal bool Process(TypeDefinition typeDef, bool moveStrippedCalls) + { + bool modified = false; + List methods = typeDef.Methods.ToList(); + + + + foreach (MethodDefinition md in methods) + { + //Has RPC attribute, doesn't quality for a quality of life attribute. + if (base.GetClass().Attributes.HasRpcAttributes(md)) + continue; + + QolAttributeType qolType; + CustomAttribute qolAttribute = GetQOLAttribute(md, out qolType); + if (qolAttribute == null) + continue; + + /* This is a one time check to make sure the qolType is + * a supported value. Multiple methods beyond this rely on the + * value being supported. Rather than check in each method a + * single check is performed here. */ + if (qolType != QolAttributeType.Server && qolType != QolAttributeType.Client) + { + base.LogError($"QolAttributeType of {qolType.ToString()} is unhandled."); + continue; + } + + CreateAttributeMethod(md, qolAttribute, qolType); + modified = true; + } + + return modified; + } + + /// + /// Returns the RPC attribute on a method, if one exist. Otherwise returns null. + /// + /// + /// + /// + private CustomAttribute GetQOLAttribute(MethodDefinition methodDef, out QolAttributeType qolType) + { + CustomAttribute foundAttribute = null; + qolType = QolAttributeType.None; + //Becomes true if an error occurred during this process. + bool error = false; + //Nothing to check. + if (methodDef == null || methodDef.CustomAttributes == null) + return null; + + foreach (CustomAttribute customAttribute in methodDef.CustomAttributes) + { + QolAttributeType thisQolType = base.GetClass().GetQolAttributeType(customAttribute.AttributeType.FullName); + if (thisQolType != QolAttributeType.None) + { + //A qol attribute already exist. + if (foundAttribute != null) + { + base.LogError($"{methodDef.Name} {thisQolType.ToString()} method cannot have multiple quality of life attributes."); + error = true; + } + ////Static method. + //if (methodDef.IsStatic) + //{ + // CodegenSession.AddError($"{methodDef.Name} {thisQolType.ToString()} method cannot be static."); + // error = true; + //} + //Abstract method. + if (methodDef.IsAbstract) + { + base.LogError($"{methodDef.Name} {thisQolType.ToString()} method cannot be abstract."); + error = true; + } + + //If all checks passed. + if (!error) + { + foundAttribute = customAttribute; + qolType = thisQolType; + } + } + } + + //If an error occurred then reset results. + if (error) + { + foundAttribute = null; + qolType = QolAttributeType.None; + } + + return foundAttribute; + } + + /// + /// Modifies the specified method to use QolType. + /// + private void CreateAttributeMethod(MethodDefinition methodDef, CustomAttribute qolAttribute, QolAttributeType qolType) + { + bool inheritsNetworkBehaviour = methodDef.DeclaringType.InheritsNetworkBehaviour(base.Session); + + //True to use InstanceFInder. + bool useStatic = (methodDef.IsStatic || !inheritsNetworkBehaviour); + + if (qolType == QolAttributeType.Client) + { + if (!StripMethod(methodDef)) + { + LoggingType logging = qolAttribute.GetField("Logging", LoggingType.Warning); + /* Since isClient also uses insert first + * it will be put ahead of the IsOwner check, since the + * codegen processes it after IsOwner. EG... + * IsOwner will be added first, then IsClient will be added first over IsOwner. */ + bool requireOwnership = qolAttribute.GetField("RequireOwnership", false); + if (requireOwnership && useStatic) + { + base.LogError($"Method {methodDef.Name} has a [Client] attribute which requires ownership but the method may not use this attribute. Either the method is static, or the script does not inherit from NetworkBehaviour."); + return; + } + //If (!base.IsOwner); + if (requireOwnership) + base.GetClass().CreateLocalClientIsOwnerCheck(methodDef, logging, true, false, true); + //Otherwise normal IsClient check. + else + base.GetClass().CreateIsClientCheck(methodDef, logging, useStatic, true, !useStatic); + } + } + else if (qolType == QolAttributeType.Server) + { + if (!StripMethod(methodDef)) + { + LoggingType logging = qolAttribute.GetField("Logging", LoggingType.Warning); + base.GetClass().CreateIsServerCheck(methodDef, logging, useStatic, true, !useStatic); + } + } + + bool StripMethod(MethodDefinition md) + { + + + //Fall through. + return false; + } + } + + + } + +} diff --git a/Assets/FishNet/CodeGenerating/Processing/QOLAttributeProcessor.cs.meta b/Assets/FishNet/CodeGenerating/Processing/QOLAttributeProcessor.cs.meta new file mode 100644 index 0000000..ff1a0e7 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/QOLAttributeProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5080d7597ffca904b9a9fd5926e4e5a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/ReaderProcessor.cs b/Assets/FishNet/CodeGenerating/Processing/ReaderProcessor.cs new file mode 100644 index 0000000..f00a35b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/ReaderProcessor.cs @@ -0,0 +1,1128 @@ +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Serializing; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Rocks; +using SR = System.Reflection; +using System.Collections.Generic; +using System; +using FishNet.CodeGenerating.ILCore; +using FishNet.CodeGenerating.Extension; +using FishNet.Utility.Performance; +using FishNet.Object; +using FishNet.Utility; + +namespace FishNet.CodeGenerating.Helping +{ + + internal class ReaderProcessor : CodegenBase + { + + #region Reflection references. + public TypeDefinition GeneratedReader_TypeDef; + public MethodDefinition GeneratedReader_OnLoad_MethodDef; + public readonly Dictionary InstancedReaderMethods = new Dictionary(); + public readonly Dictionary StaticReaderMethods = new Dictionary(); + public HashSet AutoPackedMethods = new HashSet(new TypeReferenceComparer()); + #endregion + + #region Misc. + /// + /// TypeReferences which have already had delegates made for. + /// + private HashSet _delegatedTypes = new HashSet(); + #endregion + + #region Const. + /// + /// Namespace to use for generated serializers and delegates. + /// + public const string GENERATED_READER_NAMESPACE = WriterProcessor.GENERATED_WRITER_NAMESPACE; + /// + /// Name to use for generated serializers class. + /// + public const string GENERATED_WRITERS_CLASS_NAME = "GeneratedReaders___Internal"; + /// + /// Attributes to use for generated serializers class. + /// + public const TypeAttributes GENERATED_TYPE_ATTRIBUTES = (TypeAttributes.BeforeFieldInit | TypeAttributes.Class | TypeAttributes.AnsiClass | + TypeAttributes.Public | TypeAttributes.AutoClass | TypeAttributes.Abstract | TypeAttributes.Sealed); + /// + /// Name to use for InitializeOnce method. + /// + public const string INITIALIZEONCE_METHOD_NAME = WriterProcessor.INITIALIZEONCE_METHOD_NAME; + /// + /// Attributes to use for InitializeOnce method within generated serializer classes. + /// + public const MethodAttributes INITIALIZEONCE_METHOD_ATTRIBUTES = WriterProcessor.INITIALIZEONCE_METHOD_ATTRIBUTES; + /// + /// Attritbutes to use for generated serializers. + /// + public const MethodAttributes GENERATED_METHOD_ATTRIBUTES = WriterProcessor.GENERATED_METHOD_ATTRIBUTES; + /// + /// Prefix used which all instanced and user created serializers should start with. + /// + internal const string CUSTOM_READER_PREFIX = "Read"; + /// + /// Class name to use for generated readers. + /// + internal const string GENERATED_READERS_CLASS_NAME = "GeneratedReaders___Internal"; + /// + /// Types to exclude from being scanned for auto serialization. + /// + public static System.Type[] EXCLUDED_AUTO_SERIALIZER_TYPES => WriterProcessor.EXCLUDED_AUTO_SERIALIZER_TYPES; + /// + /// Types to exclude from being scanned for auto serialization. + /// + public static string[] EXCLUDED_ASSEMBLY_PREFIXES => WriterProcessor.EXCLUDED_ASSEMBLY_PREFIXES; + /// + /// MethodReference for Write. + /// + private MethodReference _readUnpackedMethodRef; + #endregion + + public override bool ImportReferences() + { + TypeReference readerTr = base.ImportReference(typeof(Reader)); + _readUnpackedMethodRef = readerTr.CachedResolve(base.Session).GetMethodReference(base.Session, nameof(Reader.ReadUnpacked)); + + return true; + } + + public bool Process() + { + GeneralHelper gh = base.GetClass(); + + CreateGeneratedReadersClass(); + FindInstancedReaders(); + CreateInstancedReaderExtensions(); + + void CreateGeneratedReadersClass() + { + GeneratedReader_TypeDef = gh.GetOrCreateClass(out _, ReaderProcessor.GENERATED_TYPE_ATTRIBUTES, ReaderProcessor.GENERATED_READERS_CLASS_NAME, null, WriterProcessor.GENERATED_WRITER_NAMESPACE); + /* If constructor isn't set then try to get or create it + * and also add it to methods if were created. */ + GeneratedReader_OnLoad_MethodDef = gh.GetOrCreateMethod(GeneratedReader_TypeDef, out _, INITIALIZEONCE_METHOD_ATTRIBUTES, INITIALIZEONCE_METHOD_NAME, base.Module.TypeSystem.Void); + gh.CreateRuntimeInitializeOnLoadMethodAttribute(GeneratedReader_OnLoad_MethodDef); + + ILProcessor ppp = GeneratedReader_OnLoad_MethodDef.Body.GetILProcessor(); + ppp.Emit(OpCodes.Ret); + //GeneratedReaderOnLoadMethodDef.DeclaringType.Methods.Remove(GeneratedReaderOnLoadMethodDef); + } + + void FindInstancedReaders() + { + Type pooledWriterType = typeof(PooledReader); + foreach (SR.MethodInfo methodInfo in pooledWriterType.GetMethods()) + { + if (IsSpecialReadMethod(methodInfo)) + continue; + bool autoPackMethod; + if (IsIgnoredReadMethod(methodInfo, out autoPackMethod)) + continue; + + MethodReference methodRef = base.ImportReference(methodInfo); + /* TypeReference for the return type + * of the read method. */ + TypeReference typeRef = base.ImportReference(methodRef.ReturnType); + + /* If here all checks pass. */ + AddReaderMethod(typeRef, methodRef, true, true); + if (autoPackMethod) + AutoPackedMethods.Add(typeRef); + } + } + + return true; + } + + + /// + /// Returns if a MethodInfo is considered a special write method. + /// Special read methods have declared references within this class, and will not have extensions made for them. + /// + public bool IsSpecialReadMethod(SR.MethodInfo methodInfo) + { + /* Special methods. */ + if (methodInfo.Name == nameof(PooledReader.ReadPackedWhole)) + return true; + else if (methodInfo.Name == nameof(PooledReader.ReadArray)) + return true; + else if (methodInfo.Name == nameof(PooledReader.ReadDictionaryAllocated)) + return true; + + return false; + } + + /// + /// Returns if a read method should be ignored. + /// + public bool IsIgnoredReadMethod(SR.MethodInfo methodInfo, out bool autoPackMethod) + { + autoPackMethod = false; + + if (base.GetClass().HasNotSerializableAttribute(methodInfo)) + return true; + //Method name doesn't start with prefix. + else if (!methodInfo.Name.StartsWith(CUSTOM_READER_PREFIX)) + return true; + SR.ParameterInfo[] parameterInfos = methodInfo.GetParameters(); + //Can have at most one parameter for packing. + if (parameterInfos.Length > 1) + return true; + //If has one parameter make sure it's a packing type. + if (parameterInfos.Length == 1) + { + autoPackMethod = (parameterInfos[0].ParameterType == typeof(AutoPackType)); + if (!autoPackMethod) + return true; + } + + return false; + } + + + + /// + /// Adds typeRef, methodDef to instanced or readerMethods. + /// + /// + /// + /// + internal void AddReaderMethod(TypeReference typeRef, MethodReference methodRef, bool instanced, bool useAdd) + { + string fullName = typeRef.GetFullnameWithoutBrackets(); + Dictionary dict = (instanced) ? + InstancedReaderMethods : StaticReaderMethods; + + if (useAdd) + dict.Add(fullName, methodRef); + else + dict[fullName] = methodRef; + } + + + /// + /// Creates a Read delegate for readMethodRef and places it within the generated reader/writer constructor. + /// + /// + /// + internal void CreateInitializeDelegate(MethodReference readMr) + { + GeneralHelper gh = base.GetClass(); + ReaderImports ri = base.GetClass(); + WriterProcessor wp = base.GetClass(); + + /* If a global serializer is declared for the type + * and the method is not the declared serializer then + * exit early. */ + if (wp.IsGlobalSerializer(readMr.ReturnType) && readMr.Name.StartsWith(UtilityConstants.GENERATED_READER_PREFIX)) + return; + + GeneratedReader_OnLoad_MethodDef.RemoveEndRet(base.Session); + + //Check if already exist. + ILProcessor processor = GeneratedReader_OnLoad_MethodDef.Body.GetILProcessor(); + TypeReference dataTypeRef = readMr.ReturnType; + if (_delegatedTypes.Contains(dataTypeRef)) + { + base.LogError($"Generic read already created for {dataTypeRef.FullName}."); + return; + } + else + { + _delegatedTypes.Add(dataTypeRef); + } + + //Create a Func delegate + processor.Emit(OpCodes.Ldnull); + processor.Emit(OpCodes.Ldftn, readMr); + + GenericInstanceType functionGenericInstance; + MethodReference functionConstructorInstanceMethodRef; + bool isAutoPacked = IsAutoPackedType(dataTypeRef); + + //Generate for autopacktype. + if (isAutoPacked) + { + functionGenericInstance = gh.FunctionT3TypeRef.MakeGenericInstanceType(ri.Reader_TypeRef, base.GetClass().AutoPackTypeRef, dataTypeRef); + functionConstructorInstanceMethodRef = gh.FunctionT3ConstructorMethodRef.MakeHostInstanceGeneric(base.Session, functionGenericInstance); + } + //Not autopacked. + else + { + functionGenericInstance = gh.FunctionT2TypeRef.MakeGenericInstanceType(ri.Reader_TypeRef, dataTypeRef); + functionConstructorInstanceMethodRef = gh.FunctionT2ConstructorMethodRef.MakeHostInstanceGeneric(base.Session, functionGenericInstance); + } + processor.Emit(OpCodes.Newobj, functionConstructorInstanceMethodRef); + + //Call delegate to GeneratedReader.Read + GenericInstanceType genericInstance = ri.GenericReader_TypeRef.MakeGenericInstanceType(dataTypeRef); + MethodReference genericReadMethodRef = (isAutoPacked) ? + ri.GenericReader_ReadAutoPacked_MethodRef.MakeHostInstanceGeneric(base.Session, genericInstance) : + ri.GenericReader_ReadUnpacked_MethodRef.MakeHostInstanceGeneric(base.Session, genericInstance); + processor.Emit(OpCodes.Call, genericReadMethodRef); + + processor.Emit(OpCodes.Ret); + } + + /// + /// Creates reader extension methods for built-in readers. + /// + private void CreateInstancedReaderExtensions() + { + if (!FishNetILPP.IsFishNetAssembly(base.Session)) + return; + + GeneralHelper gh = base.GetClass(); + ReaderProcessor gwh = base.GetClass(); + + //List staticReaders = new List(); + foreach (KeyValuePair item in InstancedReaderMethods) + { + MethodReference instancedReadMr = item.Value; + if (instancedReadMr.ContainsGenericParameter) + continue; + + TypeReference returnTr = base.ImportReference(instancedReadMr.ReturnType); + + MethodDefinition md = new MethodDefinition($"InstancedExtension___{instancedReadMr.Name}", + WriterProcessor.GENERATED_METHOD_ATTRIBUTES, + returnTr); + //Add extension parameter. + ParameterDefinition readerPd = gh.CreateParameter(md, typeof(Reader), "reader"); + //Add parameters needed by instanced writer. + List otherPds = md.CreateParameters(base.Session, instancedReadMr); + gh.MakeExtensionMethod(md); + // + gwh.GeneratedReader_TypeDef.Methods.Add(md); + + ILProcessor processor = md.Body.GetILProcessor(); + //Load writer. + processor.Emit(OpCodes.Ldarg, readerPd); + //Load args. + foreach (ParameterDefinition pd in otherPds) + processor.Emit(OpCodes.Ldarg, pd); + //Call instanced. + processor.Emit(instancedReadMr.GetCallOpCode(base.Session), instancedReadMr); + processor.Emit(OpCodes.Ret); + + AddReaderMethod(returnTr, md, false, true); + } + } + + /// + /// Removes typeRef from static/instanced reader methods. + /// + internal void RemoveReaderMethod(TypeReference typeRef, bool instanced) + { + string fullName = typeRef.GetFullnameWithoutBrackets(); + Dictionary dict = (instanced) ? + InstancedReaderMethods : StaticReaderMethods; + + dict.Remove(fullName); + } + + /// + /// Creates read instructions returning instructions and outputing variable of read result. + /// + internal List CreateRead(MethodDefinition methodDef, ParameterDefinition readerParameterDef, TypeReference readTypeRef, out VariableDefinition createdVariableDef) + { + ILProcessor processor = methodDef.Body.GetILProcessor(); + List insts = new List(); + MethodReference readMr = GetOrCreateReadMethodReference(readTypeRef); + + if (readMr != null) + { + TypeReference dataTr = readMr.ReturnType; + bool isGlobalSerializer = base.GetClass().IsGlobalSerializer(dataTr); + + //Make a local variable. + createdVariableDef = base.GetClass().CreateVariable(methodDef, readTypeRef); + //pooledReader.ReadBool(); + insts.Add(processor.Create(OpCodes.Ldarg, readerParameterDef)); + //If an auto pack method then insert default value. + if (!isGlobalSerializer && AutoPackedMethods.Contains(readTypeRef)) + { + AutoPackType packType = base.GetClass().GetDefaultAutoPackType(readTypeRef); + insts.Add(processor.Create(OpCodes.Ldc_I4, (int)packType)); + } + + TypeReference valueTr = readTypeRef; + /* If generic then find write class for + * data type. Currently we only support one generic + * for this. */ + if (valueTr.IsGenericInstance) + { + GenericInstanceType git = (GenericInstanceType)valueTr; + TypeReference genericTr = git.GenericArguments[0]; + readMr = readMr.GetMethodReference(base.Session, genericTr); + } + + if (isGlobalSerializer) + { + //Switch out to use Read instead. + TypeReference genericTr = base.ImportReference(readTypeRef); + readMr = _readUnpackedMethodRef.GetMethodReference(base.Session, genericTr); + } + + insts.Add(processor.Create(OpCodes.Call, readMr)); + //Store into local variable. + insts.Add(processor.Create(OpCodes.Stloc, createdVariableDef)); + return insts; + } + else + { + base.LogError("Reader not found for " + readTypeRef.ToString()); + createdVariableDef = null; + return null; + } + } + + /// + /// Creates a read for fieldRef and populates it into a created variable of class or struct type. + /// + internal bool CreateReadIntoClassOrStruct(MethodDefinition readerMd, ParameterDefinition readerPd, MethodReference readMr, VariableDefinition encasingValueVd, FieldReference memberValueFr) + { + if (readMr != null) + { + WriterProcessor wp = base.GetClass(); + bool isGlobalSerializer = (wp.IsGlobalSerializer(encasingValueVd.VariableType) || wp.IsGlobalSerializer(memberValueFr.FieldType)); + + ILProcessor processor = readerMd.Body.GetILProcessor(); + /* How to load object instance. If it's a structure + * then it must be loaded by address. Otherwise if + * class Ldloc can be used. */ + OpCode loadOpCode = (encasingValueVd.VariableType.IsValueType) ? + OpCodes.Ldloca : OpCodes.Ldloc; + + /* If generic then find write class for + * data type. Currently we only support one generic + * for this. */ + if (memberValueFr.FieldType.IsGenericInstance) + { + GenericInstanceType git = (GenericInstanceType)memberValueFr.FieldType; + TypeReference genericTr = git.GenericArguments[0]; + readMr = readMr.GetMethodReference(base.Session, genericTr); + } + + processor.Emit(loadOpCode, encasingValueVd); + //reader. + processor.Emit(OpCodes.Ldarg, readerPd); + if (!isGlobalSerializer && IsAutoPackedType(memberValueFr.FieldType)) + { + AutoPackType packType = base.GetClass().GetDefaultAutoPackType(memberValueFr.FieldType); + processor.Emit(OpCodes.Ldc_I4, (int)packType); + } + + if (isGlobalSerializer) + { + //Switch out to use Read instead. + TypeReference genericTr = base.ImportReference(memberValueFr.FieldType); + readMr = _readUnpackedMethodRef.GetMethodReference(base.Session, genericTr); + } + //reader.ReadXXXX(). + processor.Emit(OpCodes.Call, readMr); + //obj.Field = result / reader.ReadXXXX(). + processor.Emit(OpCodes.Stfld, memberValueFr); + + return true; + } + else + { + base.LogError($"Reader not found for {memberValueFr.FullName}."); + return false; + } + } + + + /// + /// Creates a read for fieldRef and populates it into a created variable of class or struct type. + /// + internal bool CreateReadIntoClassOrStruct(MethodDefinition methodDef, ParameterDefinition readerPd, MethodReference readMr, VariableDefinition objectVariableDef, MethodReference setMr, TypeReference readTr) + { + if (readMr != null) + { + ILProcessor processor = methodDef.Body.GetILProcessor(); + + /* How to load object instance. If it's a structure + * then it must be loaded by address. Otherwise if + * class Ldloc can be used. */ + OpCode loadOpCode = (objectVariableDef.VariableType.IsValueType) ? + OpCodes.Ldloca : OpCodes.Ldloc; + + /* If generic then find write class for + * data type. Currently we only support one generic + * for this. */ + if (readTr.IsGenericInstance) + { + GenericInstanceType git = (GenericInstanceType)readTr; + TypeReference genericTr = git.GenericArguments[0]; + readMr = readMr.GetMethodReference(base.Session, genericTr); + } + + processor.Emit(loadOpCode, objectVariableDef); + //reader. + processor.Emit(OpCodes.Ldarg, readerPd); + if (IsAutoPackedType(readTr)) + { + AutoPackType packType = base.GetClass().GetDefaultAutoPackType(readTr); + processor.Emit(OpCodes.Ldc_I4, (int)packType); + } + //reader.ReadXXXX(). + processor.Emit(OpCodes.Call, readMr); + //obj.Property = result / reader.ReadXXXX(). + processor.Emit(OpCodes.Call, setMr); + + return true; + } + else + { + base.LogError($"Reader not found for {readTr.FullName}."); + return false; + } + } + + + + + /// + /// Creates generic write delegates for all currently known write types. + /// + internal void CreateInitializeDelegates() + { + foreach (KeyValuePair item in StaticReaderMethods) + base.GetClass().CreateInitializeDelegate(item.Value); + } + + + /// + /// Returns if typeRef has a deserializer. + /// + /// + /// + /// + internal bool HasDeserializer(TypeReference typeRef, bool createMissing) + { + bool result = (GetInstancedReadMethodReference(typeRef) != null) || + (GetStaticReadMethodReference(typeRef) != null); + + if (!result && createMissing) + { + if (!base.GetClass().HasNonSerializableAttribute(typeRef.CachedResolve(base.Session))) + { + MethodReference methodRef = CreateReader(typeRef); + result = (methodRef != null); + } + } + + return result; + } + + + /// + /// Returns if typeRef supports auto packing. + /// + /// + /// + internal bool IsAutoPackedType(TypeReference typeRef) + { + return AutoPackedMethods.Contains(typeRef); + } + /// + /// Creates a null check on the first argument and returns a null object if result indicates to do so. + /// + internal void CreateRetOnNull(ILProcessor processor, ParameterDefinition readerParameterDef, VariableDefinition resultVariableDef, bool useBool) + { + Instruction endIf = processor.Create(OpCodes.Nop); + + if (useBool) + CreateReadBool(processor, readerParameterDef, resultVariableDef); + else + CreateReadPackedWhole(processor, readerParameterDef, resultVariableDef); + + //If (true or == -1) jmp to endIf. True is null. + processor.Emit(OpCodes.Ldloc, resultVariableDef); + if (useBool) + { + processor.Emit(OpCodes.Brfalse, endIf); + } + else + { + //-1 + processor.Emit(OpCodes.Ldc_I4_M1); + processor.Emit(OpCodes.Bne_Un_S, endIf); + } + //Insert null. + processor.Emit(OpCodes.Ldnull); + //Exit method. + processor.Emit(OpCodes.Ret); + //End of if check. + processor.Append(endIf); + } + + /// + /// Creates a call to WriteBoolean with value. + /// + /// + /// + /// + internal void CreateReadBool(ILProcessor processor, ParameterDefinition readerParameterDef, VariableDefinition localBoolVariableDef) + { + MethodReference readBoolMethodRef = GetReadMethodReference(base.GetClass().GetTypeReference(typeof(bool))); + processor.Emit(OpCodes.Ldarg, readerParameterDef); + processor.Emit(readBoolMethodRef.GetCallOpCode(base.Session), readBoolMethodRef); + processor.Emit(OpCodes.Stloc, localBoolVariableDef); + } + + /// + /// Creates a call to WritePackWhole with value. + /// + /// + /// + internal void CreateReadPackedWhole(ILProcessor processor, ParameterDefinition readerParameterDef, VariableDefinition resultVariableDef) + { + //Reader. + processor.Emit(OpCodes.Ldarg, readerParameterDef); + //Reader.ReadPackedWhole(). + MethodReference readPwMr = base.GetClass().Reader_ReadPackedWhole_MethodRef; + processor.Emit(readPwMr.GetCallOpCode(base.Session), readPwMr); + processor.Emit(OpCodes.Conv_I4); + processor.Emit(OpCodes.Stloc, resultVariableDef); + } + + + #region GetReaderMethodReference. + /// + /// Returns the MethodReference for typeRef. + /// + /// + /// + internal MethodReference GetInstancedReadMethodReference(TypeReference typeRef) + { + string fullName = typeRef.GetFullnameWithoutBrackets(); + InstancedReaderMethods.TryGetValue(fullName, out MethodReference methodRef); + return methodRef; + } + /// + /// Returns the MethodReference for typeRef. + /// + /// + /// + internal MethodReference GetStaticReadMethodReference(TypeReference typeRef) + { + string fullName = typeRef.GetFullnameWithoutBrackets(); + StaticReaderMethods.TryGetValue(fullName, out MethodReference methodRef); + return methodRef; + } + /// + /// Returns the MethodReference for typeRef favoring instanced or static. Returns null if not found. + /// + /// + /// + /// + internal MethodReference GetReadMethodReference(TypeReference typeRef) + { + MethodReference result; + bool favorInstanced = false; + if (favorInstanced) + { + result = GetInstancedReadMethodReference(typeRef); + if (result == null) + result = GetStaticReadMethodReference(typeRef); + } + else + { + result = GetStaticReadMethodReference(typeRef); + if (result == null) + result = GetInstancedReadMethodReference(typeRef); + } + + return result; + } + /// + /// Returns the MethodReference for typeRef favoring instanced or static. + /// + /// + /// + /// + internal MethodReference GetOrCreateReadMethodReference(TypeReference typeRef) + { +#pragma warning disable CS0219 + bool favorInstanced = false; +#pragma warning restore CS0219 + //Try to get existing writer, if not present make one. + MethodReference readMethodRef = GetReadMethodReference(typeRef); + if (readMethodRef == null) + readMethodRef = CreateReader(typeRef); + + //If still null then return could not be generated. + if (readMethodRef == null) + { + base.LogError($"Could not create deserializer for {typeRef.FullName}."); + } + //Otherwise, check if generic and create writes for generic parameters. + else if (typeRef.IsGenericInstance) + { + GenericInstanceType git = (GenericInstanceType)typeRef; + foreach (TypeReference item in git.GenericArguments) + { + MethodReference result = GetOrCreateReadMethodReference(item); + if (result == null) + { + base.LogError($"Could not create deserializer for {item.FullName}."); + return null; + } + } + } + + return readMethodRef; + } + #endregion + + + /// + /// Generates a reader for objectTypeReference if one does not already exist. + /// + /// + /// + internal MethodReference CreateReader(TypeReference objectTr) + { + MethodReference resultMr = null; + TypeDefinition objectTypeDef; + + SerializerType serializerType = base.GetClass().GetSerializerType(objectTr, false, out objectTypeDef); + if (serializerType != SerializerType.Invalid) + { + //Array. + if (serializerType == SerializerType.Array) + resultMr = CreateArrayReaderMethodReference(objectTr); + //Enum. + else if (serializerType == SerializerType.Enum) + resultMr = CreateEnumReaderMethodDefinition(objectTr); + else if (serializerType == SerializerType.Dictionary + || serializerType == SerializerType.List) + resultMr = CreateGenericCollectionReaderMethodReference(objectTr, serializerType); + //NetworkBehaviour. + else if (serializerType == SerializerType.NetworkBehaviour) + resultMr = GetNetworkBehaviourReaderMethodReference(objectTr); + //Nullable. + else if (serializerType == SerializerType.Nullable) + resultMr = CreateNullableReaderMethodReference(objectTr); + //Class or struct. + else if (serializerType == SerializerType.ClassOrStruct) + resultMr = CreateClassOrStructReaderMethodReference(objectTr); + } + + //If was not created. + if (resultMr == null) + RemoveFromStaticReaders(objectTr); + + return resultMr; + } + + + /// + /// Removes from static writers. + /// + private void RemoveFromStaticReaders(TypeReference tr) + { + base.GetClass().RemoveReaderMethod(tr, false); + } + /// + /// Adds to static writers. + /// + private void AddToStaticReaders(TypeReference tr, MethodReference mr) + { + base.GetClass().AddReaderMethod(tr, mr.CachedResolve(base.Session), false, true); + } + + /// + /// Generates a reader for objectTypeReference if one does not already exist. + /// + /// + /// + private MethodReference CreateEnumReaderMethodDefinition(TypeReference objectTr) + { + MethodDefinition createdReaderMd = CreateStaticReaderStubMethodDefinition(objectTr); + AddToStaticReaders(objectTr, createdReaderMd); + + ILProcessor processor = createdReaderMd.Body.GetILProcessor(); + + //Get type reference for enum type. eg byte int + TypeReference underlyingTypeRef = objectTr.CachedResolve(base.Session).GetEnumUnderlyingTypeReference(); + //Get read method for underlying type. + MethodReference readMethodRef = base.GetClass().GetOrCreateReadMethodReference(underlyingTypeRef); + if (readMethodRef == null) + return null; + + ParameterDefinition readerParameterDef = createdReaderMd.Parameters[0]; + //reader.ReadXXX(). + processor.Emit(OpCodes.Ldarg, readerParameterDef); + if (base.GetClass().IsAutoPackedType(underlyingTypeRef)) + processor.Emit(OpCodes.Ldc_I4, (int)AutoPackType.Packed); + + processor.Emit(OpCodes.Call, readMethodRef); + + processor.Emit(OpCodes.Ret); + return base.ImportReference(createdReaderMd); + } + + + /// + /// Creates a read for a class type which inherits NetworkBehaviour. + /// + /// + /// + private MethodReference GetNetworkBehaviourReaderMethodReference(TypeReference objectTr) + { + MethodDefinition createdReaderMd = CreateStaticReaderStubMethodDefinition(objectTr); + AddToStaticReaders(objectTr, createdReaderMd); + + ILProcessor processor = createdReaderMd.Body.GetILProcessor(); + TypeReference networkBehaviourTypeRef = base.GetClass().GetTypeReference(typeof(NetworkBehaviour)); + + processor.Emit(OpCodes.Ldarg_0); + processor.Emit(OpCodes.Call, base.GetClass().GetReadMethodReference(networkBehaviourTypeRef)); + processor.Emit(OpCodes.Castclass, objectTr); + processor.Emit(OpCodes.Ret); + return base.ImportReference(createdReaderMd); + } + + /// + /// Creates a writer for an array. + /// + private MethodReference CreateArrayReaderMethodReference(TypeReference objectTr) + { + ReaderImports ri = base.GetClass(); + TypeReference valueTr = objectTr.GetElementType(); + + //Write not found. + if (GetOrCreateReadMethodReference(valueTr) == null) + return null; + + MethodDefinition createdMd = CreateStaticReaderStubMethodDefinition(objectTr); + AddToStaticReaders(objectTr, createdMd); + + //Find instanced writer to use. + MethodReference instancedWriteMr = ri.Reader_ReadArray_MethodRef; + //Make generic. + GenericInstanceMethod writeGim = instancedWriteMr.MakeGenericMethod(new TypeReference[] { valueTr }); + CallInstancedReader(createdMd, writeGim); + + return base.ImportReference(createdMd); + } + + + /// + /// Creates a reader for a dictionary. + /// + private MethodReference CreateDictionaryReaderMethodReference(TypeReference objectTr) + { + ReaderProcessor rp = base.GetClass(); + + GenericInstanceType genericInstance = (GenericInstanceType)objectTr; + base.ImportReference(genericInstance); + TypeReference keyTr = genericInstance.GenericArguments[0]; + TypeReference valueTr = genericInstance.GenericArguments[1]; + + /* Try to get instanced first for collection element type, if it doesn't exist then try to + * get/or make a one. */ + MethodReference keyWriteMr = rp.GetOrCreateReadMethodReference(keyTr); + MethodReference valueWriteMr = rp.GetOrCreateReadMethodReference(valueTr); + if (keyWriteMr == null || valueWriteMr == null) + return null; + + MethodDefinition createdReaderMd = CreateStaticReaderStubMethodDefinition(objectTr); + AddToStaticReaders(objectTr, createdReaderMd); + + GenericInstanceMethod readDictGim = base.GetClass().Reader_ReadDictionary_MethodRef.MakeGenericMethod(new TypeReference[] { keyTr, valueTr }); + CallInstancedReader(createdReaderMd, readDictGim); + + return base.ImportReference(createdReaderMd); + } + + + /// + /// Creates a writer for a variety of generic collections. + /// + private MethodReference CreateGenericCollectionReaderMethodReference(TypeReference objectTr, SerializerType st) + { + ReaderImports ri = base.GetClass(); + //Make value field generic. + GenericInstanceType genericInstance = (GenericInstanceType)objectTr; + base.ImportReference(genericInstance); + TypeReference valueTr = genericInstance.GenericArguments[0]; + + List genericArguments = new List(); + //Make sure all arguments have writers. + foreach (TypeReference gaTr in genericInstance.GenericArguments) + { + //Writer not found. + if (GetOrCreateReadMethodReference(gaTr) == null) + { + base.LogError($"Reader could not be found or created for type {gaTr.FullName}."); + return null; + } + genericArguments.Add(gaTr); + } + MethodReference valueWriteMr = GetOrCreateReadMethodReference(valueTr); + if (valueWriteMr == null) + return null; + + MethodDefinition createdMd = CreateStaticReaderStubMethodDefinition(objectTr); + AddToStaticReaders(objectTr, createdMd); + + //Find instanced writer to use. + MethodReference instancedReadMr; + if (st == SerializerType.Dictionary) + instancedReadMr = ri.Reader_ReadDictionary_MethodRef; + else if (st == SerializerType.List) + instancedReadMr = ri.Reader_ReadList_MethodRef; + else + instancedReadMr = null; + + //Not found. + if (instancedReadMr == null) + { + base.LogError($"Instanced reader not found for SerializerType {st} on object {objectTr.Name}."); + return null; + } + + //Make generic. + GenericInstanceMethod writeGim = instancedReadMr.MakeGenericMethod(genericArguments.ToArray()); + CallInstancedReader(createdMd, writeGim); + + return base.ImportReference(createdMd); + } + + + /// + /// Calls an instanced writer from a static writer. + /// + private void CallInstancedReader(MethodDefinition staticReaderMd, MethodReference instancedReaderMr) + { + ParameterDefinition readerPd = staticReaderMd.Parameters[0]; + ILProcessor processor = staticReaderMd.Body.GetILProcessor(); + processor.Emit(OpCodes.Ldarg, readerPd); + processor.Emit(instancedReaderMr.GetCallOpCode(base.Session), instancedReaderMr); + processor.Emit(OpCodes.Ret); + } + + ///// + ///// Create a reader for a list. + ///// + //private MethodReference CreateGenericTypeReader(TypeReference objectTr, SerializerType st) + //{ + // ReaderProcessor rp = base.GetClass(); + + // if (st != SerializerType.List && st != SerializerType.ListCache) + // { + // base.LogError($"Reader SerializerType {st} is not implemented"); + // return null; + // } + + // GenericInstanceType genericInstance = (GenericInstanceType)objectTr; + // base.ImportReference(genericInstance); + // TypeReference elementTr = genericInstance.GenericArguments[0]; + + // /* Try to get instanced first for collection element type, if it doesn't exist then try to + // * get/or make a one. */ + // MethodReference elementReadMr = rp.GetOrCreateReadMethodReference(elementTr); + // if (elementReadMr == null) + // return null; + + // TypeReference readerMethodTr = null; + // if (st == SerializerType.List) + // readerMethodTr = base.GetClass().GetTypeReference(typeof(List<>)); + // else if (st == SerializerType.ListCache) + // readerMethodTr = base.GetClass().GetTypeReference(typeof(ListCache<>)); + + // MethodReference readerMd = rp.GetReadMethodReference(readerMethodTr); + // MethodDefinition typedReaderMd = CreateStaticReaderStubMethodDefinition(objectTr); + + // AddToStaticReaders(objectTr, typedReaderMd); + + // ParameterDefinition readerPd = typedReaderMd.Parameters[0]; + + // //Find add method for list. + // MethodReference readerGim = readerMd.GetMethodReference(base.Session, elementTr); + // ILProcessor processor = readerMd.CachedResolve(base.Session).Body.GetILProcessor(); + // processor.Emit(OpCodes.Ldarg, readerPd); + // processor.Emit(OpCodes.Call, readerGim); + + // return elementReadMr; + //} + + + /// + /// Creates a reader method for a struct or class objectTypeRef. + /// + /// + /// + private MethodReference CreateNullableReaderMethodReference(TypeReference objectTr) + { + ReaderProcessor rp = base.GetClass(); + + GenericInstanceType objectGit = objectTr as GenericInstanceType; + TypeReference valueTr = objectGit.GenericArguments[0]; + + //Make sure object has a ctor. + MethodDefinition objectCtorMd = objectTr.GetConstructor(base.Session, 1); + if (objectCtorMd == null) + { + base.LogError($"{objectTr.Name} can't be deserialized because the nullable type does not have a constructor."); + return null; + } + + //Get the reader for the value. + MethodReference valueReaderMr = rp.GetOrCreateReadMethodReference(valueTr); + if (valueReaderMr == null) + return null; + + TypeDefinition objectTd = objectTr.CachedResolve(base.Session); + MethodDefinition createdReaderMd = CreateStaticReaderStubMethodDefinition(objectTr); + AddToStaticReaders(objectTr, createdReaderMd); + + ILProcessor processor = createdReaderMd.Body.GetILProcessor(); + + ParameterDefinition readerPd = createdReaderMd.Parameters[0]; + // create local for return value + VariableDefinition resultVd = base.GetClass().CreateVariable(createdReaderMd, objectTr); + + //Read if null into boolean. + VariableDefinition nullBoolVd = createdReaderMd.CreateVariable(base.Session, typeof(bool)); + rp.CreateReadBool(processor, readerPd, nullBoolVd); + + Instruction afterReturnNullInst = processor.Create(OpCodes.Nop); + processor.Emit(OpCodes.Ldloc, nullBoolVd); + processor.Emit(OpCodes.Brfalse, afterReturnNullInst); + //Return a null result. + base.GetClass().SetVariableDefinitionFromObject(processor, resultVd, objectTd); + processor.Emit(OpCodes.Ldloc, resultVd); + processor.Emit(OpCodes.Ret); + processor.Append(afterReturnNullInst); + + MethodReference initMr = objectCtorMd.MakeHostInstanceGeneric(base.Session, objectGit); + processor.Emit(OpCodes.Ldarg, readerPd); + //If an auto pack method then insert default value. + if (rp.IsAutoPackedType(valueTr)) + { + AutoPackType packType = base.GetClass().GetDefaultAutoPackType(valueTr); + processor.Emit(OpCodes.Ldc_I4, (int)packType); + } + processor.Emit(OpCodes.Call, valueReaderMr); + processor.Emit(OpCodes.Newobj, initMr); + processor.Emit(OpCodes.Ret); + + return base.ImportReference(createdReaderMd); + } + + + /// + /// Creates a reader method for a struct or class objectTypeRef. + /// + /// + /// + private MethodReference CreateClassOrStructReaderMethodReference(TypeReference objectTr) + { + MethodDefinition createdReaderMd = CreateStaticReaderStubMethodDefinition(objectTr); + AddToStaticReaders(objectTr, createdReaderMd); + + TypeDefinition objectTypeDef = objectTr.CachedResolve(base.Session); + ILProcessor processor = createdReaderMd.Body.GetILProcessor(); + + ParameterDefinition readerParameterDef = createdReaderMd.Parameters[0]; + // create local for return value + VariableDefinition objectVariableDef = base.GetClass().CreateVariable(createdReaderMd, objectTr); + + //If not a value type create a return null check. + if (!objectTypeDef.IsValueType) + { + VariableDefinition nullVariableDef = base.GetClass().CreateVariable(createdReaderMd, typeof(bool)); + //Load packed whole value into sizeVariableDef, exit if null indicator. + base.GetClass().CreateRetOnNull(processor, readerParameterDef, nullVariableDef, true); + } + + /* If here then not null. */ + //Make a new instance of object type and set to objectVariableDef. + base.GetClass().SetVariableDefinitionFromObject(processor, objectVariableDef, objectTypeDef); + if (!ReadFieldsAndProperties(createdReaderMd, readerParameterDef, objectVariableDef, objectTr)) + return null; + /* //codegen scriptableobjects seem to climb too high up to UnityEngine.Object when + * creating serializers/deserialized. Make sure this is not possible. */ + + //Load result and return it. + processor.Emit(OpCodes.Ldloc, objectVariableDef); + processor.Emit(OpCodes.Ret); + + return base.ImportReference(createdReaderMd); + } + + + /// + /// Reads all fields of objectTypeRef. + /// + private bool ReadFieldsAndProperties(MethodDefinition readerMd, ParameterDefinition readerPd, VariableDefinition encasingValueVd, TypeReference objectTr) + { + ReaderProcessor rp = base.GetClass(); + + //This probably isn't needed but I'm too afraid to remove it. + if (objectTr.Module != base.Module) + objectTr = base.ImportReference(objectTr.CachedResolve(base.Session)); + + //Fields. + foreach (FieldDefinition fieldDef in objectTr.FindAllSerializableFields(base.Session + , ReaderProcessor.EXCLUDED_AUTO_SERIALIZER_TYPES, ReaderProcessor.EXCLUDED_ASSEMBLY_PREFIXES)) + { + FieldReference importedFr = base.ImportReference(fieldDef); + if (GetReadMethod(fieldDef.FieldType, out MethodReference readMr)) + rp.CreateReadIntoClassOrStruct(readerMd, readerPd, readMr, encasingValueVd, importedFr); + } + + //Properties. + foreach (PropertyDefinition propertyDef in objectTr.FindAllSerializableProperties(base.Session + , ReaderProcessor.EXCLUDED_AUTO_SERIALIZER_TYPES, ReaderProcessor.EXCLUDED_ASSEMBLY_PREFIXES)) + { + if (GetReadMethod(propertyDef.PropertyType, out MethodReference readMr)) + { + MethodReference setMr = base.Module.ImportReference(propertyDef.SetMethod); + rp.CreateReadIntoClassOrStruct(readerMd, readerPd, readMr, encasingValueVd, setMr, propertyDef.PropertyType); + } + } + + //Gets or creates writer method and outputs it. Returns true if method is found or created. + bool GetReadMethod(TypeReference tr, out MethodReference readMr) + { + tr = base.ImportReference(tr); + readMr = rp.GetOrCreateReadMethodReference(tr); + return (readMr != null); + } + + return true; + } + + + /// + /// Creates the stub for a new reader method. + /// + /// + /// + public MethodDefinition CreateStaticReaderStubMethodDefinition(TypeReference objectTypeRef, string nameExtension = WriterProcessor.GENERATED_WRITER_NAMESPACE) + { + string methodName = $"{UtilityConstants.GENERATED_READER_PREFIX}{objectTypeRef.FullName}{nameExtension}s"; + // create new reader for this type + TypeDefinition readerTypeDef = base.GetClass().GetOrCreateClass(out _, GENERATED_TYPE_ATTRIBUTES, GENERATED_READERS_CLASS_NAME, null); + MethodDefinition readerMethodDef = readerTypeDef.AddMethod(methodName, + ReaderProcessor.GENERATED_METHOD_ATTRIBUTES, + objectTypeRef); + + base.GetClass().CreateParameter(readerMethodDef, base.GetClass().Reader_TypeRef, "reader"); + readerMethodDef.Body.InitLocals = true; + + return readerMethodDef; + } + + + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Processing/ReaderProcessor.cs.meta b/Assets/FishNet/CodeGenerating/Processing/ReaderProcessor.cs.meta new file mode 100644 index 0000000..d041ead --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/ReaderProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f9d3654f5816c4409b88fa0602c6df4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/Rpc.meta b/Assets/FishNet/CodeGenerating/Processing/Rpc.meta new file mode 100644 index 0000000..a4a26cd --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Rpc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 810757384532c3a4b9e4681f869acf1e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/Rpc/AttributeData.cs b/Assets/FishNet/CodeGenerating/Processing/Rpc/AttributeData.cs new file mode 100644 index 0000000..3d69a01 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Rpc/AttributeData.cs @@ -0,0 +1,68 @@ +using FishNet.CodeGenerating.Helping; +using FishNet.Object.Helping; +using MonoFN.Cecil; +using System.Collections.Generic; + +namespace FishNet.CodeGenerating.Processing.Rpc +{ + internal static class AttributeDataExtensions + { + + /// + /// Returns RpcTypes in datas. + /// + public static List GetRpcTypes(this List datas) + { + //RpcTypes for originalMd. + List rpcTypes = new List(); + foreach (AttributeData ad in datas) + rpcTypes.Add(ad.RpcType); + + return rpcTypes; + } + + /// + /// Gets CustomAttribute for rpcType + /// + public static CustomAttribute GetAttribute(this List datas, CodegenSession session, RpcType rpcType) + { + for (int i = 0; i < datas.Count; i++) + { + if (datas[i].RpcType == rpcType) + return datas[i].Attribute; + } + + session.LogError($"RpcType {rpcType} not found in datas."); + return null; + } + + + /// + /// Returns RpcType as flag through combining datas. + /// + /// + /// + public static RpcType GetCombinedRpcType(this List datas) + { + RpcType result = RpcType.None; + for (int i = 0; i < datas.Count; i++) + result |= datas[i].RpcType; + + return result; + } + } + + internal class AttributeData + { + public readonly CustomAttribute Attribute; + public readonly RpcType RpcType; + + public AttributeData(CustomAttribute attribute, RpcType rpcType) + { + Attribute = attribute; + RpcType = rpcType; + } + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Processing/Rpc/AttributeData.cs.meta b/Assets/FishNet/CodeGenerating/Processing/Rpc/AttributeData.cs.meta new file mode 100644 index 0000000..69cbe34 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Rpc/AttributeData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91f84e00db3d1ad448fb6a760afb6927 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/Rpc/Attributes.cs b/Assets/FishNet/CodeGenerating/Processing/Rpc/Attributes.cs new file mode 100644 index 0000000..dbeb798 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Rpc/Attributes.cs @@ -0,0 +1,166 @@ +using FishNet.CodeGenerating.Helping; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Connection; +using FishNet.Object.Helping; +using MonoFN.Cecil; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace FishNet.CodeGenerating.Processing.Rpc +{ + internal class Attributes : CodegenBase + { + + /// + /// Returns if methodDef has any Rpc attribute. + /// + public bool HasRpcAttributes(MethodDefinition methodDef) + { + foreach (CustomAttribute customAttribute in methodDef.CustomAttributes) + { + RpcType rt = base.Session.GetClass().GetRpcAttributeType(customAttribute); + if (rt != RpcType.None) + return true; + } + + //Fall through, nothing found. + return false; + } + + /// + /// Returns a collection of RpcAttribute for methodDef. + /// + public List GetRpcAttributes(MethodDefinition methodDef) + { + List results = new List(); + string asyncAttributeFullName = typeof(AsyncStateMachineAttribute).FullName; + bool isAsync = false; + + foreach (CustomAttribute customAttribute in methodDef.CustomAttributes) + { + RpcType rt = base.Session.GetClass().GetRpcAttributeType(customAttribute); + if (rt != RpcType.None) + { + results.Add(new AttributeData(customAttribute, rt)); + } + //Not a rpc attribute. + else + { + //Check if async. + if (customAttribute.Is(asyncAttributeFullName)) + isAsync = true; + } + } + + //Nothing found, exit early. + if (results.Count == 0) + { + return results; + } + //If has at least one RPC attrivbute and is an async method. + else if (isAsync) + { + base.Session.LogError($"{methodDef.Name} is an async RPC. This feature is not currently supported. You may instead run an async method from this RPC."); + return new List(); + } + //If more than one attribute make sure the combination is allowed. + else if (results.Count >= 2) + { + RpcType allRpcTypes = results.GetCombinedRpcType(); + if (allRpcTypes != (RpcType.Observers | RpcType.Target)) + { + base.Session.LogError($"{methodDef.Name} contains multiple RPC attributes. Only ObserversRpc and TargetRpc attributes may be combined."); + return new List(); + } + } + + //Next validate that the method is setup properly for each rpcType. + foreach (AttributeData ad in results) + { + //If not valid then return empty list. + if (!IsRpcMethodValid(methodDef, ad.RpcType)) + return new List(); + } + + return results; + } + + /// + /// Returns if a RpcMethod can be serialized and has a proper signature. + /// + private bool IsRpcMethodValid(MethodDefinition methodDef, RpcType rpcType) + { + //Static method. + if (methodDef.IsStatic) + { + base.Session.LogError($"{methodDef.Name} RPC method cannot be static."); + return false; + } + //Is generic type. + else if (methodDef.HasGenericParameters) + { + base.Session.LogError($"{methodDef.Name} RPC method cannot contain generic parameters."); + return false; + } + //Abstract method. + else if (methodDef.IsAbstract) + { + base.Session.LogError($"{methodDef.Name} RPC method cannot be abstract."); + return false; + } + //Non void return. + else if (methodDef.ReturnType != methodDef.Module.TypeSystem.Void) + { + base.Session.LogError($"{methodDef.Name} RPC method must return void."); + return false; + } + //Misc failing conditions. + else + { + //Check for async attribute. + foreach (CustomAttribute ca in methodDef.CustomAttributes) + { + + } + } + //TargetRpc but missing correct parameters. + if (rpcType == RpcType.Target) + { + if (methodDef.Parameters.Count == 0 || !methodDef.Parameters[0].Is(typeof(NetworkConnection))) + { + base.Session.LogError($"Target RPC {methodDef.Name} must have a NetworkConnection as the first parameter."); + return false; + } + } + + //Make sure all parameters can be serialized. + for (int i = 0; i < methodDef.Parameters.Count; i++) + { + ParameterDefinition parameterDef = methodDef.Parameters[i]; + + //If NetworkConnection, TargetRpc, and first parameter. + if ((i == 0) && (rpcType == RpcType.Target) && parameterDef.Is(typeof(NetworkConnection))) + continue; + + if (parameterDef.ParameterType.IsGenericParameter) + { + base.Session.LogError($"RPC method{methodDef.Name} contains a generic parameter. This is currently not supported."); + return false; + } + + //Can be serialized/deserialized. + bool canSerialize = base.GetClass().HasSerializerAndDeserializer(parameterDef.ParameterType, true); + if (!canSerialize) + { + base.Session.LogError($"RPC method {methodDef.Name} parameter type {parameterDef.ParameterType.FullName} does not support serialization. Use a supported type or create a custom serializer."); + return false; + } + + } + + //Fall through, success. + return true; + } + + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Processing/Rpc/Attributes.cs.meta b/Assets/FishNet/CodeGenerating/Processing/Rpc/Attributes.cs.meta new file mode 100644 index 0000000..e0ab4ab --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Rpc/Attributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 974ebf09757267941a86f92e5072258c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/Rpc/CreatedRpc.cs b/Assets/FishNet/CodeGenerating/Processing/Rpc/CreatedRpc.cs new file mode 100644 index 0000000..c2bd411 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Rpc/CreatedRpc.cs @@ -0,0 +1,58 @@ +using FishNet.Object.Helping; +using MonoFN.Cecil; +using System.Collections.Generic; + +namespace FishNet.CodeGenerating.Processing.Rpc +{ + + internal class CreatedRpc + { + public MethodDefinition OriginalMethodDef; + public uint MethodHash; + public AttributeData AttributeData; + public MethodDefinition WriterMethodDef; + public MethodDefinition ReaderMethodDef; + public MethodDefinition LogicMethodDef; + public MethodDefinition RedirectMethodDef; + public bool RunLocally; + + public RpcType RpcType => AttributeData.RpcType; + public CustomAttribute Attribute => AttributeData.Attribute; + public TypeDefinition TypeDef => OriginalMethodDef.DeclaringType; + public ModuleDefinition Module => OriginalMethodDef.Module; + } + + + internal static class CreatedRpcExtensions + { + /// + /// Returns CreatedRpc for rpcType. + /// + /// + public static CreatedRpc GetCreatedRpc(this List lst, RpcType rpcType) + { + for (int i = 0; i < lst.Count; i++) + { + if (lst[i].RpcType == rpcType) + return lst[i]; + } + //Fall through. + return null; + } + + /// + /// Returns combined RpcType for all entries. + /// + /// + public static RpcType GetCombinedRpcType(this List lst) + { + RpcType result = RpcType.None; + for (int i = 0; i < lst.Count; i++) + result |= lst[i].RpcType; + + return result; + } + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Processing/Rpc/CreatedRpc.cs.meta b/Assets/FishNet/CodeGenerating/Processing/Rpc/CreatedRpc.cs.meta new file mode 100644 index 0000000..bc68749 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Rpc/CreatedRpc.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c2176b6bfcc49934d8f36fba3df74d0c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/Rpc/RpcProcessor.cs b/Assets/FishNet/CodeGenerating/Processing/Rpc/RpcProcessor.cs new file mode 100644 index 0000000..179b804 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Rpc/RpcProcessor.cs @@ -0,0 +1,1105 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Configuring; +using FishNet.Connection; +using FishNet.Managing.Logging; +using FishNet.Object.Helping; +using FishNet.Transporting; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using GameKit.Dependencies.Utilities; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEngine; +using FishNet.Object; + +namespace FishNet.CodeGenerating.Processing.Rpc +{ + internal class RpcProcessor : CodegenBase + { + + #region Types. + private struct DelegateData + { + public RpcType RpcType; + public bool RunLocally; + public MethodDefinition OriginalMethodDef; + public MethodDefinition ReaderMethodDef; + public uint MethodHash; + public CustomAttribute RpcAttribute; + + public DelegateData(RpcType rpcType, bool runLocally, MethodDefinition originalMethodDef, MethodDefinition readerMethodDef, uint methodHash, CustomAttribute rpcAttribute) + { + RpcType = rpcType; + RunLocally = runLocally; + OriginalMethodDef = originalMethodDef; + ReaderMethodDef = readerMethodDef; + MethodHash = methodHash; + RpcAttribute = rpcAttribute; + } + } + + #endregion + + #region Public. + /// + /// Attribute helper. + /// + public Attributes Attributes = new Attributes(); + #endregion + + private List<(MethodDefinition, MethodDefinition)> _virtualRpcs = new List<(MethodDefinition createdLogicMd, MethodDefinition originalRpcMd)>(); + + #region Const. + private const string LOGIC_PREFIX = "RpcLogic___"; + private const string WRITER_PREFIX = "RpcWriter___"; + private const string READER_PREFIX = "RpcReader___"; + private const string REQUIREOWNERSHIP_NAME = nameof(ServerRpcAttribute.RequireOwnership); + private const string RUNLOCALLY_NAME = nameof(RpcAttribute.RunLocally); + private const string EXCLUDEOWNER_NAME = nameof(ObserversRpcAttribute.ExcludeOwner); + private const string EXCLUDESERVER_NAME = nameof(TargetRpcAttribute.ExcludeServer); + private const string BUFFERLAST_NAME = nameof(ObserversRpcAttribute.BufferLast); + private const string DATALENGTH_NAME = nameof(RpcAttribute.DataLength); + private const string VALIDATETARGET_NAME = nameof(TargetRpcAttribute.ValidateTarget); + private const string DATAORDERTYPE_NAME = nameof(RpcAttribute.OrderType); + #endregion + + public override bool ImportReferences() + { + Attributes.Initialize(base.Session); + return base.ImportReferences(); + } + + internal bool ProcessLocal(TypeDefinition typeDef) + { + bool modified = false; + + PredictionProcessor pp = base.GetClass(); + uint rpcCount = GetRpcCountInParents(typeDef) + pp.GetPredictionCountInParents(typeDef) + pp.GetPredictionCount(typeDef); + //All createdRpcs for typeDef. + List typeDefCeatedRpcs = new List(); + List methodDefs = typeDef.Methods.ToList(); + foreach (MethodDefinition md in methodDefs) + { + if (rpcCount >= NetworkBehaviourHelper.MAX_RPC_ALLOWANCE) + { + base.LogError($"{typeDef.FullName} and inherited types exceed {NetworkBehaviourHelper.MAX_RPC_ALLOWANCE} RPC methods. Only {NetworkBehaviourHelper.MAX_RPC_ALLOWANCE} RPC methods are supported per inheritance hierarchy."); + return false; + } + + //Rpcs created for this method. + List createdRpcs = new List(); + List attributeDatas = Attributes.GetRpcAttributes(md); + bool success = true; + foreach (AttributeData ad in attributeDatas) + { + CreatedRpc cr = new CreatedRpc(); + cr.OriginalMethodDef = md; + cr.AttributeData = ad; + cr.MethodHash = rpcCount; + + /* This is a one time check to make sure the rpcType is + * a supported value. Multiple methods beyond this rely on the + * value being supported. Rather than check in each method a + * single check is performed here. */ + if (cr.RpcType != RpcType.Observers && cr.RpcType != RpcType.Server && cr.RpcType != RpcType.Target) + { + base.LogError($"RpcType of {cr.RpcType.ToString()} is unhandled."); + break; + } + + bool created = CreateRpcMethods(attributeDatas, cr); + if (created) + { + modified = true; + + typeDefCeatedRpcs.Add(cr); + createdRpcs.Add(cr); + + if (cr.LogicMethodDef != null && cr.LogicMethodDef.IsVirtual) + _virtualRpcs.Add((cr.LogicMethodDef, md)); + + rpcCount++; + } + else + { + success = false; + } + } + + //If at least one attribute was found and all rpc methods were made. + if (createdRpcs.Count > 0 && success) + RedirectOriginalToWriter(createdRpcs); + } + + if (modified) + { + foreach (CreatedRpc cr in typeDefCeatedRpcs) + { + base.GetClass().CreateRpcDelegate(cr.RunLocally, cr.TypeDef, + cr.ReaderMethodDef, cr.RpcType, cr.MethodHash, + cr.Attribute); + } + return true; + } + else + { + return false; + } + } + + /// + /// Returns the name to use for a RpcMethod. + /// + private string GetRpcMethodName(CreatedRpc cr) + { + return GetRpcMethodName(cr.RpcType, cr.OriginalMethodDef); + } + + /// + /// Returns the name to use for a RpcMethod. + /// + private string GetRpcMethodName(RpcType rpcType, MethodDefinition originalMd) + { + return $"{rpcType}_{GetMethodNameAsParameters(originalMd)}"; + } + + /// + /// Gets RPCcount count in all of typeDefs parents, excluding typeDef itself. + /// + internal uint GetRpcCountInParents(TypeDefinition typeDef) + { + uint count = 0; + do + { + typeDef = typeDef.GetNextBaseClassToProcess(base.Session); + if (typeDef != null) + count += GetRpcCount(typeDef); + + } while (typeDef != null); + + return count; + } + + /// + /// Returns the method name with parameter types included within the name. + /// + public static string GetMethodNameAsParameters(MethodDefinition methodDef) + { + StringBuilder sb = new StringBuilder(); + foreach (ParameterDefinition pd in methodDef.Parameters) + sb.Append(pd.ParameterType.FullName); + + return $"{methodDef.Name}_{sb.ToString().GetStableHashU32()}"; + } + + /// + /// Redirects base calls for overriden RPCs. + /// + internal void RedirectBaseCalls() + { + foreach ((MethodDefinition logicMd, MethodDefinition originalMd) in _virtualRpcs) + RedirectBaseCall(logicMd, originalMd); + } + + /// + /// Gets number of RPCs by checking for RPC attributes. This does not perform error checking. + /// + /// + /// + internal uint GetRpcCount(TypeDefinition typeDef) + { + uint count = 0; + foreach (MethodDefinition methodDef in typeDef.Methods) + { + foreach (CustomAttribute customAttribute in methodDef.CustomAttributes) + { + RpcType rpcType = base.GetClass().GetRpcAttributeType(customAttribute); + if (rpcType != RpcType.None) + { + count++; + break; + } + } + } + + return count; + } + + /// + /// Creates all methods needed for a RPC. + /// + /// + /// + /// True if successful. + private bool CreateRpcMethods(List datas, CreatedRpc cr) + { + cr.RunLocally = cr.Attribute.GetField(RUNLOCALLY_NAME, false); + bool intentionallyNull; + + List serializedParameters = GetSerializedParamters(cr.RpcType, datas, cr); + + cr.WriterMethodDef = CreateRpcWriterMethod(serializedParameters, datas, cr, out intentionallyNull); + if (!intentionallyNull && cr.WriterMethodDef == null) + return false; + + cr.LogicMethodDef = CreateRpcLogicMethod(datas, cr, out intentionallyNull); + if (!intentionallyNull && cr.LogicMethodDef == null) + return false; + + cr.ReaderMethodDef = CreateRpcReaderMethod(serializedParameters, datas, cr, out intentionallyNull); + if (!intentionallyNull && cr.ReaderMethodDef == null) + return false; + + + return true; + } + + + + /// + /// Creates a writer for a RPC. + /// + /// + /// + /// + private MethodDefinition CreateRpcWriterMethod(List serializedParameters, List datas, CreatedRpc cr, out bool intentionallyNull) + { + intentionallyNull = false; + + + + string methodName = $"{WRITER_PREFIX}{GetRpcMethodName(cr)}"; + /* If method already exist then clear it. This + * can occur when a method needs to be rebuilt due to + * inheritence, and renumbering the RPC method names. */ + MethodDefinition createdMd = cr.TypeDef.GetMethod(methodName); + //If found. + if (createdMd != null) + { + createdMd.Parameters.Clear(); + createdMd.Body.Instructions.Clear(); + } + //Doesn't exist, create it. + else + { + //Create the method body. + createdMd = new MethodDefinition(methodName, + MethodAttributes.Private, + cr.Module.TypeSystem.Void); + cr.TypeDef.Methods.Add(createdMd); + createdMd.Body.InitLocals = true; + } + cr.WriterMethodDef = createdMd; + + bool result; + if (cr.RpcType == RpcType.Server) + result = CreateServerRpcWriterMethod(serializedParameters, cr); + else if (cr.RpcType == RpcType.Target || cr.RpcType == RpcType.Observers) + result = CreateClientRpcWriterMethod(serializedParameters, datas, cr); + else + result = false; + + return (result) ? cr.WriterMethodDef : null; + } + + /// + /// Returns serializable parameters for originalMd. + /// + private List GetSerializedParamters(RpcType rpcType, List attributeDatas, CreatedRpc cr) + { + MethodDefinition originalMd = cr.OriginalMethodDef; + + //RpcTypes for originalMd. + List attributeRpcTypes = attributeDatas.GetRpcTypes(); + + //Parameters to be serialized. + List serializedParameters = new List(); + /* Parameters which won't be serialized, such as channel. + * It's safe to add parameters which are null or + * not used. */ + HashSet nonserializedParameters = new HashSet(); + + //Get channel if it exist, and get target parameter. + ParameterDefinition channelParameterDef = GetChannelParameter(originalMd, rpcType); + + /* RpcType specific parameters. */ + ParameterDefinition targetConnectionParameterDef = null; + if (attributeRpcTypes.Contains(RpcType.Target)) + targetConnectionParameterDef = originalMd.Parameters[0]; + + if (rpcType == RpcType.Server) + { + //The network connection parameter might be added as null, this is okay. + nonserializedParameters.Add(GetNetworkConnectionParameter(originalMd)); + nonserializedParameters.Add(channelParameterDef); + } + else + { + nonserializedParameters.Add(channelParameterDef); + nonserializedParameters.Add(targetConnectionParameterDef); + } + + //Add all parameters which are NOT nonserialized to serializedParameters. + foreach (ParameterDefinition pd in originalMd.Parameters) + { + if (!nonserializedParameters.Contains(pd)) + serializedParameters.Add(pd); + } + + return serializedParameters; + } + + /// + /// Creates Writer method for a TargetRpc. + /// + private bool CreateClientRpcWriterMethod(List serializedParameters, List attributeDatas, CreatedRpc cr) + { + WriterProcessor wp = base.GetClass(); + + MethodDefinition writerMd = cr.WriterMethodDef; + MethodDefinition originalMd = cr.OriginalMethodDef; + + ILProcessor processor = writerMd.Body.GetILProcessor(); + //Add all parameters from the original. + for (int i = 0; i < originalMd.Parameters.Count; i++) + writerMd.Parameters.Add(originalMd.Parameters[i]); + //Get channel if it exist, and get target parameter. + ParameterDefinition channelParameterDef = GetChannelParameter(writerMd, RpcType.None); + + List rpcTypes = attributeDatas.GetRpcTypes(); + + /* RpcType specific parameters. */ + ParameterDefinition targetConnectionParameterDef = null; + if (rpcTypes.Contains(RpcType.Target)) + targetConnectionParameterDef = writerMd.Parameters[0]; + + /* Creates basic ServerRpc and ClientRpc + * conditions such as if requireOwnership ect.. + * or if (!base.isClient) */ + + CreateClientRpcConditionsForServer(writerMd); + + VariableDefinition channelVariableDef = CreateAndPopulateChannelVariable(writerMd, channelParameterDef); + /* Create a local PooledWriter variable. */ + //Default value for data length. + int dataLength = -1; + //Go through each attribute and see if a larger data length is specified. + foreach (AttributeData ad in attributeDatas) + { + int dl = ad.Attribute.GetField(DATALENGTH_NAME, -1); + if (dl > dataLength) + dataLength = dl; + } + VariableDefinition pooledWriterVariableDef = wp.CreatePooledWriter(writerMd, dataLength); + //Create all writer.WriteType() calls. + for (int i = 0; i < serializedParameters.Count; i++) + { + MethodReference writeMethodRef = wp.GetOrCreateWriteMethodReference(serializedParameters[i].ParameterType); + if (writeMethodRef == null) + return false; + + wp.CreateWrite(writerMd, pooledWriterVariableDef, serializedParameters[i], writeMethodRef); + } + + /* Call the method on NetworkBehaviour responsible for sending out the rpc. */ + if (cr.RpcType == RpcType.Observers) + processor.Add(CreateSendObserversRpc(writerMd, cr.MethodHash, pooledWriterVariableDef, channelVariableDef, cr.Attribute)); + else if (cr.RpcType == RpcType.Target) + processor.Add(CreateSendTargetRpc(writerMd, cr.MethodHash, pooledWriterVariableDef, channelVariableDef, targetConnectionParameterDef, attributeDatas)); + //Dispose of writer. + processor.Add(base.GetClass().DisposePooledWriter(writerMd, pooledWriterVariableDef)); + //Add end of method. + processor.Emit(OpCodes.Ret); + + return true; + } + + /// + /// Creates Writer method for a ServerRpc. + /// + private bool CreateServerRpcWriterMethod(List serializedParameters, CreatedRpc cr) + { + WriterProcessor wp = base.GetClass(); + + MethodDefinition writerMd = cr.WriterMethodDef; + MethodDefinition originalMd = cr.OriginalMethodDef; + ILProcessor processor = writerMd.Body.GetILProcessor(); + + //Add all parameters from the original. + for (int i = 0; i < originalMd.Parameters.Count; i++) + writerMd.Parameters.Add(originalMd.Parameters[i]); + //Add in channel if it doesnt exist. + ParameterDefinition channelParameterDef = GetChannelParameter(writerMd, RpcType.Server); + + /* Creates basic ServerRpc + * conditions such as if requireOwnership ect.. + * or if (!base.isClient) */ + + CreateServerRpcConditionsForClient(writerMd, cr.Attribute); + + VariableDefinition channelVariableDef = CreateAndPopulateChannelVariable(writerMd, channelParameterDef); + //Create a local PooledWriter variable. + int dataLength = cr.Attribute.GetField(DATALENGTH_NAME, -1); + VariableDefinition pooledWriterVariableDef = wp.CreatePooledWriter(writerMd, dataLength); + //Create all writer.WriteType() calls. + for (int i = 0; i < serializedParameters.Count; i++) + { + MethodReference writeMethodRef = wp.GetOrCreateWriteMethodReference(serializedParameters[i].ParameterType); + if (writeMethodRef == null) + return false; + + wp.CreateWrite(writerMd, pooledWriterVariableDef, serializedParameters[i], writeMethodRef); + } + + //Call the method on NetworkBehaviour responsible for sending out the rpc. + processor.Add(CreateSendServerRpc(writerMd, cr.MethodHash, pooledWriterVariableDef, channelVariableDef, cr.Attribute)); + //Dispose of writer. + processor.Add(wp.DisposePooledWriter(writerMd, pooledWriterVariableDef)); + //Add end of method. + processor.Emit(OpCodes.Ret); + + return true; + } + + /// + /// Creates a Channel VariableDefinition and populates it with parameterDef value if available, otherwise uses Channel.Reliable. + /// + /// + /// + /// + private VariableDefinition CreateAndPopulateChannelVariable(MethodDefinition methodDef, ParameterDefinition parameterDef) + { + ILProcessor processor = methodDef.Body.GetILProcessor(); + + VariableDefinition localChannelVariableDef = base.GetClass().CreateVariable(methodDef, typeof(Channel)); + if (parameterDef != null) + processor.Emit(OpCodes.Ldarg, parameterDef); + else + processor.Emit(OpCodes.Ldc_I4, (int)Channel.Reliable); + + //Set to local value. + processor.Emit(OpCodes.Stloc, localChannelVariableDef); + return localChannelVariableDef; + } + + + /// + /// Creates a reader for a RPC. + /// + /// + /// + /// + private MethodDefinition CreateRpcReaderMethod(List serializedParameters, List datas, CreatedRpc cr, out bool intentionallyNull) + { + intentionallyNull = false; + + RpcType rpcType = cr.RpcType; + MethodDefinition originalMd = cr.OriginalMethodDef; + TypeDefinition typeDef = cr.TypeDef; + bool runLocally = cr.RunLocally; + MethodDefinition logicMd = cr.LogicMethodDef; + CustomAttribute rpcAttribute = cr.Attribute; + + + + string methodName = $"{READER_PREFIX}{GetRpcMethodName(cr)}"; + /* If method already exist then just return it. This + * can occur when a method needs to be rebuilt due to + * inheritence, and renumbering the RPC method names. + * The reader method however does not need to be rewritten. */ + MethodDefinition createdMd = typeDef.GetMethod(methodName); + //If found. + if (createdMd != null) + { + cr.ReaderMethodDef = createdMd; + return createdMd; + } + else + { + //Create the method body. + createdMd = new MethodDefinition( + methodName, + MethodAttributes.Private, + originalMd.Module.TypeSystem.Void); + typeDef.Methods.Add(createdMd); + createdMd.Body.InitLocals = true; + cr.ReaderMethodDef = createdMd; + } + + if (rpcType == RpcType.Server) + return CreateServerRpcReaderMethod(typeDef, runLocally, originalMd, createdMd, serializedParameters, logicMd, rpcAttribute); + else if (rpcType == RpcType.Target || rpcType == RpcType.Observers) + return CreateClientRpcReaderMethod(serializedParameters, datas, cr); + else + return null; + } + + + /// + /// Creates a reader for ServerRpc. + /// + /// + /// + /// + private MethodDefinition CreateServerRpcReaderMethod(TypeDefinition typeDef, bool runLocally, MethodDefinition originalMd, MethodDefinition createdMd, List serializedParameters, MethodDefinition logicMd, CustomAttribute rpcAttribute) + { + ILProcessor processor = createdMd.Body.GetILProcessor(); + + bool requireOwnership = rpcAttribute.GetField(REQUIREOWNERSHIP_NAME, true); + //Create PooledReader parameter. + ParameterDefinition readerParameterDef = base.GetClass().CreateParameter(createdMd, base.GetClass().PooledReader_TypeRef); + + //Add connection parameter to the read method. Internals pass the connection into this. + ParameterDefinition channelParameterDef = GetOrCreateChannelParameter(createdMd, RpcType.Server); + ParameterDefinition connectionParameterDef = GetOrCreateNetworkConnectionParameter(createdMd); + + /* It's very important to read everything + * from the PooledReader before applying any + * exit logic. Should the method return before + * reading the data then anything after the rpc + * packet will be malformed due to invalid index. */ + VariableDefinition[] readVariableDefs; + List allReadInsts; + CreateRpcReadInstructions(createdMd, readerParameterDef, serializedParameters, out readVariableDefs, out allReadInsts); + + //Read to clear pooledreader. + processor.Add(allReadInsts); + + /* Don't continue if server is not active. + * This can happen if an object is deinitializing + * as a RPC arrives. When separate server and client + * this should not occur but there's a chance as host + * because deinitializations are slightly delayed to support + * the clientHost deinitializing the object as well. */ + base.GetClass().CreateIsServerCheck(createdMd, LoggingType.Off, false, false, false); + // + CreateServerRpcConditionsForServer(processor, requireOwnership, connectionParameterDef); + + //Block from running twice as host. + if (runLocally) + { + //The connection calling is always passed into the reader method as the last parameter. + ParameterDefinition ncPd = createdMd.Parameters[createdMd.Parameters.Count - 1]; + Instruction afterConnectionRet = processor.Create(OpCodes.Nop); + processor.Emit(OpCodes.Ldarg, ncPd); + MethodReference isLocalClientMr = base.GetClass().NetworkConnection_GetIsLocalClient_MethodRef; + processor.Emit(isLocalClientMr.GetCallOpCode(base.Session), isLocalClientMr); + processor.Emit(OpCodes.Brfalse_S, afterConnectionRet); + processor.Emit(OpCodes.Ret); + processor.Append(afterConnectionRet); + } + + //this.Logic + processor.Emit(OpCodes.Ldarg_0); + //Add each read variable as an argument. + foreach (VariableDefinition vd in readVariableDefs) + processor.Emit(OpCodes.Ldloc, vd); + + /* Pass in channel and connection if original + * method supports them. */ + ParameterDefinition originalChannelParameterDef = GetChannelParameter(originalMd, RpcType.Server); + ParameterDefinition originalConnectionParameterDef = GetNetworkConnectionParameter(originalMd); + if (originalChannelParameterDef != null) + processor.Emit(OpCodes.Ldarg, channelParameterDef); + if (originalConnectionParameterDef != null) + processor.Emit(OpCodes.Ldarg, connectionParameterDef); + //Call __Logic method. + processor.Emit(OpCodes.Call, logicMd); + processor.Emit(OpCodes.Ret); + + return createdMd; + } + + /// + /// Creates a reader for ObserversRpc. + /// + /// + /// + /// + private MethodDefinition CreateClientRpcReaderMethod(List serializedParameters, List attributeDatas, CreatedRpc cr) + { + MethodDefinition originalMd = cr.OriginalMethodDef; + MethodDefinition createdMd = cr.ReaderMethodDef; + RpcType rpcType = cr.RpcType; + CustomAttribute rpcAttribute = cr.Attribute; + bool runLocally = cr.RunLocally; + + ILProcessor processor = createdMd.Body.GetILProcessor(); + + //Create PooledReader parameter. + ParameterDefinition readerParameterDef = base.GetClass().CreateParameter(createdMd, base.GetClass().PooledReader_TypeRef); + ParameterDefinition channelParameterDef = GetOrCreateChannelParameter(createdMd, rpcType); + /* It's very important to read everything + * from the PooledReader before applying any + * exit logic. Should the method return before + * reading the data then anything after the rpc + * packet will be malformed due to invalid index. */ + VariableDefinition[] readVariableDefs; + List allReadInsts; + CreateRpcReadInstructions(createdMd, readerParameterDef, serializedParameters, out readVariableDefs, out allReadInsts); + //Read instructions even if not to include owner. + processor.Add(allReadInsts); + + /* Don't continue if client is not active. + * This can happen if an object is deinitializing + * as a RPC arrives. When separate server and client + * this should not occur but there's a chance as host + * because deinitializations are slightly delayed to support + * the clientHost deinitializing the object as well. */ + base.GetClass().CreateIsClientCheck(createdMd, LoggingType.Off, false, false, false); + + //Block from running twice as host. + if (runLocally) + processor.Add(CreateIsHostBlock(createdMd)); + + processor.Emit(OpCodes.Ldarg_0); //this. + /* TargetRpc passes in localconnection + * as receiver for connection. */ + if (rpcType == RpcType.Target) + { + processor.Emit(OpCodes.Ldarg_0); //this. + processor.Emit(OpCodes.Call, base.GetClass().LocalConnection_MethodRef); + } + else + { + //If this method uses target/observerRpc combined then load null for the connection. + RpcType allRpcTypes = attributeDatas.GetCombinedRpcType(); + if (allRpcTypes == (RpcType.Observers | RpcType.Target)) + processor.Emit(OpCodes.Ldnull); + } + //Add each read variable as an argument. + foreach (VariableDefinition vd in readVariableDefs) + processor.Emit(OpCodes.Ldloc, vd); + //Channel. + ParameterDefinition originalChannelParameterDef = GetChannelParameter(originalMd, rpcType); + if (originalChannelParameterDef != null) + processor.Emit(OpCodes.Ldarg, channelParameterDef); + //Call __Logic method. + processor.Emit(OpCodes.Call, cr.LogicMethodDef); + processor.Emit(OpCodes.Ret); + + return createdMd; + } + + + /// + /// Appends a block to the method if running as host. + /// + /// + private List CreateIsHostBlock(MethodDefinition md) + { + List ints = new List(); + ILProcessor processor = md.Body.GetILProcessor(); + + Instruction endIfInst = processor.Create(OpCodes.Nop); + ints.Add(processor.Create(OpCodes.Ldarg_0)); + ints.Add(processor.Create(OpCodes.Call, base.GetClass().IsHost_MethodRef)); + ints.Add(processor.Create(OpCodes.Brfalse_S, endIfInst)); + ints.Add(processor.Create(OpCodes.Ret)); + ints.Add(endIfInst); + + return ints; + } + + /// + /// Gets the optional NetworkConnection parameter for ServerRpc, if it exists. + /// + /// + /// + private ParameterDefinition GetNetworkConnectionParameter(MethodDefinition methodDef) + { + + ParameterDefinition result = methodDef.GetEndParameter(0); + //Is null, not networkconnection, or doesn't have default. + if (result == null || !result.Is(typeof(NetworkConnection)) || !result.HasDefault) + return null; + + return result; + } + + /// + /// Creates a NetworkConnection parameter if it's not the last or second to last parameter. + /// + /// + private ParameterDefinition GetOrCreateNetworkConnectionParameter(MethodDefinition methodDef) + { + ParameterDefinition result = GetNetworkConnectionParameter(methodDef); + if (result == null) + return base.GetClass().CreateParameter(methodDef, typeof(NetworkConnection), "conn"); + else + return result; + } + + /// + /// Returns the Channel parameter if it exist. + /// + /// + private ParameterDefinition GetChannelParameter(MethodDefinition methodDef, RpcType rpcType) + { + ParameterDefinition result = null; + ParameterDefinition pd = methodDef.GetEndParameter(0); + if (pd != null) + { + //Last parameter is channel. + if (pd.Is(typeof(Channel))) + { + result = pd; + } + /* Only other end parameter may be networkconnection. + * This can only be checked if a ServerRpc. */ + else if (rpcType == RpcType.Server) + { + //If last parameter is networkconnection and its default then can check second to last. + if (pd.Is(typeof(NetworkConnection)) && pd.HasDefault) + { + pd = methodDef.GetEndParameter(1); + if (pd != null && pd.Is(typeof(Channel))) + result = pd; + } + } + else + { + result = null; + } + } + + return result; + } + + /// + /// Creates a channel parameter if missing. + /// + /// + private ParameterDefinition GetOrCreateChannelParameter(MethodDefinition methodDef, RpcType rpcType) + { + ParameterDefinition result = GetChannelParameter(methodDef, rpcType); + //Add channel parameter if not included. + if (result == null) + { + ParameterDefinition connParameter = GetNetworkConnectionParameter(methodDef); + //If the connection parameter is specified then channel has to go before it. + if (connParameter != null) + return base.GetClass().CreateParameter(methodDef, typeof(Channel), "channel", ParameterAttributes.None, connParameter.Index); + //Not specified, add channel at end. + else + return base.GetClass().CreateParameter(methodDef, typeof(Channel), "channel"); + } + else + { + return result; + } + } + + /// + /// Creates a read for every writtenParameters and outputs variables read into, and instructions. + /// + /// + /// + /// + /// + /// + /// + private void CreateRpcReadInstructions(MethodDefinition methodDef, ParameterDefinition readerParameterDef, List serializedParameters, out VariableDefinition[] readVariableDefs, out List allReadInsts) + { + /* It's very important to read everything + * from the PooledReader before applying any + * exit logic. Should the method return before + * reading the data then anything after the rpc + * packet will be malformed due to invalid index. */ + readVariableDefs = new VariableDefinition[serializedParameters.Count]; + allReadInsts = new List(); + + //True if last parameter is a connection and a server rpc. + for (int i = 0; i < serializedParameters.Count; i++) + { + //Get read instructions and insert it before the return. + List insts = base.GetClass().CreateRead(methodDef, readerParameterDef, serializedParameters[i].ParameterType, out readVariableDefs[i]); + allReadInsts.AddRange(insts); + } + + } + /// + /// Creates conditions that clients must pass to send a ServerRpc. + /// + /// + /// + private void CreateServerRpcConditionsForClient(MethodDefinition methodDef, CustomAttribute rpcAttribute) + { + bool requireOwnership = rpcAttribute.GetField(REQUIREOWNERSHIP_NAME, true); + //If (!base.IsOwner); + if (requireOwnership) + base.GetClass().CreateLocalClientIsOwnerCheck(methodDef, LoggingType.Warning, false, false, true); + //If (!base.IsClient) + base.GetClass().CreateIsClientCheck(methodDef, LoggingType.Warning, false, true, false); + } + + /// + /// Creates conditions that server must pass to process a ServerRpc. + /// + /// + /// + /// Ret instruction. + private Instruction CreateServerRpcConditionsForServer(ILProcessor createdProcessor, bool requireOwnership, ParameterDefinition connectionParametereDef) + { + /* Don't need to check if server on receiving end. + * Next compare connection with owner. */ + //If (!base.CompareOwner); + if (requireOwnership) + return base.GetClass().CreateRemoteClientIsOwnerCheck(createdProcessor, connectionParametereDef); + else + return null; + } + + /// + /// Creates conditions that server must pass to process a ClientRpc. + /// + /// + private void CreateClientRpcConditionsForServer(MethodDefinition methodDef) + { + //If (!base.IsServer) + base.GetClass().CreateIsServerCheck(methodDef, LoggingType.Warning, false, false, false); + } + + /// + /// Creates a method containing the logic which will run when receiving the Rpc. + /// + /// + /// + private MethodDefinition CreateRpcLogicMethod(List datas, CreatedRpc cr, out bool intentionallyNull) + { + intentionallyNull = false; + + RpcType rpcType = cr.RpcType; + TypeDefinition typeDef = cr.TypeDef; + MethodDefinition originalMd = cr.OriginalMethodDef; + + + + //Methodname for logic methods do not use prefixes because there can be only one. + string methodName = $"{LOGIC_PREFIX}{GetMethodNameAsParameters(originalMd)}"; + /* If method already exist then just return it. This + * can occur when a method needs to be rebuilt due to + * inheritence, and renumbering the RPC method names. + * The logic method however does not need to be rewritten. */ + MethodDefinition logicMd = base.GetClass().CopyIntoNewMethod(originalMd, methodName, out _); + + cr.LogicMethodDef = logicMd; + return logicMd; + } + + /// + /// Finds and fixes call to base methods within remote calls + /// For example, changes `base.CmdDoSomething` to `base.UserCode_CmdDoSomething` within `this.UserCode_CmdDoSomething` + /// + /// + /// + private void RedirectBaseCall(MethodDefinition createdMethodDef, MethodDefinition originalMethodDef) + { + //All logic RPCs end with the logic suffix. + if (!createdMethodDef.Name.StartsWith(LOGIC_PREFIX)) + return; + //Not virtual, no need to check. + if (!createdMethodDef.IsVirtual) + return; + + foreach (Instruction instruction in createdMethodDef.Body.Instructions) + { + // if call to base.RpcDoSomething within this.RpcDoSOmething. + if (base.GetClass().IsCallToMethod(instruction, out MethodDefinition calledMethod) && calledMethod.Name == originalMethodDef.Name) + { + MethodReference baseLogicMd = createdMethodDef.DeclaringType.GetMethodDefinitionInAnyBase(base.Session, createdMethodDef.Name); + if (baseLogicMd == null) + { + base.LogError($"Could not find base method for {createdMethodDef.Name}."); + return; + } + + instruction.Operand = base.ImportReference(baseLogicMd); + } + } + } + + + /// + /// Redirects calls from the original Rpc method to the writer method. + /// + private void RedirectOriginalToWriter(List createdRpcs) + { + /* If there are multiple attributes/createdRpcs they will + * share the same originalMd so it's fine to take the first + * entry. */ + MethodDefinition originalMd = createdRpcs[0].OriginalMethodDef; + + + + ILProcessor processor = originalMd.Body.GetILProcessor(); + originalMd.Body.Instructions.Clear(); + + //If only one rpc type. + if (createdRpcs.Count == 1) + { + processor.Emit(OpCodes.Ldarg_0); //this. + //Parameters. + foreach (ParameterDefinition pd in originalMd.Parameters) + processor.Emit(OpCodes.Ldarg, pd); + + //Call method. + MethodReference writerMr = base.ImportReference(createdRpcs[0].WriterMethodDef); + processor.Emit(OpCodes.Call, writerMr); + + AddRunLocally(createdRpcs[0]); + } + //More than one which means it's an observer/targetRpc combo. + else + { + CreatedRpc observersRpc = createdRpcs.GetCreatedRpc(RpcType.Observers); + MethodReference observerWriterMr = base.ImportReference(observersRpc.WriterMethodDef); + + CreatedRpc targetRpc = createdRpcs.GetCreatedRpc(RpcType.Target); + MethodReference targetWriterMr = base.ImportReference(targetRpc.WriterMethodDef); + + Instruction targetRpcInst = processor.Create(OpCodes.Nop); + Instruction afterTargetRpcInst = processor.Create(OpCodes.Nop); + /* if (targetConn == null) + * WriteObserverRpc + * else + * WriteTargetRpc */ + processor.Emit(OpCodes.Ldarg, originalMd.Parameters[0]); + processor.Emit(OpCodes.Brtrue_S, targetRpcInst); + //Insert parameters. + processor.Emit(OpCodes.Ldarg_0); + foreach (ParameterDefinition pd in originalMd.Parameters) + processor.Emit(OpCodes.Ldarg, pd); + processor.Emit(OpCodes.Call, observerWriterMr); + AddRunLocally(observersRpc); + //else (target). + processor.Emit(OpCodes.Br_S, afterTargetRpcInst); + processor.Append(targetRpcInst); + //Insert parameters. + processor.Emit(OpCodes.Ldarg_0); + foreach (ParameterDefinition pd in originalMd.Parameters) + processor.Emit(OpCodes.Ldarg, pd); + processor.Emit(OpCodes.Call, targetWriterMr); + AddRunLocally(targetRpc); + processor.Append(afterTargetRpcInst); + } + + //Adds run locally logic if needed. + void AddRunLocally(CreatedRpc cRpc) + { + //Runlocally. + if (cRpc.RunLocally) + { + processor.Emit(OpCodes.Ldarg_0); //this. + //Parameters. + foreach (ParameterDefinition pd in originalMd.Parameters) + processor.Emit(OpCodes.Ldarg, pd); + processor.Emit(OpCodes.Call, cRpc.LogicMethodDef); + } + + } + + processor.Emit(OpCodes.Ret); + } + + + #region CreateSend + /// + /// Creates a call to SendServerRpc on NetworkBehaviour. + /// + /// + /// + private List CreateSendServerRpc(MethodDefinition methodDef, uint methodHash, VariableDefinition writerVariableDef, VariableDefinition channelVariableDef, CustomAttribute rpcAttribute) + { + List insts = new List(); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + insts.AddRange(CreateSendRpcCommon(processor, methodHash, writerVariableDef, channelVariableDef, rpcAttribute)); + //Call NetworkBehaviour. + insts.Add(processor.Create(OpCodes.Call, base.GetClass().SendServerRpc_MethodRef)); + + return insts; + } + + /// + /// Creates a call to SendObserversRpc on NetworkBehaviour. + /// + private List CreateSendObserversRpc(MethodDefinition methodDef, uint methodHash, VariableDefinition writerVariableDef, VariableDefinition channelVariableDef, CustomAttribute rpcAttribute) + { + List insts = new List(); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + insts.AddRange(CreateSendRpcCommon(processor, methodHash, writerVariableDef, channelVariableDef, rpcAttribute)); + //Also add if buffered. + bool bufferLast = rpcAttribute.GetField(BUFFERLAST_NAME, false); + bool excludeOwner = rpcAttribute.GetField(EXCLUDEOWNER_NAME, false); + bool excludeServer = rpcAttribute.GetField(EXCLUDESERVER_NAME, false); + + //Warn user if any values are byref. + bool usedByref = false; + foreach (ParameterDefinition item in methodDef.Parameters) + { + if (item.IsIn) + { + usedByref = true; + break; + } + } + if (usedByref) + base.LogWarning($"Method {methodDef.FullName} takes an argument by reference. While this is supported, using BufferLast in addition to by reference arguements will buffer the value as it was serialized, not as it is when sending buffered."); + + insts.Add(processor.Create(OpCodes.Ldc_I4, bufferLast.ToInt())); + insts.Add(processor.Create(OpCodes.Ldc_I4, excludeServer.ToInt())); + insts.Add(processor.Create(OpCodes.Ldc_I4, excludeOwner.ToInt())); + //Call NetworkBehaviour. + insts.Add(processor.Create(OpCodes.Call, base.GetClass().SendObserversRpc_MethodRef)); + + return insts; + } + /// + /// Creates a call to SendTargetRpc on NetworkBehaviour. + /// + private List CreateSendTargetRpc(MethodDefinition methodDef, uint methodHash, VariableDefinition writerVariableDef, VariableDefinition channelVariableDef, ParameterDefinition targetConnectionParameterDef, List attributeDatas) + { + List insts = new List(); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + CustomAttribute rpcAttribute = attributeDatas.GetAttribute(base.Session, RpcType.Target); + bool validateTarget = rpcAttribute.GetField(VALIDATETARGET_NAME, true); + bool excludeServer = rpcAttribute.GetField(EXCLUDESERVER_NAME, false); + + insts.AddRange(CreateSendRpcCommon(processor, methodHash, writerVariableDef, channelVariableDef, rpcAttribute)); + insts.Add(processor.Create(OpCodes.Ldarg, targetConnectionParameterDef)); + insts.Add(processor.Create(OpCodes.Ldc_I4, excludeServer.ToInt())); + insts.Add(processor.Create(OpCodes.Ldc_I4, validateTarget.ToInt())); + //Call NetworkBehaviour. + insts.Add(processor.Create(OpCodes.Call, base.GetClass().SendTargetRpc_MethodRef)); + + return insts; + } + + /// + /// Writes common properties that all SendRpc methods use. + /// + private List CreateSendRpcCommon(ILProcessor processor, uint methodHash, VariableDefinition writerVariableDef, VariableDefinition channelVariableDef, CustomAttribute rpcAttribute) + { + List insts = new List(); + + insts.Add(processor.Create(OpCodes.Ldarg_0)); // argument: this + insts.Add(processor.Create(OpCodes.Ldc_I4, (int)methodHash)); + //reference to PooledWriter. + insts.Add(processor.Create(OpCodes.Ldloc, writerVariableDef)); + //reference to Channel. + insts.Add(processor.Create(OpCodes.Ldloc, channelVariableDef)); + + int orderType = (int)rpcAttribute.GetField(DATAORDERTYPE_NAME, DataOrderType.Default); + insts.Add(processor.Create(OpCodes.Ldc_I4, orderType)); + + return insts; + } + #endregion + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Processing/Rpc/RpcProcessor.cs.meta b/Assets/FishNet/CodeGenerating/Processing/Rpc/RpcProcessor.cs.meta new file mode 100644 index 0000000..e87895d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/Rpc/RpcProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d4adb5891ee44f4397cd07ac2df0ce0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/SyncTypeProcessor.cs b/Assets/FishNet/CodeGenerating/Processing/SyncTypeProcessor.cs new file mode 100644 index 0000000..d89d970 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/SyncTypeProcessor.cs @@ -0,0 +1,563 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.Object.Delegating; +using FishNet.Object.Synchronizing; +using FishNet.Object.Synchronizing.Internal; +using GameKit.Dependencies.Utilities; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using MonoFN.Collections.Generic; +using System.Collections.Generic; +using System.Linq; + +namespace FishNet.CodeGenerating.Processing +{ + internal class SyncTypeProcessor : CodegenBase + { + #region Reflection references. + private TypeReference _syncBase_TypeRef; + private TypeReference _syncVar_TypeRef; + +#pragma warning disable CS0618 // Type or member is obsolete + private string _syncVarAttribute_FullName = typeof(SyncVarAttribute).FullName; + private string _syncObjectAttribute_FullName = typeof(SyncObjectAttribute).FullName; +#pragma warning restore CS0618 // Type or member is obsolete + #endregion + + #region Const. + private const string INITIALIZELATE_METHOD_NAME = nameof(SyncBase.InitializeLate); + private const string INITIALIZEEARLY_METHOD_NAME = nameof(SyncBase.InitializeEarly); + private const string GETSERIALIZEDTYPE_METHOD_NAME = nameof(ICustomSync.GetSerializedType); + #endregion + + public override bool ImportReferences() + { + System.Type svType = typeof(SyncVar<>); + _syncVar_TypeRef = base.ImportReference(svType); + + System.Type syncBaseType = typeof(SyncBase); + _syncBase_TypeRef = base.ImportReference(syncBaseType).Resolve(); + + return true; + } + + /// + /// Processes SyncVars and Objects. + /// + /// Number of SyncTypes implemented in this typeDef and those inherited of. + internal bool ProcessLocal(TypeDefinition typeDef) + { + bool modified = false; + + ValidateVersion3ToVersion4SyncVars(typeDef); + + uint startingHash = GetSyncTypeCountInParents(typeDef); + uint totalSyncTypes = (startingHash + GetSyncTypeCount(typeDef)); + if (totalSyncTypes > NetworkBehaviourHelper.MAX_SYNCTYPE_ALLOWANCE) + { + base.LogError($"Found {totalSyncTypes} SyncTypes within {typeDef.FullName} and inherited classes. The maximum number of allowed SyncTypes within type and inherited types is {NetworkBehaviourHelper.MAX_SYNCTYPE_ALLOWANCE}. Remove SyncTypes or condense them using data containers, or a custom SyncObject."); + return false; + } + + FieldDefinition[] fieldDefs = typeDef.Fields.ToArray(); + foreach (FieldDefinition fd in fieldDefs) + { + //Check if uses old attributes first. + if (HasSyncTypeAttributeUnchecked(fd)) + { + base.LogError($"SyncType {fd.Name} on type {fd.DeclaringType.FullName} implements [SyncVar] or [SyncObject]. These attributes are no longer supported as of version 4. Please see Break Solutions within the documentation to resolve these errors."); + continue; + } + SyncType st = GetSyncType(fd); + //Not a sync type field. + if (st == SyncType.Unset) + continue; + //Needs to be addressed if this ever occurs. + if (st == SyncType.Unhandled) + { + base.LogError($"Field {fd.Name} in type {fd.DeclaringType.FullName} is unhandled."); + return false; + } + //Errors occurred while checking the synctype field. + if (!IsSyncTypeFieldValid(fd, true)) + return false; + + bool isSyncObject = (st != SyncType.Variable); + bool isGeneric = fd.FieldType.IsGenericInstance; + if (isGeneric) + { + if (TryCreateGenericSyncType(startingHash, fd, isSyncObject)) + startingHash++; + } + else + { + if (TryCreateNonGenericSyncType(startingHash, fd, isSyncObject)) + startingHash++; + } + + modified = true; + } + + return modified; + } + + + /// + /// Gets number of SyncTypes by checking for SyncVar/Object attributes. This does not perform error checking. + /// + /// + /// + internal uint GetSyncTypeCount(TypeDefinition typeDef) + { + uint count = 0; + foreach (FieldDefinition fd in typeDef.Fields) + { + if (IsSyncType(fd)) + count++; + } + + return count; + } + + /// + /// Gets SyncType count in all of typeDefs parents, excluding typeDef itself. + /// + internal uint GetSyncTypeCountInParents(TypeDefinition typeDef) + { + uint count = 0; + while (true) + { + typeDef = typeDef.GetNextBaseClassToProcess(base.Session); + if (typeDef != null) + count += GetSyncTypeCount(typeDef); + else + break; + } + + return count; + } + + /// + /// Returns if fieldDef is a syncType. + /// + internal bool IsSyncType(FieldReference fieldRef) + { + FieldDefinition fd = fieldRef.CachedResolve(base.Session); + return IsSyncType(fd); + } + + /// + /// Returns if fieldDef is a syncType. + /// + internal bool IsSyncType(FieldDefinition fieldDef) + { + TypeDefinition ftTypeDef = fieldDef.FieldType.CachedResolve(base.Session); + /* TypeDef may be null for certain generated types, + * as well for some normal types such as queue because Unity broke + * them in 2022+ and decided the issue was not worth resolving. */ + if (ftTypeDef == null) + return false; + + return ftTypeDef.InheritsFrom(base.Session); + } + + + + /// + /// Throws an error on any SyncVars which are comparing null on the SyncVar field, or trying to set the field null. + /// + private void ValidateVersion3ToVersion4SyncVars(TypeDefinition td) + { +#if !FISHNET_DISABLE_V3TOV4_HELPERS + /* In version3 since the user could reference the field directly like a value these actions were allowed. Doing so now however would cause unintended behavior. + * For example... + * [SyncVar] + * private Player _myPlayer; + * + * void SomeMethod() + * { + * if (_myPlayer == null) doStuff(); + * } + * The above context would be valid in version 3. + * + * But if the user converted without paying close attention, which is reasonable to miss, this would not work as intended. + * For example... + * private readonly SyncVar _myPlayer = new(); + * + * void SomeMethod() + * { + * if (_myPlayer == null) doStuff(); + * } + * The above is not the same behavior as the field _myPlayer would never be null. Instead the code should look like this... + * + * void SomeMethod() + * { + * if (_myPlayer.Value == null) doStuff(); + * } + * The checks below will catch this scenarios. + */ + + foreach (MethodDefinition methodDef in td.Methods) + { + //Ignore constructors. + if (methodDef.IsConstructor) + continue; + if (methodDef.IsAbstract) + continue; + for (int i = 0; i < methodDef.Body.Instructions.Count; i++) + { + Instruction inst = methodDef.Body.Instructions[i]; + + /* Loading a field. (Getter) */ + if ((inst.OpCode == OpCodes.Ldfld || inst.OpCode == OpCodes.Ldflda) && inst.Operand is FieldReference opFieldld) + { + FieldReference resolvedOpField = opFieldld.CachedResolve(base.Session); + if (resolvedOpField == null) + resolvedOpField = opFieldld.DeclaringType.CachedResolve(base.Session).GetFieldReference(opFieldld.Name, base.Session); + + if (IsSyncType(resolvedOpField)) + { + //Check next opcode for a brfalse/true. + //If there are more instructions to check, which there should always be. + if (i < (methodDef.Body.Instructions.Count - 1)) + { + Instruction nextInst = methodDef.Body.Instructions[i + 1]; + if (nextInst.OpCode == OpCodes.Brfalse || nextInst.OpCode == OpCodes.Brfalse_S || + nextInst.OpCode == OpCodes.Brtrue || nextInst.OpCode == OpCodes.Brtrue_S) + base.LogError($"Method {methodDef.Name} in class {td.Name} is comparing null for the SyncType field {resolvedOpField.Name}. SyncType fields should never be null; did you intend to compare the SyncType.Value instead?"); + } + } + } + /* Setting a field. (Setter) */ + else if (inst.OpCode == OpCodes.Stfld && inst.Operand is FieldReference opFieldst) + { + FieldReference resolvedOpField = opFieldst.CachedResolve(base.Session); + if (resolvedOpField == null) + resolvedOpField = opFieldst.DeclaringType.CachedResolve(base.Session).GetFieldReference(opFieldst.Name, base.Session); + + if (IsSyncType(resolvedOpField)) + base.LogError($"Method {methodDef.Name} in class {td.Name} is setting value to the SyncType field {resolvedOpField.Name}. This will result in the SyncType not functioning."); + } + } + + } +#endif + } + + /// + /// Error checks a SyncType field. This assumes the field is a SyncType. + /// + private bool IsSyncTypeFieldValid(FieldDefinition fieldDef, bool outputError) + { + //Static. + if (fieldDef.IsStatic) + { + if (outputError) + base.LogError($"{fieldDef.Name} SyncType in type {fieldDef.DeclaringType.FullName} cannot be static."); + return false; + } + //Generic. + if (fieldDef.FieldType.IsGenericParameter) + { + if (outputError) + base.LogError($"{fieldDef.Name} SyncType in type {fieldDef.DeclaringType.FullName} cannot be be generic."); + return false; + } + + //todo checking if field is initialized would be good. + + /* Forces readonly unless user allows for serialization. + * If within this logic then the field is readonly. */ + if (!fieldDef.Attributes.HasFlag(FieldAttributes.InitOnly)) + { + bool ignoreRequirement = false; + string attributeFullName = typeof(AllowMutableSyncTypeAttribute).FullName; + //Check if has attribute to bypass readonly check. + foreach (CustomAttribute item in fieldDef.CustomAttributes) + { + if (item.AttributeType.FullName == attributeFullName) + { + ignoreRequirement = true; + break; + } + } + + if (!ignoreRequirement) + { + if (outputError) + base.LogError($"{fieldDef.Name} SyncType in type {fieldDef.DeclaringType.FullName} must be readonly or decorated with the {nameof(AllowMutableSyncTypeAttribute)} attribute. If allowing muteable do not ever re-assign the field at runtime."); + return false; + } + } + + //Fall through/pass. + return true; + } + + /// + /// Returns SyncType on a field while error checking. + /// + internal SyncType GetSyncType(FieldDefinition fieldDef) + { + if (!IsSyncType(fieldDef)) + return SyncType.Unset; + + ObjectHelper oh = base.GetClass(); + string fdName = fieldDef.FieldType.Name; + if (fdName == oh.SyncVar_Name) + return SyncType.Variable; + else if (fdName == oh.SyncList_Name) + return SyncType.List; + else if (fdName == oh.SyncDictionary_Name) + return SyncType.Dictionary; + else if (fdName == oh.SyncHashSet_Name) + return SyncType.HashSet; + //Custom types must also implement ICustomSync. + else if (fieldDef.FieldType.CachedResolve(base.Session).ImplementsInterfaceRecursive(base.Session)) + return SyncType.Custom; + else + return SyncType.Unhandled; + } + + + /// + /// Tries to create a SyncType that does not use generics. + /// + private bool TryCreateNonGenericSyncType(uint hash, FieldDefinition originalFieldDef, bool isSyncObject) + { + TypeDefinition fieldTypeTd = originalFieldDef.FieldType.CachedResolve(base.Session); + if (!fieldTypeTd.ImplementsInterface()) + { + base.LogError($"SyncType field {originalFieldDef.Name} in type {originalFieldDef.DeclaringType.FullName} does not implement {nameof(ICustomSync)}. Non-generic SyncTypes must implement {nameof(ICustomSync)}. See documentation on Custom SyncTypes for more information."); + return false; + } + //Get the serialized type. + MethodDefinition getSerialziedTypeMd = originalFieldDef.FieldType.CachedResolve(base.Session).GetMethod(GETSERIALIZEDTYPE_METHOD_NAME); + MethodReference getSerialziedTypeMr = base.ImportReference(getSerialziedTypeMd); + Collection instructions = getSerialziedTypeMr.CachedResolve(base.Session).Body.Instructions; + + bool checkForSerializer = true; + TypeReference serializedDataTypeRef = null; + /* If the user is returning null then + * they are indicating a built-in serializer + * already exists. */ + if (instructions.Count == 2 && instructions[0].OpCode == OpCodes.Ldnull && instructions[1].OpCode == OpCodes.Ret) + { + checkForSerializer = false; + } + //If not returning null then make a serializer for return type. + else + { + foreach (Instruction item in instructions) + { + if (item.OpCode == OpCodes.Ldnull) + { + checkForSerializer = false; + break; + } + + //This token references the type. + if (item.OpCode == OpCodes.Ldtoken) + { + TypeReference importedTr = null; + if (item.Operand is TypeDefinition td) + importedTr = base.ImportReference(td); + else if (item.Operand is TypeReference tr) + importedTr = base.ImportReference(tr); + + if (importedTr != null) + serializedDataTypeRef = importedTr; + } + } + } + + TypeReference[] typeRefs; + //If need to check for serialization. + if (checkForSerializer) + { + if (serializedDataTypeRef == null) + { + base.LogError($"SyncType field {originalFieldDef.Name} in type {originalFieldDef.DeclaringType.FullName} does not indicate which data type it needs to serialize. Review documentation for custom SyncTypes to view how to implement this feature."); + return false; + } + + //If here then check. + typeRefs = new TypeReference[] + { + serializedDataTypeRef, + }; + if (!CanSerialize(originalFieldDef, typeRefs)) + return false; + } + else + { + typeRefs = null; + } + + if (!InitializeSyncType(hash, originalFieldDef, typeRefs, isSyncObject)) + return false; + + return true; + } + + /// + /// Tries to create a SyncType that uses generics. + /// + private bool TryCreateGenericSyncType(uint hash, FieldDefinition originalFieldDef, bool isSyncObject) + { + GenericInstanceType tmpGenerinstanceType = originalFieldDef.FieldType as GenericInstanceType; + TypeReference[] typeRefs = new TypeReference[tmpGenerinstanceType.GenericArguments.Count]; + for (int i = 0; i < typeRefs.Length; i++) + typeRefs[i] = base.ImportReference(tmpGenerinstanceType.GenericArguments[i]); + if (!CanSerialize(originalFieldDef, typeRefs)) + return false; + + if (!InitializeSyncType(hash, originalFieldDef, typeRefs, isSyncObject)) + return false; + + return true; + } + + /// + /// Checks if type references can be serialized. + /// + /// Field definition specifying types. This is only used for debug output. + private bool CanSerialize(FieldDefinition fd, TypeReference[] typeRefs) + { + if (typeRefs == null) + return true; + + GeneralHelper gh = base.GetClass(); + foreach (TypeReference item in typeRefs) + { + bool canSerialize = gh.HasSerializerAndDeserializer(item, true); + if (!canSerialize) + { + base.LogError($"SyncType name {fd.Name} in type {fd.DeclaringType.FullName} data type {item.FullName} does not support serialization and one could not be created automatically. Use a supported type or create a custom serializer."); + return false; + } + } + + //Fall through/pass. + return true; + } + + + /// + /// Returns if attribute if a SyncVarAttribute. + /// + /// + /// + private bool IsSyncVariableAttribute(string attributeFullName) + { + return (attributeFullName == _syncVarAttribute_FullName); + } + /// + /// Returns if attribute if a SyncObjectAttribute. + /// + /// + /// + private bool IsSyncObjectAttribute(string attributeFullName) + { + return (attributeFullName == _syncObjectAttribute_FullName); + } + + /// + /// Returns if fieldDef has a SyncType attribute. No error checking is performed. + /// + /// + /// + private bool HasSyncTypeAttributeUnchecked(FieldDefinition fieldDef) + { + foreach (CustomAttribute customAttribute in fieldDef.CustomAttributes) + { + if (IsSyncObjectAttribute(customAttribute.AttributeType.FullName) || IsSyncVariableAttribute(customAttribute.AttributeType.FullName)) + return true; + } + + return false; + } + + /// + /// Sets methods used from SyncBase for typeDef. + /// + /// + internal bool SetSyncBaseInitializeMethods(FieldDefinition syncTypeFieldDef, TypeReference[] variableTypeRefs, out MethodReference initializeEarlyMr, out MethodReference initializeLateMr) + { + initializeEarlyMr = null; + initializeLateMr = null; + //Find the SyncBase class. + TypeDefinition fieldTd = syncTypeFieldDef.FieldType.CachedResolve(base.Session); + TypeDefinition syncBaseTd = fieldTd.GetClassInInheritance(base.Session, typeof(SyncBase).FullName); + //If SyncBase isn't found. + if (syncBaseTd == null) + { + base.LogError($"Could not find SyncBase within type {fieldTd.FullName}."); + return false; + } + else + { + //Early + initializeEarlyMr = syncBaseTd.GetMethodReference(base.Session, INITIALIZEEARLY_METHOD_NAME); + // if (variableTypeRefs != null) + // initializeEarlyMr = initializeEarlyMr.MakeGenericMethod(variableTypeRefs); + //Late + initializeLateMr = syncBaseTd.GetMethodReference(base.Session, INITIALIZELATE_METHOD_NAME); + // if (variableTypeRefs != null) + // initializeLateMr = initializeLateMr.MakeGenericMethod(variableTypeRefs); + + return true; + } + + } + /// + /// Initializes a SyncType using default settings. + /// + private bool InitializeSyncType(uint hash, FieldDefinition originalFieldDef, TypeReference[] variableTypeRefs, bool isSyncObject) + { + //Set needed methods from syncbase. + MethodReference initializeLateMr; + MethodReference initializeEarlyMr; + if (!SetSyncBaseInitializeMethods(originalFieldDef, variableTypeRefs, out initializeEarlyMr, out initializeLateMr)) + return false; + + //Make user field public. + originalFieldDef.Attributes &= ~FieldAttributes.Private; + originalFieldDef.Attributes |= FieldAttributes.Public; + + TypeDefinition typeDef = originalFieldDef.DeclaringType; + List insts; + ILProcessor processor; + MethodDefinition injectionMd; + + //InitializeEarly. + injectionMd = typeDef.GetMethod(NetworkBehaviourProcessor.NETWORKINITIALIZE_EARLY_INTERNAL_NAME); + processor = injectionMd.Body.GetILProcessor(); + insts = new List + { + processor.Create(OpCodes.Ldarg_0), //this. + processor.Create(OpCodes.Ldfld, originalFieldDef), + processor.Create(OpCodes.Ldarg_0), //this again for NetworkBehaviour. + processor.Create(OpCodes.Ldc_I4, (int)hash), + processor.Create(OpCodes.Ldc_I4, isSyncObject.ToInt()), + processor.Create(OpCodes.Call, initializeEarlyMr), + }; + processor.InsertFirst(insts); + + //InitializeLate. + injectionMd = typeDef.GetMethod(NetworkBehaviourProcessor.NETWORKINITIALIZE_LATE_INTERNAL_NAME); + processor = injectionMd.Body.GetILProcessor(); + insts = new List + { + processor.Create(OpCodes.Ldarg_0), //this. + processor.Create(OpCodes.Ldfld, originalFieldDef), + processor.Create(initializeLateMr.GetCallOpCode(base.Session), initializeLateMr), + }; + processor.InsertFirst(insts); + + return true; + + } + } +} diff --git a/Assets/FishNet/CodeGenerating/Processing/SyncTypeProcessor.cs.meta b/Assets/FishNet/CodeGenerating/Processing/SyncTypeProcessor.cs.meta new file mode 100644 index 0000000..1ee148f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/SyncTypeProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec95af37f78b9e340b5eaa199c1af94a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Processing/WriterProcessor.cs b/Assets/FishNet/CodeGenerating/Processing/WriterProcessor.cs new file mode 100644 index 0000000..8c11590 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/WriterProcessor.cs @@ -0,0 +1,1195 @@ +using FishNet.CodeGenerating.Extension; +using FishNet.CodeGenerating.Helping.Extension; +using FishNet.CodeGenerating.ILCore; +using FishNet.Object; +using FishNet.Serializing; +using FishNet.Utility; +using FishNet.Utility.Performance; +using MonoFN.Cecil; +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Rocks; +using System; +using System.Collections.Generic; +using SR = System.Reflection; +using UnityDebug = UnityEngine.Debug; + +namespace FishNet.CodeGenerating.Helping +{ + + internal class WriterProcessor : CodegenBase + { + #region Reflection references. + public readonly Dictionary InstancedWriterMethods = new Dictionary(); + public readonly Dictionary StaticWriterMethods = new Dictionary(); + public HashSet AutoPackedMethods = new HashSet(new TypeReferenceComparer()); + + public TypeDefinition GeneratedWriterClassTypeDef; + public MethodDefinition GeneratedWriterOnLoadMethodDef; + #endregion + + #region Misc. + /// + /// TypeReferences which have already had delegates made for. + /// + private HashSet _delegatedTypes = new HashSet(); + #endregion + + #region Const. + /// + /// Namespace to use for generated serializers and delegates. + /// + public const string GENERATED_WRITER_NAMESPACE = "FishNet.Serializing.Generated"; + /// + /// Name to use for generated serializers class. + /// + public const string GENERATED_WRITERS_CLASS_NAME = "GeneratedWriters___Internal"; + /// + /// Attributes to use for generated serializers class. + /// + public const TypeAttributes GENERATED_TYPE_ATTRIBUTES = (TypeAttributes.BeforeFieldInit | TypeAttributes.Class | TypeAttributes.AnsiClass | + TypeAttributes.Public | TypeAttributes.AutoClass | TypeAttributes.Abstract | TypeAttributes.Sealed); + /// + /// Name to use for InitializeOnce method. + /// + public const string INITIALIZEONCE_METHOD_NAME = "InitializeOnce"; + /// + /// Attributes to use for InitializeOnce method within generated serializer classes. + /// + public const MethodAttributes INITIALIZEONCE_METHOD_ATTRIBUTES = (MethodAttributes.Static | MethodAttributes.Private | MethodAttributes.HideBySig); + /// + /// Attritbutes to use for generated serializers. + /// + public const MethodAttributes GENERATED_METHOD_ATTRIBUTES = (MethodAttributes.Static | MethodAttributes.Public | MethodAttributes.HideBySig); + /// + /// Attributes required for custom serializer classes. + /// + public const TypeAttributes CUSTOM_SERIALIZER_TYPEDEF_ATTRIBUTES = (TypeAttributes.Sealed | TypeAttributes.Abstract); + /// + /// Prefix all built-in and user created write methods should begin with. + /// + internal const string CUSTOM_WRITER_PREFIX = "Write"; + /// + /// Types to exclude from being scanned for auto serialization. + /// + public static readonly System.Type[] EXCLUDED_AUTO_SERIALIZER_TYPES = new System.Type[] + { + typeof(NetworkBehaviour) + }; + /// + /// Types within assemblies which begin with these prefixes will not have serializers created for them. + /// + public static readonly string[] EXCLUDED_ASSEMBLY_PREFIXES = new string[] + { + "UnityEngine." + }; + #endregion + + public override bool ImportReferences() => true; + + /// + /// Processes data. To be used after everything else has called ImportReferences. + /// + /// + public bool Process() + { + GeneralHelper gh = base.GetClass(); + + CreateGeneratedWritersClass(); + FindInstancedWriters(); + CreateInstancedWriterExtensions(); + + //Creates class for generated writers, and init on load method. + void CreateGeneratedWritersClass() + { + GeneratedWriterClassTypeDef = gh.GetOrCreateClass(out _, GENERATED_TYPE_ATTRIBUTES, GENERATED_WRITERS_CLASS_NAME, null, WriterProcessor.GENERATED_WRITER_NAMESPACE); + /* If constructor isn't set then try to get or create it + * and also add it to methods if were created. */ + GeneratedWriterOnLoadMethodDef = gh.GetOrCreateMethod(GeneratedWriterClassTypeDef, out _, INITIALIZEONCE_METHOD_ATTRIBUTES, INITIALIZEONCE_METHOD_NAME, base.Module.TypeSystem.Void); + ILProcessor pp = GeneratedWriterOnLoadMethodDef.Body.GetILProcessor(); + pp.Emit(OpCodes.Ret); + gh.CreateRuntimeInitializeOnLoadMethodAttribute(GeneratedWriterOnLoadMethodDef); + } + + //Finds all instanced writers and autopack types. + void FindInstancedWriters() + { + Type pooledWriterType = typeof(PooledWriter); + foreach (SR.MethodInfo methodInfo in pooledWriterType.GetMethods()) + { + if (IsSpecialWriteMethod(methodInfo)) + continue; + bool autoPackMethod; + if (IsIgnoredWriteMethod(methodInfo, out autoPackMethod)) + continue; + + MethodReference methodRef = base.ImportReference(methodInfo); + /* TypeReference for the first parameter in the write method. + * The first parameter will always be the type written. */ + TypeReference typeRef = base.ImportReference(methodRef.Parameters[0].ParameterType); + /* If here all checks pass. */ + AddWriterMethod(typeRef, methodRef, true, true); + if (autoPackMethod) + AutoPackedMethods.Add(typeRef); + } + } + + return true; + } + + /// + /// Returns if a MethodInfo is considered a special write method. + /// Special write methods have declared references within this class, and will not have extensions made for them. + /// + public bool IsSpecialWriteMethod(SR.MethodInfo methodInfo) + { + /* Special methods. */ + if (methodInfo.Name == nameof(PooledWriter.Store)) + return true; + else if (methodInfo.Name == nameof(PooledWriter.WritePackedWhole)) + return true; + else if (methodInfo.Name == nameof(PooledWriter.WriteDictionary)) + return true; + else if (methodInfo.Name == nameof(PooledWriter.WriteList)) + return true; + + return false; + } + + /// + /// Returns if a write method should be ignored. + /// + public bool IsIgnoredWriteMethod(SR.MethodInfo methodInfo, out bool autoPackMethod) + { + autoPackMethod = false; + + if (base.GetClass().HasNotSerializableAttribute(methodInfo)) + return true; + //Method name doesn't start with prefix. + else if (!methodInfo.Name.StartsWith(CUSTOM_WRITER_PREFIX)) + return true; + + SR.ParameterInfo[] parameterInfos = methodInfo.GetParameters(); + /* No parameters or more than 2 parameters. Most Write methods + * will have only 1 parameter but some will have 2 if + * there is a pack option. */ + if (parameterInfos.Length < 1 || parameterInfos.Length > 2) + return true; + /* If two parameters make sure the second parameter + * is a pack parameter. */ + if (parameterInfos.Length == 2) + { + autoPackMethod = (parameterInfos[1].ParameterType == typeof(AutoPackType)); + if (!autoPackMethod) + return true; + } + + return false; + } + + + /// + /// Creates writer extension methods for built-in writers. + /// + private void CreateInstancedWriterExtensions() + { + if (!FishNetILPP.IsFishNetAssembly(base.Session)) + return; + + GeneralHelper gh = base.GetClass(); + WriterProcessor gwh = base.GetClass(); + + //List staticReaders = new List(); + foreach (KeyValuePair item in InstancedWriterMethods) + { + MethodReference instancedWriteMr = item.Value; + if (instancedWriteMr.HasGenericParameters) + continue; + + TypeReference valueTr = instancedWriteMr.Parameters[0].ParameterType; + + MethodDefinition md = new MethodDefinition($"InstancedExtension___{instancedWriteMr.Name}", + WriterProcessor.GENERATED_METHOD_ATTRIBUTES, + base.Module.TypeSystem.Void); + + //Add extension parameter. + ParameterDefinition writerPd = gh.CreateParameter(md, typeof(Writer), "writer"); + //Add parameters needed by instanced writer. + List otherPds = md.CreateParameters(base.Session, instancedWriteMr); + gh.MakeExtensionMethod(md); + // + gwh.GeneratedWriterClassTypeDef.Methods.Add(md); + + ILProcessor processor = md.Body.GetILProcessor(); + //Load writer. + processor.Emit(OpCodes.Ldarg, writerPd); + //Load args. + foreach (ParameterDefinition pd in otherPds) + processor.Emit(OpCodes.Ldarg, pd); + //Call instanced. + processor.Emit(instancedWriteMr.GetCallOpCode(base.Session), instancedWriteMr); + processor.Emit(OpCodes.Ret); + AddWriterMethod(valueTr, md, false, true); + } + + } + + /// + /// Adds typeRef, methodDef to Instanced or Static write methods. + /// + public void AddWriterMethod(TypeReference typeRef, MethodReference methodRef, bool instanced, bool useAdd) + { + Dictionary dict = (instanced) ? + InstancedWriterMethods : StaticWriterMethods; + string fullName = typeRef.GetFullnameWithoutBrackets(); + if (useAdd) + dict.Add(fullName, methodRef); + else + dict[fullName] = methodRef; + } + + /// + /// Removes typeRef from Instanced or Static write methods. + /// + internal void RemoveWriterMethod(TypeReference typeRef, bool instanced) + { + Dictionary dict = (instanced) ? + InstancedWriterMethods : StaticWriterMethods; + string fullName = typeRef.GetFullnameWithoutBrackets(); + dict.Remove(fullName); + } + + /// + /// Returns if typeRef supports auto packing. + /// + public bool IsAutoPackedType(TypeReference typeRef) + { + return AutoPackedMethods.Contains(typeRef); + } + + + /// + /// Creates Write delegates for known static methods. + /// + public void CreateInitializeDelegates() + { + foreach (KeyValuePair item in StaticWriterMethods) + base.GetClass().CreateInitializeDelegate(item.Value); + } + + /// + /// Creates a Write delegate for writeMethodRef and places it within the generated reader/writer constructor. + /// + /// + private void CreateInitializeDelegate(MethodReference writeMr) + { + GeneralHelper gh = base.GetClass(); + WriterImports wi = base.GetClass(); + + /* If a global serializer is declared for the type + * and the method is not the declared serializer then + * exit early. */ + if (IsGlobalSerializer(writeMr.Parameters[1].ParameterType) && writeMr.Name.StartsWith(UtilityConstants.GENERATED_WRITER_PREFIX)) + return; + + //Check if ret already exist, if so remove it; ret will be added on again in this method. + if (GeneratedWriterOnLoadMethodDef.Body.Instructions.Count != 0) + { + int lastIndex = (GeneratedWriterOnLoadMethodDef.Body.Instructions.Count - 1); + if (GeneratedWriterOnLoadMethodDef.Body.Instructions[lastIndex].OpCode == OpCodes.Ret) + GeneratedWriterOnLoadMethodDef.Body.Instructions.RemoveAt(lastIndex); + } + + ILProcessor processor = GeneratedWriterOnLoadMethodDef.Body.GetILProcessor(); + TypeReference dataTypeRef; + dataTypeRef = writeMr.Parameters[1].ParameterType; + + //Check if writer already exist. + if (_delegatedTypes.Contains(dataTypeRef)) + { + base.LogError($"Generic write already created for {dataTypeRef.FullName}."); + return; + } + else + { + _delegatedTypes.Add(dataTypeRef); + } + + /* Create a Action delegate. + * May also be Action delegate + * for packed types. */ + processor.Emit(OpCodes.Ldnull); + processor.Emit(OpCodes.Ldftn, writeMr); + + GenericInstanceType actionGenericInstance; + MethodReference actionConstructorInstanceMethodRef; + bool isAutoPacked = base.GetClass().IsAutoPackedType(dataTypeRef); + + //Generate for auto pack type. + if (isAutoPacked) + { + actionGenericInstance = gh.ActionT3_TypeRef.MakeGenericInstanceType(wi.Writer_TypeRef, dataTypeRef, base.GetClass().AutoPackTypeRef); + actionConstructorInstanceMethodRef = gh.ActionT3Constructor_MethodRef.MakeHostInstanceGeneric(base.Session, actionGenericInstance); + } + //Generate for normal type. + else + { + actionGenericInstance = gh.ActionT2_TypeRef.MakeGenericInstanceType(wi.Writer_TypeRef, dataTypeRef); + actionConstructorInstanceMethodRef = gh.ActionT2Constructor_MethodRef.MakeHostInstanceGeneric(base.Session, actionGenericInstance); + } + + processor.Emit(OpCodes.Newobj, actionConstructorInstanceMethodRef); + //Call delegate to GenericWriter.Write + GenericInstanceType genericInstance = wi.GenericWriter_TypeRef.MakeGenericInstanceType(dataTypeRef); + MethodReference genericWriteMethodRef = (isAutoPacked) ? + wi.GenericWriter_WriteAutoPacked_MethodRef.MakeHostInstanceGeneric(base.Session, genericInstance) : + wi.GenericWriter_WriteUnpacked_MethodRef.MakeHostInstanceGeneric(base.Session, genericInstance); + processor.Emit(OpCodes.Call, genericWriteMethodRef); + + processor.Emit(OpCodes.Ret); + } + + + + /// + /// Returns if typeRef has a serializer. + /// + /// + /// + internal bool HasSerializer(TypeReference typeRef, bool createMissing) + { + bool result = (GetInstancedWriteMethodReference(typeRef) != null) || + (GetStaticWriteMethodReference(typeRef) != null); + + if (!result && createMissing) + { + if (!base.GetClass().HasNonSerializableAttribute(typeRef.CachedResolve(base.Session))) + { + MethodReference methodRef = CreateWriter(typeRef); + result = (methodRef != null); + } + } + + return result; + } + + + #region GetWriterMethodReference. + /// + /// Returns the MethodReference for typeRef. + /// + /// + /// + internal MethodReference GetInstancedWriteMethodReference(TypeReference typeRef) + { + string fullName = typeRef.GetFullnameWithoutBrackets(); + InstancedWriterMethods.TryGetValue(fullName, out MethodReference methodRef); + return methodRef; + } + /// + /// Returns the MethodReference for typeRef. + /// + /// + /// + internal MethodReference GetStaticWriteMethodReference(TypeReference typeRef) + { + string fullName = typeRef.GetFullnameWithoutBrackets(); + StaticWriterMethods.TryGetValue(fullName, out MethodReference methodRef); + return methodRef; + } + + /// + /// Returns the MethodReference for typeRef favoring instanced or static. + /// + /// + /// + /// + internal MethodReference GetWriteMethodReference(TypeReference typeRef) + { + bool favorInstanced = false; + + MethodReference result; + if (favorInstanced) + { + result = GetInstancedWriteMethodReference(typeRef); + if (result == null) + result = GetStaticWriteMethodReference(typeRef); + } + else + { + result = GetStaticWriteMethodReference(typeRef); + if (result == null) + result = GetInstancedWriteMethodReference(typeRef); + } + + return result; + } + /// + /// Gets the write MethodRef for typeRef, or tries to create it if not present. + /// + /// + /// + internal MethodReference GetOrCreateWriteMethodReference(TypeReference typeRef) + { + //Try to get existing writer, if not present make one. + MethodReference writeMethodRef = GetWriteMethodReference(typeRef); + if (writeMethodRef == null) + writeMethodRef = CreateWriter(typeRef); + + //If still null then return could not be generated. + if (writeMethodRef == null) + { + base.LogError($"Could not create serializer for {typeRef.FullName}."); + } + //Otherwise, check if generic and create writes for generic pararameters. + else if (typeRef.IsGenericInstance) + { + GenericInstanceType git = (GenericInstanceType)typeRef; + foreach (TypeReference item in git.GenericArguments) + { + MethodReference result = GetOrCreateWriteMethodReference(item); + if (result == null) + { + base.LogError($"Could not create serializer for {item.FullName}."); + return null; + } + } + } + + return writeMethodRef; + } + #endregion + + + /// + /// Creates a PooledWriter within the body/ and returns its variable index. + /// EG: PooledWriter writer = WriterPool.RetrieveWriter(); + /// + internal VariableDefinition CreatePooledWriter(MethodDefinition methodDef, int length) + { + VariableDefinition resultVd; + List insts = CreatePooledWriter(methodDef, length, out resultVd); + + ILProcessor processor = methodDef.Body.GetILProcessor(); + processor.Add(insts); + return resultVd; + } + /// + /// Creates a PooledWriter within the body/ and returns its variable index. + /// EG: PooledWriter writer = WriterPool.RetrieveWriter(); + /// + /// + /// + /// + internal List CreatePooledWriter(MethodDefinition methodDef, int length, out VariableDefinition resultVd) + { + WriterImports wi = base.GetClass(); + + List insts = new List(); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + resultVd = base.GetClass().CreateVariable(methodDef, wi.PooledWriter_TypeRef); + //If length is specified then pass in length. + if (length > 0) + { + insts.Add(processor.Create(OpCodes.Ldc_I4, length)); + insts.Add(processor.Create(OpCodes.Call, wi.WriterPool_GetWriterLength_MethodRef)); + } + //Use parameter-less method if no length. + else + { + insts.Add(processor.Create(OpCodes.Call, wi.WriterPool_GetWriter_MethodRef)); + } + //Set value to variable definition. + insts.Add(processor.Create(OpCodes.Stloc, resultVd)); + return insts; + } + + + /// + /// Calls Dispose on a PooledWriter. + /// EG: writer.Dispose(); + /// + /// + /// + internal List DisposePooledWriter(MethodDefinition methodDef, VariableDefinition writerDefinition) + { + WriterImports wi = base.GetClass(); + + List insts = new List(); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + insts.Add(processor.Create(OpCodes.Ldloc, writerDefinition)); + insts.Add(processor.Create(wi.PooledWriter_Dispose_MethodRef.GetCallOpCode(base.Session), wi.PooledWriter_Dispose_MethodRef)); + + return insts; + } + + + /// + /// Creates a null check on the second argument using a boolean. + /// + internal void CreateRetOnNull(ILProcessor processor, ParameterDefinition writerParameterDef, ParameterDefinition checkedParameterDef, bool useBool) + { + Instruction endIf = processor.Create(OpCodes.Nop); + //If (value) jmp to endIf. + processor.Emit(OpCodes.Ldarg, checkedParameterDef); + processor.Emit(OpCodes.Brtrue, endIf); + //writer.WriteBool / writer.WritePackedWhole + if (useBool) + CreateWriteBool(processor, writerParameterDef, true); + else + CreateWritePackedWhole(processor, writerParameterDef, -1); + //Exit method. + processor.Emit(OpCodes.Ret); + //End of if check. + processor.Append(endIf); + } + + #region CreateWritePackWhole + /// + /// Creates a call to WritePackWhole with value. + /// + /// + /// + internal void CreateWritePackedWhole(ILProcessor processor, ParameterDefinition writerParameterDef, int value) + { + WriterImports wi = base.GetClass(); + + //Create local int and set it to value. + VariableDefinition intVariableDef = base.GetClass().CreateVariable(processor.Body.Method, typeof(int)); + base.GetClass().SetVariableDefinitionFromInt(processor, intVariableDef, value); + //Writer. + processor.Emit(OpCodes.Ldarg, writerParameterDef); + //Writer.WritePackedWhole(value). + processor.Emit(OpCodes.Ldloc, intVariableDef); + processor.Emit(OpCodes.Conv_U8); + processor.Emit(wi.Writer_WritePackedWhole_MethodRef.GetCallOpCode(base.Session), wi.Writer_WritePackedWhole_MethodRef); + } + /// + /// Creates a call to WritePackWhole with value. + /// + /// + /// + internal void CreateWritePackedWhole(ILProcessor processor, ParameterDefinition writerParameterDef, VariableDefinition value) + { + WriterImports wi = base.GetClass(); + + //Writer. + processor.Emit(OpCodes.Ldarg, writerParameterDef); + //Writer.WritePackedWhole(value). + processor.Emit(OpCodes.Ldloc, value); + processor.Emit(OpCodes.Conv_U8); + processor.Emit(wi.Writer_WritePackedWhole_MethodRef.GetCallOpCode(base.Session), wi.Writer_WritePackedWhole_MethodRef); + } + #endregion + + /// + /// Creates a call to WriteBoolean with value. + /// + /// + /// + /// + internal void CreateWriteBool(ILProcessor processor, ParameterDefinition writerParameterDef, bool value) + { + MethodReference writeBoolMethodRef = GetWriteMethodReference(base.GetClass().GetTypeReference(typeof(bool))); + processor.Emit(OpCodes.Ldarg, writerParameterDef); + int intValue = (value) ? 1 : 0; + processor.Emit(OpCodes.Ldc_I4, intValue); + processor.Emit(writeBoolMethodRef.GetCallOpCode(base.Session), writeBoolMethodRef); + } + + /// + /// Returns if a type should use a declared/custom serializer globally. + /// + public bool IsGlobalSerializer(TypeReference dataTypeRef) + { + return dataTypeRef.CachedResolve(base.Session).HasCustomAttribute(); + } + + /// + /// Creates a Write call on a PooledWriter variable for parameterDef. + /// EG: writer.WriteBool(xxxxx); + /// + internal List CreateWriteInstructions(MethodDefinition methodDef, object pooledWriterDef, ParameterDefinition valueParameterDef, MethodReference writeMr) + { + List insts = new List(); + ILProcessor processor = methodDef.Body.GetILProcessor(); + + if (writeMr != null) + { + bool isGlobalSerializer = IsGlobalSerializer(valueParameterDef.ParameterType); + + if (pooledWriterDef is VariableDefinition) + { + insts.Add(processor.Create(OpCodes.Ldloc, (VariableDefinition)pooledWriterDef)); + } + else if (pooledWriterDef is ParameterDefinition) + { + insts.Add(processor.Create(OpCodes.Ldarg, (ParameterDefinition)pooledWriterDef)); + } + else + { + base.LogError($"{pooledWriterDef.GetType().FullName} is not a valid writerDef. Type must be VariableDefinition or ParameterDefinition."); + return new List(); + } + insts.Add(processor.Create(OpCodes.Ldarg, valueParameterDef)); + //If an auto pack method then insert default value. + if (!isGlobalSerializer && AutoPackedMethods.Contains(valueParameterDef.ParameterType)) + { + AutoPackType packType = base.GetClass().GetDefaultAutoPackType(valueParameterDef.ParameterType); + insts.Add(processor.Create(OpCodes.Ldc_I4, (int)packType)); + } + + TypeReference valueTr = valueParameterDef.ParameterType; + /* If generic then find write class for + * data type. Currently we only support one generic + * for this. */ + if (valueTr.IsGenericInstance) + { + GenericInstanceType git = (GenericInstanceType)valueTr; + TypeReference genericTr = git.GenericArguments[0]; + writeMr = writeMr.GetMethodReference(base.Session, genericTr); + } + + if (isGlobalSerializer) + { + //Switch out to use WriteUnpacked instead. + writeMr = base.GetClass().Writer_WriteUnpacked_MethodRef.GetMethodReference(base.Session, valueTr); + } + + insts.Add(processor.Create(OpCodes.Call, writeMr)); + return insts; + } + else + { + base.LogError($"Writer not found for {valueParameterDef.ParameterType.FullName}."); + return new List(); + } + } + /// + /// Creates a Write call on a PooledWriter variable for parameterDef. + /// EG: writer.WriteBool(xxxxx); + /// + internal void CreateWrite(MethodDefinition methodDef, object writerDef, ParameterDefinition valuePd, MethodReference writeMr) + { + List insts = CreateWriteInstructions(methodDef, writerDef, valuePd, writeMr); + ILProcessor processor = methodDef.Body.GetILProcessor(); + processor.Add(insts); + } + /// + /// Creates a Write call to a writer. + /// EG: StaticClass.WriteBool(xxxxx); + /// + /// + /// + internal void CreateWrite(MethodDefinition writerMd, ParameterDefinition encasingValuePd, FieldDefinition memberValueFd, MethodReference writeMr) + { + if (writeMr != null) + { + bool isGlobalSerializer = (IsGlobalSerializer(memberValueFd.FieldType) || IsGlobalSerializer(encasingValuePd.ParameterType)); + + ILProcessor processor = writerMd.Body.GetILProcessor(); + ParameterDefinition writerPd = writerMd.Parameters[0]; + + /* If generic then find write class for + * data type. Currently we only support one generic + * for this. */ + if (memberValueFd.FieldType.IsGenericInstance) + { + GenericInstanceType git = (GenericInstanceType)memberValueFd.FieldType; + TypeReference genericTr = git.GenericArguments[0]; + writeMr = writeMr.GetMethodReference(base.Session, genericTr); + } + + FieldReference fieldRef = base.GetClass().GetFieldReference(memberValueFd); + processor.Emit(OpCodes.Ldarg, writerPd); + processor.Emit(OpCodes.Ldarg, encasingValuePd); + processor.Emit(OpCodes.Ldfld, fieldRef); + //If an auto pack method then insert default value. + if (!isGlobalSerializer && AutoPackedMethods.Contains(memberValueFd.FieldType)) + { + AutoPackType packType = base.GetClass().GetDefaultAutoPackType(memberValueFd.FieldType); + processor.Emit(OpCodes.Ldc_I4, (int)packType); + } + + /* If a generated write then instead of calling the + * generated write directly call writer.Write of + * the type. + * + * This will reroute to the generic writer, which does add an + * extra step, but this also allows us to decide what writer + * to use. In GenericWriter we can check if a method being set + * as the writer is generated, and if so while another method + * had already been set then favor the other method. + * + * This will favor built-in and user created serializers. This has to be + * done because we cannot check if a user created serializer exist + * across assemblies, but at runtime we can make sure to favor the + * created one as described above. */ + //True if has Write prefix for generated writers. + if (isGlobalSerializer) + { + //Switch out to use WriteUnpacked instead. + TypeReference genericTr = base.ImportReference(memberValueFd.FieldType); + writeMr = base.GetClass().Writer_WriteUnpacked_MethodRef.GetMethodReference(base.Session, genericTr); + } + processor.Emit(OpCodes.Call, writeMr); + } + else + { + base.LogError($"Writer not found for {memberValueFd.FieldType.FullName}."); + } + } + + /// + /// Creates a Write call to a writer. + /// EG: StaticClass.WriteBool(xxxxx); + /// + /// + /// + internal void CreateWrite(MethodDefinition writerMd, ParameterDefinition valuePd, MethodReference getMr, MethodReference writeMr) + { + TypeReference returnTr = base.ImportReference(getMr.ReturnType); + + if (writeMr != null) + { + ILProcessor processor = writerMd.Body.GetILProcessor(); + ParameterDefinition writerPd = writerMd.Parameters[0]; + + /* If generic then find write class for + * data type. Currently we only support one generic + * for this. */ + if (returnTr.IsGenericInstance) + { + GenericInstanceType git = (GenericInstanceType)returnTr; + TypeReference genericTr = git.GenericArguments[0]; + writeMr = writeMr.GetMethodReference(base.Session, genericTr); + } + + processor.Emit(OpCodes.Ldarg, writerPd); + OpCode ldArgOC0 = (valuePd.ParameterType.IsValueType) ? OpCodes.Ldarga : OpCodes.Ldarg; + processor.Emit(ldArgOC0, valuePd); + processor.Emit(OpCodes.Call, getMr); + //If an auto pack method then insert default value. + if (AutoPackedMethods.Contains(returnTr)) + { + AutoPackType packType = base.GetClass().GetDefaultAutoPackType(returnTr); + processor.Emit(OpCodes.Ldc_I4, (int)packType); + } + processor.Emit(OpCodes.Call, writeMr); + } + else + { + base.LogError($"Writer not found for {returnTr.FullName}."); + } + } + + + + #region TypeReference writer generators. + + /// + /// Generates a writer for objectTypeReference if one does not already exist. + /// + /// + /// + internal MethodReference CreateWriter(TypeReference objectTr) + { + MethodReference methodRefResult = null; + TypeDefinition objectTd; + SerializerType serializerType = base.GetClass().GetSerializerType(objectTr, true, out objectTd); + if (serializerType != SerializerType.Invalid) + { + //Array. + if (serializerType == SerializerType.Array) + methodRefResult = CreateArrayWriterMethodReference(objectTr); + //Enum. + else if (serializerType == SerializerType.Enum) + methodRefResult = CreateEnumWriterMethodDefinition(objectTr); + //Dictionary, List, ListCache + else if (serializerType == SerializerType.Dictionary + || serializerType == SerializerType.List) + methodRefResult = CreateGenericCollectionWriterMethodReference(objectTr, serializerType); + //NetworkBehaviour. + else if (serializerType == SerializerType.NetworkBehaviour) + methodRefResult = CreateNetworkBehaviourWriterMethodReference(objectTd); + //Nullable type. + else if (serializerType == SerializerType.Nullable) + methodRefResult = CreateNullableWriterMethodReference(objectTr, objectTd); + //Class or struct. + else if (serializerType == SerializerType.ClassOrStruct) + methodRefResult = CreateClassOrStructWriterMethodDefinition(objectTr); + } + + //If was not created. + if (methodRefResult == null) + RemoveFromStaticWriters(objectTr); + + return methodRefResult; + } + + /// + /// Removes from static writers. + /// + private void RemoveFromStaticWriters(TypeReference tr) + { + base.GetClass().RemoveWriterMethod(tr, false); + } + /// + /// Adds to static writers. + /// + private void AddToStaticWriters(TypeReference tr, MethodReference mr) + { + base.GetClass().AddWriterMethod(tr, mr.CachedResolve(base.Session), false, true); + } + + /// + /// Adds a write for a NetworkBehaviour class type to WriterMethods. + /// + /// + private MethodReference CreateNetworkBehaviourWriterMethodReference(TypeReference objectTr) + { + ObjectHelper oh = base.GetClass(); + + objectTr = base.ImportReference(objectTr.Resolve()); + //All NetworkBehaviour types will simply WriteNetworkBehaviour/ReadNetworkBehaviour. + //Create generated reader/writer class. This class holds all generated reader/writers. + base.GetClass().GetOrCreateClass(out _, GENERATED_TYPE_ATTRIBUTES, GENERATED_WRITERS_CLASS_NAME, null); + + MethodDefinition createdWriterMd = CreateStaticWriterStubMethodDefinition(objectTr); + AddToStaticWriters(objectTr, createdWriterMd); + + ILProcessor processor = createdWriterMd.Body.GetILProcessor(); + + MethodReference writeMethodRef = base.GetClass().GetOrCreateWriteMethodReference(oh.NetworkBehaviour_TypeRef); + //Get parameters for method. + ParameterDefinition writerParameterDef = createdWriterMd.Parameters[0]; + ParameterDefinition classParameterDef = createdWriterMd.Parameters[1]; + + //Load parameters as arguments. + processor.Emit(OpCodes.Ldarg, writerParameterDef); + processor.Emit(OpCodes.Ldarg, classParameterDef); + //writer.WriteNetworkBehaviour(arg1); + processor.Emit(OpCodes.Call, writeMethodRef); + + processor.Emit(OpCodes.Ret); + + return base.ImportReference(createdWriterMd); + } + + /// + /// Gets the length of a collection and writes the value to a variable. + /// + private void CreateCollectionLength(ILProcessor processor, ParameterDefinition collectionParameterDef, VariableDefinition storeVariableDef) + { + processor.Emit(OpCodes.Ldarg, collectionParameterDef); + processor.Emit(OpCodes.Ldlen); + processor.Emit(OpCodes.Conv_I4); + processor.Emit(OpCodes.Stloc, storeVariableDef); + } + + + /// + /// Creates a writer for a class or struct of objectTypeRef. + /// + /// + /// + private MethodReference CreateNullableWriterMethodReference(TypeReference objectTr, TypeDefinition objectTd) + { + WriterProcessor wh = base.GetClass(); + + GenericInstanceType objectGit = objectTr as GenericInstanceType; + TypeReference valueTr = objectGit.GenericArguments[0]; + + //Get the writer for the value. + MethodReference valueWriterMr = wh.GetOrCreateWriteMethodReference(valueTr); + if (valueWriterMr == null) + return null; + + + MethodDefinition tmpMd; + tmpMd = objectTd.GetMethod("get_Value"); + MethodReference genericGetValueMr = tmpMd.MakeHostInstanceGeneric(base.Session, objectGit); + tmpMd = objectTd.GetMethod("get_HasValue"); + MethodReference genericHasValueMr = tmpMd.MakeHostInstanceGeneric(base.Session, objectGit); + + /* Stubs generate Method(Writer writer, T value). */ + MethodDefinition createdWriterMd = CreateStaticWriterStubMethodDefinition(objectTr); + AddToStaticWriters(objectTr, createdWriterMd); + + ILProcessor processor = createdWriterMd.Body.GetILProcessor(); + + //Value parameter. + ParameterDefinition valuePd = createdWriterMd.Parameters[1]; + ParameterDefinition writerPd = createdWriterMd.Parameters[0]; + + //Have to write a new ret on null because nullables use hasValue for null checks. + Instruction afterNullRetInst = processor.Create(OpCodes.Nop); + processor.Emit(OpCodes.Ldarga, valuePd); + processor.Emit(OpCodes.Call, genericHasValueMr); + processor.Emit(OpCodes.Brtrue_S, afterNullRetInst); + wh.CreateWriteBool(processor, writerPd, true); + processor.Emit(OpCodes.Ret); + processor.Append(afterNullRetInst); + + //Code will only execute here and below if not null. + wh.CreateWriteBool(processor, writerPd, false); + + processor.Emit(OpCodes.Ldarg, writerPd); + processor.Emit(OpCodes.Ldarga, valuePd); + processor.Emit(OpCodes.Call, genericGetValueMr); + //If an auto pack method then insert default value. + if (wh.IsAutoPackedType(valueTr)) + { + AutoPackType packType = base.GetClass().GetDefaultAutoPackType(valueTr); + processor.Emit(OpCodes.Ldc_I4, (int)packType); + } + processor.Emit(OpCodes.Call, valueWriterMr); + + processor.Emit(OpCodes.Ret); + return base.ImportReference(createdWriterMd); + } + + + /// + /// Creates a writer for a class or struct of objectTypeRef. + /// + /// + /// + private MethodReference CreateClassOrStructWriterMethodDefinition(TypeReference objectTr) + { + WriterProcessor wh = base.GetClass(); + + /*Stubs generate Method(Writer writer, T value). */ + MethodDefinition createdWriterMd = CreateStaticWriterStubMethodDefinition(objectTr); + AddToStaticWriters(objectTr, createdWriterMd); + ILProcessor processor = createdWriterMd.Body.GetILProcessor(); + + //If not a value type then add a null check. + if (!objectTr.CachedResolve(base.Session).IsValueType) + { + ParameterDefinition writerPd = createdWriterMd.Parameters[0]; + wh.CreateRetOnNull(processor, writerPd, createdWriterMd.Parameters[1], true); + //Code will only execute here and below if not null. + wh.CreateWriteBool(processor, writerPd, false); + } + + //Write all fields for the class or struct. + ParameterDefinition valueParameterDef = createdWriterMd.Parameters[1]; + if (!WriteFieldsAndProperties(createdWriterMd, valueParameterDef, objectTr)) + return null; + + processor.Emit(OpCodes.Ret); + return base.ImportReference(createdWriterMd); + } + + /// + /// Find all fields in type and write them + /// + /// + /// + /// false if fail + private bool WriteFieldsAndProperties(MethodDefinition generatedWriteMd, ParameterDefinition encasingValuePd, TypeReference objectTr) + { + WriterProcessor wh = base.GetClass(); + + //This probably isn't needed but I'm too afraid to remove it. + if (objectTr.Module != base.Module) + objectTr = base.ImportReference(objectTr.CachedResolve(base.Session)); + + //Fields + foreach (FieldDefinition fieldDef in objectTr.FindAllSerializableFields(base.Session))//, WriterHelper.EXCLUDED_AUTO_SERIALIZER_TYPES)) + { + TypeReference tr; + if (fieldDef.FieldType.IsGenericInstance) + { + GenericInstanceType genericTr = (GenericInstanceType)fieldDef.FieldType; + tr = genericTr.GenericArguments[0]; + } + else + { + tr = fieldDef.FieldType; + } + if (GetWriteMethod(fieldDef.FieldType, out MethodReference writeMr)) + wh.CreateWrite(generatedWriteMd, encasingValuePd, fieldDef, writeMr); + } + + //Properties. + foreach (PropertyDefinition propertyDef in objectTr.FindAllSerializableProperties(base.Session + , WriterProcessor.EXCLUDED_AUTO_SERIALIZER_TYPES, WriterProcessor.EXCLUDED_ASSEMBLY_PREFIXES)) + { + if (GetWriteMethod(propertyDef.PropertyType, out MethodReference writerMr)) + { + MethodReference getMr = base.Module.ImportReference(propertyDef.GetMethod); + wh.CreateWrite(generatedWriteMd, encasingValuePd, getMr, writerMr); + } + } + + //Gets or creates writer method and outputs it. Returns true if method is found or created. + bool GetWriteMethod(TypeReference tr, out MethodReference writeMr) + { + tr = base.ImportReference(tr); + writeMr = wh.GetOrCreateWriteMethodReference(tr); + return (writeMr != null); + } + + return true; + } + + + /// + /// Creates a writer for an enum. + /// + /// + /// + private MethodReference CreateEnumWriterMethodDefinition(TypeReference enumTr) + { + WriterProcessor wh = base.GetClass(); + + MethodDefinition createdWriterMd = CreateStaticWriterStubMethodDefinition(enumTr); + AddToStaticWriters(enumTr, createdWriterMd); + + ILProcessor processor = createdWriterMd.Body.GetILProcessor(); + + //Element type for enum. EG: byte int ect + TypeReference underlyingTypeRef = enumTr.CachedResolve(base.Session).GetEnumUnderlyingTypeReference(); + //Method to write that type. + MethodReference underlyingWriterMethodRef = wh.GetOrCreateWriteMethodReference(underlyingTypeRef); + if (underlyingWriterMethodRef == null) + return null; + + ParameterDefinition writerParameterDef = createdWriterMd.Parameters[0]; + ParameterDefinition valueParameterDef = createdWriterMd.Parameters[1]; + //Push writer and value into call. + processor.Emit(OpCodes.Ldarg, writerParameterDef); + processor.Emit(OpCodes.Ldarg, valueParameterDef); + if (wh.IsAutoPackedType(underlyingTypeRef)) + processor.Emit(OpCodes.Ldc_I4, (int)AutoPackType.Packed); + + //writer.WriteXXX(value) + processor.Emit(OpCodes.Call, underlyingWriterMethodRef); + + processor.Emit(OpCodes.Ret); + return base.ImportReference(createdWriterMd); + } + + /// + /// Calls an instanced writer from a static writer. + /// + private void CallInstancedWriter(MethodDefinition staticWriterMd, MethodReference instancedWriterMr) + { + ParameterDefinition writerPd = staticWriterMd.Parameters[0]; + ParameterDefinition valuePd = staticWriterMd.Parameters[1]; + ILProcessor processor = staticWriterMd.Body.GetILProcessor(); + processor.Emit(OpCodes.Ldarg, writerPd); + processor.Emit(OpCodes.Ldarg, valuePd); + processor.Emit(instancedWriterMr.GetCallOpCode(base.Session), instancedWriterMr); + processor.Emit(OpCodes.Ret); + } + + /// + /// Creates a writer for an array. + /// + private MethodReference CreateArrayWriterMethodReference(TypeReference objectTr) + { + WriterImports wi = base.GetClass(); + TypeReference valueTr = objectTr.GetElementType(); + + //Write not found. + if (GetOrCreateWriteMethodReference(valueTr) == null) + return null; + + MethodDefinition createdMd = CreateStaticWriterStubMethodDefinition(objectTr); + AddToStaticWriters(objectTr, createdMd); + + //Find instanced writer to use. + MethodReference instancedWriteMr = wi.Writer_WriteArray_MethodRef; + //Make generic. + GenericInstanceMethod writeGim = instancedWriteMr.MakeGenericMethod(new TypeReference[] { valueTr }); + CallInstancedWriter(createdMd, writeGim); + + return base.ImportReference(createdMd); + } + + /// + /// Creates a writer for a variety of generic collections. + /// + private MethodReference CreateGenericCollectionWriterMethodReference(TypeReference objectTr, SerializerType st) + { + WriterImports wi = base.GetClass(); + //Make value field generic. + GenericInstanceType genericInstance = (GenericInstanceType)objectTr; + base.ImportReference(genericInstance); + TypeReference valueTr = genericInstance.GenericArguments[0]; + + List genericArguments = new List(); + //Make sure all arguments have writers. + foreach (TypeReference gaTr in genericInstance.GenericArguments) + { + MethodReference mr = GetOrCreateWriteMethodReference(gaTr); + //Writer not found. + if (mr == null) + { + base.LogError($"Writer could not be found or created for type {gaTr.FullName}."); + return null; + } + + genericArguments.Add(gaTr); + } + MethodReference valueWriteMr = GetOrCreateWriteMethodReference(valueTr); + if (valueWriteMr == null) + return null; + + MethodDefinition createdMd = CreateStaticWriterStubMethodDefinition(objectTr); + AddToStaticWriters(objectTr, createdMd); + + //Find instanced writer to use. + MethodReference instancedWriteMr; + if (st == SerializerType.Dictionary) + instancedWriteMr = wi.Writer_WriteDictionary_MethodRef; + else if (st == SerializerType.List) + instancedWriteMr = wi.Writer_WriteList_MethodRef; + else + instancedWriteMr = null; + + //Not found. + if (instancedWriteMr == null) + { + base.LogError($"Instanced writer not found for SerializerType {st} on object {objectTr.Name}."); + return null; + } + + //Make generic. + GenericInstanceMethod writeGim = instancedWriteMr.MakeGenericMethod(genericArguments.ToArray()); + CallInstancedWriter(createdMd, writeGim); + + return base.ImportReference(createdMd); + } + + /// + /// Creates a method definition stub for objectTypeRef. + /// + /// + /// + public MethodDefinition CreateStaticWriterStubMethodDefinition(TypeReference objectTypeRef, string nameExtension = WriterProcessor.GENERATED_WRITER_NAMESPACE) + { + string methodName = $"{UtilityConstants.GENERATED_WRITER_PREFIX}{objectTypeRef.FullName}{nameExtension}"; + // create new writer for this type + TypeDefinition writerTypeDef = base.GetClass().GetOrCreateClass(out _, GENERATED_TYPE_ATTRIBUTES, GENERATED_WRITERS_CLASS_NAME, null); + + MethodDefinition writerMethodDef = writerTypeDef.AddMethod(methodName, + MethodAttributes.Public | + MethodAttributes.Static | + MethodAttributes.HideBySig); + + base.GetClass().CreateParameter(writerMethodDef, base.GetClass().Writer_TypeRef, "writer"); + base.GetClass().CreateParameter(writerMethodDef, objectTypeRef, "value"); + base.GetClass().MakeExtensionMethod(writerMethodDef); + writerMethodDef.Body.InitLocals = true; + + return writerMethodDef; + } + #endregion + + } +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Processing/WriterProcessor.cs.meta b/Assets/FishNet/CodeGenerating/Processing/WriterProcessor.cs.meta new file mode 100644 index 0000000..9ba1d8a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Processing/WriterProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2a4021bd44dc40f47abb494e0a4326f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/Unity.FishNet.CodeGen.asmdef b/Assets/FishNet/CodeGenerating/Unity.FishNet.CodeGen.asmdef new file mode 100644 index 0000000..9aa9b97 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Unity.FishNet.CodeGen.asmdef @@ -0,0 +1,20 @@ +{ + "name": "Unity.FishNet.Codegen", + "rootNamespace": "", + "references": [ + "FishNet.Runtime", + "FishNet.Codegen.Cecil", + "GameKit.Dependencies" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": true, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/Unity.FishNet.CodeGen.asmdef.meta b/Assets/FishNet/CodeGenerating/Unity.FishNet.CodeGen.asmdef.meta new file mode 100644 index 0000000..a6d9d76 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/Unity.FishNet.CodeGen.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9341dc36b33c3984e97b22dac619ca50 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4.meta new file mode 100644 index 0000000..c4b0e13 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d0397844cfd0974f8ee136097d11380 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Directory.Build.props b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Directory.Build.props new file mode 100644 index 0000000..ee63f7a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Directory.Build.props @@ -0,0 +1,30 @@ + + + false + false + false + Debug;Release + true + true + $(MSBuildThisFileDirectory)\cecil.snk + $(DefineConstants);NET_CORE + + + + true + + + + + + + + + + + + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), Mono.Cecil.overrides))\Mono.Cecil.overrides + + + diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Directory.Build.props.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Directory.Build.props.meta new file mode 100644 index 0000000..6f127c1 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Directory.Build.props.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c3a066bef0608d24987201601e20a905 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/LICENSE.txt b/Assets/FishNet/CodeGenerating/cecil-0.11.4/LICENSE.txt new file mode 100644 index 0000000..afd0ae6 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/LICENSE.txt @@ -0,0 +1,21 @@ +Copyright (c) 2008 - 2015 Jb Evain +Copyright (c) 2008 - 2011 Novell, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/LICENSE.txt.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/LICENSE.txt.meta new file mode 100644 index 0000000..da1734e --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/LICENSE.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 65323af257ddec3409ed36503b853604 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil.meta new file mode 100644 index 0000000..47afd8d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 23bfd4374c8423f4ebf6716985b8c720 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Code.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Code.cs new file mode 100644 index 0000000..ce5c6e0 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Code.cs @@ -0,0 +1,234 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil.Cil { + + public enum Code { + Nop, + Break, + Ldarg_0, + Ldarg_1, + Ldarg_2, + Ldarg_3, + Ldloc_0, + Ldloc_1, + Ldloc_2, + Ldloc_3, + Stloc_0, + Stloc_1, + Stloc_2, + Stloc_3, + Ldarg_S, + Ldarga_S, + Starg_S, + Ldloc_S, + Ldloca_S, + Stloc_S, + Ldnull, + Ldc_I4_M1, + Ldc_I4_0, + Ldc_I4_1, + Ldc_I4_2, + Ldc_I4_3, + Ldc_I4_4, + Ldc_I4_5, + Ldc_I4_6, + Ldc_I4_7, + Ldc_I4_8, + Ldc_I4_S, + Ldc_I4, + Ldc_I8, + Ldc_R4, + Ldc_R8, + Dup, + Pop, + Jmp, + Call, + Calli, + Ret, + Br_S, + Brfalse_S, + Brtrue_S, + Beq_S, + Bge_S, + Bgt_S, + Ble_S, + Blt_S, + Bne_Un_S, + Bge_Un_S, + Bgt_Un_S, + Ble_Un_S, + Blt_Un_S, + Br, + Brfalse, + Brtrue, + Beq, + Bge, + Bgt, + Ble, + Blt, + Bne_Un, + Bge_Un, + Bgt_Un, + Ble_Un, + Blt_Un, + Switch, + Ldind_I1, + Ldind_U1, + Ldind_I2, + Ldind_U2, + Ldind_I4, + Ldind_U4, + Ldind_I8, + Ldind_I, + Ldind_R4, + Ldind_R8, + Ldind_Ref, + Stind_Ref, + Stind_I1, + Stind_I2, + Stind_I4, + Stind_I8, + Stind_R4, + Stind_R8, + Add, + Sub, + Mul, + Div, + Div_Un, + Rem, + Rem_Un, + And, + Or, + Xor, + Shl, + Shr, + Shr_Un, + Neg, + Not, + Conv_I1, + Conv_I2, + Conv_I4, + Conv_I8, + Conv_R4, + Conv_R8, + Conv_U4, + Conv_U8, + Callvirt, + Cpobj, + Ldobj, + Ldstr, + Newobj, + Castclass, + Isinst, + Conv_R_Un, + Unbox, + Throw, + Ldfld, + Ldflda, + Stfld, + Ldsfld, + Ldsflda, + Stsfld, + Stobj, + Conv_Ovf_I1_Un, + Conv_Ovf_I2_Un, + Conv_Ovf_I4_Un, + Conv_Ovf_I8_Un, + Conv_Ovf_U1_Un, + Conv_Ovf_U2_Un, + Conv_Ovf_U4_Un, + Conv_Ovf_U8_Un, + Conv_Ovf_I_Un, + Conv_Ovf_U_Un, + Box, + Newarr, + Ldlen, + Ldelema, + Ldelem_I1, + Ldelem_U1, + Ldelem_I2, + Ldelem_U2, + Ldelem_I4, + Ldelem_U4, + Ldelem_I8, + Ldelem_I, + Ldelem_R4, + Ldelem_R8, + Ldelem_Ref, + Stelem_I, + Stelem_I1, + Stelem_I2, + Stelem_I4, + Stelem_I8, + Stelem_R4, + Stelem_R8, + Stelem_Ref, + Ldelem_Any, + Stelem_Any, + Unbox_Any, + Conv_Ovf_I1, + Conv_Ovf_U1, + Conv_Ovf_I2, + Conv_Ovf_U2, + Conv_Ovf_I4, + Conv_Ovf_U4, + Conv_Ovf_I8, + Conv_Ovf_U8, + Refanyval, + Ckfinite, + Mkrefany, + Ldtoken, + Conv_U2, + Conv_U1, + Conv_I, + Conv_Ovf_I, + Conv_Ovf_U, + Add_Ovf, + Add_Ovf_Un, + Mul_Ovf, + Mul_Ovf_Un, + Sub_Ovf, + Sub_Ovf_Un, + Endfinally, + Leave, + Leave_S, + Stind_I, + Conv_U, + Arglist, + Ceq, + Cgt, + Cgt_Un, + Clt, + Clt_Un, + Ldftn, + Ldvirtftn, + Ldarg, + Ldarga, + Starg, + Ldloc, + Ldloca, + Stloc, + Localloc, + Endfilter, + Unaligned, + Volatile, + Tail, + Initobj, + Constrained, + Cpblk, + Initblk, + No, + Rethrow, + Sizeof, + Refanytype, + Readonly, + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Code.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Code.cs.meta new file mode 100644 index 0000000..087491a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Code.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2619210c5ef352b4aac70d8e5fab7a43 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeReader.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeReader.cs new file mode 100644 index 0000000..206b49a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeReader.cs @@ -0,0 +1,663 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.PE; +using MonoFN.Collections.Generic; +using System; + +namespace MonoFN.Cecil.Cil { + + sealed class CodeReader : BinaryStreamReader { + + readonly internal MetadataReader reader; + + int start; + + MethodDefinition method; + MethodBody body; + + int Offset { + get { return Position - start; } + } + + public CodeReader (MetadataReader reader) + : base (reader.image.Stream.value) + { + this.reader = reader; + } + + public int MoveTo (MethodDefinition method) + { + this.method = method; + this.reader.context = method; + var position = this.Position; + this.Position = (int)reader.image.ResolveVirtualAddress ((uint)method.RVA); + return position; + } + + public void MoveBackTo (int position) + { + this.reader.context = null; + this.Position = position; + } + + public MethodBody ReadMethodBody (MethodDefinition method) + { + var position = MoveTo (method); + this.body = new MethodBody (method); + + ReadMethodBody (); + + MoveBackTo (position); + return this.body; + } + + public int ReadCodeSize (MethodDefinition method) + { + var position = MoveTo (method); + + var code_size = ReadCodeSize (); + + MoveBackTo (position); + return code_size; + } + + int ReadCodeSize () + { + var flags = ReadByte (); + switch (flags & 0x3) { + case 0x2: // tiny + return flags >> 2; + case 0x3: // fat + Advance (-1 + 2 + 2); // go back, 2 bytes flags, 2 bytes stack size + return (int)ReadUInt32 (); + default: + throw new InvalidOperationException (); + } + } + + void ReadMethodBody () + { + var flags = ReadByte (); + switch (flags & 0x3) { + case 0x2: // tiny + body.code_size = flags >> 2; + body.MaxStackSize = 8; + ReadCode (); + break; + case 0x3: // fat + Advance (-1); + ReadFatMethod (); + break; + default: + throw new InvalidOperationException (); + } + + var symbol_reader = reader.module.symbol_reader; + + if (symbol_reader != null && method.debug_info == null) + method.debug_info = symbol_reader.Read (method); + + if (method.debug_info != null) + ReadDebugInfo (); + } + + void ReadFatMethod () + { + var flags = ReadUInt16 (); + body.max_stack_size = ReadUInt16 (); + body.code_size = (int)ReadUInt32 (); + body.local_var_token = new MetadataToken (ReadUInt32 ()); + body.init_locals = (flags & 0x10) != 0; + + if (body.local_var_token.RID != 0) + body.variables = ReadVariables (body.local_var_token); + + ReadCode (); + + if ((flags & 0x8) != 0) + ReadSection (); + } + + public VariableDefinitionCollection ReadVariables (MetadataToken local_var_token) + { + var position = reader.position; + var variables = reader.ReadVariables (local_var_token, method); + reader.position = position; + + return variables; + } + + void ReadCode () + { + start = Position; + var code_size = body.code_size; + + if (code_size < 0 || Length <= (uint)(code_size + Position)) + code_size = 0; + + var end = start + code_size; + var instructions = body.instructions = new InstructionCollection (method, (code_size + 1) / 2); + + while (Position < end) { + var offset = Position - start; + var opcode = ReadOpCode (); + var current = new Instruction (offset, opcode); + + if (opcode.OperandType != OperandType.InlineNone) + current.operand = ReadOperand (current); + + instructions.Add (current); + } + + ResolveBranches (instructions); + } + + OpCode ReadOpCode () + { + var il_opcode = ReadByte (); + return il_opcode != 0xfe + ? OpCodes.OneByteOpCode [il_opcode] + : OpCodes.TwoBytesOpCode [ReadByte ()]; + } + + object ReadOperand (Instruction instruction) + { + switch (instruction.opcode.OperandType) { + case OperandType.InlineSwitch: + var length = ReadInt32 (); + var base_offset = Offset + (4 * length); + var branches = new int [length]; + for (int i = 0; i < length; i++) + branches [i] = base_offset + ReadInt32 (); + return branches; + case OperandType.ShortInlineBrTarget: + return ReadSByte () + Offset; + case OperandType.InlineBrTarget: + return ReadInt32 () + Offset; + case OperandType.ShortInlineI: + if (instruction.opcode == OpCodes.Ldc_I4_S) + return ReadSByte (); + + return ReadByte (); + case OperandType.InlineI: + return ReadInt32 (); + case OperandType.ShortInlineR: + return ReadSingle (); + case OperandType.InlineR: + return ReadDouble (); + case OperandType.InlineI8: + return ReadInt64 (); + case OperandType.ShortInlineVar: + return GetVariable (ReadByte ()); + case OperandType.InlineVar: + return GetVariable (ReadUInt16 ()); + case OperandType.ShortInlineArg: + return GetParameter (ReadByte ()); + case OperandType.InlineArg: + return GetParameter (ReadUInt16 ()); + case OperandType.InlineSig: + return GetCallSite (ReadToken ()); + case OperandType.InlineString: + return GetString (ReadToken ()); + case OperandType.InlineTok: + case OperandType.InlineType: + case OperandType.InlineMethod: + case OperandType.InlineField: + return reader.LookupToken (ReadToken ()); + default: + throw new NotSupportedException (); + } + } + + public string GetString (MetadataToken token) + { + return reader.image.UserStringHeap.Read (token.RID); + } + + public ParameterDefinition GetParameter (int index) + { + return body.GetParameter (index); + } + + public VariableDefinition GetVariable (int index) + { + return body.GetVariable (index); + } + + public CallSite GetCallSite (MetadataToken token) + { + return reader.ReadCallSite (token); + } + + void ResolveBranches (Collection instructions) + { + var items = instructions.items; + var size = instructions.size; + + for (int i = 0; i < size; i++) { + var instruction = items [i]; + switch (instruction.opcode.OperandType) { + case OperandType.ShortInlineBrTarget: + case OperandType.InlineBrTarget: + instruction.operand = GetInstruction ((int)instruction.operand); + break; + case OperandType.InlineSwitch: + var offsets = (int [])instruction.operand; + var branches = new Instruction [offsets.Length]; + for (int j = 0; j < offsets.Length; j++) + branches [j] = GetInstruction (offsets [j]); + + instruction.operand = branches; + break; + } + } + } + + Instruction GetInstruction (int offset) + { + return GetInstruction (body.Instructions, offset); + } + + static Instruction GetInstruction (Collection instructions, int offset) + { + var size = instructions.size; + var items = instructions.items; + if (offset < 0 || offset > items [size - 1].offset) + return null; + + int min = 0; + int max = size - 1; + while (min <= max) { + int mid = min + ((max - min) / 2); + var instruction = items [mid]; + var instruction_offset = instruction.offset; + + if (offset == instruction_offset) + return instruction; + + if (offset < instruction_offset) + max = mid - 1; + else + min = mid + 1; + } + + return null; + } + + void ReadSection () + { + Align (4); + + const byte fat_format = 0x40; + const byte more_sects = 0x80; + + var flags = ReadByte (); + if ((flags & fat_format) == 0) + ReadSmallSection (); + else + ReadFatSection (); + + if ((flags & more_sects) != 0) + ReadSection (); + } + + void ReadSmallSection () + { + var count = ReadByte () / 12; + Advance (2); + + ReadExceptionHandlers ( + count, + () => (int)ReadUInt16 (), + () => (int)ReadByte ()); + } + + void ReadFatSection () + { + Advance (-1); + var count = (ReadInt32 () >> 8) / 24; + + ReadExceptionHandlers ( + count, + ReadInt32, + ReadInt32); + } + + // inline ? + void ReadExceptionHandlers (int count, Func read_entry, Func read_length) + { + for (int i = 0; i < count; i++) { + var handler = new ExceptionHandler ( + (ExceptionHandlerType)(read_entry () & 0x7)); + + handler.TryStart = GetInstruction (read_entry ()); + handler.TryEnd = GetInstruction (handler.TryStart.Offset + read_length ()); + + handler.HandlerStart = GetInstruction (read_entry ()); + handler.HandlerEnd = GetInstruction (handler.HandlerStart.Offset + read_length ()); + + ReadExceptionHandlerSpecific (handler); + + this.body.ExceptionHandlers.Add (handler); + } + } + + void ReadExceptionHandlerSpecific (ExceptionHandler handler) + { + switch (handler.HandlerType) { + case ExceptionHandlerType.Catch: + handler.CatchType = (TypeReference)reader.LookupToken (ReadToken ()); + break; + case ExceptionHandlerType.Filter: + handler.FilterStart = GetInstruction (ReadInt32 ()); + break; + default: + Advance (4); + break; + } + } + + public MetadataToken ReadToken () + { + return new MetadataToken (ReadUInt32 ()); + } + + void ReadDebugInfo () + { + if (method.debug_info.sequence_points != null) + ReadSequencePoints (); + + if (method.debug_info.scope != null) + ReadScope (method.debug_info.scope); + + if (method.custom_infos != null) + ReadCustomDebugInformations (method); + } + + void ReadCustomDebugInformations (MethodDefinition method) + { + var custom_infos = method.custom_infos; + + for (int i = 0; i < custom_infos.Count; i++) { + var state_machine_scope = custom_infos [i] as StateMachineScopeDebugInformation; + if (state_machine_scope != null) + ReadStateMachineScope (state_machine_scope); + + var async_method = custom_infos [i] as AsyncMethodBodyDebugInformation; + if (async_method != null) + ReadAsyncMethodBody (async_method); + } + } + + void ReadAsyncMethodBody (AsyncMethodBodyDebugInformation async_method) + { + if (async_method.catch_handler.Offset > -1) + async_method.catch_handler = new InstructionOffset (GetInstruction (async_method.catch_handler.Offset)); + + if (!async_method.yields.IsNullOrEmpty ()) + for (int i = 0; i < async_method.yields.Count; i++) + async_method.yields [i] = new InstructionOffset (GetInstruction (async_method.yields [i].Offset)); + + if (!async_method.resumes.IsNullOrEmpty ()) + for (int i = 0; i < async_method.resumes.Count; i++) + async_method.resumes [i] = new InstructionOffset (GetInstruction (async_method.resumes [i].Offset)); + } + + void ReadStateMachineScope (StateMachineScopeDebugInformation state_machine_scope) + { + if (state_machine_scope.scopes.IsNullOrEmpty ()) + return; + + foreach (var scope in state_machine_scope.scopes) { + scope.start = new InstructionOffset (GetInstruction (scope.start.Offset)); + + var end_instruction = GetInstruction (scope.end.Offset); + scope.end = end_instruction == null + ? new InstructionOffset () + : new InstructionOffset (end_instruction); + } + } + + void ReadSequencePoints () + { + var symbol = method.debug_info; + + for (int i = 0; i < symbol.sequence_points.Count; i++) { + var sequence_point = symbol.sequence_points [i]; + var instruction = GetInstruction (sequence_point.Offset); + if (instruction != null) + sequence_point.offset = new InstructionOffset (instruction); + } + } + + void ReadScopes (Collection scopes) + { + for (int i = 0; i < scopes.Count; i++) + ReadScope (scopes [i]); + } + + void ReadScope (ScopeDebugInformation scope) + { + var start_instruction = GetInstruction (scope.Start.Offset); + if (start_instruction != null) + scope.Start = new InstructionOffset (start_instruction); + + var end_instruction = GetInstruction (scope.End.Offset); + scope.End = end_instruction != null + ? new InstructionOffset (end_instruction) + : new InstructionOffset (); + + if (!scope.variables.IsNullOrEmpty ()) { + for (int i = 0; i < scope.variables.Count; i++) { + var variable_info = scope.variables [i]; + var variable = GetVariable (variable_info.Index); + if (variable != null) + variable_info.index = new VariableIndex (variable); + } + } + + if (!scope.scopes.IsNullOrEmpty ()) + ReadScopes (scope.scopes); + } + + public ByteBuffer PatchRawMethodBody (MethodDefinition method, CodeWriter writer, out int code_size, out MetadataToken local_var_token) + { + var position = MoveTo (method); + + var buffer = new ByteBuffer (); + + var flags = ReadByte (); + + switch (flags & 0x3) { + case 0x2: // tiny + buffer.WriteByte (flags); + local_var_token = MetadataToken.Zero; + code_size = flags >> 2; + PatchRawCode (buffer, code_size, writer); + break; + case 0x3: // fat + Advance (-1); + PatchRawFatMethod (buffer, writer, out code_size, out local_var_token); + break; + default: + throw new NotSupportedException (); + } + + MoveBackTo (position); + + return buffer; + } + + void PatchRawFatMethod (ByteBuffer buffer, CodeWriter writer, out int code_size, out MetadataToken local_var_token) + { + var flags = ReadUInt16 (); + buffer.WriteUInt16 (flags); + buffer.WriteUInt16 (ReadUInt16 ()); + code_size = ReadInt32 (); + buffer.WriteInt32 (code_size); + local_var_token = ReadToken (); + + if (local_var_token.RID > 0) { + var variables = ReadVariables (local_var_token); + buffer.WriteUInt32 (variables != null + ? writer.GetStandAloneSignature (variables).ToUInt32 () + : 0); + } else + buffer.WriteUInt32 (0); + + PatchRawCode (buffer, code_size, writer); + + if ((flags & 0x8) != 0) + PatchRawSection (buffer, writer.metadata); + } + + void PatchRawCode (ByteBuffer buffer, int code_size, CodeWriter writer) + { + var metadata = writer.metadata; + buffer.WriteBytes (ReadBytes (code_size)); + var end = buffer.position; + buffer.position -= code_size; + + while (buffer.position < end) { + OpCode opcode; + var il_opcode = buffer.ReadByte (); + if (il_opcode != 0xfe) { + opcode = OpCodes.OneByteOpCode [il_opcode]; + } else { + var il_opcode2 = buffer.ReadByte (); + opcode = OpCodes.TwoBytesOpCode [il_opcode2]; + } + + switch (opcode.OperandType) { + case OperandType.ShortInlineI: + case OperandType.ShortInlineBrTarget: + case OperandType.ShortInlineVar: + case OperandType.ShortInlineArg: + buffer.position += 1; + break; + case OperandType.InlineVar: + case OperandType.InlineArg: + buffer.position += 2; + break; + case OperandType.InlineBrTarget: + case OperandType.ShortInlineR: + case OperandType.InlineI: + buffer.position += 4; + break; + case OperandType.InlineI8: + case OperandType.InlineR: + buffer.position += 8; + break; + case OperandType.InlineSwitch: + var length = buffer.ReadInt32 (); + buffer.position += length * 4; + break; + case OperandType.InlineString: + var @string = GetString (new MetadataToken (buffer.ReadUInt32 ())); + buffer.position -= 4; + buffer.WriteUInt32 ( + new MetadataToken ( + TokenType.String, + metadata.user_string_heap.GetStringIndex (@string)).ToUInt32 ()); + break; + case OperandType.InlineSig: + var call_site = GetCallSite (new MetadataToken (buffer.ReadUInt32 ())); + buffer.position -= 4; + buffer.WriteUInt32 (writer.GetStandAloneSignature (call_site).ToUInt32 ()); + break; + case OperandType.InlineTok: + case OperandType.InlineType: + case OperandType.InlineMethod: + case OperandType.InlineField: + var provider = reader.LookupToken (new MetadataToken (buffer.ReadUInt32 ())); + buffer.position -= 4; + buffer.WriteUInt32 (metadata.LookupToken (provider).ToUInt32 ()); + break; + } + } + } + + void PatchRawSection (ByteBuffer buffer, MetadataBuilder metadata) + { + var position = Position; + Align (4); + buffer.WriteBytes (Position - position); + + const byte fat_format = 0x40; + const byte more_sects = 0x80; + + var flags = ReadByte (); + if ((flags & fat_format) == 0) { + buffer.WriteByte (flags); + PatchRawSmallSection (buffer, metadata); + } else + PatchRawFatSection (buffer, metadata); + + if ((flags & more_sects) != 0) + PatchRawSection (buffer, metadata); + } + + void PatchRawSmallSection (ByteBuffer buffer, MetadataBuilder metadata) + { + var length = ReadByte (); + buffer.WriteByte (length); + Advance (2); + + buffer.WriteUInt16 (0); + + var count = length / 12; + + PatchRawExceptionHandlers (buffer, metadata, count, false); + } + + void PatchRawFatSection (ByteBuffer buffer, MetadataBuilder metadata) + { + Advance (-1); + var length = ReadInt32 (); + buffer.WriteInt32 (length); + + var count = (length >> 8) / 24; + + PatchRawExceptionHandlers (buffer, metadata, count, true); + } + + void PatchRawExceptionHandlers (ByteBuffer buffer, MetadataBuilder metadata, int count, bool fat_entry) + { + const int fat_entry_size = 16; + const int small_entry_size = 6; + + for (int i = 0; i < count; i++) { + ExceptionHandlerType handler_type; + if (fat_entry) { + var type = ReadUInt32 (); + handler_type = (ExceptionHandlerType)(type & 0x7); + buffer.WriteUInt32 (type); + } else { + var type = ReadUInt16 (); + handler_type = (ExceptionHandlerType)(type & 0x7); + buffer.WriteUInt16 (type); + } + + buffer.WriteBytes (ReadBytes (fat_entry ? fat_entry_size : small_entry_size)); + + switch (handler_type) { + case ExceptionHandlerType.Catch: + var exception = reader.LookupToken (ReadToken ()); + buffer.WriteUInt32 (metadata.LookupToken (exception).ToUInt32 ()); + break; + default: + buffer.WriteUInt32 (ReadUInt32 ()); + break; + } + } + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeReader.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeReader.cs.meta new file mode 100644 index 0000000..4bf35a7 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeReader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 451f6a2407c53554f9a16eeb62d806ce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeWriter.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeWriter.cs new file mode 100644 index 0000000..e7126e8 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeWriter.cs @@ -0,0 +1,651 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Metadata; +using MonoFN.Cecil.PE; +using MonoFN.Collections.Generic; +using System; +using System.Collections.Generic; +using RVA = System.UInt32; + +namespace MonoFN.Cecil.Cil { + + sealed class CodeWriter : ByteBuffer { + + readonly RVA code_base; + internal readonly MetadataBuilder metadata; + readonly Dictionary standalone_signatures; + readonly Dictionary tiny_method_bodies; + + MethodBody body; + + public CodeWriter (MetadataBuilder metadata) + : base (0) + { + this.code_base = metadata.text_map.GetNextRVA (TextSegment.CLIHeader); + this.metadata = metadata; + this.standalone_signatures = new Dictionary (); + this.tiny_method_bodies = new Dictionary (new ByteBufferEqualityComparer ()); + } + + public RVA WriteMethodBody (MethodDefinition method) + { + RVA rva; + + if (IsUnresolved (method)) { + if (method.rva == 0) + return 0; + + rva = WriteUnresolvedMethodBody (method); + } else { + if (IsEmptyMethodBody (method.Body)) + return 0; + + rva = WriteResolvedMethodBody (method); + } + + return rva; + } + + static bool IsEmptyMethodBody (MethodBody body) + { + return body.instructions.IsNullOrEmpty () + && body.variables.IsNullOrEmpty (); + } + + static bool IsUnresolved (MethodDefinition method) + { + return method.HasBody && method.HasImage && method.body == null; + } + + RVA WriteUnresolvedMethodBody (MethodDefinition method) + { + var code_reader = metadata.module.reader.code; + + int code_size; + MetadataToken local_var_token; + var raw_body = code_reader.PatchRawMethodBody (method, this, out code_size, out local_var_token); + var fat_header = (raw_body.buffer [0] & 0x3) == 0x3; + if (fat_header) + Align (4); + + var rva = BeginMethod (); + + if (fat_header || !GetOrMapTinyMethodBody (raw_body, ref rva)) { + WriteBytes (raw_body); + } + + if (method.debug_info == null) + return rva; + + var symbol_writer = metadata.symbol_writer; + if (symbol_writer != null) { + method.debug_info.code_size = code_size; + method.debug_info.local_var_token = local_var_token; + symbol_writer.Write (method.debug_info); + } + + return rva; + } + + RVA WriteResolvedMethodBody (MethodDefinition method) + { + RVA rva; + + body = method.Body; + ComputeHeader (); + if (RequiresFatHeader ()) { + Align (4); + rva = BeginMethod (); + WriteFatHeader (); + WriteInstructions (); + + if (body.HasExceptionHandlers) + WriteExceptionHandlers (); + } else { + rva = BeginMethod (); + WriteByte ((byte)(0x2 | (body.CodeSize << 2))); // tiny + WriteInstructions (); + + var start_position = (int)(rva - code_base); + var body_size = position - start_position; + var body_bytes = new byte [body_size]; + + Array.Copy (buffer, start_position, body_bytes, 0, body_size); + + if (GetOrMapTinyMethodBody (new ByteBuffer (body_bytes), ref rva)) + position = start_position; + } + + var symbol_writer = metadata.symbol_writer; + if (symbol_writer != null && method.debug_info != null) { + method.debug_info.code_size = body.CodeSize; + method.debug_info.local_var_token = body.local_var_token; + symbol_writer.Write (method.debug_info); + } + + return rva; + } + + bool GetOrMapTinyMethodBody (ByteBuffer body, ref RVA rva) + { + RVA existing_rva; + if (tiny_method_bodies.TryGetValue (body, out existing_rva)) { + rva = existing_rva; + return true; + } + + tiny_method_bodies.Add (body, rva); + return false; + } + + void WriteFatHeader () + { + var body = this.body; + byte flags = 0x3; // fat + if (body.InitLocals) + flags |= 0x10; // init locals + if (body.HasExceptionHandlers) + flags |= 0x8; // more sections + + WriteByte (flags); + WriteByte (0x30); + WriteInt16 ((short)body.max_stack_size); + WriteInt32 (body.code_size); + body.local_var_token = body.HasVariables + ? GetStandAloneSignature (body.Variables) + : MetadataToken.Zero; + WriteMetadataToken (body.local_var_token); + } + + void WriteInstructions () + { + var instructions = body.Instructions; + var items = instructions.items; + var size = instructions.size; + + for (int i = 0; i < size; i++) { + var instruction = items [i]; + WriteOpCode (instruction.opcode); + WriteOperand (instruction); + } + } + + void WriteOpCode (OpCode opcode) + { + if (opcode.Size == 1) { + WriteByte (opcode.Op2); + } else { + WriteByte (opcode.Op1); + WriteByte (opcode.Op2); + } + } + + void WriteOperand (Instruction instruction) + { + var opcode = instruction.opcode; + var operand_type = opcode.OperandType; + if (operand_type == OperandType.InlineNone) + return; + + var operand = instruction.operand; + if (operand == null && !(operand_type == OperandType.InlineBrTarget || operand_type == OperandType.ShortInlineBrTarget)) { + throw new ArgumentException (); + } + + switch (operand_type) { + case OperandType.InlineSwitch: { + var targets = (Instruction [])operand; + WriteInt32 (targets.Length); + var diff = instruction.Offset + opcode.Size + (4 * (targets.Length + 1)); + for (int i = 0; i < targets.Length; i++) + WriteInt32 (GetTargetOffset (targets [i]) - diff); + break; + } + case OperandType.ShortInlineBrTarget: { + var target = (Instruction)operand; + var offset = target != null ? GetTargetOffset (target) : body.code_size; + WriteSByte ((sbyte)(offset - (instruction.Offset + opcode.Size + 1))); + break; + } + case OperandType.InlineBrTarget: { + var target = (Instruction)operand; + var offset = target != null ? GetTargetOffset (target) : body.code_size; + WriteInt32 (offset - (instruction.Offset + opcode.Size + 4)); + break; + } + case OperandType.ShortInlineVar: + WriteByte ((byte)GetVariableIndex ((VariableDefinition)operand)); + break; + case OperandType.ShortInlineArg: + WriteByte ((byte)GetParameterIndex ((ParameterDefinition)operand)); + break; + case OperandType.InlineVar: + WriteInt16 ((short)GetVariableIndex ((VariableDefinition)operand)); + break; + case OperandType.InlineArg: + WriteInt16 ((short)GetParameterIndex ((ParameterDefinition)operand)); + break; + case OperandType.InlineSig: + WriteMetadataToken (GetStandAloneSignature ((CallSite)operand)); + break; + case OperandType.ShortInlineI: + if (opcode == OpCodes.Ldc_I4_S) + WriteSByte ((sbyte)operand); + else + WriteByte ((byte)operand); + break; + case OperandType.InlineI: + WriteInt32 ((int)operand); + break; + case OperandType.InlineI8: + WriteInt64 ((long)operand); + break; + case OperandType.ShortInlineR: + WriteSingle ((float)operand); + break; + case OperandType.InlineR: + WriteDouble ((double)operand); + break; + case OperandType.InlineString: + WriteMetadataToken ( + new MetadataToken ( + TokenType.String, + GetUserStringIndex ((string)operand))); + break; + case OperandType.InlineType: + case OperandType.InlineField: + case OperandType.InlineMethod: + case OperandType.InlineTok: + WriteMetadataToken (metadata.LookupToken ((IMetadataTokenProvider)operand)); + break; + default: + throw new ArgumentException (); + } + } + + int GetTargetOffset (Instruction instruction) + { + if (instruction == null) { + var last = body.instructions [body.instructions.size - 1]; + return last.offset + last.GetSize (); + } + + return instruction.offset; + } + + uint GetUserStringIndex (string @string) + { + if (@string == null) + return 0; + + return metadata.user_string_heap.GetStringIndex (@string); + } + + static int GetVariableIndex (VariableDefinition variable) + { + return variable.Index; + } + + int GetParameterIndex (ParameterDefinition parameter) + { + if (body.method.HasThis) { + if (parameter == body.this_parameter) + return 0; + + return parameter.Index + 1; + } + + return parameter.Index; + } + + bool RequiresFatHeader () + { + var body = this.body; + return body.CodeSize >= 64 + || body.InitLocals + || body.HasVariables + || body.HasExceptionHandlers + || body.MaxStackSize > 8; + } + + void ComputeHeader () + { + int offset = 0; + var instructions = body.instructions; + var items = instructions.items; + var count = instructions.size; + var stack_size = 0; + var max_stack = 0; + Dictionary stack_sizes = null; + + if (body.HasExceptionHandlers) + ComputeExceptionHandlerStackSize (ref stack_sizes); + + for (int i = 0; i < count; i++) { + var instruction = items [i]; + instruction.offset = offset; + offset += instruction.GetSize (); + + ComputeStackSize (instruction, ref stack_sizes, ref stack_size, ref max_stack); + } + + body.code_size = offset; + body.max_stack_size = max_stack; + } + + void ComputeExceptionHandlerStackSize (ref Dictionary stack_sizes) + { + var exception_handlers = body.ExceptionHandlers; + + for (int i = 0; i < exception_handlers.Count; i++) { + var exception_handler = exception_handlers [i]; + + switch (exception_handler.HandlerType) { + case ExceptionHandlerType.Catch: + AddExceptionStackSize (exception_handler.HandlerStart, ref stack_sizes); + break; + case ExceptionHandlerType.Filter: + AddExceptionStackSize (exception_handler.FilterStart, ref stack_sizes); + AddExceptionStackSize (exception_handler.HandlerStart, ref stack_sizes); + break; + } + } + } + + static void AddExceptionStackSize (Instruction handler_start, ref Dictionary stack_sizes) + { + if (handler_start == null) + return; + + if (stack_sizes == null) + stack_sizes = new Dictionary (); + + stack_sizes [handler_start] = 1; + } + + static void ComputeStackSize (Instruction instruction, ref Dictionary stack_sizes, ref int stack_size, ref int max_stack) + { + int computed_size; + if (stack_sizes != null && stack_sizes.TryGetValue (instruction, out computed_size)) + stack_size = computed_size; + + max_stack = System.Math.Max (max_stack, stack_size); + ComputeStackDelta (instruction, ref stack_size); + max_stack = System.Math.Max (max_stack, stack_size); + + CopyBranchStackSize (instruction, ref stack_sizes, stack_size); + ComputeStackSize (instruction, ref stack_size); + } + + static void CopyBranchStackSize (Instruction instruction, ref Dictionary stack_sizes, int stack_size) + { + if (stack_size == 0) + return; + + switch (instruction.opcode.OperandType) { + case OperandType.ShortInlineBrTarget: + case OperandType.InlineBrTarget: + CopyBranchStackSize (ref stack_sizes, (Instruction)instruction.operand, stack_size); + break; + case OperandType.InlineSwitch: + var targets = (Instruction [])instruction.operand; + for (int i = 0; i < targets.Length; i++) + CopyBranchStackSize (ref stack_sizes, targets [i], stack_size); + break; + } + } + + static void CopyBranchStackSize (ref Dictionary stack_sizes, Instruction target, int stack_size) + { + if (stack_sizes == null) + stack_sizes = new Dictionary (); + + int branch_stack_size = stack_size; + + int computed_size; + if (stack_sizes.TryGetValue (target, out computed_size)) + branch_stack_size = System.Math.Max (branch_stack_size, computed_size); + + stack_sizes [target] = branch_stack_size; + } + + static void ComputeStackSize (Instruction instruction, ref int stack_size) + { + switch (instruction.opcode.FlowControl) { + case FlowControl.Branch: + case FlowControl.Throw: + case FlowControl.Return: + stack_size = 0; + break; + } + } + + static void ComputeStackDelta (Instruction instruction, ref int stack_size) + { + switch (instruction.opcode.FlowControl) { + case FlowControl.Call: { + var method = (IMethodSignature)instruction.operand; + // pop 'this' argument + if (method.HasImplicitThis () && instruction.opcode.Code != Code.Newobj) + stack_size--; + // pop normal arguments + if (method.HasParameters) + stack_size -= method.Parameters.Count; + // pop function pointer + if (instruction.opcode.Code == Code.Calli) + stack_size--; + // push return value + if (method.ReturnType.etype != ElementType.Void || instruction.opcode.Code == Code.Newobj) + stack_size++; + break; + } + default: + ComputePopDelta (instruction.opcode.StackBehaviourPop, ref stack_size); + ComputePushDelta (instruction.opcode.StackBehaviourPush, ref stack_size); + break; + } + } + + static void ComputePopDelta (StackBehaviour pop_behavior, ref int stack_size) + { + switch (pop_behavior) { + case StackBehaviour.Popi: + case StackBehaviour.Popref: + case StackBehaviour.Pop1: + stack_size--; + break; + case StackBehaviour.Pop1_pop1: + case StackBehaviour.Popi_pop1: + case StackBehaviour.Popi_popi: + case StackBehaviour.Popi_popi8: + case StackBehaviour.Popi_popr4: + case StackBehaviour.Popi_popr8: + case StackBehaviour.Popref_pop1: + case StackBehaviour.Popref_popi: + stack_size -= 2; + break; + case StackBehaviour.Popi_popi_popi: + case StackBehaviour.Popref_popi_popi: + case StackBehaviour.Popref_popi_popi8: + case StackBehaviour.Popref_popi_popr4: + case StackBehaviour.Popref_popi_popr8: + case StackBehaviour.Popref_popi_popref: + stack_size -= 3; + break; + case StackBehaviour.PopAll: + stack_size = 0; + break; + } + } + + static void ComputePushDelta (StackBehaviour push_behaviour, ref int stack_size) + { + switch (push_behaviour) { + case StackBehaviour.Push1: + case StackBehaviour.Pushi: + case StackBehaviour.Pushi8: + case StackBehaviour.Pushr4: + case StackBehaviour.Pushr8: + case StackBehaviour.Pushref: + stack_size++; + break; + case StackBehaviour.Push1_push1: + stack_size += 2; + break; + } + } + + void WriteExceptionHandlers () + { + Align (4); + + var handlers = body.ExceptionHandlers; + + if (handlers.Count < 0x15 && !RequiresFatSection (handlers)) + WriteSmallSection (handlers); + else + WriteFatSection (handlers); + } + + static bool RequiresFatSection (Collection handlers) + { + for (int i = 0; i < handlers.Count; i++) { + var handler = handlers [i]; + + if (IsFatRange (handler.TryStart, handler.TryEnd)) + return true; + + if (IsFatRange (handler.HandlerStart, handler.HandlerEnd)) + return true; + + if (handler.HandlerType == ExceptionHandlerType.Filter + && IsFatRange (handler.FilterStart, handler.HandlerStart)) + return true; + } + + return false; + } + + static bool IsFatRange (Instruction start, Instruction end) + { + if (start == null) + throw new ArgumentException (); + + if (end == null) + return true; + + return end.Offset - start.Offset > 255 || start.Offset > 65535; + } + + void WriteSmallSection (Collection handlers) + { + const byte eh_table = 0x1; + + WriteByte (eh_table); + WriteByte ((byte)(handlers.Count * 12 + 4)); + WriteBytes (2); + + WriteExceptionHandlers ( + handlers, + i => WriteUInt16 ((ushort)i), + i => WriteByte ((byte)i)); + } + + void WriteFatSection (Collection handlers) + { + const byte eh_table = 0x1; + const byte fat_format = 0x40; + + WriteByte (eh_table | fat_format); + + int size = handlers.Count * 24 + 4; + WriteByte ((byte)(size & 0xff)); + WriteByte ((byte)((size >> 8) & 0xff)); + WriteByte ((byte)((size >> 16) & 0xff)); + + WriteExceptionHandlers (handlers, WriteInt32, WriteInt32); + } + + void WriteExceptionHandlers (Collection handlers, Action write_entry, Action write_length) + { + for (int i = 0; i < handlers.Count; i++) { + var handler = handlers [i]; + + write_entry ((int)handler.HandlerType); + + write_entry (handler.TryStart.Offset); + write_length (GetTargetOffset (handler.TryEnd) - handler.TryStart.Offset); + + write_entry (handler.HandlerStart.Offset); + write_length (GetTargetOffset (handler.HandlerEnd) - handler.HandlerStart.Offset); + + WriteExceptionHandlerSpecific (handler); + } + } + + void WriteExceptionHandlerSpecific (ExceptionHandler handler) + { + switch (handler.HandlerType) { + case ExceptionHandlerType.Catch: + WriteMetadataToken (metadata.LookupToken (handler.CatchType)); + break; + case ExceptionHandlerType.Filter: + WriteInt32 (handler.FilterStart.Offset); + break; + default: + WriteInt32 (0); + break; + } + } + + public MetadataToken GetStandAloneSignature (Collection variables) + { + var signature = metadata.GetLocalVariableBlobIndex (variables); + + return GetStandAloneSignatureToken (signature); + } + + public MetadataToken GetStandAloneSignature (CallSite call_site) + { + var signature = metadata.GetCallSiteBlobIndex (call_site); + var token = GetStandAloneSignatureToken (signature); + call_site.MetadataToken = token; + return token; + } + + MetadataToken GetStandAloneSignatureToken (uint signature) + { + MetadataToken token; + if (standalone_signatures.TryGetValue (signature, out token)) + return token; + + token = new MetadataToken (TokenType.Signature, metadata.AddStandAloneSignature (signature)); + standalone_signatures.Add (signature, token); + return token; + } + + RVA BeginMethod () + { + return (RVA)(code_base + position); + } + + void WriteMetadataToken (MetadataToken token) + { + WriteUInt32 (token.ToUInt32 ()); + } + + void Align (int align) + { + align--; + WriteBytes (((position + align) & ~align) - position); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeWriter.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeWriter.cs.meta new file mode 100644 index 0000000..e4cccca --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/CodeWriter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 278f89c983a1bc6429c65a1d49dff091 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Document.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Document.cs new file mode 100644 index 0000000..ce30188 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Document.cs @@ -0,0 +1,123 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil.Cil { + + public enum DocumentType { + Other, + Text, + } + + public enum DocumentHashAlgorithm { + None, + MD5, + SHA1, + SHA256, + } + + public enum DocumentLanguage { + Other, + C, + Cpp, + CSharp, + Basic, + Java, + Cobol, + Pascal, + Cil, + JScript, + Smc, + MCpp, + FSharp, + } + + public enum DocumentLanguageVendor { + Other, + Microsoft, + } + + public sealed class Document : DebugInformation { + + string url; + + Guid type; + Guid hash_algorithm; + Guid language; + Guid language_vendor; + + byte [] hash; + byte [] embedded_source; + + public string Url { + get { return url; } + set { url = value; } + } + + public DocumentType Type { + get { return type.ToType (); } + set { type = value.ToGuid (); } + } + + public Guid TypeGuid { + get { return type; } + set { type = value; } + } + + public DocumentHashAlgorithm HashAlgorithm { + get { return hash_algorithm.ToHashAlgorithm (); } + set { hash_algorithm = value.ToGuid (); } + } + + public Guid HashAlgorithmGuid { + get { return hash_algorithm; } + set { hash_algorithm = value; } + } + + public DocumentLanguage Language { + get { return language.ToLanguage (); } + set { language = value.ToGuid (); } + } + + public Guid LanguageGuid { + get { return language; } + set { language = value; } + } + + public DocumentLanguageVendor LanguageVendor { + get { return language_vendor.ToVendor (); } + set { language_vendor = value.ToGuid (); } + } + + public Guid LanguageVendorGuid { + get { return language_vendor; } + set { language_vendor = value; } + } + + public byte [] Hash { + get { return hash; } + set { hash = value; } + } + + public byte [] EmbeddedSource { + get { return embedded_source; } + set { embedded_source = value; } + } + + public Document (string url) + { + this.url = url; + this.hash = Empty.Array; + this.embedded_source = Empty.Array; + this.token = new MetadataToken (TokenType.Document); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Document.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Document.cs.meta new file mode 100644 index 0000000..2a3915d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Document.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 86b3083301304a341b6059ea8c29be7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ExceptionHandler.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ExceptionHandler.cs new file mode 100644 index 0000000..c017553 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ExceptionHandler.cs @@ -0,0 +1,71 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil.Cil { + + public enum ExceptionHandlerType { + Catch = 0, + Filter = 1, + Finally = 2, + Fault = 4, + } + + public sealed class ExceptionHandler { + + Instruction try_start; + Instruction try_end; + Instruction filter_start; + Instruction handler_start; + Instruction handler_end; + + TypeReference catch_type; + ExceptionHandlerType handler_type; + + public Instruction TryStart { + get { return try_start; } + set { try_start = value; } + } + + public Instruction TryEnd { + get { return try_end; } + set { try_end = value; } + } + + public Instruction FilterStart { + get { return filter_start; } + set { filter_start = value; } + } + + public Instruction HandlerStart { + get { return handler_start; } + set { handler_start = value; } + } + + public Instruction HandlerEnd { + get { return handler_end; } + set { handler_end = value; } + } + + public TypeReference CatchType { + get { return catch_type; } + set { catch_type = value; } + } + + public ExceptionHandlerType HandlerType { + get { return handler_type; } + set { handler_type = value; } + } + + public ExceptionHandler (ExceptionHandlerType handlerType) + { + this.handler_type = handlerType; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ExceptionHandler.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ExceptionHandler.cs.meta new file mode 100644 index 0000000..f26784f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ExceptionHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eb17bcae1a67ec344b65d6ed78ffb704 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ILProcessor.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ILProcessor.cs new file mode 100644 index 0000000..48944a2 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ILProcessor.cs @@ -0,0 +1,291 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; + +namespace MonoFN.Cecil.Cil { + + public sealed class ILProcessor { + + readonly MethodBody body; + readonly Collection instructions; + + public MethodBody Body { + get { return body; } + } + + internal ILProcessor (MethodBody body) + { + this.body = body; + this.instructions = body.Instructions; + } + + public Instruction Create (OpCode opcode) + { + return Instruction.Create (opcode); + } + + public Instruction Create (OpCode opcode, TypeReference type) + { + return Instruction.Create (opcode, type); + } + + public Instruction Create (OpCode opcode, CallSite site) + { + return Instruction.Create (opcode, site); + } + + public Instruction Create (OpCode opcode, MethodReference method) + { + return Instruction.Create (opcode, method); + } + + public Instruction Create (OpCode opcode, FieldReference field) + { + return Instruction.Create (opcode, field); + } + + public Instruction Create (OpCode opcode, string value) + { + return Instruction.Create (opcode, value); + } + + public Instruction Create (OpCode opcode, sbyte value) + { + return Instruction.Create (opcode, value); + } + + public Instruction Create (OpCode opcode, byte value) + { + if (opcode.OperandType == OperandType.ShortInlineVar) + return Instruction.Create (opcode, body.Variables [value]); + + if (opcode.OperandType == OperandType.ShortInlineArg) + return Instruction.Create (opcode, body.GetParameter (value)); + + return Instruction.Create (opcode, value); + } + + public Instruction Create (OpCode opcode, int value) + { + if (opcode.OperandType == OperandType.InlineVar) + return Instruction.Create (opcode, body.Variables [value]); + + if (opcode.OperandType == OperandType.InlineArg) + return Instruction.Create (opcode, body.GetParameter (value)); + + return Instruction.Create (opcode, value); + } + + public Instruction Create (OpCode opcode, long value) + { + return Instruction.Create (opcode, value); + } + + public Instruction Create (OpCode opcode, float value) + { + return Instruction.Create (opcode, value); + } + + public Instruction Create (OpCode opcode, double value) + { + return Instruction.Create (opcode, value); + } + + public Instruction Create (OpCode opcode, Instruction target) + { + return Instruction.Create (opcode, target); + } + + public Instruction Create (OpCode opcode, Instruction [] targets) + { + return Instruction.Create (opcode, targets); + } + + public Instruction Create (OpCode opcode, VariableDefinition variable) + { + return Instruction.Create (opcode, variable); + } + + public Instruction Create (OpCode opcode, ParameterDefinition parameter) + { + return Instruction.Create (opcode, parameter); + } + + public void Emit (OpCode opcode) + { + Append (Create (opcode)); + } + + public void Emit (OpCode opcode, TypeReference type) + { + Append (Create (opcode, type)); + } + + public void Emit (OpCode opcode, MethodReference method) + { + Append (Create (opcode, method)); + } + + public void Emit (OpCode opcode, CallSite site) + { + Append (Create (opcode, site)); + } + + public void Emit (OpCode opcode, FieldReference field) + { + Append (Create (opcode, field)); + } + + public void Emit (OpCode opcode, string value) + { + Append (Create (opcode, value)); + } + + public void Emit (OpCode opcode, byte value) + { + Append (Create (opcode, value)); + } + + public void Emit (OpCode opcode, sbyte value) + { + Append (Create (opcode, value)); + } + + public void Emit (OpCode opcode, int value) + { + Append (Create (opcode, value)); + } + + public void Emit (OpCode opcode, long value) + { + Append (Create (opcode, value)); + } + + public void Emit (OpCode opcode, float value) + { + Append (Create (opcode, value)); + } + + public void Emit (OpCode opcode, double value) + { + Append (Create (opcode, value)); + } + + public void Emit (OpCode opcode, Instruction target) + { + Append (Create (opcode, target)); + } + + public void Emit (OpCode opcode, Instruction [] targets) + { + Append (Create (opcode, targets)); + } + + public void Emit (OpCode opcode, VariableDefinition variable) + { + Append (Create (opcode, variable)); + } + + public void Emit (OpCode opcode, ParameterDefinition parameter) + { + Append (Create (opcode, parameter)); + } + + public void InsertBefore (Instruction target, Instruction instruction) + { + if (target == null) + throw new ArgumentNullException ("target"); + if (instruction == null) + throw new ArgumentNullException ("instruction"); + + var index = instructions.IndexOf (target); + if (index == -1) + throw new ArgumentOutOfRangeException ("target"); + + instructions.Insert (index, instruction); + } + + public void InsertAfter (Instruction target, Instruction instruction) + { + if (target == null) + throw new ArgumentNullException ("target"); + if (instruction == null) + throw new ArgumentNullException ("instruction"); + + var index = instructions.IndexOf (target); + if (index == -1) + throw new ArgumentOutOfRangeException ("target"); + + instructions.Insert (index + 1, instruction); + } + + public void InsertAfter (int index, Instruction instruction) + { + if (index < 0 || index >= instructions.Count) + throw new ArgumentOutOfRangeException ("index"); + if (instruction == null) + throw new ArgumentNullException ("instruction"); + + instructions.Insert (index + 1, instruction); + } + + public void Append (Instruction instruction) + { + if (instruction == null) + throw new ArgumentNullException ("instruction"); + + instructions.Add (instruction); + } + + public void Replace (Instruction target, Instruction instruction) + { + if (target == null) + throw new ArgumentNullException ("target"); + if (instruction == null) + throw new ArgumentNullException ("instruction"); + + InsertAfter (target, instruction); + Remove (target); + } + + public void Replace (int index, Instruction instruction) + { + if (instruction == null) + throw new ArgumentNullException ("instruction"); + + InsertAfter (index, instruction); + RemoveAt (index); + } + + public void Remove (Instruction instruction) + { + if (instruction == null) + throw new ArgumentNullException ("instruction"); + + if (!instructions.Remove (instruction)) + throw new ArgumentOutOfRangeException ("instruction"); + } + + public void RemoveAt (int index) + { + if (index < 0 || index >= instructions.Count) + throw new ArgumentOutOfRangeException ("index"); + + instructions.RemoveAt (index); + } + + public void Clear () + { + instructions.Clear (); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ILProcessor.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ILProcessor.cs.meta new file mode 100644 index 0000000..5964570 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/ILProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26902ea42064c624d82727d9ef9a8f5e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Instruction.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Instruction.cs new file mode 100644 index 0000000..93afafe --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Instruction.cs @@ -0,0 +1,296 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; +using System.Text; + +namespace MonoFN.Cecil.Cil { + + public sealed class Instruction { + + internal int offset; + internal OpCode opcode; + internal object operand; + + internal Instruction previous; + internal Instruction next; + + public int Offset { + get { return offset; } + set { offset = value; } + } + + public OpCode OpCode { + get { return opcode; } + set { opcode = value; } + } + + public object Operand { + get { return operand; } + set { operand = value; } + } + + public Instruction Previous { + get { return previous; } + set { previous = value; } + } + + public Instruction Next { + get { return next; } + set { next = value; } + } + + internal Instruction (int offset, OpCode opCode) + { + this.offset = offset; + this.opcode = opCode; + } + + internal Instruction (OpCode opcode, object operand) + { + this.opcode = opcode; + this.operand = operand; + } + + public int GetSize () + { + int size = opcode.Size; + + switch (opcode.OperandType) { + case OperandType.InlineSwitch: + return size + (1 + ((Instruction [])operand).Length) * 4; + case OperandType.InlineI8: + case OperandType.InlineR: + return size + 8; + case OperandType.InlineBrTarget: + case OperandType.InlineField: + case OperandType.InlineI: + case OperandType.InlineMethod: + case OperandType.InlineString: + case OperandType.InlineTok: + case OperandType.InlineType: + case OperandType.ShortInlineR: + case OperandType.InlineSig: + return size + 4; + case OperandType.InlineArg: + case OperandType.InlineVar: + return size + 2; + case OperandType.ShortInlineBrTarget: + case OperandType.ShortInlineI: + case OperandType.ShortInlineArg: + case OperandType.ShortInlineVar: + return size + 1; + default: + return size; + } + } + + public override string ToString () + { + var instruction = new StringBuilder (); + + AppendLabel (instruction, this); + instruction.Append (':'); + instruction.Append (' '); + instruction.Append (opcode.Name); + + if (operand == null) + return instruction.ToString (); + + instruction.Append (' '); + + switch (opcode.OperandType) { + case OperandType.ShortInlineBrTarget: + case OperandType.InlineBrTarget: + AppendLabel (instruction, (Instruction)operand); + break; + case OperandType.InlineSwitch: + var labels = (Instruction [])operand; + for (int i = 0; i < labels.Length; i++) { + if (i > 0) + instruction.Append (','); + + AppendLabel (instruction, labels [i]); + } + break; + case OperandType.InlineString: + instruction.Append ('\"'); + instruction.Append (operand); + instruction.Append ('\"'); + break; + default: + instruction.Append (operand); + break; + } + + return instruction.ToString (); + } + + static void AppendLabel (StringBuilder builder, Instruction instruction) + { + builder.Append ("IL_"); + builder.Append (instruction.offset.ToString ("x4")); + } + + public static Instruction Create (OpCode opcode) + { + if (opcode.OperandType != OperandType.InlineNone) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, null); + } + + public static Instruction Create (OpCode opcode, TypeReference type) + { + if (type == null) + throw new ArgumentNullException ("type"); + if (opcode.OperandType != OperandType.InlineType && + opcode.OperandType != OperandType.InlineTok) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, type); + } + + public static Instruction Create (OpCode opcode, CallSite site) + { + if (site == null) + throw new ArgumentNullException ("site"); + if (opcode.Code != Code.Calli) + throw new ArgumentException ("code"); + + return new Instruction (opcode, site); + } + + public static Instruction Create (OpCode opcode, MethodReference method) + { + if (method == null) + throw new ArgumentNullException ("method"); + if (opcode.OperandType != OperandType.InlineMethod && + opcode.OperandType != OperandType.InlineTok) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, method); + } + + public static Instruction Create (OpCode opcode, FieldReference field) + { + if (field == null) + throw new ArgumentNullException ("field"); + if (opcode.OperandType != OperandType.InlineField && + opcode.OperandType != OperandType.InlineTok) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, field); + } + + public static Instruction Create (OpCode opcode, string value) + { + if (value == null) + throw new ArgumentNullException ("value"); + if (opcode.OperandType != OperandType.InlineString) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, value); + } + + public static Instruction Create (OpCode opcode, sbyte value) + { + if (opcode.OperandType != OperandType.ShortInlineI && + opcode != OpCodes.Ldc_I4_S) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, value); + } + + public static Instruction Create (OpCode opcode, byte value) + { + if (opcode.OperandType != OperandType.ShortInlineI || + opcode == OpCodes.Ldc_I4_S) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, value); + } + + public static Instruction Create (OpCode opcode, int value) + { + if (opcode.OperandType != OperandType.InlineI) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, value); + } + + public static Instruction Create (OpCode opcode, long value) + { + if (opcode.OperandType != OperandType.InlineI8) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, value); + } + + public static Instruction Create (OpCode opcode, float value) + { + if (opcode.OperandType != OperandType.ShortInlineR) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, value); + } + + public static Instruction Create (OpCode opcode, double value) + { + if (opcode.OperandType != OperandType.InlineR) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, value); + } + + public static Instruction Create (OpCode opcode, Instruction target) + { + if (target == null) + throw new ArgumentNullException ("target"); + if (opcode.OperandType != OperandType.InlineBrTarget && + opcode.OperandType != OperandType.ShortInlineBrTarget) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, target); + } + + public static Instruction Create (OpCode opcode, Instruction [] targets) + { + if (targets == null) + throw new ArgumentNullException ("targets"); + if (opcode.OperandType != OperandType.InlineSwitch) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, targets); + } + + public static Instruction Create (OpCode opcode, VariableDefinition variable) + { + if (variable == null) + throw new ArgumentNullException ("variable"); + if (opcode.OperandType != OperandType.ShortInlineVar && + opcode.OperandType != OperandType.InlineVar) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, variable); + } + + public static Instruction Create (OpCode opcode, ParameterDefinition parameter) + { + if (parameter == null) + throw new ArgumentNullException ("parameter"); + if (opcode.OperandType != OperandType.ShortInlineArg && + opcode.OperandType != OperandType.InlineArg) + throw new ArgumentException ("opcode"); + + return new Instruction (opcode, parameter); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Instruction.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Instruction.cs.meta new file mode 100644 index 0000000..fc5ea61 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Instruction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2d1536adbd2ca174abbd624473e722c3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/MethodBody.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/MethodBody.cs new file mode 100644 index 0000000..9a49f12 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/MethodBody.cs @@ -0,0 +1,426 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; +using System.Threading; + +namespace MonoFN.Cecil.Cil { + + public sealed class MethodBody { + + readonly internal MethodDefinition method; + + internal ParameterDefinition this_parameter; + internal int max_stack_size; + internal int code_size; + internal bool init_locals; + internal MetadataToken local_var_token; + + internal Collection instructions; + internal Collection exceptions; + internal Collection variables; + + public MethodDefinition Method { + get { return method; } + } + + public int MaxStackSize { + get { return max_stack_size; } + set { max_stack_size = value; } + } + + public int CodeSize { + get { return code_size; } + } + + public bool InitLocals { + get { return init_locals; } + set { init_locals = value; } + } + + public MetadataToken LocalVarToken { + get { return local_var_token; } + set { local_var_token = value; } + } + + public Collection Instructions { + get { + if (instructions == null) + Interlocked.CompareExchange (ref instructions, new InstructionCollection (method), null); + + return instructions; + } + } + + public bool HasExceptionHandlers { + get { return !exceptions.IsNullOrEmpty (); } + } + + public Collection ExceptionHandlers { + get { + if (exceptions == null) + Interlocked.CompareExchange (ref exceptions, new Collection (), null); + + return exceptions; + } + } + + public bool HasVariables { + get { return !variables.IsNullOrEmpty (); } + } + + public Collection Variables { + get { + if (variables == null) + Interlocked.CompareExchange (ref variables, new VariableDefinitionCollection (this.method), null); + + return variables; + } + } + + public ParameterDefinition ThisParameter { + get { + if (method == null || method.DeclaringType == null) + throw new NotSupportedException (); + + if (!method.HasThis) + return null; + + if (this_parameter == null) + Interlocked.CompareExchange (ref this_parameter, CreateThisParameter (method), null); + + return this_parameter; + } + } + + static ParameterDefinition CreateThisParameter (MethodDefinition method) + { + var parameter_type = method.DeclaringType as TypeReference; + + if (parameter_type.HasGenericParameters) { + var instance = new GenericInstanceType (parameter_type, parameter_type.GenericParameters.Count); + for (int i = 0; i < parameter_type.GenericParameters.Count; i++) + instance.GenericArguments.Add (parameter_type.GenericParameters [i]); + + parameter_type = instance; + + } + + if (parameter_type.IsValueType || parameter_type.IsPrimitive) + parameter_type = new ByReferenceType (parameter_type); + + return new ParameterDefinition (parameter_type, method); + } + + public MethodBody (MethodDefinition method) + { + this.method = method; + } + + public ILProcessor GetILProcessor () + { + return new ILProcessor (this); + } + } + + sealed class VariableDefinitionCollection : Collection { + + readonly MethodDefinition method; + + internal VariableDefinitionCollection (MethodDefinition method) + { + this.method = method; + } + + internal VariableDefinitionCollection (MethodDefinition method, int capacity) + : base (capacity) + { + this.method = method; + } + + protected override void OnAdd (VariableDefinition item, int index) + { + item.index = index; + } + + protected override void OnInsert (VariableDefinition item, int index) + { + item.index = index; + UpdateVariableIndices (index, 1); + } + + protected override void OnSet (VariableDefinition item, int index) + { + item.index = index; + } + + protected override void OnRemove (VariableDefinition item, int index) + { + UpdateVariableIndices (index + 1, -1, item); + item.index = -1; + } + + void UpdateVariableIndices (int startIndex, int offset, VariableDefinition variableToRemove = null) + { + for (int i = startIndex; i < size; i++) + items [i].index = i + offset; + + var debug_info = method == null ? null : method.debug_info; + if (debug_info == null || debug_info.Scope == null) + return; + + foreach (var scope in debug_info.GetScopes ()) { + if (!scope.HasVariables) + continue; + + var variables = scope.Variables; + int variableDebugInfoIndexToRemove = -1; + for (int i = 0; i < variables.Count; i++) { + var variable = variables [i]; + + // If a variable is being removed detect if it has debug info counterpart, if so remove that as well. + // Note that the debug info can be either resolved (has direct reference to the VariableDefinition) + // or unresolved (has only the number index of the variable) - this needs to handle both cases. + if (variableToRemove != null && + ((variable.index.IsResolved && variable.index.ResolvedVariable == variableToRemove) || + (!variable.index.IsResolved && variable.Index == variableToRemove.Index))) { + variableDebugInfoIndexToRemove = i; + continue; + } + + // For unresolved debug info updates indeces to keep them pointing to the same variable. + if (!variable.index.IsResolved && variable.Index >= startIndex) { + variable.index = new VariableIndex (variable.Index + offset); + } + } + + if (variableDebugInfoIndexToRemove >= 0) + variables.RemoveAt (variableDebugInfoIndexToRemove); + } + } + } + + class InstructionCollection : Collection { + + readonly MethodDefinition method; + + internal InstructionCollection (MethodDefinition method) + { + this.method = method; + } + + internal InstructionCollection (MethodDefinition method, int capacity) + : base (capacity) + { + this.method = method; + } + + protected override void OnAdd (Instruction item, int index) + { + if (index == 0) + return; + + var previous = items [index - 1]; + previous.next = item; + item.previous = previous; + } + + protected override void OnInsert (Instruction item, int index) + { + int startOffset = 0; + if (size != 0) { + var current = items [index]; + if (current == null) { + var last = items [index - 1]; + last.next = item; + item.previous = last; + return; + } + + startOffset = current.Offset; + + var previous = current.previous; + if (previous != null) { + previous.next = item; + item.previous = previous; + } + + current.previous = item; + item.next = current; + } + + UpdateLocalScopes (null, null); + } + + protected override void OnSet (Instruction item, int index) + { + var current = items [index]; + + item.previous = current.previous; + item.next = current.next; + + current.previous = null; + current.next = null; + + UpdateLocalScopes (item, current); + } + + protected override void OnRemove (Instruction item, int index) + { + var previous = item.previous; + if (previous != null) + previous.next = item.next; + + var next = item.next; + if (next != null) + next.previous = item.previous; + + RemoveSequencePoint (item); + UpdateLocalScopes (item, next ?? previous); + + item.previous = null; + item.next = null; + } + + void RemoveSequencePoint (Instruction instruction) + { + var debug_info = method.debug_info; + if (debug_info == null || !debug_info.HasSequencePoints) + return; + + var sequence_points = debug_info.sequence_points; + for (int i = 0; i < sequence_points.Count; i++) { + if (sequence_points [i].Offset == instruction.offset) { + sequence_points.RemoveAt (i); + return; + } + } + } + + void UpdateLocalScopes (Instruction removedInstruction, Instruction existingInstruction) + { + var debug_info = method.debug_info; + if (debug_info == null) + return; + + // Local scopes store start/end pair of "instruction offsets". Instruction offset can be either resolved, in which case it + // has a reference to Instruction, or unresolved in which case it stores numerical offset (instruction offset in the body). + // Typically local scopes loaded from PE/PDB files will be resolved, but it's not a requirement. + // Each instruction has its own offset, which is populated on load, but never updated (this would be pretty expensive to do). + // Instructions created during the editting will typically have offset 0 (so incorrect). + // Local scopes created during editing will also likely be resolved (so no numerical offsets). + // So while local scopes which are unresolved are relatively rare if they appear, manipulating them based + // on the offsets allone is pretty hard (since we can't rely on correct offsets of instructions). + // On the other hand resolved local scopes are easy to maintain, since they point to instructions and thus inserting + // instructions is basically a no-op and removing instructions is as easy as changing the pointer. + // For this reason the algorithm here is: + // - First make sure that all instruction offsets are resolved - if not - resolve them + // - First time this will be relatively expensinve as it will walk the entire method body to convert offsets to instruction pointers + // Almost all local scopes are stored in the "right" order (sequentially per start offsets), so the code uses a simple one-item + // cache instruction<->offset to avoid walking instructions multiple times (that would only happen for scopes which are out of order). + // - Subsequent calls should be cheap as it will only walk all local scopes without doing anything + // - If there was an edit on local scope which makes some of them unresolved, the cost is proportional + // - Then update as necessary by manipulaitng instruction references alone + + InstructionOffsetCache cache = new InstructionOffsetCache () { + Offset = 0, + Index = 0, + Instruction = items [0] + }; + + UpdateLocalScope (debug_info.Scope, removedInstruction, existingInstruction, ref cache); + } + + void UpdateLocalScope (ScopeDebugInformation scope, Instruction removedInstruction, Instruction existingInstruction, ref InstructionOffsetCache cache) + { + if (scope == null) + return; + + if (!scope.Start.IsResolved) + scope.Start = ResolveInstructionOffset (scope.Start, ref cache); + + if (!scope.Start.IsEndOfMethod && scope.Start.ResolvedInstruction == removedInstruction) + scope.Start = new InstructionOffset (existingInstruction); + + if (scope.HasScopes) { + foreach (var subScope in scope.Scopes) + UpdateLocalScope (subScope, removedInstruction, existingInstruction, ref cache); + } + + if (!scope.End.IsResolved) + scope.End = ResolveInstructionOffset (scope.End, ref cache); + + if (!scope.End.IsEndOfMethod && scope.End.ResolvedInstruction == removedInstruction) + scope.End = new InstructionOffset (existingInstruction); + } + + struct InstructionOffsetCache { + public int Offset; + public int Index; + public Instruction Instruction; + } + + InstructionOffset ResolveInstructionOffset (InstructionOffset inputOffset, ref InstructionOffsetCache cache) + { + if (inputOffset.IsResolved) + return inputOffset; + + int offset = inputOffset.Offset; + + if (cache.Offset == offset) + return new InstructionOffset (cache.Instruction); + + if (cache.Offset > offset) { + // This should be rare - we're resolving offset pointing to a place before the current cache position + // resolve by walking the instructions from start and don't cache the result. + int size = 0; + for (int i = 0; i < items.Length; i++) { + if (size == offset) + return new InstructionOffset (items [i]); + + if (size > offset) + return new InstructionOffset (items [i - 1]); + + size += items [i].GetSize (); + } + + // Offset is larger than the size of the body - so it points after the end + return new InstructionOffset (); + } else { + // The offset points after the current cache position - so continue counting and update the cache + int size = cache.Offset; + for (int i = cache.Index; i < items.Length; i++) { + cache.Index = i; + cache.Offset = size; + + var item = items [i]; + + // Allow for trailing null values in the case of + // instructions.Size < instructions.Capacity + if (item == null) + break; + + cache.Instruction = item; + + if (cache.Offset == offset) + return new InstructionOffset (cache.Instruction); + + if (cache.Offset > offset) + return new InstructionOffset (items [i - 1]); + + size += item.GetSize (); + } + + return new InstructionOffset (); + } + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/MethodBody.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/MethodBody.cs.meta new file mode 100644 index 0000000..6bfd730 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/MethodBody.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4be4045de2c6a0e428e5910f4e76cfac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCode.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCode.cs new file mode 100644 index 0000000..6db5b62 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCode.cs @@ -0,0 +1,439 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil.Cil { + + public enum FlowControl { + Branch, + Break, + Call, + Cond_Branch, + Meta, + Next, + Phi, + Return, + Throw, + } + + public enum OpCodeType { + Annotation, + Macro, + Nternal, + Objmodel, + Prefix, + Primitive, + } + + public enum OperandType { + InlineBrTarget, + InlineField, + InlineI, + InlineI8, + InlineMethod, + InlineNone, + InlinePhi, + InlineR, + InlineSig, + InlineString, + InlineSwitch, + InlineTok, + InlineType, + InlineVar, + InlineArg, + ShortInlineBrTarget, + ShortInlineI, + ShortInlineR, + ShortInlineVar, + ShortInlineArg, + } + + public enum StackBehaviour { + Pop0, + Pop1, + Pop1_pop1, + Popi, + Popi_pop1, + Popi_popi, + Popi_popi8, + Popi_popi_popi, + Popi_popr4, + Popi_popr8, + Popref, + Popref_pop1, + Popref_popi, + Popref_popi_popi, + Popref_popi_popi8, + Popref_popi_popr4, + Popref_popi_popr8, + Popref_popi_popref, + PopAll, + Push0, + Push1, + Push1_push1, + Pushi, + Pushi8, + Pushr4, + Pushr8, + Pushref, + Varpop, + Varpush, + } + + public struct OpCode : IEquatable { + + readonly byte op1; + readonly byte op2; + readonly byte code; + readonly byte flow_control; + readonly byte opcode_type; + readonly byte operand_type; + readonly byte stack_behavior_pop; + readonly byte stack_behavior_push; + + public string Name { + get { return OpCodeNames.names [(int)Code]; } + } + + public int Size { + get { return op1 == 0xff ? 1 : 2; } + } + + public byte Op1 { + get { return op1; } + } + + public byte Op2 { + get { return op2; } + } + + public short Value { + get { return op1 == 0xff ? op2 : (short)((op1 << 8) | op2); } + } + + public Code Code { + get { return (Code)code; } + } + + public FlowControl FlowControl { + get { return (FlowControl)flow_control; } + } + + public OpCodeType OpCodeType { + get { return (OpCodeType)opcode_type; } + } + + public OperandType OperandType { + get { return (OperandType)operand_type; } + } + + public StackBehaviour StackBehaviourPop { + get { return (StackBehaviour)stack_behavior_pop; } + } + + public StackBehaviour StackBehaviourPush { + get { return (StackBehaviour)stack_behavior_push; } + } + + internal OpCode (int x, int y) + { + this.op1 = (byte)((x >> 0) & 0xff); + this.op2 = (byte)((x >> 8) & 0xff); + this.code = (byte)((x >> 16) & 0xff); + this.flow_control = (byte)((x >> 24) & 0xff); + + this.opcode_type = (byte)((y >> 0) & 0xff); + this.operand_type = (byte)((y >> 8) & 0xff); + this.stack_behavior_pop = (byte)((y >> 16) & 0xff); + this.stack_behavior_push = (byte)((y >> 24) & 0xff); + + if (op1 == 0xff) + OpCodes.OneByteOpCode [op2] = this; + else + OpCodes.TwoBytesOpCode [op2] = this; + } + + public override int GetHashCode () + { + return Value; + } + + public override bool Equals (object obj) + { + if (!(obj is OpCode)) + return false; + + var opcode = (OpCode)obj; + return op1 == opcode.op1 && op2 == opcode.op2; + } + + public bool Equals (OpCode opcode) + { + return op1 == opcode.op1 && op2 == opcode.op2; + } + + public static bool operator == (OpCode one, OpCode other) + { + return one.op1 == other.op1 && one.op2 == other.op2; + } + + public static bool operator != (OpCode one, OpCode other) + { + return one.op1 != other.op1 || one.op2 != other.op2; + } + + public override string ToString () + { + return Name; + } + } + + static class OpCodeNames { + + internal static readonly string [] names; + + static OpCodeNames () + { + var table = new byte [] { + 3, 110, 111, 112, + 5, 98, 114, 101, 97, 107, + 7, 108, 100, 97, 114, 103, 46, 48, + 7, 108, 100, 97, 114, 103, 46, 49, + 7, 108, 100, 97, 114, 103, 46, 50, + 7, 108, 100, 97, 114, 103, 46, 51, + 7, 108, 100, 108, 111, 99, 46, 48, + 7, 108, 100, 108, 111, 99, 46, 49, + 7, 108, 100, 108, 111, 99, 46, 50, + 7, 108, 100, 108, 111, 99, 46, 51, + 7, 115, 116, 108, 111, 99, 46, 48, + 7, 115, 116, 108, 111, 99, 46, 49, + 7, 115, 116, 108, 111, 99, 46, 50, + 7, 115, 116, 108, 111, 99, 46, 51, + 7, 108, 100, 97, 114, 103, 46, 115, + 8, 108, 100, 97, 114, 103, 97, 46, 115, + 7, 115, 116, 97, 114, 103, 46, 115, + 7, 108, 100, 108, 111, 99, 46, 115, + 8, 108, 100, 108, 111, 99, 97, 46, 115, + 7, 115, 116, 108, 111, 99, 46, 115, + 6, 108, 100, 110, 117, 108, 108, + 9, 108, 100, 99, 46, 105, 52, 46, 109, 49, + 8, 108, 100, 99, 46, 105, 52, 46, 48, + 8, 108, 100, 99, 46, 105, 52, 46, 49, + 8, 108, 100, 99, 46, 105, 52, 46, 50, + 8, 108, 100, 99, 46, 105, 52, 46, 51, + 8, 108, 100, 99, 46, 105, 52, 46, 52, + 8, 108, 100, 99, 46, 105, 52, 46, 53, + 8, 108, 100, 99, 46, 105, 52, 46, 54, + 8, 108, 100, 99, 46, 105, 52, 46, 55, + 8, 108, 100, 99, 46, 105, 52, 46, 56, + 8, 108, 100, 99, 46, 105, 52, 46, 115, + 6, 108, 100, 99, 46, 105, 52, + 6, 108, 100, 99, 46, 105, 56, + 6, 108, 100, 99, 46, 114, 52, + 6, 108, 100, 99, 46, 114, 56, + 3, 100, 117, 112, + 3, 112, 111, 112, + 3, 106, 109, 112, + 4, 99, 97, 108, 108, + 5, 99, 97, 108, 108, 105, + 3, 114, 101, 116, + 4, 98, 114, 46, 115, + 9, 98, 114, 102, 97, 108, 115, 101, 46, 115, + 8, 98, 114, 116, 114, 117, 101, 46, 115, + 5, 98, 101, 113, 46, 115, + 5, 98, 103, 101, 46, 115, + 5, 98, 103, 116, 46, 115, + 5, 98, 108, 101, 46, 115, + 5, 98, 108, 116, 46, 115, + 8, 98, 110, 101, 46, 117, 110, 46, 115, + 8, 98, 103, 101, 46, 117, 110, 46, 115, + 8, 98, 103, 116, 46, 117, 110, 46, 115, + 8, 98, 108, 101, 46, 117, 110, 46, 115, + 8, 98, 108, 116, 46, 117, 110, 46, 115, + 2, 98, 114, + 7, 98, 114, 102, 97, 108, 115, 101, + 6, 98, 114, 116, 114, 117, 101, + 3, 98, 101, 113, + 3, 98, 103, 101, + 3, 98, 103, 116, + 3, 98, 108, 101, + 3, 98, 108, 116, + 6, 98, 110, 101, 46, 117, 110, + 6, 98, 103, 101, 46, 117, 110, + 6, 98, 103, 116, 46, 117, 110, + 6, 98, 108, 101, 46, 117, 110, + 6, 98, 108, 116, 46, 117, 110, + 6, 115, 119, 105, 116, 99, 104, + 8, 108, 100, 105, 110, 100, 46, 105, 49, + 8, 108, 100, 105, 110, 100, 46, 117, 49, + 8, 108, 100, 105, 110, 100, 46, 105, 50, + 8, 108, 100, 105, 110, 100, 46, 117, 50, + 8, 108, 100, 105, 110, 100, 46, 105, 52, + 8, 108, 100, 105, 110, 100, 46, 117, 52, + 8, 108, 100, 105, 110, 100, 46, 105, 56, + 7, 108, 100, 105, 110, 100, 46, 105, + 8, 108, 100, 105, 110, 100, 46, 114, 52, + 8, 108, 100, 105, 110, 100, 46, 114, 56, + 9, 108, 100, 105, 110, 100, 46, 114, 101, 102, + 9, 115, 116, 105, 110, 100, 46, 114, 101, 102, + 8, 115, 116, 105, 110, 100, 46, 105, 49, + 8, 115, 116, 105, 110, 100, 46, 105, 50, + 8, 115, 116, 105, 110, 100, 46, 105, 52, + 8, 115, 116, 105, 110, 100, 46, 105, 56, + 8, 115, 116, 105, 110, 100, 46, 114, 52, + 8, 115, 116, 105, 110, 100, 46, 114, 56, + 3, 97, 100, 100, + 3, 115, 117, 98, + 3, 109, 117, 108, + 3, 100, 105, 118, + 6, 100, 105, 118, 46, 117, 110, + 3, 114, 101, 109, + 6, 114, 101, 109, 46, 117, 110, + 3, 97, 110, 100, + 2, 111, 114, + 3, 120, 111, 114, + 3, 115, 104, 108, + 3, 115, 104, 114, + 6, 115, 104, 114, 46, 117, 110, + 3, 110, 101, 103, + 3, 110, 111, 116, + 7, 99, 111, 110, 118, 46, 105, 49, + 7, 99, 111, 110, 118, 46, 105, 50, + 7, 99, 111, 110, 118, 46, 105, 52, + 7, 99, 111, 110, 118, 46, 105, 56, + 7, 99, 111, 110, 118, 46, 114, 52, + 7, 99, 111, 110, 118, 46, 114, 56, + 7, 99, 111, 110, 118, 46, 117, 52, + 7, 99, 111, 110, 118, 46, 117, 56, + 8, 99, 97, 108, 108, 118, 105, 114, 116, + 5, 99, 112, 111, 98, 106, + 5, 108, 100, 111, 98, 106, + 5, 108, 100, 115, 116, 114, + 6, 110, 101, 119, 111, 98, 106, + 9, 99, 97, 115, 116, 99, 108, 97, 115, 115, + 6, 105, 115, 105, 110, 115, 116, + 9, 99, 111, 110, 118, 46, 114, 46, 117, 110, + 5, 117, 110, 98, 111, 120, + 5, 116, 104, 114, 111, 119, + 5, 108, 100, 102, 108, 100, + 6, 108, 100, 102, 108, 100, 97, + 5, 115, 116, 102, 108, 100, + 6, 108, 100, 115, 102, 108, 100, + 7, 108, 100, 115, 102, 108, 100, 97, + 6, 115, 116, 115, 102, 108, 100, + 5, 115, 116, 111, 98, 106, + 14, 99, 111, 110, 118, 46, 111, 118, 102, 46, 105, 49, 46, 117, 110, + 14, 99, 111, 110, 118, 46, 111, 118, 102, 46, 105, 50, 46, 117, 110, + 14, 99, 111, 110, 118, 46, 111, 118, 102, 46, 105, 52, 46, 117, 110, + 14, 99, 111, 110, 118, 46, 111, 118, 102, 46, 105, 56, 46, 117, 110, + 14, 99, 111, 110, 118, 46, 111, 118, 102, 46, 117, 49, 46, 117, 110, + 14, 99, 111, 110, 118, 46, 111, 118, 102, 46, 117, 50, 46, 117, 110, + 14, 99, 111, 110, 118, 46, 111, 118, 102, 46, 117, 52, 46, 117, 110, + 14, 99, 111, 110, 118, 46, 111, 118, 102, 46, 117, 56, 46, 117, 110, + 13, 99, 111, 110, 118, 46, 111, 118, 102, 46, 105, 46, 117, 110, + 13, 99, 111, 110, 118, 46, 111, 118, 102, 46, 117, 46, 117, 110, + 3, 98, 111, 120, + 6, 110, 101, 119, 97, 114, 114, + 5, 108, 100, 108, 101, 110, + 7, 108, 100, 101, 108, 101, 109, 97, + 9, 108, 100, 101, 108, 101, 109, 46, 105, 49, + 9, 108, 100, 101, 108, 101, 109, 46, 117, 49, + 9, 108, 100, 101, 108, 101, 109, 46, 105, 50, + 9, 108, 100, 101, 108, 101, 109, 46, 117, 50, + 9, 108, 100, 101, 108, 101, 109, 46, 105, 52, + 9, 108, 100, 101, 108, 101, 109, 46, 117, 52, + 9, 108, 100, 101, 108, 101, 109, 46, 105, 56, + 8, 108, 100, 101, 108, 101, 109, 46, 105, + 9, 108, 100, 101, 108, 101, 109, 46, 114, 52, + 9, 108, 100, 101, 108, 101, 109, 46, 114, 56, + 10, 108, 100, 101, 108, 101, 109, 46, 114, 101, 102, + 8, 115, 116, 101, 108, 101, 109, 46, 105, + 9, 115, 116, 101, 108, 101, 109, 46, 105, 49, + 9, 115, 116, 101, 108, 101, 109, 46, 105, 50, + 9, 115, 116, 101, 108, 101, 109, 46, 105, 52, + 9, 115, 116, 101, 108, 101, 109, 46, 105, 56, + 9, 115, 116, 101, 108, 101, 109, 46, 114, 52, + 9, 115, 116, 101, 108, 101, 109, 46, 114, 56, + 10, 115, 116, 101, 108, 101, 109, 46, 114, 101, 102, + 10, 108, 100, 101, 108, 101, 109, 46, 97, 110, 121, + 10, 115, 116, 101, 108, 101, 109, 46, 97, 110, 121, + 9, 117, 110, 98, 111, 120, 46, 97, 110, 121, + 11, 99, 111, 110, 118, 46, 111, 118, 102, 46, 105, 49, + 11, 99, 111, 110, 118, 46, 111, 118, 102, 46, 117, 49, + 11, 99, 111, 110, 118, 46, 111, 118, 102, 46, 105, 50, + 11, 99, 111, 110, 118, 46, 111, 118, 102, 46, 117, 50, + 11, 99, 111, 110, 118, 46, 111, 118, 102, 46, 105, 52, + 11, 99, 111, 110, 118, 46, 111, 118, 102, 46, 117, 52, + 11, 99, 111, 110, 118, 46, 111, 118, 102, 46, 105, 56, + 11, 99, 111, 110, 118, 46, 111, 118, 102, 46, 117, 56, + 9, 114, 101, 102, 97, 110, 121, 118, 97, 108, + 8, 99, 107, 102, 105, 110, 105, 116, 101, + 8, 109, 107, 114, 101, 102, 97, 110, 121, + 7, 108, 100, 116, 111, 107, 101, 110, + 7, 99, 111, 110, 118, 46, 117, 50, + 7, 99, 111, 110, 118, 46, 117, 49, + 6, 99, 111, 110, 118, 46, 105, + 10, 99, 111, 110, 118, 46, 111, 118, 102, 46, 105, + 10, 99, 111, 110, 118, 46, 111, 118, 102, 46, 117, + 7, 97, 100, 100, 46, 111, 118, 102, + 10, 97, 100, 100, 46, 111, 118, 102, 46, 117, 110, + 7, 109, 117, 108, 46, 111, 118, 102, + 10, 109, 117, 108, 46, 111, 118, 102, 46, 117, 110, + 7, 115, 117, 98, 46, 111, 118, 102, + 10, 115, 117, 98, 46, 111, 118, 102, 46, 117, 110, + 10, 101, 110, 100, 102, 105, 110, 97, 108, 108, 121, + 5, 108, 101, 97, 118, 101, + 7, 108, 101, 97, 118, 101, 46, 115, + 7, 115, 116, 105, 110, 100, 46, 105, + 6, 99, 111, 110, 118, 46, 117, + 7, 97, 114, 103, 108, 105, 115, 116, + 3, 99, 101, 113, + 3, 99, 103, 116, + 6, 99, 103, 116, 46, 117, 110, + 3, 99, 108, 116, + 6, 99, 108, 116, 46, 117, 110, + 5, 108, 100, 102, 116, 110, + 9, 108, 100, 118, 105, 114, 116, 102, 116, 110, + 5, 108, 100, 97, 114, 103, + 6, 108, 100, 97, 114, 103, 97, + 5, 115, 116, 97, 114, 103, + 5, 108, 100, 108, 111, 99, + 6, 108, 100, 108, 111, 99, 97, + 5, 115, 116, 108, 111, 99, + 8, 108, 111, 99, 97, 108, 108, 111, 99, + 9, 101, 110, 100, 102, 105, 108, 116, 101, 114, + 10, 117, 110, 97, 108, 105, 103, 110, 101, 100, 46, + 9, 118, 111, 108, 97, 116, 105, 108, 101, 46, + 5, 116, 97, 105, 108, 46, + 7, 105, 110, 105, 116, 111, 98, 106, + 12, 99, 111, 110, 115, 116, 114, 97, 105, 110, 101, 100, 46, + 5, 99, 112, 98, 108, 107, + 7, 105, 110, 105, 116, 98, 108, 107, + 3, 110, 111, 46, + 7, 114, 101, 116, 104, 114, 111, 119, + 6, 115, 105, 122, 101, 111, 102, + 10, 114, 101, 102, 97, 110, 121, 116, 121, 112, 101, + 9, 114, 101, 97, 100, 111, 110, 108, 121, 46, + }; + + names = new string [219]; + + for (int i = 0, p = 0; i < names.Length; i++) { + var buffer = new char [table [p++]]; + + for (int j = 0; j < buffer.Length; j++) + buffer [j] = (char)table [p++]; + + names [i] = new string (buffer); + } + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCode.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCode.cs.meta new file mode 100644 index 0000000..21d9966 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d8b234c106529441912c10b87502175 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCodes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCodes.cs new file mode 100644 index 0000000..f05d164 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCodes.cs @@ -0,0 +1,894 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil.Cil { + + public static class OpCodes { + + internal static readonly OpCode [] OneByteOpCode = new OpCode [0xe0 + 1]; + internal static readonly OpCode [] TwoBytesOpCode = new OpCode [0x1e + 1]; + + public static readonly OpCode Nop = new OpCode ( + 0xff << 0 | 0x00 << 8 | (byte)Code.Nop << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Break = new OpCode ( + 0xff << 0 | 0x01 << 8 | (byte)Code.Break << 16 | (byte)FlowControl.Break << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ldarg_0 = new OpCode ( + 0xff << 0 | 0x02 << 8 | (byte)Code.Ldarg_0 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldarg_1 = new OpCode ( + 0xff << 0 | 0x03 << 8 | (byte)Code.Ldarg_1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldarg_2 = new OpCode ( + 0xff << 0 | 0x04 << 8 | (byte)Code.Ldarg_2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldarg_3 = new OpCode ( + 0xff << 0 | 0x05 << 8 | (byte)Code.Ldarg_3 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldloc_0 = new OpCode ( + 0xff << 0 | 0x06 << 8 | (byte)Code.Ldloc_0 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldloc_1 = new OpCode ( + 0xff << 0 | 0x07 << 8 | (byte)Code.Ldloc_1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldloc_2 = new OpCode ( + 0xff << 0 | 0x08 << 8 | (byte)Code.Ldloc_2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldloc_3 = new OpCode ( + 0xff << 0 | 0x09 << 8 | (byte)Code.Ldloc_3 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Stloc_0 = new OpCode ( + 0xff << 0 | 0x0a << 8 | (byte)Code.Stloc_0 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stloc_1 = new OpCode ( + 0xff << 0 | 0x0b << 8 | (byte)Code.Stloc_1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stloc_2 = new OpCode ( + 0xff << 0 | 0x0c << 8 | (byte)Code.Stloc_2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stloc_3 = new OpCode ( + 0xff << 0 | 0x0d << 8 | (byte)Code.Stloc_3 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ldarg_S = new OpCode ( + 0xff << 0 | 0x0e << 8 | (byte)Code.Ldarg_S << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineArg << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldarga_S = new OpCode ( + 0xff << 0 | 0x0f << 8 | (byte)Code.Ldarga_S << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineArg << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Starg_S = new OpCode ( + 0xff << 0 | 0x10 << 8 | (byte)Code.Starg_S << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineArg << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ldloc_S = new OpCode ( + 0xff << 0 | 0x11 << 8 | (byte)Code.Ldloc_S << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineVar << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldloca_S = new OpCode ( + 0xff << 0 | 0x12 << 8 | (byte)Code.Ldloca_S << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineVar << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Stloc_S = new OpCode ( + 0xff << 0 | 0x13 << 8 | (byte)Code.Stloc_S << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineVar << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ldnull = new OpCode ( + 0xff << 0 | 0x14 << 8 | (byte)Code.Ldnull << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushref << 24); + + public static readonly OpCode Ldc_I4_M1 = new OpCode ( + 0xff << 0 | 0x15 << 8 | (byte)Code.Ldc_I4_M1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I4_0 = new OpCode ( + 0xff << 0 | 0x16 << 8 | (byte)Code.Ldc_I4_0 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I4_1 = new OpCode ( + 0xff << 0 | 0x17 << 8 | (byte)Code.Ldc_I4_1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I4_2 = new OpCode ( + 0xff << 0 | 0x18 << 8 | (byte)Code.Ldc_I4_2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I4_3 = new OpCode ( + 0xff << 0 | 0x19 << 8 | (byte)Code.Ldc_I4_3 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I4_4 = new OpCode ( + 0xff << 0 | 0x1a << 8 | (byte)Code.Ldc_I4_4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I4_5 = new OpCode ( + 0xff << 0 | 0x1b << 8 | (byte)Code.Ldc_I4_5 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I4_6 = new OpCode ( + 0xff << 0 | 0x1c << 8 | (byte)Code.Ldc_I4_6 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I4_7 = new OpCode ( + 0xff << 0 | 0x1d << 8 | (byte)Code.Ldc_I4_7 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I4_8 = new OpCode ( + 0xff << 0 | 0x1e << 8 | (byte)Code.Ldc_I4_8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I4_S = new OpCode ( + 0xff << 0 | 0x1f << 8 | (byte)Code.Ldc_I4_S << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineI << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I4 = new OpCode ( + 0xff << 0 | 0x20 << 8 | (byte)Code.Ldc_I4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineI << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldc_I8 = new OpCode ( + 0xff << 0 | 0x21 << 8 | (byte)Code.Ldc_I8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineI8 << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi8 << 24); + + public static readonly OpCode Ldc_R4 = new OpCode ( + 0xff << 0 | 0x22 << 8 | (byte)Code.Ldc_R4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.ShortInlineR << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushr4 << 24); + + public static readonly OpCode Ldc_R8 = new OpCode ( + 0xff << 0 | 0x23 << 8 | (byte)Code.Ldc_R8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineR << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushr8 << 24); + + public static readonly OpCode Dup = new OpCode ( + 0xff << 0 | 0x25 << 8 | (byte)Code.Dup << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push1_push1 << 24); + + public static readonly OpCode Pop = new OpCode ( + 0xff << 0 | 0x26 << 8 | (byte)Code.Pop << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Jmp = new OpCode ( + 0xff << 0 | 0x27 << 8 | (byte)Code.Jmp << 16 | (byte)FlowControl.Call << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineMethod << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Call = new OpCode ( + 0xff << 0 | 0x28 << 8 | (byte)Code.Call << 16 | (byte)FlowControl.Call << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineMethod << 8 | (byte)StackBehaviour.Varpop << 16 | (byte)StackBehaviour.Varpush << 24); + + public static readonly OpCode Calli = new OpCode ( + 0xff << 0 | 0x29 << 8 | (byte)Code.Calli << 16 | (byte)FlowControl.Call << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineSig << 8 | (byte)StackBehaviour.Varpop << 16 | (byte)StackBehaviour.Varpush << 24); + + public static readonly OpCode Ret = new OpCode ( + 0xff << 0 | 0x2a << 8 | (byte)Code.Ret << 16 | (byte)FlowControl.Return << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Varpop << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Br_S = new OpCode ( + 0xff << 0 | 0x2b << 8 | (byte)Code.Br_S << 16 | (byte)FlowControl.Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Brfalse_S = new OpCode ( + 0xff << 0 | 0x2c << 8 | (byte)Code.Brfalse_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Brtrue_S = new OpCode ( + 0xff << 0 | 0x2d << 8 | (byte)Code.Brtrue_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Beq_S = new OpCode ( + 0xff << 0 | 0x2e << 8 | (byte)Code.Beq_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Bge_S = new OpCode ( + 0xff << 0 | 0x2f << 8 | (byte)Code.Bge_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Bgt_S = new OpCode ( + 0xff << 0 | 0x30 << 8 | (byte)Code.Bgt_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ble_S = new OpCode ( + 0xff << 0 | 0x31 << 8 | (byte)Code.Ble_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Blt_S = new OpCode ( + 0xff << 0 | 0x32 << 8 | (byte)Code.Blt_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Bne_Un_S = new OpCode ( + 0xff << 0 | 0x33 << 8 | (byte)Code.Bne_Un_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Bge_Un_S = new OpCode ( + 0xff << 0 | 0x34 << 8 | (byte)Code.Bge_Un_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Bgt_Un_S = new OpCode ( + 0xff << 0 | 0x35 << 8 | (byte)Code.Bgt_Un_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ble_Un_S = new OpCode ( + 0xff << 0 | 0x36 << 8 | (byte)Code.Ble_Un_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Blt_Un_S = new OpCode ( + 0xff << 0 | 0x37 << 8 | (byte)Code.Blt_Un_S << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Br = new OpCode ( + 0xff << 0 | 0x38 << 8 | (byte)Code.Br << 16 | (byte)FlowControl.Branch << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Brfalse = new OpCode ( + 0xff << 0 | 0x39 << 8 | (byte)Code.Brfalse << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Brtrue = new OpCode ( + 0xff << 0 | 0x3a << 8 | (byte)Code.Brtrue << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Beq = new OpCode ( + 0xff << 0 | 0x3b << 8 | (byte)Code.Beq << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Bge = new OpCode ( + 0xff << 0 | 0x3c << 8 | (byte)Code.Bge << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Bgt = new OpCode ( + 0xff << 0 | 0x3d << 8 | (byte)Code.Bgt << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ble = new OpCode ( + 0xff << 0 | 0x3e << 8 | (byte)Code.Ble << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Blt = new OpCode ( + 0xff << 0 | 0x3f << 8 | (byte)Code.Blt << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Bne_Un = new OpCode ( + 0xff << 0 | 0x40 << 8 | (byte)Code.Bne_Un << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Bge_Un = new OpCode ( + 0xff << 0 | 0x41 << 8 | (byte)Code.Bge_Un << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Bgt_Un = new OpCode ( + 0xff << 0 | 0x42 << 8 | (byte)Code.Bgt_Un << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ble_Un = new OpCode ( + 0xff << 0 | 0x43 << 8 | (byte)Code.Ble_Un << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Blt_Un = new OpCode ( + 0xff << 0 | 0x44 << 8 | (byte)Code.Blt_Un << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Switch = new OpCode ( + 0xff << 0 | 0x45 << 8 | (byte)Code.Switch << 16 | (byte)FlowControl.Cond_Branch << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineSwitch << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ldind_I1 = new OpCode ( + 0xff << 0 | 0x46 << 8 | (byte)Code.Ldind_I1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldind_U1 = new OpCode ( + 0xff << 0 | 0x47 << 8 | (byte)Code.Ldind_U1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldind_I2 = new OpCode ( + 0xff << 0 | 0x48 << 8 | (byte)Code.Ldind_I2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldind_U2 = new OpCode ( + 0xff << 0 | 0x49 << 8 | (byte)Code.Ldind_U2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldind_I4 = new OpCode ( + 0xff << 0 | 0x4a << 8 | (byte)Code.Ldind_I4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldind_U4 = new OpCode ( + 0xff << 0 | 0x4b << 8 | (byte)Code.Ldind_U4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldind_I8 = new OpCode ( + 0xff << 0 | 0x4c << 8 | (byte)Code.Ldind_I8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushi8 << 24); + + public static readonly OpCode Ldind_I = new OpCode ( + 0xff << 0 | 0x4d << 8 | (byte)Code.Ldind_I << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldind_R4 = new OpCode ( + 0xff << 0 | 0x4e << 8 | (byte)Code.Ldind_R4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushr4 << 24); + + public static readonly OpCode Ldind_R8 = new OpCode ( + 0xff << 0 | 0x4f << 8 | (byte)Code.Ldind_R8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushr8 << 24); + + public static readonly OpCode Ldind_Ref = new OpCode ( + 0xff << 0 | 0x50 << 8 | (byte)Code.Ldind_Ref << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushref << 24); + + public static readonly OpCode Stind_Ref = new OpCode ( + 0xff << 0 | 0x51 << 8 | (byte)Code.Stind_Ref << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stind_I1 = new OpCode ( + 0xff << 0 | 0x52 << 8 | (byte)Code.Stind_I1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stind_I2 = new OpCode ( + 0xff << 0 | 0x53 << 8 | (byte)Code.Stind_I2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stind_I4 = new OpCode ( + 0xff << 0 | 0x54 << 8 | (byte)Code.Stind_I4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stind_I8 = new OpCode ( + 0xff << 0 | 0x55 << 8 | (byte)Code.Stind_I8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi_popi8 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stind_R4 = new OpCode ( + 0xff << 0 | 0x56 << 8 | (byte)Code.Stind_R4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi_popr4 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stind_R8 = new OpCode ( + 0xff << 0 | 0x57 << 8 | (byte)Code.Stind_R8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi_popr8 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Add = new OpCode ( + 0xff << 0 | 0x58 << 8 | (byte)Code.Add << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Sub = new OpCode ( + 0xff << 0 | 0x59 << 8 | (byte)Code.Sub << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Mul = new OpCode ( + 0xff << 0 | 0x5a << 8 | (byte)Code.Mul << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Div = new OpCode ( + 0xff << 0 | 0x5b << 8 | (byte)Code.Div << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Div_Un = new OpCode ( + 0xff << 0 | 0x5c << 8 | (byte)Code.Div_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Rem = new OpCode ( + 0xff << 0 | 0x5d << 8 | (byte)Code.Rem << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Rem_Un = new OpCode ( + 0xff << 0 | 0x5e << 8 | (byte)Code.Rem_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode And = new OpCode ( + 0xff << 0 | 0x5f << 8 | (byte)Code.And << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Or = new OpCode ( + 0xff << 0 | 0x60 << 8 | (byte)Code.Or << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Xor = new OpCode ( + 0xff << 0 | 0x61 << 8 | (byte)Code.Xor << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Shl = new OpCode ( + 0xff << 0 | 0x62 << 8 | (byte)Code.Shl << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Shr = new OpCode ( + 0xff << 0 | 0x63 << 8 | (byte)Code.Shr << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Shr_Un = new OpCode ( + 0xff << 0 | 0x64 << 8 | (byte)Code.Shr_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Neg = new OpCode ( + 0xff << 0 | 0x65 << 8 | (byte)Code.Neg << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Not = new OpCode ( + 0xff << 0 | 0x66 << 8 | (byte)Code.Not << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Conv_I1 = new OpCode ( + 0xff << 0 | 0x67 << 8 | (byte)Code.Conv_I1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_I2 = new OpCode ( + 0xff << 0 | 0x68 << 8 | (byte)Code.Conv_I2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_I4 = new OpCode ( + 0xff << 0 | 0x69 << 8 | (byte)Code.Conv_I4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_I8 = new OpCode ( + 0xff << 0 | 0x6a << 8 | (byte)Code.Conv_I8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi8 << 24); + + public static readonly OpCode Conv_R4 = new OpCode ( + 0xff << 0 | 0x6b << 8 | (byte)Code.Conv_R4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushr4 << 24); + + public static readonly OpCode Conv_R8 = new OpCode ( + 0xff << 0 | 0x6c << 8 | (byte)Code.Conv_R8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushr8 << 24); + + public static readonly OpCode Conv_U4 = new OpCode ( + 0xff << 0 | 0x6d << 8 | (byte)Code.Conv_U4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_U8 = new OpCode ( + 0xff << 0 | 0x6e << 8 | (byte)Code.Conv_U8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi8 << 24); + + public static readonly OpCode Callvirt = new OpCode ( + 0xff << 0 | 0x6f << 8 | (byte)Code.Callvirt << 16 | (byte)FlowControl.Call << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineMethod << 8 | (byte)StackBehaviour.Varpop << 16 | (byte)StackBehaviour.Varpush << 24); + + public static readonly OpCode Cpobj = new OpCode ( + 0xff << 0 | 0x70 << 8 | (byte)Code.Cpobj << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ldobj = new OpCode ( + 0xff << 0 | 0x71 << 8 | (byte)Code.Ldobj << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldstr = new OpCode ( + 0xff << 0 | 0x72 << 8 | (byte)Code.Ldstr << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineString << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushref << 24); + + public static readonly OpCode Newobj = new OpCode ( + 0xff << 0 | 0x73 << 8 | (byte)Code.Newobj << 16 | (byte)FlowControl.Call << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineMethod << 8 | (byte)StackBehaviour.Varpop << 16 | (byte)StackBehaviour.Pushref << 24); + + public static readonly OpCode Castclass = new OpCode ( + 0xff << 0 | 0x74 << 8 | (byte)Code.Castclass << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popref << 16 | (byte)StackBehaviour.Pushref << 24); + + public static readonly OpCode Isinst = new OpCode ( + 0xff << 0 | 0x75 << 8 | (byte)Code.Isinst << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popref << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_R_Un = new OpCode ( + 0xff << 0 | 0x76 << 8 | (byte)Code.Conv_R_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushr8 << 24); + + public static readonly OpCode Unbox = new OpCode ( + 0xff << 0 | 0x79 << 8 | (byte)Code.Unbox << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popref << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Throw = new OpCode ( + 0xff << 0 | 0x7a << 8 | (byte)Code.Throw << 16 | (byte)FlowControl.Throw << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ldfld = new OpCode ( + 0xff << 0 | 0x7b << 8 | (byte)Code.Ldfld << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineField << 8 | (byte)StackBehaviour.Popref << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldflda = new OpCode ( + 0xff << 0 | 0x7c << 8 | (byte)Code.Ldflda << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineField << 8 | (byte)StackBehaviour.Popref << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Stfld = new OpCode ( + 0xff << 0 | 0x7d << 8 | (byte)Code.Stfld << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineField << 8 | (byte)StackBehaviour.Popref_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ldsfld = new OpCode ( + 0xff << 0 | 0x7e << 8 | (byte)Code.Ldsfld << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineField << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldsflda = new OpCode ( + 0xff << 0 | 0x7f << 8 | (byte)Code.Ldsflda << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineField << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Stsfld = new OpCode ( + 0xff << 0 | 0x80 << 8 | (byte)Code.Stsfld << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineField << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stobj = new OpCode ( + 0xff << 0 | 0x81 << 8 | (byte)Code.Stobj << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popi_pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Conv_Ovf_I1_Un = new OpCode ( + 0xff << 0 | 0x82 << 8 | (byte)Code.Conv_Ovf_I1_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_I2_Un = new OpCode ( + 0xff << 0 | 0x83 << 8 | (byte)Code.Conv_Ovf_I2_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_I4_Un = new OpCode ( + 0xff << 0 | 0x84 << 8 | (byte)Code.Conv_Ovf_I4_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_I8_Un = new OpCode ( + 0xff << 0 | 0x85 << 8 | (byte)Code.Conv_Ovf_I8_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi8 << 24); + + public static readonly OpCode Conv_Ovf_U1_Un = new OpCode ( + 0xff << 0 | 0x86 << 8 | (byte)Code.Conv_Ovf_U1_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_U2_Un = new OpCode ( + 0xff << 0 | 0x87 << 8 | (byte)Code.Conv_Ovf_U2_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_U4_Un = new OpCode ( + 0xff << 0 | 0x88 << 8 | (byte)Code.Conv_Ovf_U4_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_U8_Un = new OpCode ( + 0xff << 0 | 0x89 << 8 | (byte)Code.Conv_Ovf_U8_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi8 << 24); + + public static readonly OpCode Conv_Ovf_I_Un = new OpCode ( + 0xff << 0 | 0x8a << 8 | (byte)Code.Conv_Ovf_I_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_U_Un = new OpCode ( + 0xff << 0 | 0x8b << 8 | (byte)Code.Conv_Ovf_U_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Box = new OpCode ( + 0xff << 0 | 0x8c << 8 | (byte)Code.Box << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushref << 24); + + public static readonly OpCode Newarr = new OpCode ( + 0xff << 0 | 0x8d << 8 | (byte)Code.Newarr << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushref << 24); + + public static readonly OpCode Ldlen = new OpCode ( + 0xff << 0 | 0x8e << 8 | (byte)Code.Ldlen << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldelema = new OpCode ( + 0xff << 0 | 0x8f << 8 | (byte)Code.Ldelema << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldelem_I1 = new OpCode ( + 0xff << 0 | 0x90 << 8 | (byte)Code.Ldelem_I1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldelem_U1 = new OpCode ( + 0xff << 0 | 0x91 << 8 | (byte)Code.Ldelem_U1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldelem_I2 = new OpCode ( + 0xff << 0 | 0x92 << 8 | (byte)Code.Ldelem_I2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldelem_U2 = new OpCode ( + 0xff << 0 | 0x93 << 8 | (byte)Code.Ldelem_U2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldelem_I4 = new OpCode ( + 0xff << 0 | 0x94 << 8 | (byte)Code.Ldelem_I4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldelem_U4 = new OpCode ( + 0xff << 0 | 0x95 << 8 | (byte)Code.Ldelem_U4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldelem_I8 = new OpCode ( + 0xff << 0 | 0x96 << 8 | (byte)Code.Ldelem_I8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushi8 << 24); + + public static readonly OpCode Ldelem_I = new OpCode ( + 0xff << 0 | 0x97 << 8 | (byte)Code.Ldelem_I << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldelem_R4 = new OpCode ( + 0xff << 0 | 0x98 << 8 | (byte)Code.Ldelem_R4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushr4 << 24); + + public static readonly OpCode Ldelem_R8 = new OpCode ( + 0xff << 0 | 0x99 << 8 | (byte)Code.Ldelem_R8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushr8 << 24); + + public static readonly OpCode Ldelem_Ref = new OpCode ( + 0xff << 0 | 0x9a << 8 | (byte)Code.Ldelem_Ref << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Pushref << 24); + + public static readonly OpCode Stelem_I = new OpCode ( + 0xff << 0 | 0x9b << 8 | (byte)Code.Stelem_I << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stelem_I1 = new OpCode ( + 0xff << 0 | 0x9c << 8 | (byte)Code.Stelem_I1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stelem_I2 = new OpCode ( + 0xff << 0 | 0x9d << 8 | (byte)Code.Stelem_I2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stelem_I4 = new OpCode ( + 0xff << 0 | 0x9e << 8 | (byte)Code.Stelem_I4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stelem_I8 = new OpCode ( + 0xff << 0 | 0x9f << 8 | (byte)Code.Stelem_I8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi_popi8 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stelem_R4 = new OpCode ( + 0xff << 0 | 0xa0 << 8 | (byte)Code.Stelem_R4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi_popr4 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stelem_R8 = new OpCode ( + 0xff << 0 | 0xa1 << 8 | (byte)Code.Stelem_R8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi_popr8 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stelem_Ref = new OpCode ( + 0xff << 0 | 0xa2 << 8 | (byte)Code.Stelem_Ref << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popref_popi_popref << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ldelem_Any = new OpCode ( + 0xff << 0 | 0xa3 << 8 | (byte)Code.Ldelem_Any << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popref_popi << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Stelem_Any = new OpCode ( + 0xff << 0 | 0xa4 << 8 | (byte)Code.Stelem_Any << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popref_popi_popref << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Unbox_Any = new OpCode ( + 0xff << 0 | 0xa5 << 8 | (byte)Code.Unbox_Any << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popref << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Conv_Ovf_I1 = new OpCode ( + 0xff << 0 | 0xb3 << 8 | (byte)Code.Conv_Ovf_I1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_U1 = new OpCode ( + 0xff << 0 | 0xb4 << 8 | (byte)Code.Conv_Ovf_U1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_I2 = new OpCode ( + 0xff << 0 | 0xb5 << 8 | (byte)Code.Conv_Ovf_I2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_U2 = new OpCode ( + 0xff << 0 | 0xb6 << 8 | (byte)Code.Conv_Ovf_U2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_I4 = new OpCode ( + 0xff << 0 | 0xb7 << 8 | (byte)Code.Conv_Ovf_I4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_U4 = new OpCode ( + 0xff << 0 | 0xb8 << 8 | (byte)Code.Conv_Ovf_U4 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_I8 = new OpCode ( + 0xff << 0 | 0xb9 << 8 | (byte)Code.Conv_Ovf_I8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi8 << 24); + + public static readonly OpCode Conv_Ovf_U8 = new OpCode ( + 0xff << 0 | 0xba << 8 | (byte)Code.Conv_Ovf_U8 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi8 << 24); + + public static readonly OpCode Refanyval = new OpCode ( + 0xff << 0 | 0xc2 << 8 | (byte)Code.Refanyval << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ckfinite = new OpCode ( + 0xff << 0 | 0xc3 << 8 | (byte)Code.Ckfinite << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushr8 << 24); + + public static readonly OpCode Mkrefany = new OpCode ( + 0xff << 0 | 0xc6 << 8 | (byte)Code.Mkrefany << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldtoken = new OpCode ( + 0xff << 0 | 0xd0 << 8 | (byte)Code.Ldtoken << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineTok << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_U2 = new OpCode ( + 0xff << 0 | 0xd1 << 8 | (byte)Code.Conv_U2 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_U1 = new OpCode ( + 0xff << 0 | 0xd2 << 8 | (byte)Code.Conv_U1 << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_I = new OpCode ( + 0xff << 0 | 0xd3 << 8 | (byte)Code.Conv_I << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_I = new OpCode ( + 0xff << 0 | 0xd4 << 8 | (byte)Code.Conv_Ovf_I << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Conv_Ovf_U = new OpCode ( + 0xff << 0 | 0xd5 << 8 | (byte)Code.Conv_Ovf_U << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Add_Ovf = new OpCode ( + 0xff << 0 | 0xd6 << 8 | (byte)Code.Add_Ovf << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Add_Ovf_Un = new OpCode ( + 0xff << 0 | 0xd7 << 8 | (byte)Code.Add_Ovf_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Mul_Ovf = new OpCode ( + 0xff << 0 | 0xd8 << 8 | (byte)Code.Mul_Ovf << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Mul_Ovf_Un = new OpCode ( + 0xff << 0 | 0xd9 << 8 | (byte)Code.Mul_Ovf_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Sub_Ovf = new OpCode ( + 0xff << 0 | 0xda << 8 | (byte)Code.Sub_Ovf << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Sub_Ovf_Un = new OpCode ( + 0xff << 0 | 0xdb << 8 | (byte)Code.Sub_Ovf_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Endfinally = new OpCode ( + 0xff << 0 | 0xdc << 8 | (byte)Code.Endfinally << 16 | (byte)FlowControl.Return << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Leave = new OpCode ( + 0xff << 0 | 0xdd << 8 | (byte)Code.Leave << 16 | (byte)FlowControl.Branch << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineBrTarget << 8 | (byte)StackBehaviour.PopAll << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Leave_S = new OpCode ( + 0xff << 0 | 0xde << 8 | (byte)Code.Leave_S << 16 | (byte)FlowControl.Branch << 24, + (byte)OpCodeType.Macro << 0 | (byte)OperandType.ShortInlineBrTarget << 8 | (byte)StackBehaviour.PopAll << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Stind_I = new OpCode ( + 0xff << 0 | 0xdf << 8 | (byte)Code.Stind_I << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Conv_U = new OpCode ( + 0xff << 0 | 0xe0 << 8 | (byte)Code.Conv_U << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Arglist = new OpCode ( + 0xfe << 0 | 0x00 << 8 | (byte)Code.Arglist << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ceq = new OpCode ( + 0xfe << 0 | 0x01 << 8 | (byte)Code.Ceq << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Cgt = new OpCode ( + 0xfe << 0 | 0x02 << 8 | (byte)Code.Cgt << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Cgt_Un = new OpCode ( + 0xfe << 0 | 0x03 << 8 | (byte)Code.Cgt_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Clt = new OpCode ( + 0xfe << 0 | 0x04 << 8 | (byte)Code.Clt << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Clt_Un = new OpCode ( + 0xfe << 0 | 0x05 << 8 | (byte)Code.Clt_Un << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1_pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldftn = new OpCode ( + 0xfe << 0 | 0x06 << 8 | (byte)Code.Ldftn << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineMethod << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldvirtftn = new OpCode ( + 0xfe << 0 | 0x07 << 8 | (byte)Code.Ldvirtftn << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineMethod << 8 | (byte)StackBehaviour.Popref << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Ldarg = new OpCode ( + 0xfe << 0 | 0x09 << 8 | (byte)Code.Ldarg << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineArg << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldarga = new OpCode ( + 0xfe << 0 | 0x0a << 8 | (byte)Code.Ldarga << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineArg << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Starg = new OpCode ( + 0xfe << 0 | 0x0b << 8 | (byte)Code.Starg << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineArg << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Ldloc = new OpCode ( + 0xfe << 0 | 0x0c << 8 | (byte)Code.Ldloc << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineVar << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push1 << 24); + + public static readonly OpCode Ldloca = new OpCode ( + 0xfe << 0 | 0x0d << 8 | (byte)Code.Ldloca << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineVar << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Stloc = new OpCode ( + 0xfe << 0 | 0x0e << 8 | (byte)Code.Stloc << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineVar << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Localloc = new OpCode ( + 0xfe << 0 | 0x0f << 8 | (byte)Code.Localloc << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Endfilter = new OpCode ( + 0xfe << 0 | 0x11 << 8 | (byte)Code.Endfilter << 16 | (byte)FlowControl.Return << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Unaligned = new OpCode ( + 0xfe << 0 | 0x12 << 8 | (byte)Code.Unaligned << 16 | (byte)FlowControl.Meta << 24, + (byte)OpCodeType.Prefix << 0 | (byte)OperandType.ShortInlineI << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Volatile = new OpCode ( + 0xfe << 0 | 0x13 << 8 | (byte)Code.Volatile << 16 | (byte)FlowControl.Meta << 24, + (byte)OpCodeType.Prefix << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Tail = new OpCode ( + 0xfe << 0 | 0x14 << 8 | (byte)Code.Tail << 16 | (byte)FlowControl.Meta << 24, + (byte)OpCodeType.Prefix << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Initobj = new OpCode ( + 0xfe << 0 | 0x15 << 8 | (byte)Code.Initobj << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Constrained = new OpCode ( + 0xfe << 0 | 0x16 << 8 | (byte)Code.Constrained << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Prefix << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Cpblk = new OpCode ( + 0xfe << 0 | 0x17 << 8 | (byte)Code.Cpblk << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi_popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Initblk = new OpCode ( + 0xfe << 0 | 0x18 << 8 | (byte)Code.Initblk << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Popi_popi_popi << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode No = new OpCode ( + 0xfe << 0 | 0x19 << 8 | (byte)Code.No << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Prefix << 0 | (byte)OperandType.ShortInlineI << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Rethrow = new OpCode ( + 0xfe << 0 | 0x1a << 8 | (byte)Code.Rethrow << 16 | (byte)FlowControl.Throw << 24, + (byte)OpCodeType.Objmodel << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + + public static readonly OpCode Sizeof = new OpCode ( + 0xfe << 0 | 0x1c << 8 | (byte)Code.Sizeof << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineType << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Refanytype = new OpCode ( + 0xfe << 0 | 0x1d << 8 | (byte)Code.Refanytype << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Primitive << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop1 << 16 | (byte)StackBehaviour.Pushi << 24); + + public static readonly OpCode Readonly = new OpCode ( + 0xfe << 0 | 0x1e << 8 | (byte)Code.Readonly << 16 | (byte)FlowControl.Next << 24, + (byte)OpCodeType.Prefix << 0 | (byte)OperandType.InlineNone << 8 | (byte)StackBehaviour.Pop0 << 16 | (byte)StackBehaviour.Push0 << 24); + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCodes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCodes.cs.meta new file mode 100644 index 0000000..422968a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/OpCodes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 52c19a62321778c438d2f6b483f18e73 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/PortablePdb.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/PortablePdb.cs new file mode 100644 index 0000000..64b7ad7 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/PortablePdb.cs @@ -0,0 +1,591 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Metadata; +using MonoFN.Cecil.PE; +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; + +namespace MonoFN.Cecil.Cil { + + public sealed class PortablePdbReaderProvider : ISymbolReaderProvider { + + public ISymbolReader GetSymbolReader (ModuleDefinition module, string fileName) + { + Mixin.CheckModule (module); + Mixin.CheckFileName (fileName); + + var file = File.OpenRead (Mixin.GetPdbFileName (fileName)); + return GetSymbolReader (module, Disposable.Owned (file as Stream), file.Name); + } + + public ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream) + { + Mixin.CheckModule (module); + Mixin.CheckStream (symbolStream); + + return GetSymbolReader (module, Disposable.NotOwned (symbolStream), symbolStream.GetFileName ()); + } + + ISymbolReader GetSymbolReader (ModuleDefinition module, Disposable symbolStream, string fileName) + { + return new PortablePdbReader (ImageReader.ReadPortablePdb (symbolStream, fileName), module); + } + } + + public sealed class PortablePdbReader : ISymbolReader { + + readonly Image image; + readonly ModuleDefinition module; + readonly MetadataReader reader; + readonly MetadataReader debug_reader; + + bool IsEmbedded { get { return reader.image == debug_reader.image; } } + + internal PortablePdbReader (Image image, ModuleDefinition module) + { + this.image = image; + this.module = module; + this.reader = module.reader; + this.debug_reader = new MetadataReader (image, module, this.reader); + } + + public ISymbolWriterProvider GetWriterProvider () + { + return new PortablePdbWriterProvider (); + } + + public bool ProcessDebugHeader (ImageDebugHeader header) + { + if (image == module.Image) + return true; + + foreach (var entry in header.Entries) { + if (!IsMatchingEntry (image.PdbHeap, entry)) + continue; + + ReadModule (); + return true; + } + + return false; + } + + static bool IsMatchingEntry (PdbHeap heap, ImageDebugHeaderEntry entry) + { + if (entry.Directory.Type != ImageDebugType.CodeView) + return false; + + var data = entry.Data; + + if (data.Length < 24) + return false; + + var magic = ReadInt32 (data, 0); + if (magic != 0x53445352) + return false; + + var buffer = new byte [16]; + Buffer.BlockCopy (data, 4, buffer, 0, 16); + + var module_guid = new Guid (buffer); + + Buffer.BlockCopy (heap.Id, 0, buffer, 0, 16); + + var pdb_guid = new Guid (buffer); + + return module_guid == pdb_guid; + } + + static int ReadInt32 (byte [] bytes, int start) + { + return (bytes [start] + | (bytes [start + 1] << 8) + | (bytes [start + 2] << 16) + | (bytes [start + 3] << 24)); + } + + void ReadModule () + { + module.custom_infos = debug_reader.GetCustomDebugInformation (module); + } + + public MethodDebugInformation Read (MethodDefinition method) + { + var info = new MethodDebugInformation (method); + ReadSequencePoints (info); + ReadScope (info); + ReadStateMachineKickOffMethod (info); + ReadCustomDebugInformations (info); + return info; + } + + void ReadSequencePoints (MethodDebugInformation method_info) + { + method_info.sequence_points = debug_reader.ReadSequencePoints (method_info.method); + } + + void ReadScope (MethodDebugInformation method_info) + { + method_info.scope = debug_reader.ReadScope (method_info.method); + } + + void ReadStateMachineKickOffMethod (MethodDebugInformation method_info) + { + method_info.kickoff_method = debug_reader.ReadStateMachineKickoffMethod (method_info.method); + } + + void ReadCustomDebugInformations (MethodDebugInformation info) + { + info.method.custom_infos = debug_reader.GetCustomDebugInformation (info.method); + } + + public void Dispose () + { + if (IsEmbedded) + return; + + image.Dispose (); + } + } + + public sealed class EmbeddedPortablePdbReaderProvider : ISymbolReaderProvider { + + public ISymbolReader GetSymbolReader (ModuleDefinition module, string fileName) + { + Mixin.CheckModule (module); + + var header = module.GetDebugHeader (); + var entry = header.GetEmbeddedPortablePdbEntry (); + if (entry == null) + throw new InvalidOperationException (); + + return new EmbeddedPortablePdbReader ( + (PortablePdbReader)new PortablePdbReaderProvider ().GetSymbolReader (module, GetPortablePdbStream (entry))); + } + + static Stream GetPortablePdbStream (ImageDebugHeaderEntry entry) + { + var compressed_stream = new MemoryStream (entry.Data); + var reader = new BinaryStreamReader (compressed_stream); + reader.ReadInt32 (); // signature + var length = reader.ReadInt32 (); + var decompressed_stream = new MemoryStream (length); + + using (var deflate_stream = new DeflateStream (compressed_stream, CompressionMode.Decompress, leaveOpen: true)) + deflate_stream.CopyTo (decompressed_stream); + + return decompressed_stream; + } + + public ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream) + { + throw new NotSupportedException (); + } + } + + public sealed class EmbeddedPortablePdbReader : ISymbolReader { + private readonly PortablePdbReader reader; + + internal EmbeddedPortablePdbReader (PortablePdbReader reader) + { + if (reader == null) + throw new ArgumentNullException (); + + this.reader = reader; + } + + public ISymbolWriterProvider GetWriterProvider () + { + return new EmbeddedPortablePdbWriterProvider (); + } + + public bool ProcessDebugHeader (ImageDebugHeader header) + { + return reader.ProcessDebugHeader (header); + } + + public MethodDebugInformation Read (MethodDefinition method) + { + return reader.Read (method); + } + + public void Dispose () + { + reader.Dispose (); + } + } + + public sealed class PortablePdbWriterProvider : ISymbolWriterProvider { + public ISymbolWriter GetSymbolWriter (ModuleDefinition module, string fileName) + { + Mixin.CheckModule (module); + Mixin.CheckFileName (fileName); + + var file = File.OpenWrite (Mixin.GetPdbFileName (fileName)); + return GetSymbolWriter (module, Disposable.Owned (file as Stream)); + } + + public ISymbolWriter GetSymbolWriter (ModuleDefinition module, Stream symbolStream) + { + Mixin.CheckModule (module); + Mixin.CheckStream (symbolStream); + + return GetSymbolWriter (module, Disposable.NotOwned (symbolStream)); + } + + ISymbolWriter GetSymbolWriter (ModuleDefinition module, Disposable stream) + { + var metadata = new MetadataBuilder (module, this); + var writer = ImageWriter.CreateDebugWriter (module, metadata, stream); + + return new PortablePdbWriter (metadata, module, writer); + } + } + + public sealed class PortablePdbWriter : ISymbolWriter { + + readonly MetadataBuilder pdb_metadata; + readonly ModuleDefinition module; + readonly ImageWriter writer; + + MetadataBuilder module_metadata; + + bool IsEmbedded { get { return writer == null; } } + + internal PortablePdbWriter (MetadataBuilder pdb_metadata, ModuleDefinition module) + { + this.pdb_metadata = pdb_metadata; + this.module = module; + + this.module_metadata = module.metadata_builder; + + if (module_metadata != pdb_metadata) + this.pdb_metadata.metadata_builder = this.module_metadata; + + pdb_metadata.AddCustomDebugInformations (module); + } + + internal PortablePdbWriter (MetadataBuilder pdb_metadata, ModuleDefinition module, ImageWriter writer) + : this (pdb_metadata, module) + { + this.writer = writer; + } + + public ISymbolReaderProvider GetReaderProvider () + { + return new PortablePdbReaderProvider (); + } + + public ImageDebugHeader GetDebugHeader () + { + if (IsEmbedded) + return new ImageDebugHeader (); + + var directory = new ImageDebugDirectory () { + MajorVersion = 256, + MinorVersion = 20557, + Type = ImageDebugType.CodeView, + TimeDateStamp = (int)module.timestamp, + }; + + var buffer = new ByteBuffer (); + // RSDS + buffer.WriteUInt32 (0x53445352); + // Module ID + buffer.WriteBytes (module.Mvid.ToByteArray ()); + // PDB Age + buffer.WriteUInt32 (1); + // PDB Path + var fileName = writer.BaseStream.GetFileName (); + if (string.IsNullOrEmpty (fileName)) { + fileName = module.Assembly.Name.Name + ".pdb"; + } + buffer.WriteBytes (System.Text.Encoding.UTF8.GetBytes (fileName)); + buffer.WriteByte (0); + + var data = new byte [buffer.length]; + Buffer.BlockCopy (buffer.buffer, 0, data, 0, buffer.length); + directory.SizeOfData = data.Length; + + return new ImageDebugHeader (new ImageDebugHeaderEntry (directory, data)); + } + + public void Write (MethodDebugInformation info) + { + CheckMethodDebugInformationTable (); + + pdb_metadata.AddMethodDebugInformation (info); + } + + void CheckMethodDebugInformationTable () + { + var mdi = pdb_metadata.table_heap.GetTable (Table.MethodDebugInformation); + if (mdi.length > 0) + return; + + // The MethodDebugInformation table has the same length as the Method table + mdi.rows = new Row [module_metadata.method_rid - 1]; + mdi.length = mdi.rows.Length; + } + + public void Dispose () + { + if (IsEmbedded) + return; + + WritePdbFile (); + } + + void WritePdbFile () + { + WritePdbHeap (); + + WriteTableHeap (); + + writer.BuildMetadataTextMap (); + writer.WriteMetadataHeader (); + writer.WriteMetadata (); + + writer.Flush (); + writer.stream.Dispose (); + } + + void WritePdbHeap () + { + var pdb_heap = pdb_metadata.pdb_heap; + + pdb_heap.WriteBytes (module.Mvid.ToByteArray ()); + pdb_heap.WriteUInt32 (module_metadata.timestamp); + + pdb_heap.WriteUInt32 (module_metadata.entry_point.ToUInt32 ()); + + var table_heap = module_metadata.table_heap; + var tables = table_heap.tables; + + ulong valid = 0; + for (int i = 0; i < tables.Length; i++) { + if (tables [i] == null || tables [i].Length == 0) + continue; + + valid |= (1UL << i); + } + + pdb_heap.WriteUInt64 (valid); + + for (int i = 0; i < tables.Length; i++) { + if (tables [i] == null || tables [i].Length == 0) + continue; + + pdb_heap.WriteUInt32 ((uint)tables [i].Length); + } + } + + void WriteTableHeap () + { + pdb_metadata.table_heap.string_offsets = pdb_metadata.string_heap.WriteStrings (); + pdb_metadata.table_heap.ComputeTableInformations (); + pdb_metadata.table_heap.WriteTableHeap (); + } + } + + public sealed class EmbeddedPortablePdbWriterProvider : ISymbolWriterProvider { + + public ISymbolWriter GetSymbolWriter (ModuleDefinition module, string fileName) + { + Mixin.CheckModule (module); + Mixin.CheckFileName (fileName); + + var stream = new MemoryStream (); + var pdb_writer = (PortablePdbWriter)new PortablePdbWriterProvider ().GetSymbolWriter (module, stream); + return new EmbeddedPortablePdbWriter (stream, pdb_writer); + } + + public ISymbolWriter GetSymbolWriter (ModuleDefinition module, Stream symbolStream) + { + throw new NotSupportedException (); + } + } + + public sealed class EmbeddedPortablePdbWriter : ISymbolWriter { + + readonly Stream stream; + readonly PortablePdbWriter writer; + + internal EmbeddedPortablePdbWriter (Stream stream, PortablePdbWriter writer) + { + this.stream = stream; + this.writer = writer; + } + + public ISymbolReaderProvider GetReaderProvider () + { + return new EmbeddedPortablePdbReaderProvider (); + } + + public ImageDebugHeader GetDebugHeader () + { + writer.Dispose (); + + var directory = new ImageDebugDirectory { + Type = ImageDebugType.EmbeddedPortablePdb, + MajorVersion = 0x0100, + MinorVersion = 0x0100, + }; + + var data = new MemoryStream (); + + var w = new BinaryStreamWriter (data); + w.WriteByte (0x4d); + w.WriteByte (0x50); + w.WriteByte (0x44); + w.WriteByte (0x42); + + w.WriteInt32 ((int)stream.Length); + + stream.Position = 0; + + using (var compress_stream = new DeflateStream (data, CompressionMode.Compress, leaveOpen: true)) + stream.CopyTo (compress_stream); + + directory.SizeOfData = (int)data.Length; + + return new ImageDebugHeader (new [] { + writer.GetDebugHeader ().Entries [0], + new ImageDebugHeaderEntry (directory, data.ToArray ()) + }); + } + + public void Write (MethodDebugInformation info) + { + writer.Write (info); + } + + public void Dispose () + { + } + } + + static class PdbGuidMapping { + + static readonly Dictionary guid_language = new Dictionary (); + static readonly Dictionary language_guid = new Dictionary (); + + static PdbGuidMapping () + { + AddMapping (DocumentLanguage.C, new Guid ("63a08714-fc37-11d2-904c-00c04fa302a1")); + AddMapping (DocumentLanguage.Cpp, new Guid ("3a12d0b7-c26c-11d0-b442-00a0244a1dd2")); + AddMapping (DocumentLanguage.CSharp, new Guid ("3f5162f8-07c6-11d3-9053-00c04fa302a1")); + AddMapping (DocumentLanguage.Basic, new Guid ("3a12d0b8-c26c-11d0-b442-00a0244a1dd2")); + AddMapping (DocumentLanguage.Java, new Guid ("3a12d0b4-c26c-11d0-b442-00a0244a1dd2")); + AddMapping (DocumentLanguage.Cobol, new Guid ("af046cd1-d0e1-11d2-977c-00a0c9b4d50c")); + AddMapping (DocumentLanguage.Pascal, new Guid ("af046cd2-d0e1-11d2-977c-00a0c9b4d50c")); + AddMapping (DocumentLanguage.Cil, new Guid ("af046cd3-d0e1-11d2-977c-00a0c9b4d50c")); + AddMapping (DocumentLanguage.JScript, new Guid ("3a12d0b6-c26c-11d0-b442-00a0244a1dd2")); + AddMapping (DocumentLanguage.Smc, new Guid ("0d9b9f7b-6611-11d3-bd2a-0000f80849bd")); + AddMapping (DocumentLanguage.MCpp, new Guid ("4b35fde8-07c6-11d3-9053-00c04fa302a1")); + AddMapping (DocumentLanguage.FSharp, new Guid ("ab4f38c9-b6e6-43ba-be3b-58080b2ccce3")); + } + + static void AddMapping (DocumentLanguage language, Guid guid) + { + guid_language.Add (guid, language); + language_guid.Add (language, guid); + } + + static readonly Guid type_text = new Guid ("5a869d0b-6611-11d3-bd2a-0000f80849bd"); + + public static DocumentType ToType (this Guid guid) + { + if (guid == type_text) + return DocumentType.Text; + + return DocumentType.Other; + } + + public static Guid ToGuid (this DocumentType type) + { + if (type == DocumentType.Text) + return type_text; + + return new Guid (); + } + + static readonly Guid hash_md5 = new Guid ("406ea660-64cf-4c82-b6f0-42d48172a799"); + static readonly Guid hash_sha1 = new Guid ("ff1816ec-aa5e-4d10-87f7-6f4963833460"); + static readonly Guid hash_sha256 = new Guid ("8829d00f-11b8-4213-878b-770e8597ac16"); + + public static DocumentHashAlgorithm ToHashAlgorithm (this Guid guid) + { + if (guid == hash_md5) + return DocumentHashAlgorithm.MD5; + + if (guid == hash_sha1) + return DocumentHashAlgorithm.SHA1; + + if (guid == hash_sha256) + return DocumentHashAlgorithm.SHA256; + + return DocumentHashAlgorithm.None; + } + + public static Guid ToGuid (this DocumentHashAlgorithm hash_algo) + { + if (hash_algo == DocumentHashAlgorithm.MD5) + return hash_md5; + + if (hash_algo == DocumentHashAlgorithm.SHA1) + return hash_sha1; + + if (hash_algo == DocumentHashAlgorithm.SHA256) + return hash_sha256; + + return new Guid (); + } + + public static DocumentLanguage ToLanguage (this Guid guid) + { + DocumentLanguage language; + if (!guid_language.TryGetValue (guid, out language)) + return DocumentLanguage.Other; + + return language; + } + + public static Guid ToGuid (this DocumentLanguage language) + { + Guid guid; + if (!language_guid.TryGetValue (language, out guid)) + return new Guid (); + + return guid; + } + + static readonly Guid vendor_ms = new Guid ("994b45c4-e6e9-11d2-903f-00c04fa302a1"); + + public static DocumentLanguageVendor ToVendor (this Guid guid) + { + if (guid == vendor_ms) + return DocumentLanguageVendor.Microsoft; + + return DocumentLanguageVendor.Other; + } + + public static Guid ToGuid (this DocumentLanguageVendor vendor) + { + if (vendor == DocumentLanguageVendor.Microsoft) + return vendor_ms; + + return new Guid (); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/PortablePdb.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/PortablePdb.cs.meta new file mode 100644 index 0000000..8b260c9 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/PortablePdb.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 34e2f5d4b9b9ea542bec15f2d9acc3ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/SequencePoint.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/SequencePoint.cs new file mode 100644 index 0000000..591815a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/SequencePoint.cs @@ -0,0 +1,76 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil.Cil { + + public sealed class SequencePoint { + + internal InstructionOffset offset; + Document document; + + int start_line; + int start_column; + int end_line; + int end_column; + + public int Offset { + get { return offset.Offset; } + } + + public int StartLine { + get { return start_line; } + set { start_line = value; } + } + + public int StartColumn { + get { return start_column; } + set { start_column = value; } + } + + public int EndLine { + get { return end_line; } + set { end_line = value; } + } + + public int EndColumn { + get { return end_column; } + set { end_column = value; } + } + + public bool IsHidden { + get { return start_line == 0xfeefee && start_line == end_line; } + } + + public Document Document { + get { return document; } + set { document = value; } + } + + internal SequencePoint (int offset, Document document) + { + if (document == null) + throw new ArgumentNullException ("document"); + + this.offset = new InstructionOffset (offset); + this.document = document; + } + + public SequencePoint (Instruction instruction, Document document) + { + if (document == null) + throw new ArgumentNullException ("document"); + + this.offset = new InstructionOffset (instruction); + this.document = document; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/SequencePoint.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/SequencePoint.cs.meta new file mode 100644 index 0000000..bac78ab --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/SequencePoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 612e6675dca63a84b9e8aaeb3e3b9ec6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Symbols.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Symbols.cs new file mode 100644 index 0000000..4e75a0c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Symbols.cs @@ -0,0 +1,1226 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.PE; +using MonoFN.Collections.Generic; +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Threading; +using SR = System.Reflection; + +namespace MonoFN.Cecil.Cil { + + [StructLayout (LayoutKind.Sequential)] + public struct ImageDebugDirectory { + public const int Size = 28; + + public int Characteristics; + public int TimeDateStamp; + public short MajorVersion; + public short MinorVersion; + public ImageDebugType Type; + public int SizeOfData; + public int AddressOfRawData; + public int PointerToRawData; + } + + public enum ImageDebugType { + CodeView = 2, + Deterministic = 16, + EmbeddedPortablePdb = 17, + } + + public sealed class ImageDebugHeader { + + readonly ImageDebugHeaderEntry [] entries; + + public bool HasEntries { + get { return !entries.IsNullOrEmpty (); } + } + + public ImageDebugHeaderEntry [] Entries { + get { return entries; } + } + + public ImageDebugHeader (ImageDebugHeaderEntry [] entries) + { + this.entries = entries ?? Empty.Array; + } + + public ImageDebugHeader () + : this (Empty.Array) + { + } + + public ImageDebugHeader (ImageDebugHeaderEntry entry) + : this (new [] { entry }) + { + } + } + + public sealed class ImageDebugHeaderEntry { + + ImageDebugDirectory directory; + readonly byte [] data; + + public ImageDebugDirectory Directory { + get { return directory; } + internal set { directory = value; } + } + + public byte [] Data { + get { return data; } + } + + public ImageDebugHeaderEntry (ImageDebugDirectory directory, byte [] data) + { + this.directory = directory; + this.data = data ?? Empty.Array; + } + } + + public sealed class ScopeDebugInformation : DebugInformation { + + internal InstructionOffset start; + internal InstructionOffset end; + internal ImportDebugInformation import; + internal Collection scopes; + internal Collection variables; + internal Collection constants; + + public InstructionOffset Start { + get { return start; } + set { start = value; } + } + + public InstructionOffset End { + get { return end; } + set { end = value; } + } + + public ImportDebugInformation Import { + get { return import; } + set { import = value; } + } + + public bool HasScopes { + get { return !scopes.IsNullOrEmpty (); } + } + + public Collection Scopes { + get { + if (scopes == null) + Interlocked.CompareExchange (ref scopes, new Collection (), null); + + return scopes; + } + } + + public bool HasVariables { + get { return !variables.IsNullOrEmpty (); } + } + + public Collection Variables { + get { + if (variables == null) + Interlocked.CompareExchange (ref variables, new Collection (), null); + + return variables; + } + } + + public bool HasConstants { + get { return !constants.IsNullOrEmpty (); } + } + + public Collection Constants { + get { + if (constants == null) + Interlocked.CompareExchange (ref constants, new Collection (), null); + + return constants; + } + } + + internal ScopeDebugInformation () + { + this.token = new MetadataToken (TokenType.LocalScope); + } + + public ScopeDebugInformation (Instruction start, Instruction end) + : this () + { + if (start == null) + throw new ArgumentNullException ("start"); + + this.start = new InstructionOffset (start); + + if (end != null) + this.end = new InstructionOffset (end); + } + + public bool TryGetName (VariableDefinition variable, out string name) + { + name = null; + if (variables == null || variables.Count == 0) + return false; + + for (int i = 0; i < variables.Count; i++) { + if (variables [i].Index == variable.Index) { + name = variables [i].Name; + return true; + } + } + + return false; + } + } + + public struct InstructionOffset { + + readonly Instruction instruction; + readonly int? offset; + + public int Offset { + get { + if (instruction != null) + return instruction.Offset; + if (offset.HasValue) + return offset.Value; + + throw new NotSupportedException (); + } + } + + public bool IsEndOfMethod { + get { return instruction == null && !offset.HasValue; } + } + + internal bool IsResolved => instruction != null || !offset.HasValue; + + internal Instruction ResolvedInstruction => instruction; + + public InstructionOffset (Instruction instruction) + { + if (instruction == null) + throw new ArgumentNullException ("instruction"); + + this.instruction = instruction; + this.offset = null; + } + + public InstructionOffset (int offset) + { + this.instruction = null; + this.offset = offset; + } + } + + [Flags] + public enum VariableAttributes : ushort { + None = 0, + DebuggerHidden = 1, + } + + public struct VariableIndex { + readonly VariableDefinition variable; + readonly int? index; + + public int Index { + get { + if (variable != null) + return variable.Index; + if (index.HasValue) + return index.Value; + + throw new NotSupportedException (); + } + } + + internal bool IsResolved => variable != null; + + internal VariableDefinition ResolvedVariable => variable; + + public VariableIndex (VariableDefinition variable) + { + if (variable == null) + throw new ArgumentNullException ("variable"); + + this.variable = variable; + this.index = null; + } + + public VariableIndex (int index) + { + this.variable = null; + this.index = index; + } + } + + public abstract class DebugInformation : ICustomDebugInformationProvider { + + internal MetadataToken token; + internal Collection custom_infos; + + public MetadataToken MetadataToken { + get { return token; } + set { token = value; } + } + + public bool HasCustomDebugInformations { + get { return !custom_infos.IsNullOrEmpty (); } + } + + public Collection CustomDebugInformations { + get { + if (custom_infos == null) + Interlocked.CompareExchange (ref custom_infos, new Collection (), null); + + return custom_infos; + } + } + + internal DebugInformation () + { + } + } + + public sealed class VariableDebugInformation : DebugInformation { + + string name; + ushort attributes; + internal VariableIndex index; + + public int Index { + get { return index.Index; } + } + + public string Name { + get { return name; } + set { name = value; } + } + + public VariableAttributes Attributes { + get { return (VariableAttributes)attributes; } + set { attributes = (ushort)value; } + } + + public bool IsDebuggerHidden { + get { return attributes.GetAttributes ((ushort)VariableAttributes.DebuggerHidden); } + set { attributes = attributes.SetAttributes ((ushort)VariableAttributes.DebuggerHidden, value); } + } + + internal VariableDebugInformation (int index, string name) + { + if (name == null) + throw new ArgumentNullException ("name"); + + this.index = new VariableIndex (index); + this.name = name; + } + + public VariableDebugInformation (VariableDefinition variable, string name) + { + if (variable == null) + throw new ArgumentNullException ("variable"); + if (name == null) + throw new ArgumentNullException ("name"); + + this.index = new VariableIndex (variable); + this.name = name; + this.token = new MetadataToken (TokenType.LocalVariable); + } + } + + public sealed class ConstantDebugInformation : DebugInformation { + + string name; + TypeReference constant_type; + object value; + + public string Name { + get { return name; } + set { name = value; } + } + + public TypeReference ConstantType { + get { return constant_type; } + set { constant_type = value; } + } + + public object Value { + get { return value; } + set { this.value = value; } + } + + public ConstantDebugInformation (string name, TypeReference constant_type, object value) + { + if (name == null) + throw new ArgumentNullException ("name"); + + this.name = name; + this.constant_type = constant_type; + this.value = value; + this.token = new MetadataToken (TokenType.LocalConstant); + } + } + + public enum ImportTargetKind : byte { + ImportNamespace = 1, + ImportNamespaceInAssembly = 2, + ImportType = 3, + ImportXmlNamespaceWithAlias = 4, + ImportAlias = 5, + DefineAssemblyAlias = 6, + DefineNamespaceAlias = 7, + DefineNamespaceInAssemblyAlias = 8, + DefineTypeAlias = 9, + } + + public sealed class ImportTarget { + + internal ImportTargetKind kind; + + internal string @namespace; + internal TypeReference type; + internal AssemblyNameReference reference; + internal string alias; + + public string Namespace { + get { return @namespace; } + set { @namespace = value; } + } + + public TypeReference Type { + get { return type; } + set { type = value; } + } + + public AssemblyNameReference AssemblyReference { + get { return reference; } + set { reference = value; } + } + + public string Alias { + get { return alias; } + set { alias = value; } + } + + public ImportTargetKind Kind { + get { return kind; } + set { kind = value; } + } + + public ImportTarget (ImportTargetKind kind) + { + this.kind = kind; + } + } + + public sealed class ImportDebugInformation : DebugInformation { + + internal ImportDebugInformation parent; + internal Collection targets; + + public bool HasTargets { + get { return !targets.IsNullOrEmpty (); } + } + + public Collection Targets { + get { + if (targets == null) + Interlocked.CompareExchange (ref targets, new Collection (), null); + + return targets; + } + } + + public ImportDebugInformation Parent { + get { return parent; } + set { parent = value; } + } + + public ImportDebugInformation () + { + this.token = new MetadataToken (TokenType.ImportScope); + } + } + + public interface ICustomDebugInformationProvider : IMetadataTokenProvider { + bool HasCustomDebugInformations { get; } + Collection CustomDebugInformations { get; } + } + + public enum CustomDebugInformationKind { + Binary, + StateMachineScope, + DynamicVariable, + DefaultNamespace, + AsyncMethodBody, + EmbeddedSource, + SourceLink, + } + + public abstract class CustomDebugInformation : DebugInformation { + + Guid identifier; + + public Guid Identifier { + get { return identifier; } + } + + public abstract CustomDebugInformationKind Kind { get; } + + internal CustomDebugInformation (Guid identifier) + { + this.identifier = identifier; + this.token = new MetadataToken (TokenType.CustomDebugInformation); + } + } + + public sealed class BinaryCustomDebugInformation : CustomDebugInformation { + + byte [] data; + + public byte [] Data { + get { return data; } + set { data = value; } + } + + public override CustomDebugInformationKind Kind { + get { return CustomDebugInformationKind.Binary; } + } + + public BinaryCustomDebugInformation (Guid identifier, byte [] data) + : base (identifier) + { + this.data = data; + } + } + + public sealed class AsyncMethodBodyDebugInformation : CustomDebugInformation { + + internal InstructionOffset catch_handler; + internal Collection yields; + internal Collection resumes; + internal Collection resume_methods; + + public InstructionOffset CatchHandler { + get { return catch_handler; } + set { catch_handler = value; } + } + + public Collection Yields { + get { + if (yields == null) + Interlocked.CompareExchange (ref yields, new Collection (), null); + + return yields; + } + } + + public Collection Resumes { + get { + if (resumes == null) + Interlocked.CompareExchange (ref resumes, new Collection (), null); + + return resumes; + } + } + + public Collection ResumeMethods { + get { return resume_methods ?? (resume_methods = new Collection ()); } + } + + public override CustomDebugInformationKind Kind { + get { return CustomDebugInformationKind.AsyncMethodBody; } + } + + public static Guid KindIdentifier = new Guid ("{54FD2AC5-E925-401A-9C2A-F94F171072F8}"); + + internal AsyncMethodBodyDebugInformation (int catchHandler) + : base (KindIdentifier) + { + this.catch_handler = new InstructionOffset (catchHandler); + } + + public AsyncMethodBodyDebugInformation (Instruction catchHandler) + : base (KindIdentifier) + { + this.catch_handler = new InstructionOffset (catchHandler); + } + + public AsyncMethodBodyDebugInformation () + : base (KindIdentifier) + { + this.catch_handler = new InstructionOffset (-1); + } + } + + public sealed class StateMachineScope { + + internal InstructionOffset start; + internal InstructionOffset end; + + public InstructionOffset Start { + get { return start; } + set { start = value; } + } + + public InstructionOffset End { + get { return end; } + set { end = value; } + } + + internal StateMachineScope (int start, int end) + { + this.start = new InstructionOffset (start); + this.end = new InstructionOffset (end); + } + + public StateMachineScope (Instruction start, Instruction end) + { + this.start = new InstructionOffset (start); + this.end = end != null ? new InstructionOffset (end) : new InstructionOffset (); + } + } + + public sealed class StateMachineScopeDebugInformation : CustomDebugInformation { + + internal Collection scopes; + + public Collection Scopes { + get { return scopes ?? (scopes = new Collection ()); } + } + + public override CustomDebugInformationKind Kind { + get { return CustomDebugInformationKind.StateMachineScope; } + } + + public static Guid KindIdentifier = new Guid ("{6DA9A61E-F8C7-4874-BE62-68BC5630DF71}"); + + public StateMachineScopeDebugInformation () + : base (KindIdentifier) + { + } + } + + public sealed class EmbeddedSourceDebugInformation : CustomDebugInformation { + + internal uint index; + internal MetadataReader debug_reader; + internal bool resolved; + internal byte [] content; + internal bool compress; + + public byte [] Content { + get { + if (!resolved) + Resolve (); + + return content; + } + set { + content = value; + resolved = true; + } + } + + public bool Compress { + get { + if (!resolved) + Resolve (); + + return compress; + } + set { + compress = value; + resolved = true; + } + } + + public override CustomDebugInformationKind Kind { + get { return CustomDebugInformationKind.EmbeddedSource; } + } + + public static Guid KindIdentifier = new Guid ("{0E8A571B-6926-466E-B4AD-8AB04611F5FE}"); + + internal EmbeddedSourceDebugInformation (uint index, MetadataReader debug_reader) + : base (KindIdentifier) + { + this.index = index; + this.debug_reader = debug_reader; + } + + public EmbeddedSourceDebugInformation (byte [] content, bool compress) + : base (KindIdentifier) + { + this.resolved = true; + this.content = content; + this.compress = compress; + } + + internal byte [] ReadRawEmbeddedSourceDebugInformation () + { + if (debug_reader == null) + throw new InvalidOperationException (); + + return debug_reader.ReadRawEmbeddedSourceDebugInformation (index); + } + + void Resolve () + { + if (resolved) + return; + + if (debug_reader == null) + throw new InvalidOperationException (); + + var row = debug_reader.ReadEmbeddedSourceDebugInformation (index); + content = row.Col1; + compress = row.Col2; + resolved = true; + } + } + + public sealed class SourceLinkDebugInformation : CustomDebugInformation { + + internal string content; + + public string Content { + get { return content; } + set { content = value; } + } + + public override CustomDebugInformationKind Kind { + get { return CustomDebugInformationKind.SourceLink; } + } + + public static Guid KindIdentifier = new Guid ("{CC110556-A091-4D38-9FEC-25AB9A351A6A}"); + + public SourceLinkDebugInformation (string content) + : base (KindIdentifier) + { + this.content = content; + } + } + + public sealed class MethodDebugInformation : DebugInformation { + + internal MethodDefinition method; + internal Collection sequence_points; + internal ScopeDebugInformation scope; + internal MethodDefinition kickoff_method; + internal int code_size; + internal MetadataToken local_var_token; + + public MethodDefinition Method { + get { return method; } + } + + public bool HasSequencePoints { + get { return !sequence_points.IsNullOrEmpty (); } + } + + public Collection SequencePoints { + get { + if (sequence_points == null) + Interlocked.CompareExchange (ref sequence_points, new Collection (), null); + + return sequence_points; + } + } + + public ScopeDebugInformation Scope { + get { return scope; } + set { scope = value; } + } + + public MethodDefinition StateMachineKickOffMethod { + get { return kickoff_method; } + set { kickoff_method = value; } + } + + internal MethodDebugInformation (MethodDefinition method) + { + if (method == null) + throw new ArgumentNullException ("method"); + + this.method = method; + this.token = new MetadataToken (TokenType.MethodDebugInformation, method.MetadataToken.RID); + } + + public SequencePoint GetSequencePoint (Instruction instruction) + { + if (!HasSequencePoints) + return null; + + for (int i = 0; i < sequence_points.Count; i++) + if (sequence_points [i].Offset == instruction.Offset) + return sequence_points [i]; + + return null; + } + + public IDictionary GetSequencePointMapping () + { + var instruction_mapping = new Dictionary (); + if (!HasSequencePoints || !method.HasBody) + return instruction_mapping; + + var offset_mapping = new Dictionary (sequence_points.Count); + + for (int i = 0; i < sequence_points.Count; i++) { + if (!offset_mapping.ContainsKey (sequence_points [i].Offset)) + offset_mapping.Add (sequence_points [i].Offset, sequence_points [i]); + } + + var instructions = method.Body.Instructions; + + for (int i = 0; i < instructions.Count; i++) { + SequencePoint sequence_point; + if (offset_mapping.TryGetValue (instructions [i].Offset, out sequence_point)) + instruction_mapping.Add (instructions [i], sequence_point); + } + + return instruction_mapping; + } + + public IEnumerable GetScopes () + { + if (scope == null) + return Empty.Array; + + return GetScopes (new [] { scope }); + } + + static IEnumerable GetScopes (IList scopes) + { + for (int i = 0; i < scopes.Count; i++) { + var scope = scopes [i]; + + yield return scope; + + if (!scope.HasScopes) + continue; + + foreach (var sub_scope in GetScopes (scope.Scopes)) + yield return sub_scope; + } + } + + public bool TryGetName (VariableDefinition variable, out string name) + { + name = null; + + var has_name = false; + var unique_name = ""; + + foreach (var scope in GetScopes ()) { + string slot_name; + if (!scope.TryGetName (variable, out slot_name)) + continue; + + if (!has_name) { + has_name = true; + unique_name = slot_name; + continue; + } + + if (unique_name != slot_name) + return false; + } + + name = unique_name; + return has_name; + } + } + + public interface ISymbolReader : IDisposable { + + ISymbolWriterProvider GetWriterProvider (); + bool ProcessDebugHeader (ImageDebugHeader header); + MethodDebugInformation Read (MethodDefinition method); + } + + public interface ISymbolReaderProvider { + ISymbolReader GetSymbolReader (ModuleDefinition module, string fileName); + ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream); + } + +#if !NET_CORE + [Serializable] +#endif + public sealed class SymbolsNotFoundException : FileNotFoundException { + + public SymbolsNotFoundException (string message) : base (message) + { + } + +#if !NET_CORE + SymbolsNotFoundException ( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) + : base (info, context) + { + } +#endif + } + +#if !NET_CORE + [Serializable] +#endif + public sealed class SymbolsNotMatchingException : InvalidOperationException { + + public SymbolsNotMatchingException (string message) : base (message) + { + } + +#if !NET_CORE + SymbolsNotMatchingException ( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) + : base (info, context) + { + } +#endif + } + + public class DefaultSymbolReaderProvider : ISymbolReaderProvider { + + readonly bool throw_if_no_symbol; + + public DefaultSymbolReaderProvider () + : this (throwIfNoSymbol: true) + { + } + + public DefaultSymbolReaderProvider (bool throwIfNoSymbol) + { + throw_if_no_symbol = throwIfNoSymbol; + } + + public ISymbolReader GetSymbolReader (ModuleDefinition module, string fileName) + { + if (module.Image.HasDebugTables ()) + return null; + + if (module.HasDebugHeader) { + var header = module.GetDebugHeader (); + var entry = header.GetEmbeddedPortablePdbEntry (); + if (entry != null) + return new EmbeddedPortablePdbReaderProvider ().GetSymbolReader (module, fileName); + } + + var pdb_file_name = Mixin.GetPdbFileName (fileName); + + if (File.Exists (pdb_file_name)) { + if (Mixin.IsPortablePdb (Mixin.GetPdbFileName (fileName))) + return new PortablePdbReaderProvider ().GetSymbolReader (module, fileName); + + try { + return SymbolProvider.GetReaderProvider (SymbolKind.NativePdb).GetSymbolReader (module, fileName); + } + catch (Exception) { + // We might not include support for native pdbs. + } + } + + var mdb_file_name = Mixin.GetMdbFileName (fileName); + if (File.Exists (mdb_file_name)) { + try { + return SymbolProvider.GetReaderProvider (SymbolKind.Mdb).GetSymbolReader (module, fileName); + } + catch (Exception) { + // We might not include support for mdbs. + } + } + + if (throw_if_no_symbol) + throw new SymbolsNotFoundException (string.Format ("No symbol found for file: {0}", fileName)); + + return null; + } + + public ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream) + { + if (module.Image.HasDebugTables ()) + return null; + + if (module.HasDebugHeader) { + var header = module.GetDebugHeader (); + var entry = header.GetEmbeddedPortablePdbEntry (); + if (entry != null) + return new EmbeddedPortablePdbReaderProvider ().GetSymbolReader (module, ""); + } + + Mixin.CheckStream (symbolStream); + Mixin.CheckReadSeek (symbolStream); + + var position = symbolStream.Position; + + const int portablePdbHeader = 0x424a5342; + + var reader = new BinaryStreamReader (symbolStream); + var intHeader = reader.ReadInt32 (); + symbolStream.Position = position; + + if (intHeader == portablePdbHeader) { + return new PortablePdbReaderProvider ().GetSymbolReader (module, symbolStream); + } + + const string nativePdbHeader = "Microsoft C/C++ MSF 7.00"; + + var bytesHeader = reader.ReadBytes (nativePdbHeader.Length); + symbolStream.Position = position; + var isNativePdb = true; + + for (var i = 0; i < bytesHeader.Length; i++) { + if (bytesHeader [i] != (byte)nativePdbHeader [i]) { + isNativePdb = false; + break; + } + } + + if (isNativePdb) { + try { + return SymbolProvider.GetReaderProvider (SymbolKind.NativePdb).GetSymbolReader (module, symbolStream); + } + catch (Exception) { + // We might not include support for native pdbs. + } + } + + const long mdbHeader = 0x45e82623fd7fa614; + + var longHeader = reader.ReadInt64 (); + symbolStream.Position = position; + + if (longHeader == mdbHeader) { + try { + return SymbolProvider.GetReaderProvider (SymbolKind.Mdb).GetSymbolReader (module, symbolStream); + } + catch (Exception) { + // We might not include support for mdbs. + } + } + + if (throw_if_no_symbol) + throw new SymbolsNotFoundException (string.Format ("No symbols found in stream")); + + return null; + } + } + + enum SymbolKind { + NativePdb, + PortablePdb, + EmbeddedPortablePdb, + Mdb, + } + + static class SymbolProvider { + + static SR.AssemblyName GetSymbolAssemblyName (SymbolKind kind) + { + if (kind == SymbolKind.PortablePdb) + throw new ArgumentException (); + + var suffix = GetSymbolNamespace (kind); + + var cecil_name = typeof (SymbolProvider).Assembly.GetName (); + + var name = new SR.AssemblyName { + Name = cecil_name.Name + "." + suffix, + Version = cecil_name.Version, +#if NET_CORE + CultureName = cecil_name.CultureName, +#else + CultureInfo = cecil_name.CultureInfo, +#endif + }; + + name.SetPublicKeyToken (cecil_name.GetPublicKeyToken ()); + + return name; + } + + static Type GetSymbolType (SymbolKind kind, string fullname) + { + var type = Type.GetType (fullname); + if (type != null) + return type; + + var assembly_name = GetSymbolAssemblyName (kind); + + type = Type.GetType (fullname + ", " + assembly_name.FullName); + if (type != null) + return type; + + try { + var assembly = SR.Assembly.Load (assembly_name); + if (assembly != null) + return assembly.GetType (fullname); + } + catch (FileNotFoundException) { + } + catch (FileLoadException) { + } + + return null; + } + + public static ISymbolReaderProvider GetReaderProvider (SymbolKind kind) + { + if (kind == SymbolKind.PortablePdb) + return new PortablePdbReaderProvider (); + if (kind == SymbolKind.EmbeddedPortablePdb) + return new EmbeddedPortablePdbReaderProvider (); + + var provider_name = GetSymbolTypeName (kind, "ReaderProvider"); + var type = GetSymbolType (kind, provider_name); + if (type == null) + throw new TypeLoadException ("Could not find symbol provider type " + provider_name); + + return (ISymbolReaderProvider)Activator.CreateInstance (type); + } + + static string GetSymbolTypeName (SymbolKind kind, string name) + { + return "MonoFN.Cecil" + "." + GetSymbolNamespace (kind) + "." + kind + name; + } + + static string GetSymbolNamespace (SymbolKind kind) + { + if (kind == SymbolKind.PortablePdb || kind == SymbolKind.EmbeddedPortablePdb) + return "Cil"; + if (kind == SymbolKind.NativePdb) + return "Pdb"; + if (kind == SymbolKind.Mdb) + return "Mdb"; + + throw new ArgumentException (); + } + } + + public interface ISymbolWriter : IDisposable { + + ISymbolReaderProvider GetReaderProvider (); + ImageDebugHeader GetDebugHeader (); + void Write (MethodDebugInformation info); + } + + public interface ISymbolWriterProvider { + + ISymbolWriter GetSymbolWriter (ModuleDefinition module, string fileName); + ISymbolWriter GetSymbolWriter (ModuleDefinition module, Stream symbolStream); + } + + public class DefaultSymbolWriterProvider : ISymbolWriterProvider { + + public ISymbolWriter GetSymbolWriter (ModuleDefinition module, string fileName) + { + var reader = module.SymbolReader; + if (reader == null) + throw new InvalidOperationException (); + + if (module.Image != null && module.Image.HasDebugTables ()) + return null; + + return reader.GetWriterProvider ().GetSymbolWriter (module, fileName); + } + + public ISymbolWriter GetSymbolWriter (ModuleDefinition module, Stream symbolStream) + { + throw new NotSupportedException (); + } + } +} + +namespace MonoFN.Cecil { + + static partial class Mixin { + + public static ImageDebugHeaderEntry GetCodeViewEntry (this ImageDebugHeader header) + { + return GetEntry (header, ImageDebugType.CodeView); + } + + public static ImageDebugHeaderEntry GetDeterministicEntry (this ImageDebugHeader header) + { + return GetEntry (header, ImageDebugType.Deterministic); + } + + public static ImageDebugHeader AddDeterministicEntry (this ImageDebugHeader header) + { + var entry = new ImageDebugHeaderEntry (new ImageDebugDirectory { Type = ImageDebugType.Deterministic }, Empty.Array); + if (header == null) + return new ImageDebugHeader (entry); + + var entries = new ImageDebugHeaderEntry [header.Entries.Length + 1]; + Array.Copy (header.Entries, entries, header.Entries.Length); + entries [entries.Length - 1] = entry; + return new ImageDebugHeader (entries); + } + + public static ImageDebugHeaderEntry GetEmbeddedPortablePdbEntry (this ImageDebugHeader header) + { + return GetEntry (header, ImageDebugType.EmbeddedPortablePdb); + } + + private static ImageDebugHeaderEntry GetEntry (this ImageDebugHeader header, ImageDebugType type) + { + if (!header.HasEntries) + return null; + + for (var i = 0; i < header.Entries.Length; i++) { + var entry = header.Entries [i]; + if (entry.Directory.Type == type) + return entry; + } + + return null; + } + + public static string GetPdbFileName (string assemblyFileName) + { + return Path.ChangeExtension (assemblyFileName, ".pdb"); + } + + public static string GetMdbFileName (string assemblyFileName) + { + return assemblyFileName + ".mdb"; + } + + public static bool IsPortablePdb (string fileName) + { + using (var file = new FileStream (fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + return IsPortablePdb (file); + } + + public static bool IsPortablePdb (Stream stream) + { + const uint ppdb_signature = 0x424a5342; + + if (stream.Length < 4) return false; + var position = stream.Position; + try { + var reader = new BinaryReader (stream); + return reader.ReadUInt32 () == ppdb_signature; + } + finally { + stream.Position = position; + } + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Symbols.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Symbols.cs.meta new file mode 100644 index 0000000..f82ee9b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/Symbols.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de9ae158807f471449a81d9b8b3e3c4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableDefinition.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableDefinition.cs new file mode 100644 index 0000000..b3da0a2 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableDefinition.cs @@ -0,0 +1,29 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil.Cil { + + public sealed class VariableDefinition : VariableReference { + + public bool IsPinned { + get { return variable_type.IsPinned; } + } + + public VariableDefinition (TypeReference variableType) + : base (variableType) + { + } + + public override VariableDefinition Resolve () + { + return this; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableDefinition.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableDefinition.cs.meta new file mode 100644 index 0000000..b4e1886 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1346fa5ba8ac9e8418cc20d2d7d0ad21 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableReference.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableReference.cs new file mode 100644 index 0000000..1957d8d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableReference.cs @@ -0,0 +1,42 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil.Cil { + + public abstract class VariableReference { + + internal int index = -1; + protected TypeReference variable_type; + + public TypeReference VariableType { + get { return variable_type; } + set { variable_type = value; } + } + + public int Index { + get { return index; } + } + + internal VariableReference (TypeReference variable_type) + { + this.variable_type = variable_type; + } + + public abstract VariableDefinition Resolve (); + + public override string ToString () + { + if (index >= 0) + return "V_" + index; + + return string.Empty; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableReference.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableReference.cs.meta new file mode 100644 index 0000000..e951cc3 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Cil/VariableReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b5dca1eaac23bfd4ba8e881302a72e33 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata.meta new file mode 100644 index 0000000..6bee4a2 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cf18653914b5e6f429d4566a7897264c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/BlobHeap.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/BlobHeap.cs new file mode 100644 index 0000000..63dcd4d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/BlobHeap.cs @@ -0,0 +1,54 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil.Metadata { + + sealed class BlobHeap : Heap { + + public BlobHeap (byte [] data) + : base (data) + { + } + + public byte [] Read (uint index) + { + if (index == 0 || index > this.data.Length - 1) + return Empty.Array; + + int position = (int)index; + int length = (int)data.ReadCompressedUInt32 (ref position); + + if (length > data.Length - position) + return Empty.Array; + + var buffer = new byte [length]; + + Buffer.BlockCopy (data, position, buffer, 0, length); + + return buffer; + } + + public void GetView (uint signature, out byte [] buffer, out int index, out int length) + { + if (signature == 0 || signature > data.Length - 1) { + buffer = null; + index = length = 0; + return; + } + + buffer = data; + + index = (int)signature; + length = (int)buffer.ReadCompressedUInt32 (ref index); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/BlobHeap.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/BlobHeap.cs.meta new file mode 100644 index 0000000..b6ef813 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/BlobHeap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 33eef67f4a74e1c40a6bdb3da9d22d00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Buffers.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Buffers.cs new file mode 100644 index 0000000..7ab352c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Buffers.cs @@ -0,0 +1,499 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.PE; +using System; +using System.Collections.Generic; +using System.Text; +using RVA = System.UInt32; + +namespace MonoFN.Cecil.Metadata { + + sealed class TableHeapBuffer : HeapBuffer { + + readonly ModuleDefinition module; + readonly MetadataBuilder metadata; + + readonly internal TableInformation [] table_infos = new TableInformation [Mixin.TableCount]; + readonly internal MetadataTable [] tables = new MetadataTable [Mixin.TableCount]; + + bool large_string; + bool large_blob; + bool large_guid; + + readonly int [] coded_index_sizes = new int [Mixin.CodedIndexCount]; + readonly Func counter; + + internal uint [] string_offsets; + + public override bool IsEmpty { + get { return false; } + } + + public TableHeapBuffer (ModuleDefinition module, MetadataBuilder metadata) + : base (24) + { + this.module = module; + this.metadata = metadata; + this.counter = GetTableLength; + } + + int GetTableLength (Table table) + { + return (int)table_infos [(int)table].Length; + } + + public TTable GetTable (Table table) where TTable : MetadataTable, new() + { + var md_table = (TTable)tables [(int)table]; + if (md_table != null) + return md_table; + + md_table = new TTable (); + tables [(int)table] = md_table; + return md_table; + } + + public void WriteBySize (uint value, int size) + { + if (size == 4) + WriteUInt32 (value); + else + WriteUInt16 ((ushort)value); + } + + public void WriteBySize (uint value, bool large) + { + if (large) + WriteUInt32 (value); + else + WriteUInt16 ((ushort)value); + } + + public void WriteString (uint @string) + { + WriteBySize (string_offsets [@string], large_string); + } + + public void WriteBlob (uint blob) + { + WriteBySize (blob, large_blob); + } + + public void WriteGuid (uint guid) + { + WriteBySize (guid, large_guid); + } + + public void WriteRID (uint rid, Table table) + { + WriteBySize (rid, table_infos [(int)table].IsLarge); + } + + int GetCodedIndexSize (CodedIndex coded_index) + { + var index = (int)coded_index; + var size = coded_index_sizes [index]; + if (size != 0) + return size; + + return coded_index_sizes [index] = coded_index.GetSize (counter); + } + + public void WriteCodedRID (uint rid, CodedIndex coded_index) + { + WriteBySize (rid, GetCodedIndexSize (coded_index)); + } + + public void WriteTableHeap () + { + WriteUInt32 (0); // Reserved + WriteByte (GetTableHeapVersion ()); // MajorVersion + WriteByte (0); // MinorVersion + WriteByte (GetHeapSizes ()); // HeapSizes + WriteByte (10); // Reserved2 + WriteUInt64 (GetValid ()); // Valid + WriteUInt64 (0xc416003301fa00); // Sorted + + WriteRowCount (); + WriteTables (); + } + + void WriteRowCount () + { + for (int i = 0; i < tables.Length; i++) { + var table = tables [i]; + if (table == null || table.Length == 0) + continue; + + WriteUInt32 ((uint)table.Length); + } + } + + void WriteTables () + { + for (int i = 0; i < tables.Length; i++) { + var table = tables [i]; + if (table == null || table.Length == 0) + continue; + + table.Write (this); + } + } + + ulong GetValid () + { + ulong valid = 0; + + for (int i = 0; i < tables.Length; i++) { + var table = tables [i]; + if (table == null || table.Length == 0) + continue; + + table.Sort (); + valid |= (1UL << i); + } + + return valid; + } + + public void ComputeTableInformations () + { + if (metadata.metadata_builder != null) + ComputeTableInformations (metadata.metadata_builder.table_heap); + + ComputeTableInformations (metadata.table_heap); + } + + void ComputeTableInformations (TableHeapBuffer table_heap) + { + var tables = table_heap.tables; + for (int i = 0; i < tables.Length; i++) { + var table = tables [i]; + if (table != null && table.Length > 0) + table_infos [i].Length = (uint)table.Length; + } + } + + byte GetHeapSizes () + { + byte heap_sizes = 0; + + if (metadata.string_heap.IsLarge) { + large_string = true; + heap_sizes |= 0x01; + } + + if (metadata.guid_heap.IsLarge) { + large_guid = true; + heap_sizes |= 0x02; + } + + if (metadata.blob_heap.IsLarge) { + large_blob = true; + heap_sizes |= 0x04; + } + + return heap_sizes; + } + + byte GetTableHeapVersion () + { + switch (module.Runtime) { + case TargetRuntime.Net_1_0: + case TargetRuntime.Net_1_1: + return 1; + default: + return 2; + } + } + + public void FixupData (RVA data_rva) + { + var table = GetTable (Table.FieldRVA); + if (table.length == 0) + return; + + var field_idx_size = GetTable (Table.Field).IsLarge ? 4 : 2; + var previous = this.position; + + base.position = table.position; + for (int i = 0; i < table.length; i++) { + var rva = ReadUInt32 (); + base.position -= 4; + WriteUInt32 (rva + data_rva); + base.position += field_idx_size; + } + + base.position = previous; + } + } + + sealed class ResourceBuffer : ByteBuffer { + + public ResourceBuffer () + : base (0) + { + } + + public uint AddResource (byte [] resource) + { + var offset = (uint)this.position; + WriteInt32 (resource.Length); + WriteBytes (resource); + return offset; + } + } + + sealed class DataBuffer : ByteBuffer { + + public DataBuffer () + : base (0) + { + } + + public RVA AddData (byte [] data) + { + var rva = (RVA)position; + WriteBytes (data); + return rva; + } + } + + abstract class HeapBuffer : ByteBuffer { + + public bool IsLarge { + get { return base.length > 65535; } + } + + public abstract bool IsEmpty { get; } + + protected HeapBuffer (int length) + : base (length) + { + } + } + + sealed class GuidHeapBuffer : HeapBuffer { + + readonly Dictionary guids = new Dictionary (); + + public override bool IsEmpty { + get { return length == 0; } + } + + public GuidHeapBuffer () + : base (16) + { + } + + public uint GetGuidIndex (Guid guid) + { + uint index; + if (guids.TryGetValue (guid, out index)) + return index; + + index = (uint)guids.Count + 1; + WriteGuid (guid); + guids.Add (guid, index); + return index; + } + + void WriteGuid (Guid guid) + { + WriteBytes (guid.ToByteArray ()); + } + } + + class StringHeapBuffer : HeapBuffer { + + protected Dictionary strings = new Dictionary (StringComparer.Ordinal); + + public sealed override bool IsEmpty { + get { return length <= 1; } + } + + public StringHeapBuffer () + : base (1) + { + WriteByte (0); + } + + public virtual uint GetStringIndex (string @string) + { + uint index; + if (strings.TryGetValue (@string, out index)) + return index; + + index = (uint)strings.Count + 1; + strings.Add (@string, index); + return index; + } + + public uint [] WriteStrings () + { + var sorted = SortStrings (strings); + strings = null; + + // Add 1 for empty string whose index and offset are both 0 + var string_offsets = new uint [sorted.Count + 1]; + string_offsets [0] = 0; + + // Find strings that can be folded + var previous = string.Empty; + foreach (var entry in sorted) { + var @string = entry.Key; + var index = entry.Value; + var position = base.position; + + if (previous.EndsWith (@string, StringComparison.Ordinal) && !IsLowSurrogateChar (entry.Key [0])) { + // Map over the tail of prev string. Watch for null-terminator of prev string. + string_offsets [index] = (uint)(position - (Encoding.UTF8.GetByteCount (entry.Key) + 1)); + } else { + string_offsets [index] = (uint)position; + WriteString (@string); + } + + previous = entry.Key; + } + + return string_offsets; + } + + static List> SortStrings (Dictionary strings) + { + var sorted = new List> (strings); + sorted.Sort (new SuffixSort ()); + return sorted; + } + + static bool IsLowSurrogateChar (int c) + { + return unchecked((uint)(c - 0xDC00)) <= 0xDFFF - 0xDC00; + } + + protected virtual void WriteString (string @string) + { + WriteBytes (Encoding.UTF8.GetBytes (@string)); + WriteByte (0); + } + + // Sorts strings such that a string is followed immediately by all strings + // that are a suffix of it. + private class SuffixSort : IComparer> { + + public int Compare (KeyValuePair xPair, KeyValuePair yPair) + { + var x = xPair.Key; + var y = yPair.Key; + + for (int i = x.Length - 1, j = y.Length - 1; i >= 0 & j >= 0; i--, j--) { + if (x [i] < y [j]) { + return -1; + } + + if (x [i] > y [j]) { + return +1; + } + } + + return y.Length.CompareTo (x.Length); + } + } + } + + sealed class BlobHeapBuffer : HeapBuffer { + + readonly Dictionary blobs = new Dictionary (new ByteBufferEqualityComparer ()); + + public override bool IsEmpty { + get { return length <= 1; } + } + + public BlobHeapBuffer () + : base (1) + { + WriteByte (0); + } + + public uint GetBlobIndex (ByteBuffer blob) + { + uint index; + if (blobs.TryGetValue (blob, out index)) + return index; + + index = (uint)base.position; + WriteBlob (blob); + blobs.Add (blob, index); + return index; + } + + void WriteBlob (ByteBuffer blob) + { + WriteCompressedUInt32 ((uint)blob.length); + WriteBytes (blob); + } + } + + sealed class UserStringHeapBuffer : StringHeapBuffer { + + public override uint GetStringIndex (string @string) + { + uint index; + if (strings.TryGetValue (@string, out index)) + return index; + + index = (uint)base.position; + WriteString (@string); + strings.Add (@string, index); + return index; + } + + protected override void WriteString (string @string) + { + WriteCompressedUInt32 ((uint)@string.Length * 2 + 1); + + byte special = 0; + + for (int i = 0; i < @string.Length; i++) { + var @char = @string [i]; + WriteUInt16 (@char); + + if (special == 1) + continue; + + if (@char < 0x20 || @char > 0x7e) { + if (@char > 0x7e + || (@char >= 0x01 && @char <= 0x08) + || (@char >= 0x0e && @char <= 0x1f) + || @char == 0x27 + || @char == 0x2d) { + + special = 1; + } + } + } + + WriteByte (special); + } + } + + sealed class PdbHeapBuffer : HeapBuffer { + + public override bool IsEmpty { + get { return false; } + } + + public PdbHeapBuffer () + : base (0) + { + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Buffers.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Buffers.cs.meta new file mode 100644 index 0000000..480046a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Buffers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b1d0a81b66e78341ab77acdd3b15234 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/CodedIndex.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/CodedIndex.cs new file mode 100644 index 0000000..601a347 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/CodedIndex.cs @@ -0,0 +1,29 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil.Metadata { + + enum CodedIndex { + TypeDefOrRef, + HasConstant, + HasCustomAttribute, + HasFieldMarshal, + HasDeclSecurity, + MemberRefParent, + HasSemantics, + MethodDefOrRef, + MemberForwarded, + Implementation, + CustomAttributeType, + ResolutionScope, + TypeOrMethodDef, + HasCustomDebugInformation, + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/CodedIndex.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/CodedIndex.cs.meta new file mode 100644 index 0000000..553ef4d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/CodedIndex.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd50ffa8272dac444831e33b1b9d7f56 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/ElementType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/ElementType.cs new file mode 100644 index 0000000..8351286 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/ElementType.cs @@ -0,0 +1,55 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil.Metadata { + + enum ElementType : byte { + None = 0x00, + Void = 0x01, + Boolean = 0x02, + Char = 0x03, + I1 = 0x04, + U1 = 0x05, + I2 = 0x06, + U2 = 0x07, + I4 = 0x08, + U4 = 0x09, + I8 = 0x0a, + U8 = 0x0b, + R4 = 0x0c, + R8 = 0x0d, + String = 0x0e, + Ptr = 0x0f, // Followed by token + ByRef = 0x10, // Followed by token + ValueType = 0x11, // Followed by token + Class = 0x12, // Followed by token + Var = 0x13, // Followed by generic parameter number + Array = 0x14, // + GenericInst = 0x15, // ... */ + TypedByRef = 0x16, + I = 0x18, // System.IntPtr + U = 0x19, // System.UIntPtr + FnPtr = 0x1b, // Followed by full method signature + Object = 0x1c, // System.Object + SzArray = 0x1d, // Single-dim array with 0 lower bound + MVar = 0x1e, // Followed by generic parameter number + CModReqD = 0x1f, // Required modifier : followed by a TypeDef or TypeRef token + CModOpt = 0x20, // Optional modifier : followed by a TypeDef or TypeRef token + Internal = 0x21, // Implemented within the CLI + Modifier = 0x40, // Or'd with following element types + Sentinel = 0x41, // Sentinel for varargs method signature + Pinned = 0x45, // Denotes a local variable that points at a pinned object + + // special undocumented constants + Type = 0x50, + Boxed = 0x51, + Enum = 0x55 + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/ElementType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/ElementType.cs.meta new file mode 100644 index 0000000..58173f6 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/ElementType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94c4cb498ef60034d83bb60d3f743832 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/GuidHeap.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/GuidHeap.cs new file mode 100644 index 0000000..ec9c644 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/GuidHeap.cs @@ -0,0 +1,36 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil.Metadata { + + sealed class GuidHeap : Heap { + + public GuidHeap (byte [] data) + : base (data) + { + } + + public Guid Read (uint index) + { + const int guid_size = 16; + + if (index == 0 || ((index - 1) + guid_size) > data.Length) + return new Guid (); + + var buffer = new byte [guid_size]; + + Buffer.BlockCopy (this.data, (int)((index - 1) * guid_size), buffer, 0, guid_size); + + return new Guid (buffer); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/GuidHeap.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/GuidHeap.cs.meta new file mode 100644 index 0000000..eaabe77 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/GuidHeap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4bb39ab6484eb114b91a85d4b53f0f28 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Heap.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Heap.cs new file mode 100644 index 0000000..3cbb026 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Heap.cs @@ -0,0 +1,24 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil.Metadata { + + abstract class Heap { + + public int IndexSize; + + readonly internal byte [] data; + + protected Heap (byte [] data) + { + this.data = data; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Heap.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Heap.cs.meta new file mode 100644 index 0000000..c0d849b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Heap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c343466f40d68574499155a2acd05e6b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/MetadataToken.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/MetadataToken.cs new file mode 100644 index 0000000..50b2556 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/MetadataToken.cs @@ -0,0 +1,94 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + public struct MetadataToken : IEquatable { + + readonly uint token; + + public uint RID { + get { return token & 0x00ffffff; } + } + + public TokenType TokenType { + get { return (TokenType)(token & 0xff000000); } + } + + public static readonly MetadataToken Zero = new MetadataToken ((uint)0); + + public MetadataToken (uint token) + { + this.token = token; + } + + public MetadataToken (TokenType type) + : this (type, 0) + { + } + + public MetadataToken (TokenType type, uint rid) + { + token = (uint)type | rid; + } + + public MetadataToken (TokenType type, int rid) + { + token = (uint)type | (uint)rid; + } + + public int ToInt32 () + { + return (int)token; + } + + public uint ToUInt32 () + { + return token; + } + + public override int GetHashCode () + { + return (int)token; + } + + public bool Equals (MetadataToken other) + { + return other.token == token; + } + + public override bool Equals (object obj) + { + if (obj is MetadataToken) { + var other = (MetadataToken)obj; + return other.token == token; + } + + return false; + } + + public static bool operator == (MetadataToken one, MetadataToken other) + { + return one.token == other.token; + } + + public static bool operator != (MetadataToken one, MetadataToken other) + { + return one.token != other.token; + } + + public override string ToString () + { + return string.Format ("[{0}:0x{1}]", TokenType, RID.ToString ("x4")); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/MetadataToken.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/MetadataToken.cs.meta new file mode 100644 index 0000000..3026242 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/MetadataToken.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 755d1954236c374458be77d93493faf8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/PdbHeap.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/PdbHeap.cs new file mode 100644 index 0000000..6b56710 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/PdbHeap.cs @@ -0,0 +1,32 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using RID = System.UInt32; + +namespace MonoFN.Cecil.Metadata { + + sealed class PdbHeap : Heap { + + public byte [] Id; + public RID EntryPoint; + public long TypeSystemTables; + public uint [] TypeSystemTableRows; + + public PdbHeap (byte [] data) + : base (data) + { + } + + public bool HasTable (Table table) + { + return (TypeSystemTables & (1L << (int)table)) != 0; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/PdbHeap.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/PdbHeap.cs.meta new file mode 100644 index 0000000..6505525 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/PdbHeap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c64dd6e20a2b11c44ad424d29380c14c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Row.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Row.cs new file mode 100644 index 0000000..880eeb3 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Row.cs @@ -0,0 +1,152 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System.Collections.Generic; + +namespace MonoFN.Cecil.Metadata { + + struct Row { + internal T1 Col1; + internal T2 Col2; + + public Row (T1 col1, T2 col2) + { + Col1 = col1; + Col2 = col2; + } + } + + struct Row { + internal T1 Col1; + internal T2 Col2; + internal T3 Col3; + + public Row (T1 col1, T2 col2, T3 col3) + { + Col1 = col1; + Col2 = col2; + Col3 = col3; + } + } + + struct Row { + internal T1 Col1; + internal T2 Col2; + internal T3 Col3; + internal T4 Col4; + + public Row (T1 col1, T2 col2, T3 col3, T4 col4) + { + Col1 = col1; + Col2 = col2; + Col3 = col3; + Col4 = col4; + } + } + + struct Row { + internal T1 Col1; + internal T2 Col2; + internal T3 Col3; + internal T4 Col4; + internal T5 Col5; + + public Row (T1 col1, T2 col2, T3 col3, T4 col4, T5 col5) + { + Col1 = col1; + Col2 = col2; + Col3 = col3; + Col4 = col4; + Col5 = col5; + } + } + + struct Row { + internal T1 Col1; + internal T2 Col2; + internal T3 Col3; + internal T4 Col4; + internal T5 Col5; + internal T6 Col6; + + public Row (T1 col1, T2 col2, T3 col3, T4 col4, T5 col5, T6 col6) + { + Col1 = col1; + Col2 = col2; + Col3 = col3; + Col4 = col4; + Col5 = col5; + Col6 = col6; + } + } + + struct Row { + internal T1 Col1; + internal T2 Col2; + internal T3 Col3; + internal T4 Col4; + internal T5 Col5; + internal T6 Col6; + internal T7 Col7; + internal T8 Col8; + internal T9 Col9; + + public Row (T1 col1, T2 col2, T3 col3, T4 col4, T5 col5, T6 col6, T7 col7, T8 col8, T9 col9) + { + Col1 = col1; + Col2 = col2; + Col3 = col3; + Col4 = col4; + Col5 = col5; + Col6 = col6; + Col7 = col7; + Col8 = col8; + Col9 = col9; + } + } + + sealed class RowEqualityComparer : IEqualityComparer>, IEqualityComparer>, IEqualityComparer> { + + public bool Equals (Row x, Row y) + { + return x.Col1 == y.Col1 + && x.Col2 == y.Col2; + } + + public int GetHashCode (Row obj) + { + string x = obj.Col1, y = obj.Col2; + return (x != null ? x.GetHashCode () : 0) ^ (y != null ? y.GetHashCode () : 0); + } + + public bool Equals (Row x, Row y) + { + return x.Col1 == y.Col1 + && x.Col2 == y.Col2; + } + + public int GetHashCode (Row obj) + { + return (int)(obj.Col1 ^ obj.Col2); + } + + public bool Equals (Row x, Row y) + { + return x.Col1 == y.Col1 + && x.Col2 == y.Col2 + && x.Col3 == y.Col3; + } + + public int GetHashCode (Row obj) + { + return (int)(obj.Col1 ^ obj.Col2 ^ obj.Col3); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Row.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Row.cs.meta new file mode 100644 index 0000000..dc7d118 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Row.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89fd184bcc2b97840a2c0dfeec671be2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/StringHeap.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/StringHeap.cs new file mode 100644 index 0000000..22559df --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/StringHeap.cs @@ -0,0 +1,59 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System.Collections.Generic; +using System.Text; + +namespace MonoFN.Cecil.Metadata { + + class StringHeap : Heap { + + readonly Dictionary strings = new Dictionary (); + + public StringHeap (byte [] data) + : base (data) + { + } + + public string Read (uint index) + { + if (index == 0) + return string.Empty; + + string @string; + if (strings.TryGetValue (index, out @string)) + return @string; + + if (index > data.Length - 1) + return string.Empty; + + @string = ReadStringAt (index); + if (@string.Length != 0) + strings.Add (index, @string); + + return @string; + } + + protected virtual string ReadStringAt (uint index) + { + int length = 0; + int start = (int)index; + + for (int i = start; ; i++) { + if (data [i] == 0) + break; + + length++; + } + + return Encoding.UTF8.GetString (data, start, length); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/StringHeap.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/StringHeap.cs.meta new file mode 100644 index 0000000..9e51e42 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/StringHeap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0fc64863ca825b4e994640b0be9a938 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TableHeap.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TableHeap.cs new file mode 100644 index 0000000..e4f206b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TableHeap.cs @@ -0,0 +1,101 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil.Metadata { + + enum Table : byte { + Module = 0x00, + TypeRef = 0x01, + TypeDef = 0x02, + FieldPtr = 0x03, + Field = 0x04, + MethodPtr = 0x05, + Method = 0x06, + ParamPtr = 0x07, + Param = 0x08, + InterfaceImpl = 0x09, + MemberRef = 0x0a, + Constant = 0x0b, + CustomAttribute = 0x0c, + FieldMarshal = 0x0d, + DeclSecurity = 0x0e, + ClassLayout = 0x0f, + FieldLayout = 0x10, + StandAloneSig = 0x11, + EventMap = 0x12, + EventPtr = 0x13, + Event = 0x14, + PropertyMap = 0x15, + PropertyPtr = 0x16, + Property = 0x17, + MethodSemantics = 0x18, + MethodImpl = 0x19, + ModuleRef = 0x1a, + TypeSpec = 0x1b, + ImplMap = 0x1c, + FieldRVA = 0x1d, + EncLog = 0x1e, + EncMap = 0x1f, + Assembly = 0x20, + AssemblyProcessor = 0x21, + AssemblyOS = 0x22, + AssemblyRef = 0x23, + AssemblyRefProcessor = 0x24, + AssemblyRefOS = 0x25, + File = 0x26, + ExportedType = 0x27, + ManifestResource = 0x28, + NestedClass = 0x29, + GenericParam = 0x2a, + MethodSpec = 0x2b, + GenericParamConstraint = 0x2c, + + Document = 0x30, + MethodDebugInformation = 0x31, + LocalScope = 0x32, + LocalVariable = 0x33, + LocalConstant = 0x34, + ImportScope = 0x35, + StateMachineMethod = 0x36, + CustomDebugInformation = 0x37, + } + + struct TableInformation { + public uint Offset; + public uint Length; + public uint RowSize; + + public bool IsLarge { + get { return Length > ushort.MaxValue; } + } + } + + sealed class TableHeap : Heap { + + public long Valid; + public long Sorted; + + public readonly TableInformation [] Tables = new TableInformation [Mixin.TableCount]; + + public TableInformation this [Table table] { + get { return Tables [(int)table]; } + } + + public TableHeap (byte [] data) + : base (data) + { + } + + public bool HasTable (Table table) + { + return (Valid & (1L << (int)table)) != 0; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TableHeap.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TableHeap.cs.meta new file mode 100644 index 0000000..64fe6ce --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TableHeap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 978b1609b2ddc0c4baf628cc608456a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TokenType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TokenType.cs new file mode 100644 index 0000000..e527181 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TokenType.cs @@ -0,0 +1,49 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public enum TokenType : uint { + Module = 0x00000000, + TypeRef = 0x01000000, + TypeDef = 0x02000000, + Field = 0x04000000, + Method = 0x06000000, + Param = 0x08000000, + InterfaceImpl = 0x09000000, + MemberRef = 0x0a000000, + CustomAttribute = 0x0c000000, + Permission = 0x0e000000, + Signature = 0x11000000, + Event = 0x14000000, + Property = 0x17000000, + ModuleRef = 0x1a000000, + TypeSpec = 0x1b000000, + Assembly = 0x20000000, + AssemblyRef = 0x23000000, + File = 0x26000000, + ExportedType = 0x27000000, + ManifestResource = 0x28000000, + GenericParam = 0x2a000000, + MethodSpec = 0x2b000000, + GenericParamConstraint = 0x2c000000, + + Document = 0x30000000, + MethodDebugInformation = 0x31000000, + LocalScope = 0x32000000, + LocalVariable = 0x33000000, + LocalConstant = 0x34000000, + ImportScope = 0x35000000, + StateMachineMethod = 0x36000000, + CustomDebugInformation = 0x37000000, + + String = 0x70000000, + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TokenType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TokenType.cs.meta new file mode 100644 index 0000000..7dd9eb4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/TokenType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dba0af6138c6a084b8787e88b20b142a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/UserStringHeap.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/UserStringHeap.cs new file mode 100644 index 0000000..afdaa2c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/UserStringHeap.cs @@ -0,0 +1,36 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil.Metadata { + + sealed class UserStringHeap : StringHeap { + + public UserStringHeap (byte [] data) + : base (data) + { + } + + protected override string ReadStringAt (uint index) + { + int start = (int)index; + + uint length = (uint)(data.ReadCompressedUInt32 (ref start) & ~1); + if (length < 1) + return string.Empty; + + var chars = new char [length / 2]; + + for (int i = start, j = 0; i < start + length; i += 2) + chars [j++] = (char)(data [i] | (data [i + 1] << 8)); + + return new string (chars); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/UserStringHeap.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/UserStringHeap.cs.meta new file mode 100644 index 0000000..40594bf --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/UserStringHeap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2d89100b382ef8e4ea67917917d04db6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Utilities.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Utilities.cs new file mode 100644 index 0000000..c5a3b03 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Utilities.cs @@ -0,0 +1,649 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Metadata; +using System; + +namespace MonoFN.Cecil { + + static partial class Mixin { + + public const int TableCount = 58; + public const int CodedIndexCount = 14; + + public static uint ReadCompressedUInt32 (this byte [] data, ref int position) + { + uint integer; + if ((data [position] & 0x80) == 0) { + integer = data [position]; + position++; + } else if ((data [position] & 0x40) == 0) { + integer = (uint)(data [position] & ~0x80) << 8; + integer |= data [position + 1]; + position += 2; + } else { + integer = (uint)(data [position] & ~0xc0) << 24; + integer |= (uint)data [position + 1] << 16; + integer |= (uint)data [position + 2] << 8; + integer |= (uint)data [position + 3]; + position += 4; + } + return integer; + } + + public static MetadataToken GetMetadataToken (this CodedIndex self, uint data) + { + uint rid; + TokenType token_type; + switch (self) { + case CodedIndex.TypeDefOrRef: + rid = data >> 2; + switch (data & 3) { + case 0: + token_type = TokenType.TypeDef; goto ret; + case 1: + token_type = TokenType.TypeRef; goto ret; + case 2: + token_type = TokenType.TypeSpec; goto ret; + default: + goto exit; + } + case CodedIndex.HasConstant: + rid = data >> 2; + switch (data & 3) { + case 0: + token_type = TokenType.Field; goto ret; + case 1: + token_type = TokenType.Param; goto ret; + case 2: + token_type = TokenType.Property; goto ret; + default: + goto exit; + } + case CodedIndex.HasCustomAttribute: + rid = data >> 5; + switch (data & 31) { + case 0: + token_type = TokenType.Method; goto ret; + case 1: + token_type = TokenType.Field; goto ret; + case 2: + token_type = TokenType.TypeRef; goto ret; + case 3: + token_type = TokenType.TypeDef; goto ret; + case 4: + token_type = TokenType.Param; goto ret; + case 5: + token_type = TokenType.InterfaceImpl; goto ret; + case 6: + token_type = TokenType.MemberRef; goto ret; + case 7: + token_type = TokenType.Module; goto ret; + case 8: + token_type = TokenType.Permission; goto ret; + case 9: + token_type = TokenType.Property; goto ret; + case 10: + token_type = TokenType.Event; goto ret; + case 11: + token_type = TokenType.Signature; goto ret; + case 12: + token_type = TokenType.ModuleRef; goto ret; + case 13: + token_type = TokenType.TypeSpec; goto ret; + case 14: + token_type = TokenType.Assembly; goto ret; + case 15: + token_type = TokenType.AssemblyRef; goto ret; + case 16: + token_type = TokenType.File; goto ret; + case 17: + token_type = TokenType.ExportedType; goto ret; + case 18: + token_type = TokenType.ManifestResource; goto ret; + case 19: + token_type = TokenType.GenericParam; goto ret; + case 20: + token_type = TokenType.GenericParamConstraint; goto ret; + case 21: + token_type = TokenType.MethodSpec; goto ret; + default: + goto exit; + } + case CodedIndex.HasFieldMarshal: + rid = data >> 1; + switch (data & 1) { + case 0: + token_type = TokenType.Field; goto ret; + case 1: + token_type = TokenType.Param; goto ret; + default: + goto exit; + } + case CodedIndex.HasDeclSecurity: + rid = data >> 2; + switch (data & 3) { + case 0: + token_type = TokenType.TypeDef; goto ret; + case 1: + token_type = TokenType.Method; goto ret; + case 2: + token_type = TokenType.Assembly; goto ret; + default: + goto exit; + } + case CodedIndex.MemberRefParent: + rid = data >> 3; + switch (data & 7) { + case 0: + token_type = TokenType.TypeDef; goto ret; + case 1: + token_type = TokenType.TypeRef; goto ret; + case 2: + token_type = TokenType.ModuleRef; goto ret; + case 3: + token_type = TokenType.Method; goto ret; + case 4: + token_type = TokenType.TypeSpec; goto ret; + default: + goto exit; + } + case CodedIndex.HasSemantics: + rid = data >> 1; + switch (data & 1) { + case 0: + token_type = TokenType.Event; goto ret; + case 1: + token_type = TokenType.Property; goto ret; + default: + goto exit; + } + case CodedIndex.MethodDefOrRef: + rid = data >> 1; + switch (data & 1) { + case 0: + token_type = TokenType.Method; goto ret; + case 1: + token_type = TokenType.MemberRef; goto ret; + default: + goto exit; + } + case CodedIndex.MemberForwarded: + rid = data >> 1; + switch (data & 1) { + case 0: + token_type = TokenType.Field; goto ret; + case 1: + token_type = TokenType.Method; goto ret; + default: + goto exit; + } + case CodedIndex.Implementation: + rid = data >> 2; + switch (data & 3) { + case 0: + token_type = TokenType.File; goto ret; + case 1: + token_type = TokenType.AssemblyRef; goto ret; + case 2: + token_type = TokenType.ExportedType; goto ret; + default: + goto exit; + } + case CodedIndex.CustomAttributeType: + rid = data >> 3; + switch (data & 7) { + case 2: + token_type = TokenType.Method; goto ret; + case 3: + token_type = TokenType.MemberRef; goto ret; + default: + goto exit; + } + case CodedIndex.ResolutionScope: + rid = data >> 2; + switch (data & 3) { + case 0: + token_type = TokenType.Module; goto ret; + case 1: + token_type = TokenType.ModuleRef; goto ret; + case 2: + token_type = TokenType.AssemblyRef; goto ret; + case 3: + token_type = TokenType.TypeRef; goto ret; + default: + goto exit; + } + case CodedIndex.TypeOrMethodDef: + rid = data >> 1; + switch (data & 1) { + case 0: + token_type = TokenType.TypeDef; goto ret; + case 1: + token_type = TokenType.Method; goto ret; + default: goto exit; + } + case CodedIndex.HasCustomDebugInformation: + rid = data >> 5; + switch (data & 31) { + case 0: + token_type = TokenType.Method; goto ret; + case 1: + token_type = TokenType.Field; goto ret; + case 2: + token_type = TokenType.TypeRef; goto ret; + case 3: + token_type = TokenType.TypeDef; goto ret; + case 4: + token_type = TokenType.Param; goto ret; + case 5: + token_type = TokenType.InterfaceImpl; goto ret; + case 6: + token_type = TokenType.MemberRef; goto ret; + case 7: + token_type = TokenType.Module; goto ret; + case 8: + token_type = TokenType.Permission; goto ret; + case 9: + token_type = TokenType.Property; goto ret; + case 10: + token_type = TokenType.Event; goto ret; + case 11: + token_type = TokenType.Signature; goto ret; + case 12: + token_type = TokenType.ModuleRef; goto ret; + case 13: + token_type = TokenType.TypeSpec; goto ret; + case 14: + token_type = TokenType.Assembly; goto ret; + case 15: + token_type = TokenType.AssemblyRef; goto ret; + case 16: + token_type = TokenType.File; goto ret; + case 17: + token_type = TokenType.ExportedType; goto ret; + case 18: + token_type = TokenType.ManifestResource; goto ret; + case 19: + token_type = TokenType.GenericParam; goto ret; + case 20: + token_type = TokenType.GenericParamConstraint; goto ret; + case 21: + token_type = TokenType.MethodSpec; goto ret; + case 22: + token_type = TokenType.Document; goto ret; + case 23: + token_type = TokenType.LocalScope; goto ret; + case 24: + token_type = TokenType.LocalVariable; goto ret; + case 25: + token_type = TokenType.LocalConstant; goto ret; + case 26: + token_type = TokenType.ImportScope; goto ret; + default: + goto exit; + } + default: + goto exit; + } + ret: + return new MetadataToken (token_type, rid); + exit: + return MetadataToken.Zero; + } + + public static uint CompressMetadataToken (this CodedIndex self, MetadataToken token) + { + uint ret = 0; + if (token.RID == 0) + return ret; + switch (self) { + case CodedIndex.TypeDefOrRef: + ret = token.RID << 2; + switch (token.TokenType) { + case TokenType.TypeDef: + return ret | 0; + case TokenType.TypeRef: + return ret | 1; + case TokenType.TypeSpec: + return ret | 2; + default: + goto exit; + } + case CodedIndex.HasConstant: + ret = token.RID << 2; + switch (token.TokenType) { + case TokenType.Field: + return ret | 0; + case TokenType.Param: + return ret | 1; + case TokenType.Property: + return ret | 2; + default: + goto exit; + } + case CodedIndex.HasCustomAttribute: + ret = token.RID << 5; + switch (token.TokenType) { + case TokenType.Method: + return ret | 0; + case TokenType.Field: + return ret | 1; + case TokenType.TypeRef: + return ret | 2; + case TokenType.TypeDef: + return ret | 3; + case TokenType.Param: + return ret | 4; + case TokenType.InterfaceImpl: + return ret | 5; + case TokenType.MemberRef: + return ret | 6; + case TokenType.Module: + return ret | 7; + case TokenType.Permission: + return ret | 8; + case TokenType.Property: + return ret | 9; + case TokenType.Event: + return ret | 10; + case TokenType.Signature: + return ret | 11; + case TokenType.ModuleRef: + return ret | 12; + case TokenType.TypeSpec: + return ret | 13; + case TokenType.Assembly: + return ret | 14; + case TokenType.AssemblyRef: + return ret | 15; + case TokenType.File: + return ret | 16; + case TokenType.ExportedType: + return ret | 17; + case TokenType.ManifestResource: + return ret | 18; + case TokenType.GenericParam: + return ret | 19; + case TokenType.GenericParamConstraint: + return ret | 20; + case TokenType.MethodSpec: + return ret | 21; + default: + goto exit; + } + case CodedIndex.HasFieldMarshal: + ret = token.RID << 1; + switch (token.TokenType) { + case TokenType.Field: + return ret | 0; + case TokenType.Param: + return ret | 1; + default: + goto exit; + } + case CodedIndex.HasDeclSecurity: + ret = token.RID << 2; + switch (token.TokenType) { + case TokenType.TypeDef: + return ret | 0; + case TokenType.Method: + return ret | 1; + case TokenType.Assembly: + return ret | 2; + default: + goto exit; + } + case CodedIndex.MemberRefParent: + ret = token.RID << 3; + switch (token.TokenType) { + case TokenType.TypeDef: + return ret | 0; + case TokenType.TypeRef: + return ret | 1; + case TokenType.ModuleRef: + return ret | 2; + case TokenType.Method: + return ret | 3; + case TokenType.TypeSpec: + return ret | 4; + default: + goto exit; + } + case CodedIndex.HasSemantics: + ret = token.RID << 1; + switch (token.TokenType) { + case TokenType.Event: + return ret | 0; + case TokenType.Property: + return ret | 1; + default: + goto exit; + } + case CodedIndex.MethodDefOrRef: + ret = token.RID << 1; + switch (token.TokenType) { + case TokenType.Method: + return ret | 0; + case TokenType.MemberRef: + return ret | 1; + default: + goto exit; + } + case CodedIndex.MemberForwarded: + ret = token.RID << 1; + switch (token.TokenType) { + case TokenType.Field: + return ret | 0; + case TokenType.Method: + return ret | 1; + default: + goto exit; + } + case CodedIndex.Implementation: + ret = token.RID << 2; + switch (token.TokenType) { + case TokenType.File: + return ret | 0; + case TokenType.AssemblyRef: + return ret | 1; + case TokenType.ExportedType: + return ret | 2; + default: + goto exit; + } + case CodedIndex.CustomAttributeType: + ret = token.RID << 3; + switch (token.TokenType) { + case TokenType.Method: + return ret | 2; + case TokenType.MemberRef: + return ret | 3; + default: + goto exit; + } + case CodedIndex.ResolutionScope: + ret = token.RID << 2; + switch (token.TokenType) { + case TokenType.Module: + return ret | 0; + case TokenType.ModuleRef: + return ret | 1; + case TokenType.AssemblyRef: + return ret | 2; + case TokenType.TypeRef: + return ret | 3; + default: + goto exit; + } + case CodedIndex.TypeOrMethodDef: + ret = token.RID << 1; + switch (token.TokenType) { + case TokenType.TypeDef: + return ret | 0; + case TokenType.Method: + return ret | 1; + default: + goto exit; + } + case CodedIndex.HasCustomDebugInformation: + ret = token.RID << 5; + switch (token.TokenType) { + case TokenType.Method: + return ret | 0; + case TokenType.Field: + return ret | 1; + case TokenType.TypeRef: + return ret | 2; + case TokenType.TypeDef: + return ret | 3; + case TokenType.Param: + return ret | 4; + case TokenType.InterfaceImpl: + return ret | 5; + case TokenType.MemberRef: + return ret | 6; + case TokenType.Module: + return ret | 7; + case TokenType.Permission: + return ret | 8; + case TokenType.Property: + return ret | 9; + case TokenType.Event: + return ret | 10; + case TokenType.Signature: + return ret | 11; + case TokenType.ModuleRef: + return ret | 12; + case TokenType.TypeSpec: + return ret | 13; + case TokenType.Assembly: + return ret | 14; + case TokenType.AssemblyRef: + return ret | 15; + case TokenType.File: + return ret | 16; + case TokenType.ExportedType: + return ret | 17; + case TokenType.ManifestResource: + return ret | 18; + case TokenType.GenericParam: + return ret | 19; + case TokenType.GenericParamConstraint: + return ret | 20; + case TokenType.MethodSpec: + return ret | 21; + case TokenType.Document: + return ret | 22; + case TokenType.LocalScope: + return ret | 23; + case TokenType.LocalVariable: + return ret | 24; + case TokenType.LocalConstant: + return ret | 25; + case TokenType.ImportScope: + return ret | 26; + default: + goto exit; + } + default: + goto exit; + } + exit: + throw new ArgumentException (); + } + + public static int GetSize (this CodedIndex self, Func counter) + { + int bits; + Table [] tables; + + switch (self) { + case CodedIndex.TypeDefOrRef: + bits = 2; + tables = new [] { Table.TypeDef, Table.TypeRef, Table.TypeSpec }; + break; + case CodedIndex.HasConstant: + bits = 2; + tables = new [] { Table.Field, Table.Param, Table.Property }; + break; + case CodedIndex.HasCustomAttribute: + bits = 5; + tables = new [] { + Table.Method, Table.Field, Table.TypeRef, Table.TypeDef, Table.Param, Table.InterfaceImpl, Table.MemberRef, + Table.Module, Table.DeclSecurity, Table.Property, Table.Event, Table.StandAloneSig, Table.ModuleRef, + Table.TypeSpec, Table.Assembly, Table.AssemblyRef, Table.File, Table.ExportedType, + Table.ManifestResource, Table.GenericParam, Table.GenericParamConstraint, Table.MethodSpec, + }; + break; + case CodedIndex.HasFieldMarshal: + bits = 1; + tables = new [] { Table.Field, Table.Param }; + break; + case CodedIndex.HasDeclSecurity: + bits = 2; + tables = new [] { Table.TypeDef, Table.Method, Table.Assembly }; + break; + case CodedIndex.MemberRefParent: + bits = 3; + tables = new [] { Table.TypeDef, Table.TypeRef, Table.ModuleRef, Table.Method, Table.TypeSpec }; + break; + case CodedIndex.HasSemantics: + bits = 1; + tables = new [] { Table.Event, Table.Property }; + break; + case CodedIndex.MethodDefOrRef: + bits = 1; + tables = new [] { Table.Method, Table.MemberRef }; + break; + case CodedIndex.MemberForwarded: + bits = 1; + tables = new [] { Table.Field, Table.Method }; + break; + case CodedIndex.Implementation: + bits = 2; + tables = new [] { Table.File, Table.AssemblyRef, Table.ExportedType }; + break; + case CodedIndex.CustomAttributeType: + bits = 3; + tables = new [] { Table.Method, Table.MemberRef }; + break; + case CodedIndex.ResolutionScope: + bits = 2; + tables = new [] { Table.Module, Table.ModuleRef, Table.AssemblyRef, Table.TypeRef }; + break; + case CodedIndex.TypeOrMethodDef: + bits = 1; + tables = new [] { Table.TypeDef, Table.Method }; + break; + case CodedIndex.HasCustomDebugInformation: + bits = 5; + tables = new [] { + Table.Method, Table.Field, Table.TypeRef, Table.TypeDef, Table.Param, Table.InterfaceImpl, Table.MemberRef, + Table.Module, Table.DeclSecurity, Table.Property, Table.Event, Table.StandAloneSig, Table.ModuleRef, + Table.TypeSpec, Table.Assembly, Table.AssemblyRef, Table.File, Table.ExportedType, + Table.ManifestResource, Table.GenericParam, Table.GenericParamConstraint, Table.MethodSpec, + Table.Document, Table.LocalScope, Table.LocalVariable, Table.LocalConstant, Table.ImportScope, + }; + break; + default: + throw new ArgumentException (); + } + + int max = 0; + + for (int i = 0; i < tables.Length; i++) { + max = System.Math.Max (counter (tables [i]), max); + } + + return max < (1 << (16 - bits)) ? 2 : 4; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Utilities.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Utilities.cs.meta new file mode 100644 index 0000000..6fab64b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Metadata/Utilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4785957c0c546de4680e1196a57f66d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE.meta new file mode 100644 index 0000000..1ebbe55 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a1a250fa69b80b34c9ca9b9086296b97 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamReader.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamReader.cs new file mode 100644 index 0000000..c584ff8 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamReader.cs @@ -0,0 +1,53 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System.IO; + +namespace MonoFN.Cecil.PE { + + class BinaryStreamReader : BinaryReader { + + public int Position { + get { return (int)BaseStream.Position; } + set { BaseStream.Position = value; } + } + + public int Length { + get { return (int)BaseStream.Length; } + } + + public BinaryStreamReader (Stream stream) + : base (stream) + { + } + + public void Advance (int bytes) + { + BaseStream.Seek (bytes, SeekOrigin.Current); + } + + public void MoveTo (uint position) + { + BaseStream.Seek (position, SeekOrigin.Begin); + } + + public void Align (int align) + { + align--; + var position = Position; + Advance (((position + align) & ~align) - position); + } + + public DataDirectory ReadDataDirectory () + { + return new DataDirectory (ReadUInt32 (), ReadUInt32 ()); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamReader.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamReader.cs.meta new file mode 100644 index 0000000..a1d4c1d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamReader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7492ed3a048237443b99d7a25e806ce6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamWriter.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamWriter.cs new file mode 100644 index 0000000..34ad11a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamWriter.cs @@ -0,0 +1,88 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System.IO; + +namespace MonoFN.Cecil.PE { + + class BinaryStreamWriter : BinaryWriter { + + public int Position { + get { return (int)BaseStream.Position; } + set { BaseStream.Position = value; } + } + + public BinaryStreamWriter (Stream stream) + : base (stream) + { + } + + public void WriteByte (byte value) + { + Write (value); + } + + public void WriteUInt16 (ushort value) + { + Write (value); + } + + public void WriteInt16 (short value) + { + Write (value); + } + + public void WriteUInt32 (uint value) + { + Write (value); + } + + public void WriteInt32 (int value) + { + Write (value); + } + + public void WriteUInt64 (ulong value) + { + Write (value); + } + + public void WriteBytes (byte [] bytes) + { + Write (bytes); + } + + public void WriteDataDirectory (DataDirectory directory) + { + Write (directory.VirtualAddress); + Write (directory.Size); + } + + public void WriteBuffer (ByteBuffer buffer) + { + Write (buffer.buffer, 0, buffer.length); + } + + protected void Advance (int bytes) + { + BaseStream.Seek (bytes, SeekOrigin.Current); + } + + public void Align (int align) + { + align--; + var position = Position; + var bytes = ((position + align) & ~align) - position; + + for (int i = 0; i < bytes; i++) + WriteByte (0); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamWriter.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamWriter.cs.meta new file mode 100644 index 0000000..2c0e298 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/BinaryStreamWriter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26d384e0dd0e44549a9faf09adbd0a41 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBuffer.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBuffer.cs new file mode 100644 index 0000000..8e5c947 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBuffer.cs @@ -0,0 +1,335 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil.PE { + + class ByteBuffer { + + internal byte [] buffer; + internal int length; + internal int position; + + public ByteBuffer () + { + this.buffer = Empty.Array; + } + + public ByteBuffer (int length) + { + this.buffer = new byte [length]; + } + + public ByteBuffer (byte [] buffer) + { + this.buffer = buffer ?? Empty.Array; + this.length = this.buffer.Length; + } + + public void Advance (int length) + { + position += length; + } + + public byte ReadByte () + { + return buffer [position++]; + } + + public sbyte ReadSByte () + { + return (sbyte)ReadByte (); + } + + public byte [] ReadBytes (int length) + { + var bytes = new byte [length]; + Buffer.BlockCopy (buffer, position, bytes, 0, length); + position += length; + return bytes; + } + + public ushort ReadUInt16 () + { + ushort value = (ushort)(buffer [position] + | (buffer [position + 1] << 8)); + position += 2; + return value; + } + + public short ReadInt16 () + { + return (short)ReadUInt16 (); + } + + public uint ReadUInt32 () + { + uint value = (uint)(buffer [position] + | (buffer [position + 1] << 8) + | (buffer [position + 2] << 16) + | (buffer [position + 3] << 24)); + position += 4; + return value; + } + + public int ReadInt32 () + { + return (int)ReadUInt32 (); + } + + public ulong ReadUInt64 () + { + uint low = ReadUInt32 (); + uint high = ReadUInt32 (); + + return (((ulong)high) << 32) | low; + } + + public long ReadInt64 () + { + return (long)ReadUInt64 (); + } + + public uint ReadCompressedUInt32 () + { + byte first = ReadByte (); + if ((first & 0x80) == 0) + return first; + + if ((first & 0x40) == 0) + return ((uint)(first & ~0x80) << 8) + | ReadByte (); + + return ((uint)(first & ~0xc0) << 24) + | (uint)ReadByte () << 16 + | (uint)ReadByte () << 8 + | ReadByte (); + } + + public int ReadCompressedInt32 () + { + var b = buffer [position]; + var u = (int)ReadCompressedUInt32 (); + var v = u >> 1; + if ((u & 1) == 0) + return v; + + switch (b & 0xc0) { + case 0: + case 0x40: + return v - 0x40; + case 0x80: + return v - 0x2000; + default: + return v - 0x10000000; + } + } + + public float ReadSingle () + { + if (!BitConverter.IsLittleEndian) { + var bytes = ReadBytes (4); + Array.Reverse (bytes); + return BitConverter.ToSingle (bytes, 0); + } + + float value = BitConverter.ToSingle (buffer, position); + position += 4; + return value; + } + + public double ReadDouble () + { + if (!BitConverter.IsLittleEndian) { + var bytes = ReadBytes (8); + Array.Reverse (bytes); + return BitConverter.ToDouble (bytes, 0); + } + + double value = BitConverter.ToDouble (buffer, position); + position += 8; + return value; + } + + public void WriteByte (byte value) + { + if (position == buffer.Length) + Grow (1); + + buffer [position++] = value; + + if (position > length) + length = position; + } + + public void WriteSByte (sbyte value) + { + WriteByte ((byte)value); + } + + public void WriteUInt16 (ushort value) + { + if (position + 2 > buffer.Length) + Grow (2); + + buffer [position++] = (byte)value; + buffer [position++] = (byte)(value >> 8); + + if (position > length) + length = position; + } + + public void WriteInt16 (short value) + { + WriteUInt16 ((ushort)value); + } + + public void WriteUInt32 (uint value) + { + if (position + 4 > buffer.Length) + Grow (4); + + buffer [position++] = (byte)value; + buffer [position++] = (byte)(value >> 8); + buffer [position++] = (byte)(value >> 16); + buffer [position++] = (byte)(value >> 24); + + if (position > length) + length = position; + } + + public void WriteInt32 (int value) + { + WriteUInt32 ((uint)value); + } + + public void WriteUInt64 (ulong value) + { + if (position + 8 > buffer.Length) + Grow (8); + + buffer [position++] = (byte)value; + buffer [position++] = (byte)(value >> 8); + buffer [position++] = (byte)(value >> 16); + buffer [position++] = (byte)(value >> 24); + buffer [position++] = (byte)(value >> 32); + buffer [position++] = (byte)(value >> 40); + buffer [position++] = (byte)(value >> 48); + buffer [position++] = (byte)(value >> 56); + + if (position > length) + length = position; + } + + public void WriteInt64 (long value) + { + WriteUInt64 ((ulong)value); + } + + public void WriteCompressedUInt32 (uint value) + { + if (value < 0x80) + WriteByte ((byte)value); + else if (value < 0x4000) { + WriteByte ((byte)(0x80 | (value >> 8))); + WriteByte ((byte)(value & 0xff)); + } else { + WriteByte ((byte)((value >> 24) | 0xc0)); + WriteByte ((byte)((value >> 16) & 0xff)); + WriteByte ((byte)((value >> 8) & 0xff)); + WriteByte ((byte)(value & 0xff)); + } + } + + public void WriteCompressedInt32 (int value) + { + if (value >= 0) { + WriteCompressedUInt32 ((uint)(value << 1)); + return; + } + + if (value > -0x40) + value = 0x40 + value; + else if (value >= -0x2000) + value = 0x2000 + value; + else if (value >= -0x20000000) + value = 0x20000000 + value; + + WriteCompressedUInt32 ((uint)((value << 1) | 1)); + } + + public void WriteBytes (byte [] bytes) + { + var length = bytes.Length; + if (position + length > buffer.Length) + Grow (length); + + Buffer.BlockCopy (bytes, 0, buffer, position, length); + position += length; + + if (position > this.length) + this.length = position; + } + + public void WriteBytes (int length) + { + if (position + length > buffer.Length) + Grow (length); + + position += length; + + if (position > this.length) + this.length = position; + } + + public void WriteBytes (ByteBuffer buffer) + { + if (position + buffer.length > this.buffer.Length) + Grow (buffer.length); + + Buffer.BlockCopy (buffer.buffer, 0, this.buffer, position, buffer.length); + position += buffer.length; + + if (position > this.length) + this.length = position; + } + + public void WriteSingle (float value) + { + var bytes = BitConverter.GetBytes (value); + + if (!BitConverter.IsLittleEndian) + Array.Reverse (bytes); + + WriteBytes (bytes); + } + + public void WriteDouble (double value) + { + var bytes = BitConverter.GetBytes (value); + + if (!BitConverter.IsLittleEndian) + Array.Reverse (bytes); + + WriteBytes (bytes); + } + + void Grow (int desired) + { + var current = this.buffer; + var current_length = current.Length; + + var buffer = new byte [System.Math.Max (current_length + desired, current_length * 2)]; + Buffer.BlockCopy (current, 0, buffer, 0, current_length); + this.buffer = buffer; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBuffer.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBuffer.cs.meta new file mode 100644 index 0000000..15415a1 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBuffer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3752816249ea16e4aba70adb03f01673 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBufferEqualityComparer.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBufferEqualityComparer.cs new file mode 100644 index 0000000..25caec1 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBufferEqualityComparer.cs @@ -0,0 +1,47 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System.Collections.Generic; + +namespace MonoFN.Cecil.PE { + + sealed class ByteBufferEqualityComparer : IEqualityComparer { + + public bool Equals (ByteBuffer x, ByteBuffer y) + { + if (x.length != y.length) + return false; + + var x_buffer = x.buffer; + var y_buffer = y.buffer; + + for (int i = 0; i < x.length; i++) + if (x_buffer [i] != y_buffer [i]) + return false; + + return true; + } + + public int GetHashCode (ByteBuffer buffer) + { + // See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function + const int fnv_offset_bias = unchecked((int)2166136261); + const int fnv_prime = 16777619; + + var hash_code = fnv_offset_bias; + var bytes = buffer.buffer; + + for (int i = 0; i < buffer.length; i++) + hash_code = unchecked((hash_code ^ bytes [i]) * fnv_prime); + + return hash_code; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBufferEqualityComparer.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBufferEqualityComparer.cs.meta new file mode 100644 index 0000000..402b21d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ByteBufferEqualityComparer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0db5f2f7f9a349d4d89e2329ffd563b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/DataDirectory.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/DataDirectory.cs new file mode 100644 index 0000000..81121af --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/DataDirectory.cs @@ -0,0 +1,30 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using RVA = System.UInt32; + +namespace MonoFN.Cecil.PE { + + struct DataDirectory { + + public readonly RVA VirtualAddress; + public readonly uint Size; + + public bool IsZero { + get { return VirtualAddress == 0 && Size == 0; } + } + + public DataDirectory (RVA rva, uint size) + { + this.VirtualAddress = rva; + this.Size = size; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/DataDirectory.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/DataDirectory.cs.meta new file mode 100644 index 0000000..b196baa --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/DataDirectory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7cd272a7ff953734bbacab398dfc9fe8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Image.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Image.cs new file mode 100644 index 0000000..a129178 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Image.cs @@ -0,0 +1,169 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Metadata; +using System; +using System.IO; +using RVA = System.UInt32; + +namespace MonoFN.Cecil.PE { + + sealed class Image : IDisposable { + + public Disposable Stream; + public string FileName; + + public ModuleKind Kind; + public uint Characteristics; + public string RuntimeVersion; + public TargetArchitecture Architecture; + public ModuleCharacteristics DllCharacteristics; + public ushort LinkerVersion; + public ushort SubSystemMajor; + public ushort SubSystemMinor; + + public ImageDebugHeader DebugHeader; + + public Section [] Sections; + + public Section MetadataSection; + + public uint EntryPointToken; + public uint Timestamp; + public ModuleAttributes Attributes; + + public DataDirectory Win32Resources; + public DataDirectory Debug; + public DataDirectory Resources; + public DataDirectory StrongName; + + public StringHeap StringHeap; + public BlobHeap BlobHeap; + public UserStringHeap UserStringHeap; + public GuidHeap GuidHeap; + public TableHeap TableHeap; + public PdbHeap PdbHeap; + + readonly int [] coded_index_sizes = new int [14]; + + readonly Func counter; + + public Image () + { + counter = GetTableLength; + } + + public bool HasTable (Table table) + { + return GetTableLength (table) > 0; + } + + public int GetTableLength (Table table) + { + return (int)TableHeap [table].Length; + } + + public int GetTableIndexSize (Table table) + { + return GetTableLength (table) < 65536 ? 2 : 4; + } + + public int GetCodedIndexSize (CodedIndex coded_index) + { + var index = (int)coded_index; + var size = coded_index_sizes [index]; + if (size != 0) + return size; + + return coded_index_sizes [index] = coded_index.GetSize (counter); + } + + public uint ResolveVirtualAddress (RVA rva) + { + var section = GetSectionAtVirtualAddress (rva); + if (section == null) + throw new ArgumentOutOfRangeException (); + + return ResolveVirtualAddressInSection (rva, section); + } + + public uint ResolveVirtualAddressInSection (RVA rva, Section section) + { + return rva + section.PointerToRawData - section.VirtualAddress; + } + + public Section GetSection (string name) + { + var sections = this.Sections; + for (int i = 0; i < sections.Length; i++) { + var section = sections [i]; + if (section.Name == name) + return section; + } + + return null; + } + + public Section GetSectionAtVirtualAddress (RVA rva) + { + var sections = this.Sections; + for (int i = 0; i < sections.Length; i++) { + var section = sections [i]; + if (rva >= section.VirtualAddress && rva < section.VirtualAddress + section.SizeOfRawData) + return section; + } + + return null; + } + + BinaryStreamReader GetReaderAt (RVA rva) + { + var section = GetSectionAtVirtualAddress (rva); + if (section == null) + return null; + + var reader = new BinaryStreamReader (Stream.value); + reader.MoveTo (ResolveVirtualAddressInSection (rva, section)); + return reader; + } + + public TRet GetReaderAt (RVA rva, TItem item, Func read) where TRet : class + { + var position = Stream.value.Position; + try { + var reader = GetReaderAt (rva); + if (reader == null) + return null; + + return read (item, reader); + } + finally { + Stream.value.Position = position; + } + } + + public bool HasDebugTables () + { + return HasTable (Table.Document) + || HasTable (Table.MethodDebugInformation) + || HasTable (Table.LocalScope) + || HasTable (Table.LocalVariable) + || HasTable (Table.LocalConstant) + || HasTable (Table.StateMachineMethod) + || HasTable (Table.CustomDebugInformation); + } + + public void Dispose () + { + Stream.Dispose (); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Image.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Image.cs.meta new file mode 100644 index 0000000..2978245 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Image.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be7f3ca6a9f5ad34db68702bd99778fd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageReader.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageReader.cs new file mode 100644 index 0000000..8837e6b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageReader.cs @@ -0,0 +1,793 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Metadata; +using System; +using System.IO; + +namespace MonoFN.Cecil.PE { + + sealed class ImageReader : BinaryStreamReader { + + readonly Image image; + + DataDirectory cli; + DataDirectory metadata; + + uint table_heap_offset; + + public ImageReader (Disposable stream, string file_name) + : base (stream.value) + { + image = new Image (); + image.Stream = stream; + image.FileName = file_name; + } + + void MoveTo (DataDirectory directory) + { + BaseStream.Position = image.ResolveVirtualAddress (directory.VirtualAddress); + } + + void ReadImage () + { + if (BaseStream.Length < 128) + throw new BadImageFormatException (); + + // - DOSHeader + + // PE 2 + // Start 58 + // Lfanew 4 + // End 64 + + if (ReadUInt16 () != 0x5a4d) + throw new BadImageFormatException (); + + Advance (58); + + MoveTo (ReadUInt32 ()); + + if (ReadUInt32 () != 0x00004550) + throw new BadImageFormatException (); + + // - PEFileHeader + + // Machine 2 + image.Architecture = ReadArchitecture (); + + // NumberOfSections 2 + ushort sections = ReadUInt16 (); + + // TimeDateStamp 4 + image.Timestamp = ReadUInt32 (); + // PointerToSymbolTable 4 + // NumberOfSymbols 4 + // OptionalHeaderSize 2 + Advance (10); + + // Characteristics 2 + ushort characteristics = ReadUInt16 (); + + ushort subsystem, dll_characteristics; + ReadOptionalHeaders (out subsystem, out dll_characteristics); + ReadSections (sections); + ReadCLIHeader (); + ReadMetadata (); + ReadDebugHeader (); + + image.Characteristics = characteristics; + image.Kind = GetModuleKind (characteristics, subsystem); + image.DllCharacteristics = (ModuleCharacteristics)dll_characteristics; + } + + TargetArchitecture ReadArchitecture () + { + return (TargetArchitecture)ReadUInt16 (); + } + + static ModuleKind GetModuleKind (ushort characteristics, ushort subsystem) + { + if ((characteristics & 0x2000) != 0) // ImageCharacteristics.Dll + return ModuleKind.Dll; + + if (subsystem == 0x2 || subsystem == 0x9) // SubSystem.WindowsGui || SubSystem.WindowsCeGui + return ModuleKind.Windows; + + return ModuleKind.Console; + } + + void ReadOptionalHeaders (out ushort subsystem, out ushort dll_characteristics) + { + // - PEOptionalHeader + // - StandardFieldsHeader + + // Magic 2 + bool pe64 = ReadUInt16 () == 0x20b; + + // pe32 || pe64 + + image.LinkerVersion = ReadUInt16 (); + // CodeSize 4 + // InitializedDataSize 4 + // UninitializedDataSize4 + // EntryPointRVA 4 + // BaseOfCode 4 + // BaseOfData 4 || 0 + + // - NTSpecificFieldsHeader + + // ImageBase 4 || 8 + // SectionAlignment 4 + // FileAlignement 4 + // OSMajor 2 + // OSMinor 2 + // UserMajor 2 + // UserMinor 2 + // SubSysMajor 2 + // SubSysMinor 2 + Advance (44); + + image.SubSystemMajor = ReadUInt16 (); + image.SubSystemMinor = ReadUInt16 (); + + // Reserved 4 + // ImageSize 4 + // HeaderSize 4 + // FileChecksum 4 + Advance (16); + + // SubSystem 2 + subsystem = ReadUInt16 (); + + // DLLFlags 2 + dll_characteristics = ReadUInt16 (); + // StackReserveSize 4 || 8 + // StackCommitSize 4 || 8 + // HeapReserveSize 4 || 8 + // HeapCommitSize 4 || 8 + // LoaderFlags 4 + // NumberOfDataDir 4 + + // - DataDirectoriesHeader + + // ExportTable 8 + // ImportTable 8 + + Advance (pe64 ? 56 : 40); + + // ResourceTable 8 + + image.Win32Resources = ReadDataDirectory (); + + // ExceptionTable 8 + // CertificateTable 8 + // BaseRelocationTable 8 + + Advance (24); + + // Debug 8 + image.Debug = ReadDataDirectory (); + + // Copyright 8 + // GlobalPtr 8 + // TLSTable 8 + // LoadConfigTable 8 + // BoundImport 8 + // IAT 8 + // DelayImportDescriptor8 + Advance (56); + + // CLIHeader 8 + cli = ReadDataDirectory (); + + if (cli.IsZero) + throw new BadImageFormatException (); + + // Reserved 8 + Advance (8); + } + + string ReadAlignedString (int length) + { + int read = 0; + var buffer = new char [length]; + while (read < length) { + var current = ReadByte (); + if (current == 0) + break; + + buffer [read++] = (char)current; + } + + Advance (-1 + ((read + 4) & ~3) - read); + + return new string (buffer, 0, read); + } + + string ReadZeroTerminatedString (int length) + { + int read = 0; + var buffer = new char [length]; + var bytes = ReadBytes (length); + while (read < length) { + var current = bytes [read]; + if (current == 0) + break; + + buffer [read++] = (char)current; + } + + return new string (buffer, 0, read); + } + + void ReadSections (ushort count) + { + var sections = new Section [count]; + + for (int i = 0; i < count; i++) { + var section = new Section (); + + // Name + section.Name = ReadZeroTerminatedString (8); + + // VirtualSize 4 + Advance (4); + + // VirtualAddress 4 + section.VirtualAddress = ReadUInt32 (); + // SizeOfRawData 4 + section.SizeOfRawData = ReadUInt32 (); + // PointerToRawData 4 + section.PointerToRawData = ReadUInt32 (); + + // PointerToRelocations 4 + // PointerToLineNumbers 4 + // NumberOfRelocations 2 + // NumberOfLineNumbers 2 + // Characteristics 4 + Advance (16); + + sections [i] = section; + } + + image.Sections = sections; + } + + void ReadCLIHeader () + { + MoveTo (cli); + + // - CLIHeader + + // Cb 4 + // MajorRuntimeVersion 2 + // MinorRuntimeVersion 2 + Advance (8); + + // Metadata 8 + metadata = ReadDataDirectory (); + // Flags 4 + image.Attributes = (ModuleAttributes)ReadUInt32 (); + // EntryPointToken 4 + image.EntryPointToken = ReadUInt32 (); + // Resources 8 + image.Resources = ReadDataDirectory (); + // StrongNameSignature 8 + image.StrongName = ReadDataDirectory (); + // CodeManagerTable 8 + // VTableFixups 8 + // ExportAddressTableJumps 8 + // ManagedNativeHeader 8 + } + + void ReadMetadata () + { + MoveTo (metadata); + + if (ReadUInt32 () != 0x424a5342) + throw new BadImageFormatException (); + + // MajorVersion 2 + // MinorVersion 2 + // Reserved 4 + Advance (8); + + image.RuntimeVersion = ReadZeroTerminatedString (ReadInt32 ()); + + // Flags 2 + Advance (2); + + var streams = ReadUInt16 (); + + var section = image.GetSectionAtVirtualAddress (metadata.VirtualAddress); + if (section == null) + throw new BadImageFormatException (); + + image.MetadataSection = section; + + for (int i = 0; i < streams; i++) + ReadMetadataStream (section); + + if (image.PdbHeap != null) + ReadPdbHeap (); + + if (image.TableHeap != null) + ReadTableHeap (); + } + + void ReadDebugHeader () + { + if (image.Debug.IsZero) { + image.DebugHeader = new ImageDebugHeader (Empty.Array); + return; + } + + MoveTo (image.Debug); + + var entries = new ImageDebugHeaderEntry [(int)image.Debug.Size / ImageDebugDirectory.Size]; + + for (int i = 0; i < entries.Length; i++) { + var directory = new ImageDebugDirectory { + Characteristics = ReadInt32 (), + TimeDateStamp = ReadInt32 (), + MajorVersion = ReadInt16 (), + MinorVersion = ReadInt16 (), + Type = (ImageDebugType)ReadInt32 (), + SizeOfData = ReadInt32 (), + AddressOfRawData = ReadInt32 (), + PointerToRawData = ReadInt32 (), + }; + + if (directory.PointerToRawData == 0 || directory.SizeOfData < 0) { + entries [i] = new ImageDebugHeaderEntry (directory, Empty.Array); + continue; + } + + var position = Position; + try { + MoveTo ((uint)directory.PointerToRawData); + var data = ReadBytes (directory.SizeOfData); + entries [i] = new ImageDebugHeaderEntry (directory, data); + } + finally { + Position = position; + } + } + + image.DebugHeader = new ImageDebugHeader (entries); + } + + void ReadMetadataStream (Section section) + { + // Offset 4 + uint offset = metadata.VirtualAddress - section.VirtualAddress + ReadUInt32 (); // relative to the section start + + // Size 4 + uint size = ReadUInt32 (); + + var data = ReadHeapData (offset, size); + + var name = ReadAlignedString (16); + switch (name) { + case "#~": + case "#-": + image.TableHeap = new TableHeap (data); + table_heap_offset = offset; + break; + case "#Strings": + image.StringHeap = new StringHeap (data); + break; + case "#Blob": + image.BlobHeap = new BlobHeap (data); + break; + case "#GUID": + image.GuidHeap = new GuidHeap (data); + break; + case "#US": + image.UserStringHeap = new UserStringHeap (data); + break; + case "#Pdb": + image.PdbHeap = new PdbHeap (data); + break; + } + } + + byte [] ReadHeapData (uint offset, uint size) + { + var position = BaseStream.Position; + MoveTo (offset + image.MetadataSection.PointerToRawData); + var data = ReadBytes ((int)size); + BaseStream.Position = position; + + return data; + } + + void ReadTableHeap () + { + var heap = image.TableHeap; + + MoveTo (table_heap_offset + image.MetadataSection.PointerToRawData); + + // Reserved 4 + // MajorVersion 1 + // MinorVersion 1 + Advance (6); + + // HeapSizes 1 + var sizes = ReadByte (); + + // Reserved2 1 + Advance (1); + + // Valid 8 + heap.Valid = ReadInt64 (); + + // Sorted 8 + heap.Sorted = ReadInt64 (); + + if (image.PdbHeap != null) { + for (int i = 0; i < Mixin.TableCount; i++) { + if (!image.PdbHeap.HasTable ((Table)i)) + continue; + + heap.Tables [i].Length = image.PdbHeap.TypeSystemTableRows [i]; + } + } + + for (int i = 0; i < Mixin.TableCount; i++) { + if (!heap.HasTable ((Table)i)) + continue; + + heap.Tables [i].Length = ReadUInt32 (); + } + + SetIndexSize (image.StringHeap, sizes, 0x1); + SetIndexSize (image.GuidHeap, sizes, 0x2); + SetIndexSize (image.BlobHeap, sizes, 0x4); + + ComputeTableInformations (); + } + + static void SetIndexSize (Heap heap, uint sizes, byte flag) + { + if (heap == null) + return; + + heap.IndexSize = (sizes & flag) > 0 ? 4 : 2; + } + + int GetTableIndexSize (Table table) + { + return image.GetTableIndexSize (table); + } + + int GetCodedIndexSize (CodedIndex index) + { + return image.GetCodedIndexSize (index); + } + + void ComputeTableInformations () + { + uint offset = (uint)BaseStream.Position - table_heap_offset - image.MetadataSection.PointerToRawData; // header + + int stridx_size = image.StringHeap != null ? image.StringHeap.IndexSize : 2; + int guididx_size = image.GuidHeap != null ? image.GuidHeap.IndexSize : 2; + int blobidx_size = image.BlobHeap != null ? image.BlobHeap.IndexSize : 2; + + var heap = image.TableHeap; + var tables = heap.Tables; + + for (int i = 0; i < Mixin.TableCount; i++) { + var table = (Table)i; + if (!heap.HasTable (table)) + continue; + + int size; + switch (table) { + case Table.Module: + size = 2 // Generation + + stridx_size // Name + + (guididx_size * 3); // Mvid, EncId, EncBaseId + break; + case Table.TypeRef: + size = GetCodedIndexSize (CodedIndex.ResolutionScope) // ResolutionScope + + (stridx_size * 2); // Name, Namespace + break; + case Table.TypeDef: + size = 4 // Flags + + (stridx_size * 2) // Name, Namespace + + GetCodedIndexSize (CodedIndex.TypeDefOrRef) // BaseType + + GetTableIndexSize (Table.Field) // FieldList + + GetTableIndexSize (Table.Method); // MethodList + break; + case Table.FieldPtr: + size = GetTableIndexSize (Table.Field); // Field + break; + case Table.Field: + size = 2 // Flags + + stridx_size // Name + + blobidx_size; // Signature + break; + case Table.MethodPtr: + size = GetTableIndexSize (Table.Method); // Method + break; + case Table.Method: + size = 8 // Rva 4, ImplFlags 2, Flags 2 + + stridx_size // Name + + blobidx_size // Signature + + GetTableIndexSize (Table.Param); // ParamList + break; + case Table.ParamPtr: + size = GetTableIndexSize (Table.Param); // Param + break; + case Table.Param: + size = 4 // Flags 2, Sequence 2 + + stridx_size; // Name + break; + case Table.InterfaceImpl: + size = GetTableIndexSize (Table.TypeDef) // Class + + GetCodedIndexSize (CodedIndex.TypeDefOrRef); // Interface + break; + case Table.MemberRef: + size = GetCodedIndexSize (CodedIndex.MemberRefParent) // Class + + stridx_size // Name + + blobidx_size; // Signature + break; + case Table.Constant: + size = 2 // Type + + GetCodedIndexSize (CodedIndex.HasConstant) // Parent + + blobidx_size; // Value + break; + case Table.CustomAttribute: + size = GetCodedIndexSize (CodedIndex.HasCustomAttribute) // Parent + + GetCodedIndexSize (CodedIndex.CustomAttributeType) // Type + + blobidx_size; // Value + break; + case Table.FieldMarshal: + size = GetCodedIndexSize (CodedIndex.HasFieldMarshal) // Parent + + blobidx_size; // NativeType + break; + case Table.DeclSecurity: + size = 2 // Action + + GetCodedIndexSize (CodedIndex.HasDeclSecurity) // Parent + + blobidx_size; // PermissionSet + break; + case Table.ClassLayout: + size = 6 // PackingSize 2, ClassSize 4 + + GetTableIndexSize (Table.TypeDef); // Parent + break; + case Table.FieldLayout: + size = 4 // Offset + + GetTableIndexSize (Table.Field); // Field + break; + case Table.StandAloneSig: + size = blobidx_size; // Signature + break; + case Table.EventMap: + size = GetTableIndexSize (Table.TypeDef) // Parent + + GetTableIndexSize (Table.Event); // EventList + break; + case Table.EventPtr: + size = GetTableIndexSize (Table.Event); // Event + break; + case Table.Event: + size = 2 // Flags + + stridx_size // Name + + GetCodedIndexSize (CodedIndex.TypeDefOrRef); // EventType + break; + case Table.PropertyMap: + size = GetTableIndexSize (Table.TypeDef) // Parent + + GetTableIndexSize (Table.Property); // PropertyList + break; + case Table.PropertyPtr: + size = GetTableIndexSize (Table.Property); // Property + break; + case Table.Property: + size = 2 // Flags + + stridx_size // Name + + blobidx_size; // Type + break; + case Table.MethodSemantics: + size = 2 // Semantics + + GetTableIndexSize (Table.Method) // Method + + GetCodedIndexSize (CodedIndex.HasSemantics); // Association + break; + case Table.MethodImpl: + size = GetTableIndexSize (Table.TypeDef) // Class + + GetCodedIndexSize (CodedIndex.MethodDefOrRef) // MethodBody + + GetCodedIndexSize (CodedIndex.MethodDefOrRef); // MethodDeclaration + break; + case Table.ModuleRef: + size = stridx_size; // Name + break; + case Table.TypeSpec: + size = blobidx_size; // Signature + break; + case Table.ImplMap: + size = 2 // MappingFlags + + GetCodedIndexSize (CodedIndex.MemberForwarded) // MemberForwarded + + stridx_size // ImportName + + GetTableIndexSize (Table.ModuleRef); // ImportScope + break; + case Table.FieldRVA: + size = 4 // RVA + + GetTableIndexSize (Table.Field); // Field + break; + case Table.EncLog: + size = 8; + break; + case Table.EncMap: + size = 4; + break; + case Table.Assembly: + size = 16 // HashAlgId 4, Version 4 * 2, Flags 4 + + blobidx_size // PublicKey + + (stridx_size * 2); // Name, Culture + break; + case Table.AssemblyProcessor: + size = 4; // Processor + break; + case Table.AssemblyOS: + size = 12; // Platform 4, Version 2 * 4 + break; + case Table.AssemblyRef: + size = 12 // Version 2 * 4 + Flags 4 + + (blobidx_size * 2) // PublicKeyOrToken, HashValue + + (stridx_size * 2); // Name, Culture + break; + case Table.AssemblyRefProcessor: + size = 4 // Processor + + GetTableIndexSize (Table.AssemblyRef); // AssemblyRef + break; + case Table.AssemblyRefOS: + size = 12 // Platform 4, Version 2 * 4 + + GetTableIndexSize (Table.AssemblyRef); // AssemblyRef + break; + case Table.File: + size = 4 // Flags + + stridx_size // Name + + blobidx_size; // HashValue + break; + case Table.ExportedType: + size = 8 // Flags 4, TypeDefId 4 + + (stridx_size * 2) // Name, Namespace + + GetCodedIndexSize (CodedIndex.Implementation); // Implementation + break; + case Table.ManifestResource: + size = 8 // Offset, Flags + + stridx_size // Name + + GetCodedIndexSize (CodedIndex.Implementation); // Implementation + break; + case Table.NestedClass: + size = GetTableIndexSize (Table.TypeDef) // NestedClass + + GetTableIndexSize (Table.TypeDef); // EnclosingClass + break; + case Table.GenericParam: + size = 4 // Number, Flags + + GetCodedIndexSize (CodedIndex.TypeOrMethodDef) // Owner + + stridx_size; // Name + break; + case Table.MethodSpec: + size = GetCodedIndexSize (CodedIndex.MethodDefOrRef) // Method + + blobidx_size; // Instantiation + break; + case Table.GenericParamConstraint: + size = GetTableIndexSize (Table.GenericParam) // Owner + + GetCodedIndexSize (CodedIndex.TypeDefOrRef); // Constraint + break; + case Table.Document: + size = blobidx_size // Name + + guididx_size // HashAlgorithm + + blobidx_size // Hash + + guididx_size; // Language + break; + case Table.MethodDebugInformation: + size = GetTableIndexSize (Table.Document) // Document + + blobidx_size; // SequencePoints + break; + case Table.LocalScope: + size = GetTableIndexSize (Table.Method) // Method + + GetTableIndexSize (Table.ImportScope) // ImportScope + + GetTableIndexSize (Table.LocalVariable) // VariableList + + GetTableIndexSize (Table.LocalConstant) // ConstantList + + 4 * 2; // StartOffset, Length + break; + case Table.LocalVariable: + size = 2 // Attributes + + 2 // Index + + stridx_size; // Name + break; + case Table.LocalConstant: + size = stridx_size // Name + + blobidx_size; // Signature + break; + case Table.ImportScope: + size = GetTableIndexSize (Table.ImportScope) // Parent + + blobidx_size; + break; + case Table.StateMachineMethod: + size = GetTableIndexSize (Table.Method) // MoveNextMethod + + GetTableIndexSize (Table.Method); // KickOffMethod + break; + case Table.CustomDebugInformation: + size = GetCodedIndexSize (CodedIndex.HasCustomDebugInformation) // Parent + + guididx_size // Kind + + blobidx_size; // Value + break; + default: + throw new NotSupportedException (); + } + + tables [i].RowSize = (uint)size; + tables [i].Offset = offset; + + offset += (uint)size * tables [i].Length; + } + } + + void ReadPdbHeap () + { + var heap = image.PdbHeap; + + var buffer = new ByteBuffer (heap.data); + + heap.Id = buffer.ReadBytes (20); + heap.EntryPoint = buffer.ReadUInt32 (); + heap.TypeSystemTables = buffer.ReadInt64 (); + heap.TypeSystemTableRows = new uint [Mixin.TableCount]; + + for (int i = 0; i < Mixin.TableCount; i++) { + var table = (Table)i; + if (!heap.HasTable (table)) + continue; + + heap.TypeSystemTableRows [i] = buffer.ReadUInt32 (); + } + } + + public static Image ReadImage (Disposable stream, string file_name) + { + try { + var reader = new ImageReader (stream, file_name); + reader.ReadImage (); + return reader.image; + } + catch (EndOfStreamException e) { + throw new BadImageFormatException (stream.value.GetFileName (), e); + } + } + + public static Image ReadPortablePdb (Disposable stream, string file_name) + { + try { + var reader = new ImageReader (stream, file_name); + var length = (uint)stream.value.Length; + + reader.image.Sections = new [] { + new Section { + PointerToRawData = 0, + SizeOfRawData = length, + VirtualAddress = 0, + VirtualSize = length, + } + }; + + reader.metadata = new DataDirectory (0, length); + reader.ReadMetadata (); + return reader.image; + } + catch (EndOfStreamException e) { + throw new BadImageFormatException (stream.value.GetFileName (), e); + } + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageReader.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageReader.cs.meta new file mode 100644 index 0000000..a001d10 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageReader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba04d4e3389423e47b35aaccee205576 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageWriter.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageWriter.cs new file mode 100644 index 0000000..061a95f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageWriter.cs @@ -0,0 +1,860 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Metadata; +using System; +using System.IO; +using RVA = System.UInt32; + +namespace MonoFN.Cecil.PE { + + sealed class ImageWriter : BinaryStreamWriter { + + readonly ModuleDefinition module; + readonly MetadataBuilder metadata; + readonly TextMap text_map; + readonly internal Disposable stream; + + readonly string runtime_version; + + ImageDebugHeader debug_header; + + ByteBuffer win32_resources; + + const uint pe_header_size = 0x98u; + const uint section_header_size = 0x28u; + const uint file_alignment = 0x200; + const uint section_alignment = 0x2000; + const ulong image_base = 0x00400000; + + internal const RVA text_rva = 0x2000; + + readonly bool pe64; + readonly bool has_reloc; + + internal Section text; + internal Section rsrc; + internal Section reloc; + + ushort sections; + + ImageWriter (ModuleDefinition module, string runtime_version, MetadataBuilder metadata, Disposable stream, bool metadataOnly = false) + : base (stream.value) + { + this.module = module; + this.runtime_version = runtime_version; + this.text_map = metadata.text_map; + this.stream = stream; + this.metadata = metadata; + if (metadataOnly) + return; + + this.pe64 = module.Architecture == TargetArchitecture.AMD64 || module.Architecture == TargetArchitecture.IA64 || module.Architecture == TargetArchitecture.ARM64; + this.has_reloc = module.Architecture == TargetArchitecture.I386; + this.GetDebugHeader (); + this.GetWin32Resources (); + this.BuildTextMap (); + this.sections = (ushort)(has_reloc ? 2 : 1); // text + reloc? + } + + void GetDebugHeader () + { + var symbol_writer = metadata.symbol_writer; + if (symbol_writer != null) + debug_header = symbol_writer.GetDebugHeader (); + + if (module.HasDebugHeader) { + var header = module.GetDebugHeader (); + var deterministic = header.GetDeterministicEntry (); + if (deterministic == null) + return; + + debug_header = debug_header.AddDeterministicEntry (); + } + } + + void GetWin32Resources () + { + if (!module.HasImage) + return; + + DataDirectory win32_resources_directory = module.Image.Win32Resources; + var size = win32_resources_directory.Size; + + if (size > 0) { + win32_resources = module.Image.GetReaderAt (win32_resources_directory.VirtualAddress, size, (s, reader) => new ByteBuffer (reader.ReadBytes ((int)s))); + } + } + + public static ImageWriter CreateWriter (ModuleDefinition module, MetadataBuilder metadata, Disposable stream) + { + var writer = new ImageWriter (module, module.runtime_version, metadata, stream); + writer.BuildSections (); + return writer; + } + + public static ImageWriter CreateDebugWriter (ModuleDefinition module, MetadataBuilder metadata, Disposable stream) + { + var writer = new ImageWriter (module, "PDB v1.0", metadata, stream, metadataOnly: true); + var length = metadata.text_map.GetLength (); + writer.text = new Section { SizeOfRawData = length, VirtualSize = length }; + return writer; + } + + void BuildSections () + { + var has_win32_resources = win32_resources != null; + if (has_win32_resources) + sections++; + + text = CreateSection (".text", text_map.GetLength (), null); + var previous = text; + + if (has_win32_resources) { + rsrc = CreateSection (".rsrc", (uint)win32_resources.length, previous); + + PatchWin32Resources (win32_resources); + previous = rsrc; + } + + if (has_reloc) + reloc = CreateSection (".reloc", 12u, previous); + } + + Section CreateSection (string name, uint size, Section previous) + { + return new Section { + Name = name, + VirtualAddress = previous != null + ? previous.VirtualAddress + Align (previous.VirtualSize, section_alignment) + : text_rva, + VirtualSize = size, + PointerToRawData = previous != null + ? previous.PointerToRawData + previous.SizeOfRawData + : Align (GetHeaderSize (), file_alignment), + SizeOfRawData = Align (size, file_alignment) + }; + } + + static uint Align (uint value, uint align) + { + align--; + return (value + align) & ~align; + } + + void WriteDOSHeader () + { + Write (new byte [] { + // dos header start + 0x4d, 0x5a, 0x90, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + // lfanew + 0x80, 0x00, 0x00, 0x00, + // dos header end + 0x0e, 0x1f, 0xba, 0x0e, 0x00, 0xb4, 0x09, + 0xcd, 0x21, 0xb8, 0x01, 0x4c, 0xcd, 0x21, + 0x54, 0x68, 0x69, 0x73, 0x20, 0x70, 0x72, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x63, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x62, + 0x65, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x69, + 0x6e, 0x20, 0x44, 0x4f, 0x53, 0x20, 0x6d, + 0x6f, 0x64, 0x65, 0x2e, 0x0d, 0x0d, 0x0a, + 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00 + }); + } + + ushort SizeOfOptionalHeader () + { + return (ushort)(!pe64 ? 0xe0 : 0xf0); + } + + void WritePEFileHeader () + { + WriteUInt32 (0x00004550); // Magic + WriteUInt16 ((ushort)module.Architecture); // Machine + WriteUInt16 (sections); // NumberOfSections + WriteUInt32 (metadata.timestamp); + WriteUInt32 (0); // PointerToSymbolTable + WriteUInt32 (0); // NumberOfSymbols + WriteUInt16 (SizeOfOptionalHeader ()); // SizeOfOptionalHeader + + const ushort LargeAddressAware = 0x0020; + + // ExecutableImage | (!pe64 ? 32BitsMachine : LargeAddressAware) + var characteristics = (ushort)(0x0002 | (!pe64 ? 0x0100 : LargeAddressAware)); + if (module.Kind == ModuleKind.Dll || module.Kind == ModuleKind.NetModule) + characteristics |= 0x2000; + + if (module.Image != null && (module.Image.Characteristics & LargeAddressAware) != 0) + characteristics |= LargeAddressAware; + + WriteUInt16 (characteristics); // Characteristics + } + + Section LastSection () + { + if (reloc != null) + return reloc; + + if (rsrc != null) + return rsrc; + + return text; + } + + void WriteOptionalHeaders () + { + WriteUInt16 ((ushort)(!pe64 ? 0x10b : 0x20b)); // Magic + WriteUInt16 (module.linker_version); + WriteUInt32 (text.SizeOfRawData); // CodeSize + WriteUInt32 ((reloc != null ? reloc.SizeOfRawData : 0) + + (rsrc != null ? rsrc.SizeOfRawData : 0)); // InitializedDataSize + WriteUInt32 (0); // UninitializedDataSize + + var startub_stub = text_map.GetRange (TextSegment.StartupStub); + WriteUInt32 (startub_stub.Length > 0 ? startub_stub.Start : 0); // EntryPointRVA + WriteUInt32 (text_rva); // BaseOfCode + + if (!pe64) { + WriteUInt32 (0); // BaseOfData + WriteUInt32 ((uint)image_base); // ImageBase + } else { + WriteUInt64 (image_base); // ImageBase + } + + WriteUInt32 (section_alignment); // SectionAlignment + WriteUInt32 (file_alignment); // FileAlignment + + WriteUInt16 (4); // OSMajor + WriteUInt16 (0); // OSMinor + WriteUInt16 (0); // UserMajor + WriteUInt16 (0); // UserMinor + WriteUInt16 (module.subsystem_major); // SubSysMajor + WriteUInt16 (module.subsystem_minor); // SubSysMinor + WriteUInt32 (0); // Reserved + + var last_section = LastSection (); + WriteUInt32 (last_section.VirtualAddress + Align (last_section.VirtualSize, section_alignment)); // ImageSize + WriteUInt32 (text.PointerToRawData); // HeaderSize + + WriteUInt32 (0); // Checksum + WriteUInt16 (GetSubSystem ()); // SubSystem + WriteUInt16 ((ushort)module.Characteristics); // DLLFlags + + if (!pe64) { + const uint stack_reserve = 0x100000; + const uint stack_commit = 0x1000; + const uint heap_reserve = 0x100000; + const uint heap_commit = 0x1000; + + WriteUInt32 (stack_reserve); + WriteUInt32 (stack_commit); + WriteUInt32 (heap_reserve); + WriteUInt32 (heap_commit); + } else { + const ulong stack_reserve = 0x400000; + const ulong stack_commit = 0x4000; + const ulong heap_reserve = 0x100000; + const ulong heap_commit = 0x2000; + + WriteUInt64 (stack_reserve); + WriteUInt64 (stack_commit); + WriteUInt64 (heap_reserve); + WriteUInt64 (heap_commit); + } + + WriteUInt32 (0); // LoaderFlags + WriteUInt32 (16); // NumberOfDataDir + + WriteZeroDataDirectory (); // ExportTable + WriteDataDirectory (text_map.GetDataDirectory (TextSegment.ImportDirectory)); // ImportTable + if (rsrc != null) { // ResourceTable + WriteUInt32 (rsrc.VirtualAddress); + WriteUInt32 (rsrc.VirtualSize); + } else + WriteZeroDataDirectory (); + + WriteZeroDataDirectory (); // ExceptionTable + WriteZeroDataDirectory (); // CertificateTable + WriteUInt32 (reloc != null ? reloc.VirtualAddress : 0); // BaseRelocationTable + WriteUInt32 (reloc != null ? reloc.VirtualSize : 0); + + if (text_map.GetLength (TextSegment.DebugDirectory) > 0) { + WriteUInt32 (text_map.GetRVA (TextSegment.DebugDirectory)); + WriteUInt32 ((uint)(debug_header.Entries.Length * ImageDebugDirectory.Size)); + } else + WriteZeroDataDirectory (); + + WriteZeroDataDirectory (); // Copyright + WriteZeroDataDirectory (); // GlobalPtr + WriteZeroDataDirectory (); // TLSTable + WriteZeroDataDirectory (); // LoadConfigTable + WriteZeroDataDirectory (); // BoundImport + WriteDataDirectory (text_map.GetDataDirectory (TextSegment.ImportAddressTable)); // IAT + WriteZeroDataDirectory (); // DelayImportDesc + WriteDataDirectory (text_map.GetDataDirectory (TextSegment.CLIHeader)); // CLIHeader + WriteZeroDataDirectory (); // Reserved + } + + void WriteZeroDataDirectory () + { + WriteUInt32 (0); + WriteUInt32 (0); + } + + ushort GetSubSystem () + { + switch (module.Kind) { + case ModuleKind.Console: + case ModuleKind.Dll: + case ModuleKind.NetModule: + return 0x3; + case ModuleKind.Windows: + return 0x2; + default: + throw new ArgumentOutOfRangeException (); + } + } + + void WriteSectionHeaders () + { + WriteSection (text, 0x60000020); + + if (rsrc != null) + WriteSection (rsrc, 0x40000040); + + if (reloc != null) + WriteSection (reloc, 0x42000040); + } + + void WriteSection (Section section, uint characteristics) + { + var name = new byte [8]; + var sect_name = section.Name; + for (int i = 0; i < sect_name.Length; i++) + name [i] = (byte)sect_name [i]; + + WriteBytes (name); + WriteUInt32 (section.VirtualSize); + WriteUInt32 (section.VirtualAddress); + WriteUInt32 (section.SizeOfRawData); + WriteUInt32 (section.PointerToRawData); + WriteUInt32 (0); // PointerToRelocations + WriteUInt32 (0); // PointerToLineNumbers + WriteUInt16 (0); // NumberOfRelocations + WriteUInt16 (0); // NumberOfLineNumbers + WriteUInt32 (characteristics); + } + + uint GetRVAFileOffset (Section section, RVA rva) + { + return section.PointerToRawData + rva - section.VirtualAddress; + } + + void MoveTo (uint pointer) + { + BaseStream.Seek (pointer, SeekOrigin.Begin); + } + + void MoveToRVA (Section section, RVA rva) + { + BaseStream.Seek (GetRVAFileOffset (section, rva), SeekOrigin.Begin); + } + + void MoveToRVA (TextSegment segment) + { + MoveToRVA (text, text_map.GetRVA (segment)); + } + + void WriteRVA (RVA rva) + { + if (!pe64) + WriteUInt32 (rva); + else + WriteUInt64 (rva); + } + + void PrepareSection (Section section) + { + MoveTo (section.PointerToRawData); + + const int buffer_size = 4096; + + if (section.SizeOfRawData <= buffer_size) { + Write (new byte [section.SizeOfRawData]); + MoveTo (section.PointerToRawData); + return; + } + + var written = 0; + var buffer = new byte [buffer_size]; + while (written != section.SizeOfRawData) { + var write_size = System.Math.Min ((int)section.SizeOfRawData - written, buffer_size); + Write (buffer, 0, write_size); + written += write_size; + } + + MoveTo (section.PointerToRawData); + } + + void WriteText () + { + PrepareSection (text); + + // ImportAddressTable + + if (has_reloc) { + WriteRVA (text_map.GetRVA (TextSegment.ImportHintNameTable)); + WriteRVA (0); + } + + // CLIHeader + + WriteUInt32 (0x48); + WriteUInt16 (2); + WriteUInt16 ((ushort)((module.Runtime <= TargetRuntime.Net_1_1) ? 0 : 5)); + + WriteUInt32 (text_map.GetRVA (TextSegment.MetadataHeader)); + WriteUInt32 (GetMetadataLength ()); + WriteUInt32 ((uint)module.Attributes); + WriteUInt32 (metadata.entry_point.ToUInt32 ()); + WriteDataDirectory (text_map.GetDataDirectory (TextSegment.Resources)); + WriteDataDirectory (text_map.GetDataDirectory (TextSegment.StrongNameSignature)); + WriteZeroDataDirectory (); // CodeManagerTable + WriteZeroDataDirectory (); // VTableFixups + WriteZeroDataDirectory (); // ExportAddressTableJumps + WriteZeroDataDirectory (); // ManagedNativeHeader + + // Code + + MoveToRVA (TextSegment.Code); + WriteBuffer (metadata.code); + + // Resources + + MoveToRVA (TextSegment.Resources); + WriteBuffer (metadata.resources); + + // Data + + if (metadata.data.length > 0) { + MoveToRVA (TextSegment.Data); + WriteBuffer (metadata.data); + } + + // StrongNameSignature + // stays blank + + // MetadataHeader + + MoveToRVA (TextSegment.MetadataHeader); + WriteMetadataHeader (); + + WriteMetadata (); + + // DebugDirectory + if (text_map.GetLength (TextSegment.DebugDirectory) > 0) { + MoveToRVA (TextSegment.DebugDirectory); + WriteDebugDirectory (); + } + + if (!has_reloc) + return; + + // ImportDirectory + MoveToRVA (TextSegment.ImportDirectory); + WriteImportDirectory (); + + // StartupStub + MoveToRVA (TextSegment.StartupStub); + WriteStartupStub (); + } + + uint GetMetadataLength () + { + return text_map.GetRVA (TextSegment.DebugDirectory) - text_map.GetRVA (TextSegment.MetadataHeader); + } + + public void WriteMetadataHeader () + { + WriteUInt32 (0x424a5342); // Signature + WriteUInt16 (1); // MajorVersion + WriteUInt16 (1); // MinorVersion + WriteUInt32 (0); // Reserved + + var version = GetZeroTerminatedString (runtime_version); + WriteUInt32 ((uint)version.Length); + WriteBytes (version); + WriteUInt16 (0); // Flags + WriteUInt16 (GetStreamCount ()); + + uint offset = text_map.GetRVA (TextSegment.TableHeap) - text_map.GetRVA (TextSegment.MetadataHeader); + + WriteStreamHeader (ref offset, TextSegment.TableHeap, "#~"); + WriteStreamHeader (ref offset, TextSegment.StringHeap, "#Strings"); + WriteStreamHeader (ref offset, TextSegment.UserStringHeap, "#US"); + WriteStreamHeader (ref offset, TextSegment.GuidHeap, "#GUID"); + WriteStreamHeader (ref offset, TextSegment.BlobHeap, "#Blob"); + WriteStreamHeader (ref offset, TextSegment.PdbHeap, "#Pdb"); + } + + ushort GetStreamCount () + { + return (ushort)( + 1 // #~ + + 1 // #Strings + + (metadata.user_string_heap.IsEmpty ? 0 : 1) // #US + + (metadata.guid_heap.IsEmpty ? 0 : 1) // GUID + + (metadata.blob_heap.IsEmpty ? 0 : 1) + + (metadata.pdb_heap == null ? 0 : 1)); // #Blob + } + + void WriteStreamHeader (ref uint offset, TextSegment heap, string name) + { + var length = (uint)text_map.GetLength (heap); + if (length == 0) + return; + + WriteUInt32 (offset); + WriteUInt32 (length); + WriteBytes (GetZeroTerminatedString (name)); + offset += length; + } + + static int GetZeroTerminatedStringLength (string @string) + { + return (@string.Length + 1 + 3) & ~3; + } + + static byte [] GetZeroTerminatedString (string @string) + { + return GetString (@string, GetZeroTerminatedStringLength (@string)); + } + + static byte [] GetSimpleString (string @string) + { + return GetString (@string, @string.Length); + } + + static byte [] GetString (string @string, int length) + { + var bytes = new byte [length]; + for (int i = 0; i < @string.Length; i++) + bytes [i] = (byte)@string [i]; + + return bytes; + } + + public void WriteMetadata () + { + WriteHeap (TextSegment.TableHeap, metadata.table_heap); + WriteHeap (TextSegment.StringHeap, metadata.string_heap); + WriteHeap (TextSegment.UserStringHeap, metadata.user_string_heap); + WriteHeap (TextSegment.GuidHeap, metadata.guid_heap); + WriteHeap (TextSegment.BlobHeap, metadata.blob_heap); + WriteHeap (TextSegment.PdbHeap, metadata.pdb_heap); + } + + void WriteHeap (TextSegment heap, HeapBuffer buffer) + { + if (buffer == null || buffer.IsEmpty) + return; + + MoveToRVA (heap); + WriteBuffer (buffer); + } + + void WriteDebugDirectory () + { + var data_start = (int)BaseStream.Position + (debug_header.Entries.Length * ImageDebugDirectory.Size); + + for (var i = 0; i < debug_header.Entries.Length; i++) { + var entry = debug_header.Entries [i]; + var directory = entry.Directory; + WriteInt32 (directory.Characteristics); + WriteInt32 (directory.TimeDateStamp); + WriteInt16 (directory.MajorVersion); + WriteInt16 (directory.MinorVersion); + WriteInt32 ((int)directory.Type); + WriteInt32 (directory.SizeOfData); + WriteInt32 (directory.AddressOfRawData); + WriteInt32 (data_start); + + data_start += entry.Data.Length; + } + + for (var i = 0; i < debug_header.Entries.Length; i++) { + var entry = debug_header.Entries [i]; + WriteBytes (entry.Data); + } + } + + void WriteImportDirectory () + { + WriteUInt32 (text_map.GetRVA (TextSegment.ImportDirectory) + 40); // ImportLookupTable + WriteUInt32 (0); // DateTimeStamp + WriteUInt32 (0); // ForwarderChain + WriteUInt32 (text_map.GetRVA (TextSegment.ImportHintNameTable) + 14); + WriteUInt32 (text_map.GetRVA (TextSegment.ImportAddressTable)); + Advance (20); + + // ImportLookupTable + WriteUInt32 (text_map.GetRVA (TextSegment.ImportHintNameTable)); + + // ImportHintNameTable + MoveToRVA (TextSegment.ImportHintNameTable); + + WriteUInt16 (0); // Hint + WriteBytes (GetRuntimeMain ()); + WriteByte (0); + WriteBytes (GetSimpleString ("mscoree.dll")); + WriteUInt16 (0); + } + + byte [] GetRuntimeMain () + { + return module.Kind == ModuleKind.Dll || module.Kind == ModuleKind.NetModule + ? GetSimpleString ("_CorDllMain") + : GetSimpleString ("_CorExeMain"); + } + + void WriteStartupStub () + { + switch (module.Architecture) { + case TargetArchitecture.I386: + WriteUInt16 (0x25ff); + WriteUInt32 ((uint)image_base + text_map.GetRVA (TextSegment.ImportAddressTable)); + return; + default: + throw new NotSupportedException (); + } + } + + void WriteRsrc () + { + PrepareSection (rsrc); + WriteBuffer (win32_resources); + } + + void WriteReloc () + { + PrepareSection (reloc); + + var reloc_rva = text_map.GetRVA (TextSegment.StartupStub); + reloc_rva += module.Architecture == TargetArchitecture.IA64 ? 0x20u : 2; + var page_rva = reloc_rva & ~0xfffu; + + WriteUInt32 (page_rva); // PageRVA + WriteUInt32 (0x000c); // Block Size + + switch (module.Architecture) { + case TargetArchitecture.I386: + WriteUInt32 (0x3000 + reloc_rva - page_rva); + break; + default: + throw new NotSupportedException (); + } + } + + public void WriteImage () + { + WriteDOSHeader (); + WritePEFileHeader (); + WriteOptionalHeaders (); + WriteSectionHeaders (); + WriteText (); + if (rsrc != null) + WriteRsrc (); + if (reloc != null) + WriteReloc (); + Flush (); + } + + void BuildTextMap () + { + var map = text_map; + + map.AddMap (TextSegment.Code, metadata.code.length, !pe64 ? 4 : 16); + map.AddMap (TextSegment.Resources, metadata.resources.length, 8); + map.AddMap (TextSegment.Data, metadata.data.length, 4); + if (metadata.data.length > 0) + metadata.table_heap.FixupData (map.GetRVA (TextSegment.Data)); + map.AddMap (TextSegment.StrongNameSignature, GetStrongNameLength (), 4); + + BuildMetadataTextMap (); + + int debug_dir_len = 0; + if (debug_header != null && debug_header.HasEntries) { + var directories_len = debug_header.Entries.Length * ImageDebugDirectory.Size; + var data_address = (int)map.GetNextRVA (TextSegment.BlobHeap) + directories_len; + var data_len = 0; + + for (var i = 0; i < debug_header.Entries.Length; i++) { + var entry = debug_header.Entries [i]; + var directory = entry.Directory; + + directory.AddressOfRawData = entry.Data.Length == 0 ? 0 : data_address; + entry.Directory = directory; + + data_len += entry.Data.Length; + data_address += data_len; + } + + debug_dir_len = directories_len + data_len; + } + + map.AddMap (TextSegment.DebugDirectory, debug_dir_len, 4); + + if (!has_reloc) { + var start = map.GetNextRVA (TextSegment.DebugDirectory); + map.AddMap (TextSegment.ImportDirectory, new Range (start, 0)); + map.AddMap (TextSegment.ImportHintNameTable, new Range (start, 0)); + map.AddMap (TextSegment.StartupStub, new Range (start, 0)); + return; + } + + RVA import_dir_rva = map.GetNextRVA (TextSegment.DebugDirectory); + RVA import_hnt_rva = import_dir_rva + 48u; + import_hnt_rva = (import_hnt_rva + 15u) & ~15u; + uint import_dir_len = (import_hnt_rva - import_dir_rva) + 27u; + + RVA startup_stub_rva = import_dir_rva + import_dir_len; + startup_stub_rva = module.Architecture == TargetArchitecture.IA64 + ? (startup_stub_rva + 15u) & ~15u + : 2 + ((startup_stub_rva + 3u) & ~3u); + + map.AddMap (TextSegment.ImportDirectory, new Range (import_dir_rva, import_dir_len)); + map.AddMap (TextSegment.ImportHintNameTable, new Range (import_hnt_rva, 0)); + map.AddMap (TextSegment.StartupStub, new Range (startup_stub_rva, GetStartupStubLength ())); + } + + public void BuildMetadataTextMap () + { + var map = text_map; + + map.AddMap (TextSegment.MetadataHeader, GetMetadataHeaderLength (module.RuntimeVersion)); + map.AddMap (TextSegment.TableHeap, metadata.table_heap.length, 4); + map.AddMap (TextSegment.StringHeap, metadata.string_heap.length, 4); + map.AddMap (TextSegment.UserStringHeap, metadata.user_string_heap.IsEmpty ? 0 : metadata.user_string_heap.length, 4); + map.AddMap (TextSegment.GuidHeap, metadata.guid_heap.length, 4); + map.AddMap (TextSegment.BlobHeap, metadata.blob_heap.IsEmpty ? 0 : metadata.blob_heap.length, 4); + map.AddMap (TextSegment.PdbHeap, metadata.pdb_heap == null ? 0 : metadata.pdb_heap.length, 4); + } + + uint GetStartupStubLength () + { + switch (module.Architecture) { + case TargetArchitecture.I386: + return 6; + default: + throw new NotSupportedException (); + } + } + + int GetMetadataHeaderLength (string runtimeVersion) + { + return + // MetadataHeader + 20 + GetZeroTerminatedStringLength (runtimeVersion) + // #~ header + + 12 + // #Strings header + + 20 + // #US header + + (metadata.user_string_heap.IsEmpty ? 0 : 12) + // #GUID header + + 16 + // #Blob header + + (metadata.blob_heap.IsEmpty ? 0 : 16) + // + + (metadata.pdb_heap == null ? 0 : 16); + } + + int GetStrongNameLength () + { + if (module.kind == ModuleKind.NetModule || module.Assembly == null) + return 0; + + var public_key = module.Assembly.Name.PublicKey; + if (public_key.IsNullOrEmpty ()) + return 0; + + // in fx 2.0 the key may be from 384 to 16384 bits + // so we must calculate the signature size based on + // the size of the public key (minus the 32 byte header) + int size = public_key.Length; + if (size > 32) + return size - 32; + + // note: size == 16 for the ECMA "key" which is replaced + // by the runtime with a 1024 bits key (128 bytes) + + return 128; // default strongname signature size + } + + public DataDirectory GetStrongNameSignatureDirectory () + { + return text_map.GetDataDirectory (TextSegment.StrongNameSignature); + } + + public uint GetHeaderSize () + { + return pe_header_size + SizeOfOptionalHeader () + (sections * section_header_size); + } + + void PatchWin32Resources (ByteBuffer resources) + { + PatchResourceDirectoryTable (resources); + } + + void PatchResourceDirectoryTable (ByteBuffer resources) + { + resources.Advance (12); + + var entries = resources.ReadUInt16 () + resources.ReadUInt16 (); + + for (int i = 0; i < entries; i++) + PatchResourceDirectoryEntry (resources); + } + + void PatchResourceDirectoryEntry (ByteBuffer resources) + { + resources.Advance (4); + var child = resources.ReadUInt32 (); + + var position = resources.position; + resources.position = (int)child & 0x7fffffff; + + if ((child & 0x80000000) != 0) + PatchResourceDirectoryTable (resources); + else + PatchResourceDataEntry (resources); + + resources.position = position; + } + + void PatchResourceDataEntry (ByteBuffer resources) + { + var rva = resources.ReadUInt32 (); + resources.position -= 4; + + resources.WriteUInt32 (rva - module.Image.Win32Resources.VirtualAddress + rsrc.VirtualAddress); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageWriter.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageWriter.cs.meta new file mode 100644 index 0000000..c230acb --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/ImageWriter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88ebae078ed1c8346be0a945ce3b03b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Section.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Section.cs new file mode 100644 index 0000000..9c52503 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Section.cs @@ -0,0 +1,22 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using RVA = System.UInt32; + +namespace MonoFN.Cecil.PE { + + sealed class Section { + public string Name; + public RVA VirtualAddress; + public uint VirtualSize; + public uint SizeOfRawData; + public uint PointerToRawData; + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Section.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Section.cs.meta new file mode 100644 index 0000000..33d91fb --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/Section.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dc33915bdaaf42a428f8a4694e9611a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/TextMap.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/TextMap.cs new file mode 100644 index 0000000..fbe06e2 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/TextMap.cs @@ -0,0 +1,106 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using RVA = System.UInt32; + +namespace MonoFN.Cecil.PE { + + enum TextSegment { + ImportAddressTable, + CLIHeader, + Code, + Resources, + Data, + StrongNameSignature, + + // Metadata + MetadataHeader, + TableHeap, + StringHeap, + UserStringHeap, + GuidHeap, + BlobHeap, + PdbHeap, + // End Metadata + + DebugDirectory, + ImportDirectory, + ImportHintNameTable, + StartupStub, + } + + sealed class TextMap { + + readonly Range [] map = new Range [17 /*Enum.GetValues (typeof (TextSegment)).Length*/]; + + public void AddMap (TextSegment segment, int length) + { + map [(int)segment] = new Range (GetStart (segment), (uint)length); + } + + public void AddMap (TextSegment segment, int length, int align) + { + align--; + + AddMap (segment, (length + align) & ~align); + } + + public void AddMap (TextSegment segment, Range range) + { + map [(int)segment] = range; + } + + public Range GetRange (TextSegment segment) + { + return map [(int)segment]; + } + + public DataDirectory GetDataDirectory (TextSegment segment) + { + var range = map [(int)segment]; + + return new DataDirectory (range.Length == 0 ? 0 : range.Start, range.Length); + } + + public RVA GetRVA (TextSegment segment) + { + return map [(int)segment].Start; + } + + public RVA GetNextRVA (TextSegment segment) + { + var i = (int)segment; + return map [i].Start + map [i].Length; + } + + public int GetLength (TextSegment segment) + { + return (int)map [(int)segment].Length; + } + + RVA GetStart (TextSegment segment) + { + var index = (int)segment; + return index == 0 ? ImageWriter.text_rva : ComputeStart (index); + } + + RVA ComputeStart (int index) + { + index--; + return map [index].Start + map [index].Length; + } + + public uint GetLength () + { + var range = map [(int)TextSegment.StartupStub]; + return range.Start - ImageWriter.text_rva + range.Length; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/TextMap.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/TextMap.cs.meta new file mode 100644 index 0000000..93ceea3 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.PE/TextMap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d36ca0589eb8014fa28bc58a88ae85f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Tests.props b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Tests.props new file mode 100644 index 0000000..bd6df1f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Tests.props @@ -0,0 +1,16 @@ + + + true + + + + 3.11.0 + + + 15.9.0 + + + 3.12.0 + + + diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Tests.props.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Tests.props.meta new file mode 100644 index 0000000..ae02e4c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.Tests.props.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4304d9110a6c73049a70f3d001e1ac37 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.meta new file mode 100644 index 0000000..ccdbf3d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 08f20128864a55d45abd8a30563f2f5c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nunit b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nunit new file mode 100644 index 0000000..2acfc12 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nunit @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nunit.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nunit.meta new file mode 100644 index 0000000..0163c57 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nunit.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 70249fc3714c2ba43bb69eeceaf02171 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nuspec b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nuspec new file mode 100644 index 0000000..626c5ac --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nuspec @@ -0,0 +1,42 @@ + + + + Mono.Cecil + 0.11.4.0 + Mono.Cecil + Jb Evain + Jb Evain + MIT + false + http://github.com/jbevain/cecil/ + Cecil is a library written by Jb Evain to generate and inspect programs and libraries in the ECMA CIL format. + Cecil is a library written by Jb Evain to generate and inspect programs and libraries in the ECMA CIL format. It has full support for generics, and support some debugging symbol format. In simple English, with Cecil, you can load existing managed assemblies, browse all the contained types, modify them on the fly and save back to the disk the modified assembly. + en-US + assembly assemblies module modules il cil msil bytecode reflection injection cecil mono aop + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nuspec.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nuspec.meta new file mode 100644 index 0000000..033480e --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.nuspec.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9ab5a3af6caf6d14da0bad821a809a27 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.sln.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.sln.meta new file mode 100644 index 0000000..aa8a077 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil.sln.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 246f31a0e00fea74a93125fec6d80da8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ArrayType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ArrayType.cs new file mode 100644 index 0000000..df72aab --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ArrayType.cs @@ -0,0 +1,145 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; +using System.Text; +using System.Threading; +using MD = MonoFN.Cecil.Metadata; + +namespace MonoFN.Cecil { + + public struct ArrayDimension { + + int? lower_bound; + int? upper_bound; + + public int? LowerBound { + get { return lower_bound; } + set { lower_bound = value; } + } + + public int? UpperBound { + get { return upper_bound; } + set { upper_bound = value; } + } + + public bool IsSized { + get { return lower_bound.HasValue || upper_bound.HasValue; } + } + + public ArrayDimension (int? lowerBound, int? upperBound) + { + this.lower_bound = lowerBound; + this.upper_bound = upperBound; + } + + public override string ToString () + { + return !IsSized + ? string.Empty + : lower_bound + "..." + upper_bound; + } + } + + public sealed class ArrayType : TypeSpecification { + + Collection dimensions; + + public Collection Dimensions { + get { + if (dimensions != null) + return dimensions; + + var empty_dimensions = new Collection (); + empty_dimensions.Add (new ArrayDimension ()); + + Interlocked.CompareExchange (ref dimensions, empty_dimensions, null); + + return dimensions; + } + } + + public int Rank { + get { return dimensions == null ? 1 : dimensions.Count; } + } + + public bool IsVector { + get { + if (dimensions == null) + return true; + + if (dimensions.Count > 1) + return false; + + var dimension = dimensions [0]; + + return !dimension.IsSized; + } + } + + public override bool IsValueType { + get { return false; } + set { throw new InvalidOperationException (); } + } + + public override string Name { + get { return base.Name + Suffix; } + } + + public override string FullName { + get { return base.FullName + Suffix; } + } + + string Suffix { + get { + if (IsVector) + return "[]"; + + var suffix = new StringBuilder (); + suffix.Append ("["); + for (int i = 0; i < dimensions.Count; i++) { + if (i > 0) + suffix.Append (","); + + suffix.Append (dimensions [i].ToString ()); + } + suffix.Append ("]"); + + return suffix.ToString (); + } + } + + public override bool IsArray { + get { return true; } + } + + public ArrayType (TypeReference type) + : base (type) + { + Mixin.CheckType (type); + this.etype = MD.ElementType.Array; + } + + public ArrayType (TypeReference type, int rank) + : this (type) + { + Mixin.CheckType (type); + + if (rank == 1) + return; + + dimensions = new Collection (rank); + for (int i = 0; i < rank; i++) + dimensions.Add (new ArrayDimension ()); + this.etype = MD.ElementType.Array; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ArrayType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ArrayType.cs.meta new file mode 100644 index 0000000..bace606 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ArrayType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7add098db82a032428c139b59f0878be +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyDefinition.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyDefinition.cs new file mode 100644 index 0000000..de9ffde --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyDefinition.cs @@ -0,0 +1,189 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; +using System.IO; +using System.Threading; + +namespace MonoFN.Cecil { + + public sealed class AssemblyDefinition : ICustomAttributeProvider, ISecurityDeclarationProvider, IDisposable { + + AssemblyNameDefinition name; + + internal ModuleDefinition main_module; + Collection modules; + Collection custom_attributes; + Collection security_declarations; + + public AssemblyNameDefinition Name { + get { return name; } + set { name = value; } + } + + public string FullName { + get { return name != null ? name.FullName : string.Empty; } + } + + public MetadataToken MetadataToken { + get { return new MetadataToken (TokenType.Assembly, 1); } + set { } + } + + public Collection Modules { + get { + if (modules != null) + return modules; + + if (main_module.HasImage) + return main_module.Read (ref modules, this, (_, reader) => reader.ReadModules ()); + + Interlocked.CompareExchange (ref modules, new Collection (1) { main_module }, null); + return modules; + } + } + + public ModuleDefinition MainModule { + get { return main_module; } + } + + public MethodDefinition EntryPoint { + get { return main_module.EntryPoint; } + set { main_module.EntryPoint = value; } + } + + public bool HasCustomAttributes { + get { + if (custom_attributes != null) + return custom_attributes.Count > 0; + + return this.GetHasCustomAttributes (main_module); + } + } + + public Collection CustomAttributes { + get { return custom_attributes ?? (this.GetCustomAttributes (ref custom_attributes, main_module)); } + } + + public bool HasSecurityDeclarations { + get { + if (security_declarations != null) + return security_declarations.Count > 0; + + return this.GetHasSecurityDeclarations (main_module); + } + } + + public Collection SecurityDeclarations { + get { return security_declarations ?? (this.GetSecurityDeclarations (ref security_declarations, main_module)); } + } + + internal AssemblyDefinition () + { + } + + public void Dispose () + { + if (this.modules == null) { + main_module.Dispose (); + return; + } + + var modules = this.Modules; + for (int i = 0; i < modules.Count; i++) + modules [i].Dispose (); + } + public static AssemblyDefinition CreateAssembly (AssemblyNameDefinition assemblyName, string moduleName, ModuleKind kind) + { + return CreateAssembly (assemblyName, moduleName, new ModuleParameters { Kind = kind }); + } + + public static AssemblyDefinition CreateAssembly (AssemblyNameDefinition assemblyName, string moduleName, ModuleParameters parameters) + { + if (assemblyName == null) + throw new ArgumentNullException ("assemblyName"); + if (moduleName == null) + throw new ArgumentNullException ("moduleName"); + Mixin.CheckParameters (parameters); + if (parameters.Kind == ModuleKind.NetModule) + throw new ArgumentException ("kind"); + + var assembly = ModuleDefinition.CreateModule (moduleName, parameters).Assembly; + assembly.Name = assemblyName; + + return assembly; + } + + public static AssemblyDefinition ReadAssembly (string fileName) + { + return ReadAssembly (ModuleDefinition.ReadModule (fileName)); + } + + public static AssemblyDefinition ReadAssembly (string fileName, ReaderParameters parameters) + { + return ReadAssembly (ModuleDefinition.ReadModule (fileName, parameters)); + } + + public static AssemblyDefinition ReadAssembly (Stream stream) + { + return ReadAssembly (ModuleDefinition.ReadModule (stream)); + } + + public static AssemblyDefinition ReadAssembly (Stream stream, ReaderParameters parameters) + { + return ReadAssembly (ModuleDefinition.ReadModule (stream, parameters)); + } + + static AssemblyDefinition ReadAssembly (ModuleDefinition module) + { + var assembly = module.Assembly; + if (assembly == null) + throw new ArgumentException (); + + return assembly; + } + + public void Write (string fileName) + { + Write (fileName, new WriterParameters ()); + } + + public void Write (string fileName, WriterParameters parameters) + { + main_module.Write (fileName, parameters); + } + + public void Write () + { + main_module.Write (); + } + + public void Write (WriterParameters parameters) + { + main_module.Write (parameters); + } + + public void Write (Stream stream) + { + Write (stream, new WriterParameters ()); + } + + public void Write (Stream stream, WriterParameters parameters) + { + main_module.Write (stream, parameters); + } + + public override string ToString () + { + return this.FullName; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyDefinition.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyDefinition.cs.meta new file mode 100644 index 0000000..d66f03d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1c1ac0fc48f2d424f9c0d9fa74b16b07 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyFlags.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyFlags.cs new file mode 100644 index 0000000..a5f83a7 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyFlags.cs @@ -0,0 +1,24 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum AssemblyAttributes : uint { + PublicKey = 0x0001, + SideBySideCompatible = 0x0000, + Retargetable = 0x0100, + WindowsRuntime = 0x0200, + DisableJITCompileOptimizer = 0x4000, + EnableJITCompileTracking = 0x8000, + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyFlags.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyFlags.cs.meta new file mode 100644 index 0000000..d7c8791 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyFlags.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 257c8151138cda34dafbe0ca56ebedf4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyHashAlgorithm.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyHashAlgorithm.cs new file mode 100644 index 0000000..fb0cc5f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyHashAlgorithm.cs @@ -0,0 +1,22 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public enum AssemblyHashAlgorithm : uint { + None = 0x0000, + MD5 = 0x8003, + SHA1 = 0x8004, + SHA256 = 0x800C, + SHA384 = 0x800D, + SHA512 = 0x800E, + Reserved = 0x8003, // MD5 + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyHashAlgorithm.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyHashAlgorithm.cs.meta new file mode 100644 index 0000000..98687b5 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyHashAlgorithm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b200bdec09584af41bd3f656e091cccf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyInfo.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyInfo.cs new file mode 100644 index 0000000..94dc9b7 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyInfo.cs @@ -0,0 +1,23 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle (Consts.AssemblyName)] + +[assembly: Guid ("fd225bb4-fa53-44b2-a6db-85f5e48dcb54")] + +[assembly: InternalsVisibleTo ("MonoFN.Cecil.Tests, PublicKey=" + Consts.PublicKey)] +[assembly: InternalsVisibleTo ("MonoFN.Cecil.Pdb, PublicKey=" + Consts.PublicKey)] +[assembly: InternalsVisibleTo ("MonoFN.Cecil.Mdb, PublicKey=" + Consts.PublicKey)] +[assembly: InternalsVisibleTo ("MonoFN.Cecil.Rocks, PublicKey=" + Consts.PublicKey)] diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyInfo.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyInfo.cs.meta new file mode 100644 index 0000000..715025d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ff23d7231ddfa574b816532360874834 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyLinkedResource.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyLinkedResource.cs new file mode 100644 index 0000000..de592ae --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyLinkedResource.cs @@ -0,0 +1,37 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public sealed class AssemblyLinkedResource : Resource { + + AssemblyNameReference reference; + + public AssemblyNameReference Assembly { + get { return reference; } + set { reference = value; } + } + + public override ResourceType ResourceType { + get { return ResourceType.AssemblyLinked; } + } + + public AssemblyLinkedResource (string name, ManifestResourceAttributes flags) + : base (name, flags) + { + } + + public AssemblyLinkedResource (string name, ManifestResourceAttributes flags, AssemblyNameReference reference) + : base (name, flags) + { + this.reference = reference; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyLinkedResource.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyLinkedResource.cs.meta new file mode 100644 index 0000000..259e540 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyLinkedResource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c3d5a207fc55ac5419e42c86cef15db0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameDefinition.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameDefinition.cs new file mode 100644 index 0000000..b46e1b9 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameDefinition.cs @@ -0,0 +1,32 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + public sealed class AssemblyNameDefinition : AssemblyNameReference { + + public override byte [] Hash { + get { return Empty.Array; } + } + + internal AssemblyNameDefinition () + { + this.token = new MetadataToken (TokenType.Assembly, 1); + } + + public AssemblyNameDefinition (string name, Version version) + : base (name, version) + { + this.token = new MetadataToken (TokenType.Assembly, 1); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameDefinition.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameDefinition.cs.meta new file mode 100644 index 0000000..7409717 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68b90f4f023a67e4db7ddb52802ca21e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameReference.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameReference.cs new file mode 100644 index 0000000..d0b0585 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameReference.cs @@ -0,0 +1,269 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; +using System.Globalization; +using System.Security.Cryptography; +using System.Text; +using System.Threading; + +namespace MonoFN.Cecil { + + public class AssemblyNameReference : IMetadataScope { + + string name; + string culture; + Version version; + uint attributes; + byte [] public_key; + byte [] public_key_token; + AssemblyHashAlgorithm hash_algorithm; + byte [] hash; + + internal MetadataToken token; + + string full_name; + + public string Name { + get { return name; } + set { + name = value; + full_name = null; + } + } + + public string Culture { + get { return culture; } + set { + culture = value; + full_name = null; + } + } + + public Version Version { + get { return version; } + set { + version = Mixin.CheckVersion (value); + full_name = null; + } + } + + public AssemblyAttributes Attributes { + get { return (AssemblyAttributes)attributes; } + set { attributes = (uint)value; } + } + + public bool HasPublicKey { + get { return attributes.GetAttributes ((uint)AssemblyAttributes.PublicKey); } + set { attributes = attributes.SetAttributes ((uint)AssemblyAttributes.PublicKey, value); } + } + + public bool IsSideBySideCompatible { + get { return attributes.GetAttributes ((uint)AssemblyAttributes.SideBySideCompatible); } + set { attributes = attributes.SetAttributes ((uint)AssemblyAttributes.SideBySideCompatible, value); } + } + + public bool IsRetargetable { + get { return attributes.GetAttributes ((uint)AssemblyAttributes.Retargetable); } + set { attributes = attributes.SetAttributes ((uint)AssemblyAttributes.Retargetable, value); } + } + + public bool IsWindowsRuntime { + get { return attributes.GetAttributes ((uint)AssemblyAttributes.WindowsRuntime); } + set { attributes = attributes.SetAttributes ((uint)AssemblyAttributes.WindowsRuntime, value); } + } + + public byte [] PublicKey { + get { return public_key ?? Empty.Array; } + set { + public_key = value; + HasPublicKey = !public_key.IsNullOrEmpty (); + public_key_token = null; + full_name = null; + } + } + + public byte [] PublicKeyToken { + get { + if (public_key_token == null && !public_key.IsNullOrEmpty ()) { + var hash = HashPublicKey (); + // we need the last 8 bytes in reverse order + var local_public_key_token = new byte [8]; + Array.Copy (hash, (hash.Length - 8), local_public_key_token, 0, 8); + Array.Reverse (local_public_key_token, 0, 8); + Interlocked.CompareExchange (ref public_key_token, local_public_key_token, null); // publish only once finished (required for thread-safety) + } + return public_key_token ?? Empty.Array; + } + set { + public_key_token = value; + full_name = null; + } + } + + byte [] HashPublicKey () + { + HashAlgorithm algorithm; + + switch (hash_algorithm) { + case AssemblyHashAlgorithm.Reserved: + algorithm = MD5.Create (); + break; + default: + // None default to SHA1 + algorithm = SHA1.Create (); + break; + } + + using (algorithm) + return algorithm.ComputeHash (public_key); + } + + public virtual MetadataScopeType MetadataScopeType { + get { return MetadataScopeType.AssemblyNameReference; } + } + + public string FullName { + get { + if (full_name != null) + return full_name; + + const string sep = ", "; + + var builder = new StringBuilder (); + builder.Append (name); + builder.Append (sep); + builder.Append ("Version="); + builder.Append (version.ToString (fieldCount: 4)); + builder.Append (sep); + builder.Append ("Culture="); + builder.Append (string.IsNullOrEmpty (culture) ? "neutral" : culture); + builder.Append (sep); + builder.Append ("PublicKeyToken="); + + var pk_token = PublicKeyToken; + if (!pk_token.IsNullOrEmpty () && pk_token.Length > 0) { + for (int i = 0; i < pk_token.Length; i++) { + builder.Append (pk_token [i].ToString ("x2")); + } + } else + builder.Append ("null"); + + if (IsRetargetable) { + builder.Append (sep); + builder.Append ("Retargetable=Yes"); + } + + Interlocked.CompareExchange (ref full_name, builder.ToString (), null); + + return full_name; + } + } + + public static AssemblyNameReference Parse (string fullName) + { + if (fullName == null) + throw new ArgumentNullException ("fullName"); + if (fullName.Length == 0) + throw new ArgumentException ("Name can not be empty"); + + var name = new AssemblyNameReference (); + var tokens = fullName.Split (','); + for (int i = 0; i < tokens.Length; i++) { + var token = tokens [i].Trim (); + + if (i == 0) { + name.Name = token; + continue; + } + + var parts = token.Split ('='); + if (parts.Length != 2) + throw new ArgumentException ("Malformed name"); + + switch (parts [0].ToLowerInvariant ()) { + case "version": + name.Version = new Version (parts [1]); + break; + case "culture": + name.Culture = parts [1] == "neutral" ? "" : parts [1]; + break; + case "publickeytoken": + var pk_token = parts [1]; + if (pk_token == "null") + break; + + name.PublicKeyToken = new byte [pk_token.Length / 2]; + for (int j = 0; j < name.PublicKeyToken.Length; j++) + name.PublicKeyToken [j] = Byte.Parse (pk_token.Substring (j * 2, 2), NumberStyles.HexNumber); + + break; + } + } + + return name; + } + + public AssemblyHashAlgorithm HashAlgorithm { + get { return hash_algorithm; } + set { hash_algorithm = value; } + } + + public virtual byte [] Hash { + get { return hash; } + set { hash = value; } + } + + public MetadataToken MetadataToken { + get { return token; } + set { token = value; } + } + + internal AssemblyNameReference () + { + this.version = Mixin.ZeroVersion; + this.token = new MetadataToken (TokenType.AssemblyRef); + } + + public AssemblyNameReference (string name, Version version) + { + Mixin.CheckName (name); + + this.name = name; + this.version = Mixin.CheckVersion (version); + this.hash_algorithm = AssemblyHashAlgorithm.None; + this.token = new MetadataToken (TokenType.AssemblyRef); + } + + public override string ToString () + { + return this.FullName; + } + } + + partial class Mixin { + + public static Version ZeroVersion = new Version (0, 0, 0, 0); + + public static Version CheckVersion (Version version) + { + if (version == null) + return ZeroVersion; + + if (version.Build == -1) + return new Version (version.Major, version.Minor, 0, 0); + + if (version.Revision == -1) + return new Version (version.Major, version.Minor, version.Build, 0); + + return version; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameReference.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameReference.cs.meta new file mode 100644 index 0000000..980b1fd --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyNameReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fdaf7563058f3f54ba3e6b32c888eb3c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyReader.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyReader.cs new file mode 100644 index 0000000..2a3d6ef --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyReader.cs @@ -0,0 +1,3889 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Metadata; +using MonoFN.Cecil.PE; +using MonoFN.Collections.Generic; +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Text; +using RVA = System.UInt32; + +namespace MonoFN.Cecil { + + abstract class ModuleReader { + + readonly protected ModuleDefinition module; + + protected ModuleReader (Image image, ReadingMode mode) + { + this.module = new ModuleDefinition (image); + this.module.ReadingMode = mode; + } + + protected abstract void ReadModule (); + public abstract void ReadSymbols (ModuleDefinition module); + + protected void ReadModuleManifest (MetadataReader reader) + { + reader.Populate (module); + + ReadAssembly (reader); + } + + void ReadAssembly (MetadataReader reader) + { + var name = reader.ReadAssemblyNameDefinition (); + if (name == null) { + module.kind = ModuleKind.NetModule; + return; + } + + var assembly = new AssemblyDefinition (); + assembly.Name = name; + + module.assembly = assembly; + assembly.main_module = module; + } + + public static ModuleDefinition CreateModule (Image image, ReaderParameters parameters) + { + var reader = CreateModuleReader (image, parameters.ReadingMode); + var module = reader.module; + + if (parameters.assembly_resolver != null) + module.assembly_resolver = Disposable.NotOwned (parameters.assembly_resolver); + + if (parameters.metadata_resolver != null) + module.metadata_resolver = parameters.metadata_resolver; + + if (parameters.metadata_importer_provider != null) + module.metadata_importer = parameters.metadata_importer_provider.GetMetadataImporter (module); + + if (parameters.reflection_importer_provider != null) + module.reflection_importer = parameters.reflection_importer_provider.GetReflectionImporter (module); + + GetMetadataKind (module, parameters); + + reader.ReadModule (); + + ReadSymbols (module, parameters); + + reader.ReadSymbols (module); + + if (parameters.ReadingMode == ReadingMode.Immediate) + module.MetadataSystem.Clear (); + + return module; + } + + static void ReadSymbols (ModuleDefinition module, ReaderParameters parameters) + { + var symbol_reader_provider = parameters.SymbolReaderProvider; + + if (symbol_reader_provider == null && parameters.ReadSymbols) + symbol_reader_provider = new DefaultSymbolReaderProvider (); + + if (symbol_reader_provider != null) { + module.SymbolReaderProvider = symbol_reader_provider; + + var reader = parameters.SymbolStream != null + ? symbol_reader_provider.GetSymbolReader (module, parameters.SymbolStream) + : symbol_reader_provider.GetSymbolReader (module, module.FileName); + + if (reader != null) { + try { + module.ReadSymbols (reader, parameters.ThrowIfSymbolsAreNotMatching); + } + catch (Exception) { + reader.Dispose (); + throw; + } + } + } + + if (module.Image.HasDebugTables ()) + module.ReadSymbols (new PortablePdbReader (module.Image, module)); + } + + static void GetMetadataKind (ModuleDefinition module, ReaderParameters parameters) + { + if (!parameters.ApplyWindowsRuntimeProjections) { + module.MetadataKind = MetadataKind.Ecma335; + return; + } + + var runtime_version = module.RuntimeVersion; + + if (!runtime_version.Contains ("WindowsRuntime")) + module.MetadataKind = MetadataKind.Ecma335; + else if (runtime_version.Contains ("CLR")) + module.MetadataKind = MetadataKind.ManagedWindowsMetadata; + else + module.MetadataKind = MetadataKind.WindowsMetadata; + } + + static ModuleReader CreateModuleReader (Image image, ReadingMode mode) + { + switch (mode) { + case ReadingMode.Immediate: + return new ImmediateModuleReader (image); + case ReadingMode.Deferred: + return new DeferredModuleReader (image); + default: + throw new ArgumentException (); + } + } + } + + sealed class ImmediateModuleReader : ModuleReader { + + bool resolve_attributes; + + public ImmediateModuleReader (Image image) + : base (image, ReadingMode.Immediate) + { + } + + protected override void ReadModule () + { + this.module.Read (this.module, (module, reader) => { + ReadModuleManifest (reader); + ReadModule (module, resolve_attributes: true); + }); + } + + public void ReadModule (ModuleDefinition module, bool resolve_attributes) + { + this.resolve_attributes = resolve_attributes; + + if (module.HasAssemblyReferences) + Mixin.Read (module.AssemblyReferences); + if (module.HasResources) + Mixin.Read (module.Resources); + if (module.HasModuleReferences) + Mixin.Read (module.ModuleReferences); + if (module.HasTypes) + ReadTypes (module.Types); + if (module.HasExportedTypes) + Mixin.Read (module.ExportedTypes); + + ReadCustomAttributes (module); + + var assembly = module.Assembly; + if (module.kind == ModuleKind.NetModule || assembly == null) + return; + + ReadCustomAttributes (assembly); + ReadSecurityDeclarations (assembly); + } + + void ReadTypes (Collection types) + { + for (int i = 0; i < types.Count; i++) + ReadType (types [i]); + } + + void ReadType (TypeDefinition type) + { + ReadGenericParameters (type); + + if (type.HasInterfaces) + ReadInterfaces (type); + + if (type.HasNestedTypes) + ReadTypes (type.NestedTypes); + + if (type.HasLayoutInfo) + Mixin.Read (type.ClassSize); + + if (type.HasFields) + ReadFields (type); + + if (type.HasMethods) + ReadMethods (type); + + if (type.HasProperties) + ReadProperties (type); + + if (type.HasEvents) + ReadEvents (type); + + ReadSecurityDeclarations (type); + ReadCustomAttributes (type); + } + + void ReadInterfaces (TypeDefinition type) + { + var interfaces = type.Interfaces; + + for (int i = 0; i < interfaces.Count; i++) + ReadCustomAttributes (interfaces [i]); + } + + void ReadGenericParameters (IGenericParameterProvider provider) + { + if (!provider.HasGenericParameters) + return; + + var parameters = provider.GenericParameters; + + for (int i = 0; i < parameters.Count; i++) { + var parameter = parameters [i]; + + if (parameter.HasConstraints) + ReadGenericParameterConstraints (parameter); + + ReadCustomAttributes (parameter); + } + } + + void ReadGenericParameterConstraints (GenericParameter parameter) + { + var constraints = parameter.Constraints; + + for (int i = 0; i < constraints.Count; i++) + ReadCustomAttributes (constraints [i]); + } + + void ReadSecurityDeclarations (ISecurityDeclarationProvider provider) + { + if (!provider.HasSecurityDeclarations) + return; + + var security_declarations = provider.SecurityDeclarations; + + if (!resolve_attributes) + return; + + for (int i = 0; i < security_declarations.Count; i++) { + var security_declaration = security_declarations [i]; + + Mixin.Read (security_declaration.SecurityAttributes); + } + } + + void ReadCustomAttributes (ICustomAttributeProvider provider) + { + if (!provider.HasCustomAttributes) + return; + + var custom_attributes = provider.CustomAttributes; + + if (!resolve_attributes) + return; + + for (int i = 0; i < custom_attributes.Count; i++) { + var custom_attribute = custom_attributes [i]; + + Mixin.Read (custom_attribute.ConstructorArguments); + } + } + + void ReadFields (TypeDefinition type) + { + var fields = type.Fields; + + for (int i = 0; i < fields.Count; i++) { + var field = fields [i]; + + if (field.HasConstant) + Mixin.Read (field.Constant); + + if (field.HasLayoutInfo) + Mixin.Read (field.Offset); + + if (field.RVA > 0) + Mixin.Read (field.InitialValue); + + if (field.HasMarshalInfo) + Mixin.Read (field.MarshalInfo); + + ReadCustomAttributes (field); + } + } + + void ReadMethods (TypeDefinition type) + { + var methods = type.Methods; + + for (int i = 0; i < methods.Count; i++) { + var method = methods [i]; + + ReadGenericParameters (method); + + if (method.HasParameters) + ReadParameters (method); + + if (method.HasOverrides) + Mixin.Read (method.Overrides); + + if (method.IsPInvokeImpl) + Mixin.Read (method.PInvokeInfo); + + ReadSecurityDeclarations (method); + ReadCustomAttributes (method); + + var return_type = method.MethodReturnType; + if (return_type.HasConstant) + Mixin.Read (return_type.Constant); + + if (return_type.HasMarshalInfo) + Mixin.Read (return_type.MarshalInfo); + + ReadCustomAttributes (return_type); + } + } + + void ReadParameters (MethodDefinition method) + { + var parameters = method.Parameters; + + for (int i = 0; i < parameters.Count; i++) { + var parameter = parameters [i]; + + if (parameter.HasConstant) + Mixin.Read (parameter.Constant); + + if (parameter.HasMarshalInfo) + Mixin.Read (parameter.MarshalInfo); + + ReadCustomAttributes (parameter); + } + } + + void ReadProperties (TypeDefinition type) + { + var properties = type.Properties; + + for (int i = 0; i < properties.Count; i++) { + var property = properties [i]; + + Mixin.Read (property.GetMethod); + + if (property.HasConstant) + Mixin.Read (property.Constant); + + ReadCustomAttributes (property); + } + } + + void ReadEvents (TypeDefinition type) + { + var events = type.Events; + + for (int i = 0; i < events.Count; i++) { + var @event = events [i]; + + Mixin.Read (@event.AddMethod); + + ReadCustomAttributes (@event); + } + } + + public override void ReadSymbols (ModuleDefinition module) + { + if (module.symbol_reader == null) + return; + + ReadTypesSymbols (module.Types, module.symbol_reader); + } + + void ReadTypesSymbols (Collection types, ISymbolReader symbol_reader) + { + for (int i = 0; i < types.Count; i++) { + var type = types [i]; + + if (type.HasNestedTypes) + ReadTypesSymbols (type.NestedTypes, symbol_reader); + + if (type.HasMethods) + ReadMethodsSymbols (type, symbol_reader); + } + } + + void ReadMethodsSymbols (TypeDefinition type, ISymbolReader symbol_reader) + { + var methods = type.Methods; + for (int i = 0; i < methods.Count; i++) { + var method = methods [i]; + + if (method.HasBody && method.token.RID != 0 && method.debug_info == null) + method.debug_info = symbol_reader.Read (method); + } + } + } + + sealed class DeferredModuleReader : ModuleReader { + + public DeferredModuleReader (Image image) + : base (image, ReadingMode.Deferred) + { + } + + protected override void ReadModule () + { + this.module.Read (this.module, (_, reader) => ReadModuleManifest (reader)); + } + + public override void ReadSymbols (ModuleDefinition module) + { + } + } + + sealed class MetadataReader : ByteBuffer { + + readonly internal Image image; + readonly internal ModuleDefinition module; + readonly internal MetadataSystem metadata; + + internal CodeReader code; + internal IGenericContext context; + + readonly MetadataReader metadata_reader; + + public MetadataReader (ModuleDefinition module) + : base (module.Image.TableHeap.data) + { + this.image = module.Image; + this.module = module; + this.metadata = module.MetadataSystem; + this.code = new CodeReader (this); + } + + public MetadataReader (Image image, ModuleDefinition module, MetadataReader metadata_reader) + : base (image.TableHeap.data) + { + this.image = image; + this.module = module; + this.metadata = module.MetadataSystem; + this.metadata_reader = metadata_reader; + } + + int GetCodedIndexSize (CodedIndex index) + { + return image.GetCodedIndexSize (index); + } + + uint ReadByIndexSize (int size) + { + if (size == 4) + return ReadUInt32 (); + else + return ReadUInt16 (); + } + + byte [] ReadBlob () + { + var blob_heap = image.BlobHeap; + if (blob_heap == null) { + position += 2; + return Empty.Array; + } + + return blob_heap.Read (ReadBlobIndex ()); + } + + byte [] ReadBlob (uint signature) + { + var blob_heap = image.BlobHeap; + if (blob_heap == null) + return Empty.Array; + + return blob_heap.Read (signature); + } + + uint ReadBlobIndex () + { + var blob_heap = image.BlobHeap; + return ReadByIndexSize (blob_heap != null ? blob_heap.IndexSize : 2); + } + + void GetBlobView (uint signature, out byte [] blob, out int index, out int count) + { + var blob_heap = image.BlobHeap; + if (blob_heap == null) { + blob = null; + index = count = 0; + return; + } + + blob_heap.GetView (signature, out blob, out index, out count); + } + + string ReadString () + { + return image.StringHeap.Read (ReadByIndexSize (image.StringHeap.IndexSize)); + } + + uint ReadStringIndex () + { + return ReadByIndexSize (image.StringHeap.IndexSize); + } + + Guid ReadGuid () + { + return image.GuidHeap.Read (ReadByIndexSize (image.GuidHeap.IndexSize)); + } + + uint ReadTableIndex (Table table) + { + return ReadByIndexSize (image.GetTableIndexSize (table)); + } + + MetadataToken ReadMetadataToken (CodedIndex index) + { + return index.GetMetadataToken (ReadByIndexSize (GetCodedIndexSize (index))); + } + + int MoveTo (Table table) + { + var info = image.TableHeap [table]; + if (info.Length != 0) + this.position = (int)info.Offset; + + return (int)info.Length; + } + + bool MoveTo (Table table, uint row) + { + var info = image.TableHeap [table]; + var length = info.Length; + if (length == 0 || row > length) + return false; + + this.position = (int)(info.Offset + (info.RowSize * (row - 1))); + return true; + } + + public AssemblyNameDefinition ReadAssemblyNameDefinition () + { + if (MoveTo (Table.Assembly) == 0) + return null; + + var name = new AssemblyNameDefinition (); + + name.HashAlgorithm = (AssemblyHashAlgorithm)ReadUInt32 (); + + PopulateVersionAndFlags (name); + + name.PublicKey = ReadBlob (); + + PopulateNameAndCulture (name); + + return name; + } + + public ModuleDefinition Populate (ModuleDefinition module) + { + if (MoveTo (Table.Module) == 0) + return module; + + Advance (2); // Generation + + module.Name = ReadString (); + module.Mvid = ReadGuid (); + + return module; + } + + void InitializeAssemblyReferences () + { + if (metadata.AssemblyReferences != null) + return; + + int length = MoveTo (Table.AssemblyRef); + var references = metadata.AssemblyReferences = new AssemblyNameReference [length]; + + for (uint i = 0; i < length; i++) { + var reference = new AssemblyNameReference (); + reference.token = new MetadataToken (TokenType.AssemblyRef, i + 1); + + PopulateVersionAndFlags (reference); + + var key_or_token = ReadBlob (); + + if (reference.HasPublicKey) + reference.PublicKey = key_or_token; + else + reference.PublicKeyToken = key_or_token; + + PopulateNameAndCulture (reference); + + reference.Hash = ReadBlob (); + + references [i] = reference; + } + } + + public Collection ReadAssemblyReferences () + { + InitializeAssemblyReferences (); + + var references = new Collection (metadata.AssemblyReferences); + if (module.IsWindowsMetadata ()) + module.Projections.AddVirtualReferences (references); + + return references; + } + + public MethodDefinition ReadEntryPoint () + { + if (module.Image.EntryPointToken == 0) + return null; + + var token = new MetadataToken (module.Image.EntryPointToken); + return GetMethodDefinition (token.RID); + } + + public Collection ReadModules () + { + var modules = new Collection (1); + modules.Add (this.module); + + int length = MoveTo (Table.File); + for (uint i = 1; i <= length; i++) { + var attributes = (FileAttributes)ReadUInt32 (); + var name = ReadString (); + ReadBlobIndex (); + + if (attributes != FileAttributes.ContainsMetaData) + continue; + + var parameters = new ReaderParameters { + ReadingMode = module.ReadingMode, + SymbolReaderProvider = module.SymbolReaderProvider, + AssemblyResolver = module.AssemblyResolver + }; + + var netmodule = ModuleDefinition.ReadModule (GetModuleFileName (name), parameters); + netmodule.assembly = this.module.assembly; + + modules.Add (netmodule); + } + + return modules; + } + + string GetModuleFileName (string name) + { + if (module.FileName == null) + throw new NotSupportedException (); + + var path = Path.GetDirectoryName (module.FileName); + return Path.Combine (path, name); + } + + void InitializeModuleReferences () + { + if (metadata.ModuleReferences != null) + return; + + int length = MoveTo (Table.ModuleRef); + var references = metadata.ModuleReferences = new ModuleReference [length]; + + for (uint i = 0; i < length; i++) { + var reference = new ModuleReference (ReadString ()); + reference.token = new MetadataToken (TokenType.ModuleRef, i + 1); + + references [i] = reference; + } + } + + public Collection ReadModuleReferences () + { + InitializeModuleReferences (); + + return new Collection (metadata.ModuleReferences); + } + + public bool HasFileResource () + { + int length = MoveTo (Table.File); + if (length == 0) + return false; + + for (uint i = 1; i <= length; i++) + if (ReadFileRecord (i).Col1 == FileAttributes.ContainsNoMetaData) + return true; + + return false; + } + + public Collection ReadResources () + { + int length = MoveTo (Table.ManifestResource); + var resources = new Collection (length); + + for (int i = 1; i <= length; i++) { + var offset = ReadUInt32 (); + var flags = (ManifestResourceAttributes)ReadUInt32 (); + var name = ReadString (); + var implementation = ReadMetadataToken (CodedIndex.Implementation); + + Resource resource; + + if (implementation.RID == 0) { + resource = new EmbeddedResource (name, flags, offset, this); + } else if (implementation.TokenType == TokenType.AssemblyRef) { + resource = new AssemblyLinkedResource (name, flags) { + Assembly = (AssemblyNameReference)GetTypeReferenceScope (implementation), + }; + } else if (implementation.TokenType == TokenType.File) { + var file_record = ReadFileRecord (implementation.RID); + + resource = new LinkedResource (name, flags) { + File = file_record.Col2, + hash = ReadBlob (file_record.Col3) + }; + } else + continue; + + resources.Add (resource); + } + + return resources; + } + + Row ReadFileRecord (uint rid) + { + var position = this.position; + + if (!MoveTo (Table.File, rid)) + throw new ArgumentException (); + + var record = new Row ( + (FileAttributes)ReadUInt32 (), + ReadString (), + ReadBlobIndex ()); + + this.position = position; + + return record; + } + + public byte [] GetManagedResource (uint offset) + { + return image.GetReaderAt (image.Resources.VirtualAddress, offset, (o, reader) => { + reader.Advance ((int)o); + return reader.ReadBytes (reader.ReadInt32 ()); + }) ?? Empty.Array; + } + + void PopulateVersionAndFlags (AssemblyNameReference name) + { + name.Version = new Version ( + ReadUInt16 (), + ReadUInt16 (), + ReadUInt16 (), + ReadUInt16 ()); + + name.Attributes = (AssemblyAttributes)ReadUInt32 (); + } + + void PopulateNameAndCulture (AssemblyNameReference name) + { + name.Name = ReadString (); + name.Culture = ReadString (); + } + + public TypeDefinitionCollection ReadTypes () + { + InitializeTypeDefinitions (); + var mtypes = metadata.Types; + var type_count = mtypes.Length - metadata.NestedTypes.Count; + var types = new TypeDefinitionCollection (module, type_count); + + for (int i = 0; i < mtypes.Length; i++) { + var type = mtypes [i]; + if (IsNested (type.Attributes)) + continue; + + types.Add (type); + } + + if (image.HasTable (Table.MethodPtr) || image.HasTable (Table.FieldPtr)) + CompleteTypes (); + + return types; + } + + void CompleteTypes () + { + var types = metadata.Types; + + for (int i = 0; i < types.Length; i++) { + var type = types [i]; + + Mixin.Read (type.Fields); + Mixin.Read (type.Methods); + } + } + + void InitializeTypeDefinitions () + { + if (metadata.Types != null) + return; + + InitializeNestedTypes (); + InitializeFields (); + InitializeMethods (); + + int length = MoveTo (Table.TypeDef); + var types = metadata.Types = new TypeDefinition [length]; + + for (uint i = 0; i < length; i++) { + if (types [i] != null) + continue; + + types [i] = ReadType (i + 1); + } + + if (module.IsWindowsMetadata ()) { + for (uint i = 0; i < length; i++) { + WindowsRuntimeProjections.Project (types [i]); + } + } + } + + static bool IsNested (TypeAttributes attributes) + { + switch (attributes & TypeAttributes.VisibilityMask) { + case TypeAttributes.NestedAssembly: + case TypeAttributes.NestedFamANDAssem: + case TypeAttributes.NestedFamily: + case TypeAttributes.NestedFamORAssem: + case TypeAttributes.NestedPrivate: + case TypeAttributes.NestedPublic: + return true; + default: + return false; + } + } + + public bool HasNestedTypes (TypeDefinition type) + { + Collection mapping; + InitializeNestedTypes (); + + if (!metadata.TryGetNestedTypeMapping (type, out mapping)) + return false; + + return mapping.Count > 0; + } + + public Collection ReadNestedTypes (TypeDefinition type) + { + InitializeNestedTypes (); + Collection mapping; + if (!metadata.TryGetNestedTypeMapping (type, out mapping)) + return new MemberDefinitionCollection (type); + + var nested_types = new MemberDefinitionCollection (type, mapping.Count); + + for (int i = 0; i < mapping.Count; i++) { + var nested_type = GetTypeDefinition (mapping [i]); + + if (nested_type != null) + nested_types.Add (nested_type); + } + + metadata.RemoveNestedTypeMapping (type); + + return nested_types; + } + + void InitializeNestedTypes () + { + if (metadata.NestedTypes != null) + return; + + var length = MoveTo (Table.NestedClass); + + metadata.NestedTypes = new Dictionary> (length); + metadata.ReverseNestedTypes = new Dictionary (length); + + if (length == 0) + return; + + for (int i = 1; i <= length; i++) { + var nested = ReadTableIndex (Table.TypeDef); + var declaring = ReadTableIndex (Table.TypeDef); + + AddNestedMapping (declaring, nested); + } + } + + void AddNestedMapping (uint declaring, uint nested) + { + metadata.SetNestedTypeMapping (declaring, AddMapping (metadata.NestedTypes, declaring, nested)); + metadata.SetReverseNestedTypeMapping (nested, declaring); + } + + static Collection AddMapping (Dictionary> cache, TKey key, TValue value) + { + Collection mapped; + if (!cache.TryGetValue (key, out mapped)) { + mapped = new Collection (); + } + mapped.Add (value); + return mapped; + } + + TypeDefinition ReadType (uint rid) + { + if (!MoveTo (Table.TypeDef, rid)) + return null; + + var attributes = (TypeAttributes)ReadUInt32 (); + var name = ReadString (); + var @namespace = ReadString (); + var type = new TypeDefinition (@namespace, name, attributes); + type.token = new MetadataToken (TokenType.TypeDef, rid); + type.scope = module; + type.module = module; + + metadata.AddTypeDefinition (type); + + this.context = type; + + type.BaseType = GetTypeDefOrRef (ReadMetadataToken (CodedIndex.TypeDefOrRef)); + + type.fields_range = ReadListRange (rid, Table.TypeDef, Table.Field); + type.methods_range = ReadListRange (rid, Table.TypeDef, Table.Method); + + if (IsNested (attributes)) + type.DeclaringType = GetNestedTypeDeclaringType (type); + + return type; + } + + TypeDefinition GetNestedTypeDeclaringType (TypeDefinition type) + { + uint declaring_rid; + if (!metadata.TryGetReverseNestedTypeMapping (type, out declaring_rid)) + return null; + + metadata.RemoveReverseNestedTypeMapping (type); + return GetTypeDefinition (declaring_rid); + } + + Range ReadListRange (uint current_index, Table current, Table target) + { + var list = new Range (); + + var start = ReadTableIndex (target); + if (start == 0) + return list; + + uint next_index; + var current_table = image.TableHeap [current]; + + if (current_index == current_table.Length) + next_index = image.TableHeap [target].Length + 1; + else { + var position = this.position; + this.position += (int)(current_table.RowSize - image.GetTableIndexSize (target)); + next_index = ReadTableIndex (target); + this.position = position; + } + + list.Start = start; + list.Length = next_index - start; + + return list; + } + + public Row ReadTypeLayout (TypeDefinition type) + { + InitializeTypeLayouts (); + Row class_layout; + var rid = type.token.RID; + if (!metadata.ClassLayouts.TryGetValue (rid, out class_layout)) + return new Row (Mixin.NoDataMarker, Mixin.NoDataMarker); + + type.PackingSize = (short)class_layout.Col1; + type.ClassSize = (int)class_layout.Col2; + + metadata.ClassLayouts.Remove (rid); + + return new Row ((short)class_layout.Col1, (int)class_layout.Col2); + } + + void InitializeTypeLayouts () + { + if (metadata.ClassLayouts != null) + return; + + int length = MoveTo (Table.ClassLayout); + + var class_layouts = metadata.ClassLayouts = new Dictionary> (length); + + for (uint i = 0; i < length; i++) { + var packing_size = ReadUInt16 (); + var class_size = ReadUInt32 (); + + var parent = ReadTableIndex (Table.TypeDef); + + class_layouts.Add (parent, new Row (packing_size, class_size)); + } + } + + public TypeReference GetTypeDefOrRef (MetadataToken token) + { + return (TypeReference)LookupToken (token); + } + + public TypeDefinition GetTypeDefinition (uint rid) + { + InitializeTypeDefinitions (); + + var type = metadata.GetTypeDefinition (rid); + if (type != null) + return type; + + type = ReadTypeDefinition (rid); + + if (module.IsWindowsMetadata ()) + WindowsRuntimeProjections.Project (type); + + return type; + } + + TypeDefinition ReadTypeDefinition (uint rid) + { + if (!MoveTo (Table.TypeDef, rid)) + return null; + + return ReadType (rid); + } + + void InitializeTypeReferences () + { + if (metadata.TypeReferences != null) + return; + + metadata.TypeReferences = new TypeReference [image.GetTableLength (Table.TypeRef)]; + } + + public TypeReference GetTypeReference (string scope, string full_name) + { + InitializeTypeReferences (); + + var length = metadata.TypeReferences.Length; + + for (uint i = 1; i <= length; i++) { + var type = GetTypeReference (i); + + if (type.FullName != full_name) + continue; + + if (string.IsNullOrEmpty (scope)) + return type; + + if (type.Scope.Name == scope) + return type; + } + + return null; + } + + TypeReference GetTypeReference (uint rid) + { + InitializeTypeReferences (); + + var type = metadata.GetTypeReference (rid); + if (type != null) + return type; + + return ReadTypeReference (rid); + } + + TypeReference ReadTypeReference (uint rid) + { + if (!MoveTo (Table.TypeRef, rid)) + return null; + + TypeReference declaring_type = null; + IMetadataScope scope; + + var scope_token = ReadMetadataToken (CodedIndex.ResolutionScope); + + var name = ReadString (); + var @namespace = ReadString (); + + var type = new TypeReference ( + @namespace, + name, + module, + null); + + type.token = new MetadataToken (TokenType.TypeRef, rid); + + metadata.AddTypeReference (type); + + if (scope_token.TokenType == TokenType.TypeRef) { + if (scope_token.RID != rid) { + declaring_type = GetTypeDefOrRef (scope_token); + + scope = declaring_type != null + ? declaring_type.Scope + : module; + } else // obfuscated typeref row pointing to self + scope = module; + } else + scope = GetTypeReferenceScope (scope_token); + + type.scope = scope; + type.DeclaringType = declaring_type; + + MetadataSystem.TryProcessPrimitiveTypeReference (type); + + if (type.Module.IsWindowsMetadata ()) + WindowsRuntimeProjections.Project (type); + + return type; + } + + IMetadataScope GetTypeReferenceScope (MetadataToken scope) + { + if (scope.TokenType == TokenType.Module) + return module; + + IMetadataScope [] scopes; + + switch (scope.TokenType) { + case TokenType.AssemblyRef: + InitializeAssemblyReferences (); + scopes = metadata.AssemblyReferences; + break; + case TokenType.ModuleRef: + InitializeModuleReferences (); + scopes = metadata.ModuleReferences; + break; + default: + throw new NotSupportedException (); + } + + var index = scope.RID - 1; + if (index < 0 || index >= scopes.Length) + return null; + + return scopes [index]; + } + + public IEnumerable GetTypeReferences () + { + InitializeTypeReferences (); + + var length = image.GetTableLength (Table.TypeRef); + + var type_references = new TypeReference [length]; + + for (uint i = 1; i <= length; i++) + type_references [i - 1] = GetTypeReference (i); + + return type_references; + } + + TypeReference GetTypeSpecification (uint rid) + { + if (!MoveTo (Table.TypeSpec, rid)) + return null; + + var reader = ReadSignature (ReadBlobIndex ()); + var type = reader.ReadTypeSignature (); + if (type.token.RID == 0) + type.token = new MetadataToken (TokenType.TypeSpec, rid); + + return type; + } + + SignatureReader ReadSignature (uint signature) + { + return new SignatureReader (signature, this); + } + + public bool HasInterfaces (TypeDefinition type) + { + InitializeInterfaces (); + Collection> mapping; + + return metadata.TryGetInterfaceMapping (type, out mapping); + } + + public InterfaceImplementationCollection ReadInterfaces (TypeDefinition type) + { + InitializeInterfaces (); + Collection> mapping; + + if (!metadata.TryGetInterfaceMapping (type, out mapping)) + return new InterfaceImplementationCollection (type); + + var interfaces = new InterfaceImplementationCollection (type, mapping.Count); + + this.context = type; + + for (int i = 0; i < mapping.Count; i++) { + interfaces.Add ( + new InterfaceImplementation ( + GetTypeDefOrRef (mapping [i].Col2), + new MetadataToken (TokenType.InterfaceImpl, mapping [i].Col1))); + } + + metadata.RemoveInterfaceMapping (type); + + return interfaces; + } + + void InitializeInterfaces () + { + if (metadata.Interfaces != null) + return; + + int length = MoveTo (Table.InterfaceImpl); + + metadata.Interfaces = new Dictionary>> (length); + + for (uint i = 1; i <= length; i++) { + var type = ReadTableIndex (Table.TypeDef); + var @interface = ReadMetadataToken (CodedIndex.TypeDefOrRef); + + AddInterfaceMapping (type, new Row (i, @interface)); + } + } + + void AddInterfaceMapping (uint type, Row @interface) + { + metadata.SetInterfaceMapping (type, AddMapping (metadata.Interfaces, type, @interface)); + } + + public Collection ReadFields (TypeDefinition type) + { + var fields_range = type.fields_range; + if (fields_range.Length == 0) + return new MemberDefinitionCollection (type); + + var fields = new MemberDefinitionCollection (type, (int)fields_range.Length); + this.context = type; + + if (!MoveTo (Table.FieldPtr, fields_range.Start)) { + if (!MoveTo (Table.Field, fields_range.Start)) + return fields; + + for (uint i = 0; i < fields_range.Length; i++) + ReadField (fields_range.Start + i, fields); + } else + ReadPointers (Table.FieldPtr, Table.Field, fields_range, fields, ReadField); + + return fields; + } + + void ReadField (uint field_rid, Collection fields) + { + var attributes = (FieldAttributes)ReadUInt16 (); + var name = ReadString (); + var signature = ReadBlobIndex (); + + var field = new FieldDefinition (name, attributes, ReadFieldType (signature)); + field.token = new MetadataToken (TokenType.Field, field_rid); + metadata.AddFieldDefinition (field); + + if (IsDeleted (field)) + return; + + fields.Add (field); + + if (module.IsWindowsMetadata ()) + WindowsRuntimeProjections.Project (field); + } + + void InitializeFields () + { + if (metadata.Fields != null) + return; + + metadata.Fields = new FieldDefinition [image.GetTableLength (Table.Field)]; + } + + TypeReference ReadFieldType (uint signature) + { + var reader = ReadSignature (signature); + + const byte field_sig = 0x6; + + if (reader.ReadByte () != field_sig) + throw new NotSupportedException (); + + return reader.ReadTypeSignature (); + } + + public int ReadFieldRVA (FieldDefinition field) + { + InitializeFieldRVAs (); + var rid = field.token.RID; + + RVA rva; + if (!metadata.FieldRVAs.TryGetValue (rid, out rva)) + return 0; + + var size = GetFieldTypeSize (field.FieldType); + + if (size == 0 || rva == 0) + return 0; + + metadata.FieldRVAs.Remove (rid); + + field.InitialValue = GetFieldInitializeValue (size, rva); + + return (int)rva; + } + + byte [] GetFieldInitializeValue (int size, RVA rva) + { + return image.GetReaderAt (rva, size, (s, reader) => reader.ReadBytes (s)) ?? Empty.Array; + } + + static int GetFieldTypeSize (TypeReference type) + { + int size = 0; + + switch (type.etype) { + case ElementType.Boolean: + case ElementType.U1: + case ElementType.I1: + size = 1; + break; + case ElementType.U2: + case ElementType.I2: + case ElementType.Char: + size = 2; + break; + case ElementType.U4: + case ElementType.I4: + case ElementType.R4: + size = 4; + break; + case ElementType.U8: + case ElementType.I8: + case ElementType.R8: + size = 8; + break; + case ElementType.Ptr: + case ElementType.FnPtr: + size = IntPtr.Size; + break; + case ElementType.CModOpt: + case ElementType.CModReqD: + return GetFieldTypeSize (((IModifierType)type).ElementType); + default: + var field_type = type.Resolve (); + if (field_type != null && field_type.HasLayoutInfo) + size = field_type.ClassSize; + + break; + } + + return size; + } + + void InitializeFieldRVAs () + { + if (metadata.FieldRVAs != null) + return; + + int length = MoveTo (Table.FieldRVA); + + var field_rvas = metadata.FieldRVAs = new Dictionary (length); + + for (int i = 0; i < length; i++) { + var rva = ReadUInt32 (); + var field = ReadTableIndex (Table.Field); + + field_rvas.Add (field, rva); + } + } + + public int ReadFieldLayout (FieldDefinition field) + { + InitializeFieldLayouts (); + var rid = field.token.RID; + uint offset; + if (!metadata.FieldLayouts.TryGetValue (rid, out offset)) + return Mixin.NoDataMarker; + + metadata.FieldLayouts.Remove (rid); + + return (int)offset; + } + + void InitializeFieldLayouts () + { + if (metadata.FieldLayouts != null) + return; + + int length = MoveTo (Table.FieldLayout); + + var field_layouts = metadata.FieldLayouts = new Dictionary (length); + + for (int i = 0; i < length; i++) { + var offset = ReadUInt32 (); + var field = ReadTableIndex (Table.Field); + + field_layouts.Add (field, offset); + } + } + + public bool HasEvents (TypeDefinition type) + { + InitializeEvents (); + + Range range; + if (!metadata.TryGetEventsRange (type, out range)) + return false; + + return range.Length > 0; + } + + public Collection ReadEvents (TypeDefinition type) + { + InitializeEvents (); + Range range; + + if (!metadata.TryGetEventsRange (type, out range)) + return new MemberDefinitionCollection (type); + + var events = new MemberDefinitionCollection (type, (int)range.Length); + + metadata.RemoveEventsRange (type); + + if (range.Length == 0) + return events; + + this.context = type; + + if (!MoveTo (Table.EventPtr, range.Start)) { + if (!MoveTo (Table.Event, range.Start)) + return events; + + for (uint i = 0; i < range.Length; i++) + ReadEvent (range.Start + i, events); + } else + ReadPointers (Table.EventPtr, Table.Event, range, events, ReadEvent); + + return events; + } + + void ReadEvent (uint event_rid, Collection events) + { + var attributes = (EventAttributes)ReadUInt16 (); + var name = ReadString (); + var event_type = GetTypeDefOrRef (ReadMetadataToken (CodedIndex.TypeDefOrRef)); + + var @event = new EventDefinition (name, attributes, event_type); + @event.token = new MetadataToken (TokenType.Event, event_rid); + + if (IsDeleted (@event)) + return; + + events.Add (@event); + } + + void InitializeEvents () + { + if (metadata.Events != null) + return; + + int length = MoveTo (Table.EventMap); + + metadata.Events = new Dictionary (length); + + for (uint i = 1; i <= length; i++) { + var type_rid = ReadTableIndex (Table.TypeDef); + Range events_range = ReadListRange (i, Table.EventMap, Table.Event); + metadata.AddEventsRange (type_rid, events_range); + } + } + + public bool HasProperties (TypeDefinition type) + { + InitializeProperties (); + + Range range; + if (!metadata.TryGetPropertiesRange (type, out range)) + return false; + + return range.Length > 0; + } + + public Collection ReadProperties (TypeDefinition type) + { + InitializeProperties (); + + Range range; + + if (!metadata.TryGetPropertiesRange (type, out range)) + return new MemberDefinitionCollection (type); + + metadata.RemovePropertiesRange (type); + + var properties = new MemberDefinitionCollection (type, (int)range.Length); + + if (range.Length == 0) + return properties; + + this.context = type; + + if (!MoveTo (Table.PropertyPtr, range.Start)) { + if (!MoveTo (Table.Property, range.Start)) + return properties; + for (uint i = 0; i < range.Length; i++) + ReadProperty (range.Start + i, properties); + } else + ReadPointers (Table.PropertyPtr, Table.Property, range, properties, ReadProperty); + + return properties; + } + + void ReadProperty (uint property_rid, Collection properties) + { + var attributes = (PropertyAttributes)ReadUInt16 (); + var name = ReadString (); + var signature = ReadBlobIndex (); + + var reader = ReadSignature (signature); + const byte property_signature = 0x8; + + var calling_convention = reader.ReadByte (); + + if ((calling_convention & property_signature) == 0) + throw new NotSupportedException (); + + var has_this = (calling_convention & 0x20) != 0; + + reader.ReadCompressedUInt32 (); // count + + var property = new PropertyDefinition (name, attributes, reader.ReadTypeSignature ()); + property.HasThis = has_this; + property.token = new MetadataToken (TokenType.Property, property_rid); + + if (IsDeleted (property)) + return; + + properties.Add (property); + } + + void InitializeProperties () + { + if (metadata.Properties != null) + return; + + int length = MoveTo (Table.PropertyMap); + + metadata.Properties = new Dictionary (length); + + for (uint i = 1; i <= length; i++) { + var type_rid = ReadTableIndex (Table.TypeDef); + var properties_range = ReadListRange (i, Table.PropertyMap, Table.Property); + metadata.AddPropertiesRange (type_rid, properties_range); + } + } + + MethodSemanticsAttributes ReadMethodSemantics (MethodDefinition method) + { + InitializeMethodSemantics (); + Row row; + if (!metadata.Semantics.TryGetValue (method.token.RID, out row)) + return MethodSemanticsAttributes.None; + + var type = method.DeclaringType; + + switch (row.Col1) { + case MethodSemanticsAttributes.AddOn: + GetEvent (type, row.Col2).add_method = method; + break; + case MethodSemanticsAttributes.Fire: + GetEvent (type, row.Col2).invoke_method = method; + break; + case MethodSemanticsAttributes.RemoveOn: + GetEvent (type, row.Col2).remove_method = method; + break; + case MethodSemanticsAttributes.Getter: + GetProperty (type, row.Col2).get_method = method; + break; + case MethodSemanticsAttributes.Setter: + GetProperty (type, row.Col2).set_method = method; + break; + case MethodSemanticsAttributes.Other: + switch (row.Col2.TokenType) { + case TokenType.Event: { + var @event = GetEvent (type, row.Col2); + if (@event.other_methods == null) + @event.other_methods = new Collection (); + + @event.other_methods.Add (method); + break; + } + case TokenType.Property: { + var property = GetProperty (type, row.Col2); + if (property.other_methods == null) + property.other_methods = new Collection (); + + property.other_methods.Add (method); + + break; + } + default: + throw new NotSupportedException (); + } + break; + default: + throw new NotSupportedException (); + } + + metadata.Semantics.Remove (method.token.RID); + + return row.Col1; + } + + static EventDefinition GetEvent (TypeDefinition type, MetadataToken token) + { + if (token.TokenType != TokenType.Event) + throw new ArgumentException (); + + return GetMember (type.Events, token); + } + + static PropertyDefinition GetProperty (TypeDefinition type, MetadataToken token) + { + if (token.TokenType != TokenType.Property) + throw new ArgumentException (); + + return GetMember (type.Properties, token); + } + + static TMember GetMember (Collection members, MetadataToken token) where TMember : IMemberDefinition + { + for (int i = 0; i < members.Count; i++) { + var member = members [i]; + if (member.MetadataToken == token) + return member; + } + + throw new ArgumentException (); + } + + void InitializeMethodSemantics () + { + if (metadata.Semantics != null) + return; + + int length = MoveTo (Table.MethodSemantics); + + var semantics = metadata.Semantics = new Dictionary> (0); + + for (uint i = 0; i < length; i++) { + var attributes = (MethodSemanticsAttributes)ReadUInt16 (); + var method_rid = ReadTableIndex (Table.Method); + var association = ReadMetadataToken (CodedIndex.HasSemantics); + + semantics [method_rid] = new Row (attributes, association); + } + } + + public void ReadMethods (PropertyDefinition property) + { + ReadAllSemantics (property.DeclaringType); + } + + public void ReadMethods (EventDefinition @event) + { + ReadAllSemantics (@event.DeclaringType); + } + + public void ReadAllSemantics (MethodDefinition method) + { + ReadAllSemantics (method.DeclaringType); + } + + void ReadAllSemantics (TypeDefinition type) + { + var methods = type.Methods; + for (int i = 0; i < methods.Count; i++) { + var method = methods [i]; + if (method.sem_attrs_ready) + continue; + + method.sem_attrs = ReadMethodSemantics (method); + method.sem_attrs_ready = true; + } + } + + public Collection ReadMethods (TypeDefinition type) + { + var methods_range = type.methods_range; + if (methods_range.Length == 0) + return new MemberDefinitionCollection (type); + + var methods = new MemberDefinitionCollection (type, (int)methods_range.Length); + if (!MoveTo (Table.MethodPtr, methods_range.Start)) { + if (!MoveTo (Table.Method, methods_range.Start)) + return methods; + + for (uint i = 0; i < methods_range.Length; i++) + ReadMethod (methods_range.Start + i, methods); + } else + ReadPointers (Table.MethodPtr, Table.Method, methods_range, methods, ReadMethod); + + return methods; + } + + void ReadPointers (Table ptr, Table table, Range range, Collection members, Action> reader) + where TMember : IMemberDefinition + { + for (uint i = 0; i < range.Length; i++) { + MoveTo (ptr, range.Start + i); + + var rid = ReadTableIndex (table); + MoveTo (table, rid); + + reader (rid, members); + } + } + + static bool IsDeleted (IMemberDefinition member) + { + return member.IsSpecialName && member.Name == "_Deleted"; + } + + void InitializeMethods () + { + if (metadata.Methods != null) + return; + + metadata.Methods = new MethodDefinition [image.GetTableLength (Table.Method)]; + } + + void ReadMethod (uint method_rid, Collection methods) + { + var method = new MethodDefinition (); + method.rva = ReadUInt32 (); + method.ImplAttributes = (MethodImplAttributes)ReadUInt16 (); + method.Attributes = (MethodAttributes)ReadUInt16 (); + method.Name = ReadString (); + method.token = new MetadataToken (TokenType.Method, method_rid); + + if (IsDeleted (method)) + return; + + methods.Add (method); // attach method + + var signature = ReadBlobIndex (); + var param_range = ReadListRange (method_rid, Table.Method, Table.Param); + + this.context = method; + + ReadMethodSignature (signature, method); + metadata.AddMethodDefinition (method); + + if (param_range.Length != 0) { + var position = base.position; + ReadParameters (method, param_range); + base.position = position; + } + + if (module.IsWindowsMetadata ()) + WindowsRuntimeProjections.Project (method); + } + + void ReadParameters (MethodDefinition method, Range param_range) + { + if (!MoveTo (Table.ParamPtr, param_range.Start)) { + if (!MoveTo (Table.Param, param_range.Start)) + return; + + for (uint i = 0; i < param_range.Length; i++) + ReadParameter (param_range.Start + i, method); + } else + ReadParameterPointers (method, param_range); + } + + void ReadParameterPointers (MethodDefinition method, Range range) + { + for (uint i = 0; i < range.Length; i++) { + MoveTo (Table.ParamPtr, range.Start + i); + + var rid = ReadTableIndex (Table.Param); + + MoveTo (Table.Param, rid); + + ReadParameter (rid, method); + } + } + + void ReadParameter (uint param_rid, MethodDefinition method) + { + var attributes = (ParameterAttributes)ReadUInt16 (); + var sequence = ReadUInt16 (); + var name = ReadString (); + + var parameter = sequence == 0 + ? method.MethodReturnType.Parameter + : method.Parameters [sequence - 1]; + + parameter.token = new MetadataToken (TokenType.Param, param_rid); + parameter.Name = name; + parameter.Attributes = attributes; + } + + void ReadMethodSignature (uint signature, IMethodSignature method) + { + var reader = ReadSignature (signature); + reader.ReadMethodSignature (method); + } + + public PInvokeInfo ReadPInvokeInfo (MethodDefinition method) + { + InitializePInvokes (); + Row row; + + var rid = method.token.RID; + + if (!metadata.PInvokes.TryGetValue (rid, out row)) + return null; + + metadata.PInvokes.Remove (rid); + + return new PInvokeInfo ( + row.Col1, + image.StringHeap.Read (row.Col2), + module.ModuleReferences [(int)row.Col3 - 1]); + } + + void InitializePInvokes () + { + if (metadata.PInvokes != null) + return; + + int length = MoveTo (Table.ImplMap); + + var pinvokes = metadata.PInvokes = new Dictionary> (length); + + for (int i = 1; i <= length; i++) { + var attributes = (PInvokeAttributes)ReadUInt16 (); + var method = ReadMetadataToken (CodedIndex.MemberForwarded); + var name = ReadStringIndex (); + var scope = ReadTableIndex (Table.File); + + if (method.TokenType != TokenType.Method) + continue; + + pinvokes.Add (method.RID, new Row (attributes, name, scope)); + } + } + + public bool HasGenericParameters (IGenericParameterProvider provider) + { + InitializeGenericParameters (); + + Range [] ranges; + if (!metadata.TryGetGenericParameterRanges (provider, out ranges)) + return false; + + return RangesSize (ranges) > 0; + } + + public Collection ReadGenericParameters (IGenericParameterProvider provider) + { + InitializeGenericParameters (); + + Range [] ranges; + if (!metadata.TryGetGenericParameterRanges (provider, out ranges)) + return new GenericParameterCollection (provider); + + metadata.RemoveGenericParameterRange (provider); + + var generic_parameters = new GenericParameterCollection (provider, RangesSize (ranges)); + + for (int i = 0; i < ranges.Length; i++) + ReadGenericParametersRange (ranges [i], provider, generic_parameters); + + return generic_parameters; + } + + void ReadGenericParametersRange (Range range, IGenericParameterProvider provider, GenericParameterCollection generic_parameters) + { + if (!MoveTo (Table.GenericParam, range.Start)) + return; + + for (uint i = 0; i < range.Length; i++) { + ReadUInt16 (); // index + var flags = (GenericParameterAttributes)ReadUInt16 (); + ReadMetadataToken (CodedIndex.TypeOrMethodDef); + var name = ReadString (); + + var parameter = new GenericParameter (name, provider); + parameter.token = new MetadataToken (TokenType.GenericParam, range.Start + i); + parameter.Attributes = flags; + + generic_parameters.Add (parameter); + } + } + + void InitializeGenericParameters () + { + if (metadata.GenericParameters != null) + return; + + metadata.GenericParameters = InitializeRanges ( + Table.GenericParam, () => { + Advance (4); + var next = ReadMetadataToken (CodedIndex.TypeOrMethodDef); + ReadStringIndex (); + return next; + }); + } + + Dictionary InitializeRanges (Table table, Func get_next) + { + int length = MoveTo (table); + var ranges = new Dictionary (length); + + if (length == 0) + return ranges; + + MetadataToken owner = MetadataToken.Zero; + Range range = new Range (1, 0); + + for (uint i = 1; i <= length; i++) { + var next = get_next (); + + if (i == 1) { + owner = next; + range.Length++; + } else if (next != owner) { + AddRange (ranges, owner, range); + range = new Range (i, 1); + owner = next; + } else + range.Length++; + } + + AddRange (ranges, owner, range); + + return ranges; + } + + static void AddRange (Dictionary ranges, MetadataToken owner, Range range) + { + if (owner.RID == 0) + return; + + Range [] slots; + if (!ranges.TryGetValue (owner, out slots)) { + ranges.Add (owner, new [] { range }); + return; + } + + ranges [owner] = slots.Add (range); + } + + public bool HasGenericConstraints (GenericParameter generic_parameter) + { + InitializeGenericConstraints (); + + Collection> mapping; + if (!metadata.TryGetGenericConstraintMapping (generic_parameter, out mapping)) + return false; + + return mapping.Count > 0; + } + + public GenericParameterConstraintCollection ReadGenericConstraints (GenericParameter generic_parameter) + { + InitializeGenericConstraints (); + + Collection> mapping; + if (!metadata.TryGetGenericConstraintMapping (generic_parameter, out mapping)) + return new GenericParameterConstraintCollection (generic_parameter); + + var constraints = new GenericParameterConstraintCollection (generic_parameter, mapping.Count); + + this.context = (IGenericContext)generic_parameter.Owner; + + for (int i = 0; i < mapping.Count; i++) { + constraints.Add ( + new GenericParameterConstraint ( + GetTypeDefOrRef (mapping [i].Col2), + new MetadataToken (TokenType.GenericParamConstraint, mapping [i].Col1))); + } + + metadata.RemoveGenericConstraintMapping (generic_parameter); + + return constraints; + } + + void InitializeGenericConstraints () + { + if (metadata.GenericConstraints != null) + return; + + var length = MoveTo (Table.GenericParamConstraint); + + metadata.GenericConstraints = new Dictionary>> (length); + + for (uint i = 1; i <= length; i++) { + AddGenericConstraintMapping ( + ReadTableIndex (Table.GenericParam), + new Row (i, ReadMetadataToken (CodedIndex.TypeDefOrRef))); + } + } + + void AddGenericConstraintMapping (uint generic_parameter, Row constraint) + { + metadata.SetGenericConstraintMapping ( + generic_parameter, + AddMapping (metadata.GenericConstraints, generic_parameter, constraint)); + } + + public bool HasOverrides (MethodDefinition method) + { + InitializeOverrides (); + Collection mapping; + + if (!metadata.TryGetOverrideMapping (method, out mapping)) + return false; + + return mapping.Count > 0; + } + + public Collection ReadOverrides (MethodDefinition method) + { + InitializeOverrides (); + + Collection mapping; + if (!metadata.TryGetOverrideMapping (method, out mapping)) + return new Collection (); + + var overrides = new Collection (mapping.Count); + + this.context = method; + + for (int i = 0; i < mapping.Count; i++) + overrides.Add ((MethodReference)LookupToken (mapping [i])); + + metadata.RemoveOverrideMapping (method); + + return overrides; + } + + void InitializeOverrides () + { + if (metadata.Overrides != null) + return; + + var length = MoveTo (Table.MethodImpl); + + metadata.Overrides = new Dictionary> (length); + + for (int i = 1; i <= length; i++) { + ReadTableIndex (Table.TypeDef); + + var method = ReadMetadataToken (CodedIndex.MethodDefOrRef); + if (method.TokenType != TokenType.Method) + throw new NotSupportedException (); + + var @override = ReadMetadataToken (CodedIndex.MethodDefOrRef); + + AddOverrideMapping (method.RID, @override); + } + } + + void AddOverrideMapping (uint method_rid, MetadataToken @override) + { + metadata.SetOverrideMapping ( + method_rid, + AddMapping (metadata.Overrides, method_rid, @override)); + } + + public MethodBody ReadMethodBody (MethodDefinition method) + { + return code.ReadMethodBody (method); + } + + public int ReadCodeSize (MethodDefinition method) + { + return code.ReadCodeSize (method); + } + + public CallSite ReadCallSite (MetadataToken token) + { + if (!MoveTo (Table.StandAloneSig, token.RID)) + return null; + + var signature = ReadBlobIndex (); + + var call_site = new CallSite (); + + ReadMethodSignature (signature, call_site); + + call_site.MetadataToken = token; + + return call_site; + } + + public VariableDefinitionCollection ReadVariables (MetadataToken local_var_token, MethodDefinition method = null) + { + if (!MoveTo (Table.StandAloneSig, local_var_token.RID)) + return null; + + var reader = ReadSignature (ReadBlobIndex ()); + const byte local_sig = 0x7; + + if (reader.ReadByte () != local_sig) + throw new NotSupportedException (); + + var count = reader.ReadCompressedUInt32 (); + if (count == 0) + return null; + + var variables = new VariableDefinitionCollection (method, (int)count); + + for (int i = 0; i < count; i++) + variables.Add (new VariableDefinition (reader.ReadTypeSignature ())); + + return variables; + } + + public IMetadataTokenProvider LookupToken (MetadataToken token) + { + var rid = token.RID; + + if (rid == 0) + return null; + + if (metadata_reader != null) + return metadata_reader.LookupToken (token); + + IMetadataTokenProvider element; + var position = this.position; + var context = this.context; + + switch (token.TokenType) { + case TokenType.TypeDef: + element = GetTypeDefinition (rid); + break; + case TokenType.TypeRef: + element = GetTypeReference (rid); + break; + case TokenType.TypeSpec: + element = GetTypeSpecification (rid); + break; + case TokenType.Field: + element = GetFieldDefinition (rid); + break; + case TokenType.Method: + element = GetMethodDefinition (rid); + break; + case TokenType.MemberRef: + element = GetMemberReference (rid); + break; + case TokenType.MethodSpec: + element = GetMethodSpecification (rid); + break; + default: + return null; + } + + this.position = position; + this.context = context; + + return element; + } + + public FieldDefinition GetFieldDefinition (uint rid) + { + InitializeTypeDefinitions (); + + var field = metadata.GetFieldDefinition (rid); + if (field != null) + return field; + + return LookupField (rid); + } + + FieldDefinition LookupField (uint rid) + { + var type = metadata.GetFieldDeclaringType (rid); + if (type == null) + return null; + + Mixin.Read (type.Fields); + + return metadata.GetFieldDefinition (rid); + } + + public MethodDefinition GetMethodDefinition (uint rid) + { + InitializeTypeDefinitions (); + + var method = metadata.GetMethodDefinition (rid); + if (method != null) + return method; + + return LookupMethod (rid); + } + + MethodDefinition LookupMethod (uint rid) + { + var type = metadata.GetMethodDeclaringType (rid); + if (type == null) + return null; + + Mixin.Read (type.Methods); + + return metadata.GetMethodDefinition (rid); + } + + MethodSpecification GetMethodSpecification (uint rid) + { + if (!MoveTo (Table.MethodSpec, rid)) + return null; + + var element_method = (MethodReference)LookupToken ( + ReadMetadataToken (CodedIndex.MethodDefOrRef)); + var signature = ReadBlobIndex (); + + var method_spec = ReadMethodSpecSignature (signature, element_method); + method_spec.token = new MetadataToken (TokenType.MethodSpec, rid); + return method_spec; + } + + MethodSpecification ReadMethodSpecSignature (uint signature, MethodReference method) + { + var reader = ReadSignature (signature); + const byte methodspec_sig = 0x0a; + + var call_conv = reader.ReadByte (); + + if (call_conv != methodspec_sig) + throw new NotSupportedException (); + + var arity = reader.ReadCompressedUInt32 (); + + var instance = new GenericInstanceMethod (method, (int)arity); + + reader.ReadGenericInstanceSignature (method, instance, arity); + + return instance; + } + + MemberReference GetMemberReference (uint rid) + { + InitializeMemberReferences (); + + var member = metadata.GetMemberReference (rid); + if (member != null) + return member; + + member = ReadMemberReference (rid); + if (member != null && !member.ContainsGenericParameter) + metadata.AddMemberReference (member); + return member; + } + + MemberReference ReadMemberReference (uint rid) + { + if (!MoveTo (Table.MemberRef, rid)) + return null; + + var token = ReadMetadataToken (CodedIndex.MemberRefParent); + var name = ReadString (); + var signature = ReadBlobIndex (); + + MemberReference member; + + switch (token.TokenType) { + case TokenType.TypeDef: + case TokenType.TypeRef: + case TokenType.TypeSpec: + member = ReadTypeMemberReference (token, name, signature); + break; + case TokenType.Method: + member = ReadMethodMemberReference (token, name, signature); + break; + default: + throw new NotSupportedException (); + } + + member.token = new MetadataToken (TokenType.MemberRef, rid); + return member; + } + + MemberReference ReadTypeMemberReference (MetadataToken type, string name, uint signature) + { + var declaring_type = GetTypeDefOrRef (type); + + if (!declaring_type.IsArray) + this.context = declaring_type; + + var member = ReadMemberReferenceSignature (signature, declaring_type); + member.Name = name; + + return member; + } + + MemberReference ReadMemberReferenceSignature (uint signature, TypeReference declaring_type) + { + var reader = ReadSignature (signature); + const byte field_sig = 0x6; + + if (reader.buffer [reader.position] == field_sig) { + reader.position++; + var field = new FieldReference (); + field.DeclaringType = declaring_type; + field.FieldType = reader.ReadTypeSignature (); + return field; + } else { + var method = new MethodReference (); + method.DeclaringType = declaring_type; + reader.ReadMethodSignature (method); + return method; + } + } + + MemberReference ReadMethodMemberReference (MetadataToken token, string name, uint signature) + { + var method = GetMethodDefinition (token.RID); + + this.context = method; + + var member = ReadMemberReferenceSignature (signature, method.DeclaringType); + member.Name = name; + + return member; + } + + void InitializeMemberReferences () + { + if (metadata.MemberReferences != null) + return; + + metadata.MemberReferences = new MemberReference [image.GetTableLength (Table.MemberRef)]; + } + + public IEnumerable GetMemberReferences () + { + InitializeMemberReferences (); + + var length = image.GetTableLength (Table.MemberRef); + + var type_system = module.TypeSystem; + + var context = new MethodDefinition (string.Empty, MethodAttributes.Static, type_system.Void); + context.DeclaringType = new TypeDefinition (string.Empty, string.Empty, TypeAttributes.Public); + + var member_references = new MemberReference [length]; + + for (uint i = 1; i <= length; i++) { + this.context = context; + member_references [i - 1] = GetMemberReference (i); + } + + return member_references; + } + + void InitializeConstants () + { + if (metadata.Constants != null) + return; + + var length = MoveTo (Table.Constant); + + var constants = metadata.Constants = new Dictionary> (length); + + for (uint i = 1; i <= length; i++) { + var type = (ElementType)ReadUInt16 (); + var owner = ReadMetadataToken (CodedIndex.HasConstant); + var signature = ReadBlobIndex (); + + constants.Add (owner, new Row (type, signature)); + } + } + + public TypeReference ReadConstantSignature (MetadataToken token) + { + if (token.TokenType != TokenType.Signature) + throw new NotSupportedException (); + + if (token.RID == 0) + return null; + + if (!MoveTo (Table.StandAloneSig, token.RID)) + return null; + + return ReadFieldType (ReadBlobIndex ()); + } + + public object ReadConstant (IConstantProvider owner) + { + InitializeConstants (); + + Row row; + if (!metadata.Constants.TryGetValue (owner.MetadataToken, out row)) + return Mixin.NoValue; + + metadata.Constants.Remove (owner.MetadataToken); + + return ReadConstantValue (row.Col1, row.Col2); + } + + object ReadConstantValue (ElementType etype, uint signature) + { + switch (etype) { + case ElementType.Class: + case ElementType.Object: + return null; + case ElementType.String: + return ReadConstantString (signature); + default: + return ReadConstantPrimitive (etype, signature); + } + } + + string ReadConstantString (uint signature) + { + byte [] blob; + int index, count; + + GetBlobView (signature, out blob, out index, out count); + if (count == 0) + return string.Empty; + + if ((count & 1) == 1) + count--; + + return Encoding.Unicode.GetString (blob, index, count); + } + + object ReadConstantPrimitive (ElementType type, uint signature) + { + var reader = ReadSignature (signature); + return reader.ReadConstantSignature (type); + } + + internal void InitializeCustomAttributes () + { + if (metadata.CustomAttributes != null) + return; + + metadata.CustomAttributes = InitializeRanges ( + Table.CustomAttribute, () => { + var next = ReadMetadataToken (CodedIndex.HasCustomAttribute); + ReadMetadataToken (CodedIndex.CustomAttributeType); + ReadBlobIndex (); + return next; + }); + } + + public bool HasCustomAttributes (ICustomAttributeProvider owner) + { + InitializeCustomAttributes (); + + Range [] ranges; + if (!metadata.TryGetCustomAttributeRanges (owner, out ranges)) + return false; + + return RangesSize (ranges) > 0; + } + + public Collection ReadCustomAttributes (ICustomAttributeProvider owner) + { + InitializeCustomAttributes (); + + Range [] ranges; + if (!metadata.TryGetCustomAttributeRanges (owner, out ranges)) + return new Collection (); + + var custom_attributes = new Collection (RangesSize (ranges)); + + for (int i = 0; i < ranges.Length; i++) + ReadCustomAttributeRange (ranges [i], custom_attributes); + + metadata.RemoveCustomAttributeRange (owner); + + if (module.IsWindowsMetadata ()) + foreach (var custom_attribute in custom_attributes) + WindowsRuntimeProjections.Project (owner, custom_attribute); + + return custom_attributes; + } + + void ReadCustomAttributeRange (Range range, Collection custom_attributes) + { + if (!MoveTo (Table.CustomAttribute, range.Start)) + return; + + for (var i = 0; i < range.Length; i++) { + ReadMetadataToken (CodedIndex.HasCustomAttribute); + + var constructor = (MethodReference)LookupToken ( + ReadMetadataToken (CodedIndex.CustomAttributeType)); + + var signature = ReadBlobIndex (); + + custom_attributes.Add (new CustomAttribute (signature, constructor)); + } + } + + static int RangesSize (Range [] ranges) + { + uint size = 0; + for (int i = 0; i < ranges.Length; i++) + size += ranges [i].Length; + + return (int)size; + } + + public IEnumerable GetCustomAttributes () + { + InitializeTypeDefinitions (); + + var length = image.TableHeap [Table.CustomAttribute].Length; + var custom_attributes = new Collection ((int)length); + ReadCustomAttributeRange (new Range (1, length), custom_attributes); + + return custom_attributes; + } + + public byte [] ReadCustomAttributeBlob (uint signature) + { + return ReadBlob (signature); + } + + public void ReadCustomAttributeSignature (CustomAttribute attribute) + { + var reader = ReadSignature (attribute.signature); + + if (!reader.CanReadMore ()) + return; + + if (reader.ReadUInt16 () != 0x0001) + throw new InvalidOperationException (); + + var constructor = attribute.Constructor; + if (constructor.HasParameters) + reader.ReadCustomAttributeConstructorArguments (attribute, constructor.Parameters); + + if (!reader.CanReadMore ()) + return; + + var named = reader.ReadUInt16 (); + + if (named == 0) + return; + + reader.ReadCustomAttributeNamedArguments (named, ref attribute.fields, ref attribute.properties); + } + + void InitializeMarshalInfos () + { + if (metadata.FieldMarshals != null) + return; + + var length = MoveTo (Table.FieldMarshal); + + var marshals = metadata.FieldMarshals = new Dictionary (length); + + for (int i = 0; i < length; i++) { + var token = ReadMetadataToken (CodedIndex.HasFieldMarshal); + var signature = ReadBlobIndex (); + if (token.RID == 0) + continue; + + marshals.Add (token, signature); + } + } + + public bool HasMarshalInfo (IMarshalInfoProvider owner) + { + InitializeMarshalInfos (); + + return metadata.FieldMarshals.ContainsKey (owner.MetadataToken); + } + + public MarshalInfo ReadMarshalInfo (IMarshalInfoProvider owner) + { + InitializeMarshalInfos (); + + uint signature; + if (!metadata.FieldMarshals.TryGetValue (owner.MetadataToken, out signature)) + return null; + + var reader = ReadSignature (signature); + + metadata.FieldMarshals.Remove (owner.MetadataToken); + + return reader.ReadMarshalInfo (); + } + + void InitializeSecurityDeclarations () + { + if (metadata.SecurityDeclarations != null) + return; + + metadata.SecurityDeclarations = InitializeRanges ( + Table.DeclSecurity, () => { + ReadUInt16 (); + var next = ReadMetadataToken (CodedIndex.HasDeclSecurity); + ReadBlobIndex (); + return next; + }); + } + + public bool HasSecurityDeclarations (ISecurityDeclarationProvider owner) + { + InitializeSecurityDeclarations (); + + Range [] ranges; + if (!metadata.TryGetSecurityDeclarationRanges (owner, out ranges)) + return false; + + return RangesSize (ranges) > 0; + } + + public Collection ReadSecurityDeclarations (ISecurityDeclarationProvider owner) + { + InitializeSecurityDeclarations (); + + Range [] ranges; + if (!metadata.TryGetSecurityDeclarationRanges (owner, out ranges)) + return new Collection (); + + var security_declarations = new Collection (RangesSize (ranges)); + + for (int i = 0; i < ranges.Length; i++) + ReadSecurityDeclarationRange (ranges [i], security_declarations); + + metadata.RemoveSecurityDeclarationRange (owner); + + return security_declarations; + } + + void ReadSecurityDeclarationRange (Range range, Collection security_declarations) + { + if (!MoveTo (Table.DeclSecurity, range.Start)) + return; + + for (int i = 0; i < range.Length; i++) { + var action = (SecurityAction)ReadUInt16 (); + ReadMetadataToken (CodedIndex.HasDeclSecurity); + var signature = ReadBlobIndex (); + + security_declarations.Add (new SecurityDeclaration (action, signature, module)); + } + } + + public byte [] ReadSecurityDeclarationBlob (uint signature) + { + return ReadBlob (signature); + } + + public void ReadSecurityDeclarationSignature (SecurityDeclaration declaration) + { + var signature = declaration.signature; + var reader = ReadSignature (signature); + + if (reader.buffer [reader.position] != '.') { + ReadXmlSecurityDeclaration (signature, declaration); + return; + } + + reader.position++; + var count = reader.ReadCompressedUInt32 (); + var attributes = new Collection ((int)count); + + for (int i = 0; i < count; i++) + attributes.Add (reader.ReadSecurityAttribute ()); + + declaration.security_attributes = attributes; + } + + void ReadXmlSecurityDeclaration (uint signature, SecurityDeclaration declaration) + { + var attributes = new Collection (1); + + var attribute = new SecurityAttribute ( + module.TypeSystem.LookupType ("System.Security.Permissions", "PermissionSetAttribute")); + + attribute.properties = new Collection (1); + attribute.properties.Add ( + new CustomAttributeNamedArgument ( + "XML", + new CustomAttributeArgument ( + module.TypeSystem.String, + ReadUnicodeStringBlob (signature)))); + + attributes.Add (attribute); + + declaration.security_attributes = attributes; + } + + public Collection ReadExportedTypes () + { + var length = MoveTo (Table.ExportedType); + if (length == 0) + return new Collection (); + + var exported_types = new Collection (length); + + for (int i = 1; i <= length; i++) { + var attributes = (TypeAttributes)ReadUInt32 (); + var identifier = ReadUInt32 (); + var name = ReadString (); + var @namespace = ReadString (); + var implementation = ReadMetadataToken (CodedIndex.Implementation); + + ExportedType declaring_type = null; + IMetadataScope scope = null; + + switch (implementation.TokenType) { + case TokenType.AssemblyRef: + case TokenType.File: + scope = GetExportedTypeScope (implementation); + break; + case TokenType.ExportedType: + // FIXME: if the table is not properly sorted + declaring_type = exported_types [(int)implementation.RID - 1]; + break; + } + + var exported_type = new ExportedType (@namespace, name, module, scope) { + Attributes = attributes, + Identifier = (int)identifier, + DeclaringType = declaring_type, + }; + exported_type.token = new MetadataToken (TokenType.ExportedType, i); + + exported_types.Add (exported_type); + } + + return exported_types; + } + + IMetadataScope GetExportedTypeScope (MetadataToken token) + { + var position = this.position; + IMetadataScope scope; + + switch (token.TokenType) { + case TokenType.AssemblyRef: + InitializeAssemblyReferences (); + scope = metadata.GetAssemblyNameReference (token.RID); + break; + case TokenType.File: + InitializeModuleReferences (); + scope = GetModuleReferenceFromFile (token); + break; + default: + throw new NotSupportedException (); + } + + this.position = position; + return scope; + } + + ModuleReference GetModuleReferenceFromFile (MetadataToken token) + { + if (!MoveTo (Table.File, token.RID)) + return null; + + ReadUInt32 (); + var file_name = ReadString (); + var modules = module.ModuleReferences; + + ModuleReference reference; + for (int i = 0; i < modules.Count; i++) { + reference = modules [i]; + if (reference.Name == file_name) + return reference; + } + + reference = new ModuleReference (file_name); + modules.Add (reference); + return reference; + } + + void InitializeDocuments () + { + if (metadata.Documents != null) + return; + + int length = MoveTo (Table.Document); + + var documents = metadata.Documents = new Document [length]; + + for (uint i = 1; i <= length; i++) { + var name_index = ReadBlobIndex (); + var hash_algorithm = ReadGuid (); + var hash = ReadBlob (); + var language = ReadGuid (); + + var signature = ReadSignature (name_index); + var name = signature.ReadDocumentName (); + + documents [i - 1] = new Document (name) { + HashAlgorithmGuid = hash_algorithm, + Hash = hash, + LanguageGuid = language, + token = new MetadataToken (TokenType.Document, i), + }; + } + } + + public Collection ReadSequencePoints (MethodDefinition method) + { + InitializeDocuments (); + + if (!MoveTo (Table.MethodDebugInformation, method.MetadataToken.RID)) + return new Collection (0); + + var document_index = ReadTableIndex (Table.Document); + var signature = ReadBlobIndex (); + if (signature == 0) + return new Collection (0); + + var document = GetDocument (document_index); + var reader = ReadSignature (signature); + + return reader.ReadSequencePoints (document); + } + + public Document GetDocument (uint rid) + { + var document = metadata.GetDocument (rid); + if (document == null) + return null; + + document.custom_infos = GetCustomDebugInformation (document); + return document; + } + + void InitializeLocalScopes () + { + if (metadata.LocalScopes != null) + return; + + InitializeMethods (); + + int length = MoveTo (Table.LocalScope); + + metadata.LocalScopes = new Dictionary>> (); + + for (uint i = 1; i <= length; i++) { + var method = ReadTableIndex (Table.Method); + var import = ReadTableIndex (Table.ImportScope); + var variables = ReadListRange (i, Table.LocalScope, Table.LocalVariable); + var constants = ReadListRange (i, Table.LocalScope, Table.LocalConstant); + var scope_start = ReadUInt32 (); + var scope_length = ReadUInt32 (); + + metadata.SetLocalScopes (method, AddMapping (metadata.LocalScopes, method, new Row (import, variables, constants, scope_start, scope_length, i))); + } + } + + public ScopeDebugInformation ReadScope (MethodDefinition method) + { + InitializeLocalScopes (); + InitializeImportScopes (); + + Collection> records; + if (!metadata.TryGetLocalScopes (method, out records)) + return null; + + var method_scope = null as ScopeDebugInformation; + + for (int i = 0; i < records.Count; i++) { + var scope = ReadLocalScope (records [i]); + + if (i == 0) { + method_scope = scope; + continue; + } + + if (!AddScope (method_scope.scopes, scope)) + method_scope.Scopes.Add (scope); + } + + return method_scope; + } + + static bool AddScope (Collection scopes, ScopeDebugInformation scope) + { + if (scopes.IsNullOrEmpty ()) + return false; + + foreach (var sub_scope in scopes) { + if (sub_scope.HasScopes && AddScope (sub_scope.Scopes, scope)) + return true; + + if (scope.Start.Offset >= sub_scope.Start.Offset && scope.End.Offset <= sub_scope.End.Offset) { + sub_scope.Scopes.Add (scope); + return true; + } + } + + return false; + } + + ScopeDebugInformation ReadLocalScope (Row record) + { + var scope = new ScopeDebugInformation { + start = new InstructionOffset ((int)record.Col4), + end = new InstructionOffset ((int)(record.Col4 + record.Col5)), + token = new MetadataToken (TokenType.LocalScope, record.Col6), + }; + + if (record.Col1 > 0) + scope.import = metadata.GetImportScope (record.Col1); + + if (record.Col2.Length > 0) { + scope.variables = new Collection ((int)record.Col2.Length); + for (uint i = 0; i < record.Col2.Length; i++) { + var variable = ReadLocalVariable (record.Col2.Start + i); + if (variable != null) + scope.variables.Add (variable); + } + } + + if (record.Col3.Length > 0) { + scope.constants = new Collection ((int)record.Col3.Length); + for (uint i = 0; i < record.Col3.Length; i++) { + var constant = ReadLocalConstant (record.Col3.Start + i); + if (constant != null) + scope.constants.Add (constant); + } + } + + return scope; + } + + VariableDebugInformation ReadLocalVariable (uint rid) + { + if (!MoveTo (Table.LocalVariable, rid)) + return null; + + var attributes = (VariableAttributes)ReadUInt16 (); + var index = ReadUInt16 (); + var name = ReadString (); + + var variable = new VariableDebugInformation (index, name) { Attributes = attributes, token = new MetadataToken (TokenType.LocalVariable, rid) }; + variable.custom_infos = GetCustomDebugInformation (variable); + return variable; + } + + ConstantDebugInformation ReadLocalConstant (uint rid) + { + if (!MoveTo (Table.LocalConstant, rid)) + return null; + + var name = ReadString (); + var signature = ReadSignature (ReadBlobIndex ()); + var type = signature.ReadTypeSignature (); + + object value; + if (type.etype == ElementType.String) { + if (signature.CanReadMore () && signature.buffer [signature.position] != 0xff) { + var bytes = signature.ReadBytes ((int)(signature.sig_length - (signature.position - signature.start))); + value = Encoding.Unicode.GetString (bytes, 0, bytes.Length); + } else + value = null; + } else if (type.IsTypeOf ("System", "Decimal")) { + var b = signature.ReadByte (); + value = new decimal (signature.ReadInt32 (), signature.ReadInt32 (), signature.ReadInt32 (), (b & 0x80) != 0, (byte)(b & 0x7f)); + } else if (type.IsTypeOf ("System", "DateTime")) { + value = new DateTime (signature.ReadInt64 ()); + } else if (type.etype == ElementType.Object || type.etype == ElementType.None || type.etype == ElementType.Class || type.etype == ElementType.Array || type.etype == ElementType.GenericInst) { + value = null; + } else + value = signature.ReadConstantSignature (type.etype); + + var constant = new ConstantDebugInformation (name, type, value) { token = new MetadataToken (TokenType.LocalConstant, rid) }; + constant.custom_infos = GetCustomDebugInformation (constant); + return constant; + } + + void InitializeImportScopes () + { + if (metadata.ImportScopes != null) + return; + + var length = MoveTo (Table.ImportScope); + + metadata.ImportScopes = new ImportDebugInformation [length]; + + for (int i = 1; i <= length; i++) { + ReadTableIndex (Table.ImportScope); + + var import = new ImportDebugInformation (); + import.token = new MetadataToken (TokenType.ImportScope, i); + + var signature = ReadSignature (ReadBlobIndex ()); + while (signature.CanReadMore ()) + import.Targets.Add (ReadImportTarget (signature)); + + metadata.ImportScopes [i - 1] = import; + } + + MoveTo (Table.ImportScope); + + for (int i = 0; i < length; i++) { + var parent = ReadTableIndex (Table.ImportScope); + + ReadBlobIndex (); + + if (parent != 0) + metadata.ImportScopes [i].Parent = metadata.GetImportScope (parent); + } + } + + public string ReadUTF8StringBlob (uint signature) + { + return ReadStringBlob (signature, Encoding.UTF8); + } + + string ReadUnicodeStringBlob (uint signature) + { + return ReadStringBlob (signature, Encoding.Unicode); + } + + string ReadStringBlob (uint signature, Encoding encoding) + { + byte [] blob; + int index, count; + + GetBlobView (signature, out blob, out index, out count); + if (count == 0) + return string.Empty; + + return encoding.GetString (blob, index, count); + } + + ImportTarget ReadImportTarget (SignatureReader signature) + { + AssemblyNameReference reference = null; + string @namespace = null; + string alias = null; + TypeReference type = null; + + var kind = (ImportTargetKind)signature.ReadCompressedUInt32 (); + switch (kind) { + case ImportTargetKind.ImportNamespace: + @namespace = ReadUTF8StringBlob (signature.ReadCompressedUInt32 ()); + break; + case ImportTargetKind.ImportNamespaceInAssembly: + reference = metadata.GetAssemblyNameReference (signature.ReadCompressedUInt32 ()); + @namespace = ReadUTF8StringBlob (signature.ReadCompressedUInt32 ()); + break; + case ImportTargetKind.ImportType: + type = signature.ReadTypeToken (); + break; + case ImportTargetKind.ImportXmlNamespaceWithAlias: + alias = ReadUTF8StringBlob (signature.ReadCompressedUInt32 ()); + @namespace = ReadUTF8StringBlob (signature.ReadCompressedUInt32 ()); + break; + case ImportTargetKind.ImportAlias: + alias = ReadUTF8StringBlob (signature.ReadCompressedUInt32 ()); + break; + case ImportTargetKind.DefineAssemblyAlias: + alias = ReadUTF8StringBlob (signature.ReadCompressedUInt32 ()); + reference = metadata.GetAssemblyNameReference (signature.ReadCompressedUInt32 ()); + break; + case ImportTargetKind.DefineNamespaceAlias: + alias = ReadUTF8StringBlob (signature.ReadCompressedUInt32 ()); + @namespace = ReadUTF8StringBlob (signature.ReadCompressedUInt32 ()); + break; + case ImportTargetKind.DefineNamespaceInAssemblyAlias: + alias = ReadUTF8StringBlob (signature.ReadCompressedUInt32 ()); + reference = metadata.GetAssemblyNameReference (signature.ReadCompressedUInt32 ()); + @namespace = ReadUTF8StringBlob (signature.ReadCompressedUInt32 ()); + break; + case ImportTargetKind.DefineTypeAlias: + alias = ReadUTF8StringBlob (signature.ReadCompressedUInt32 ()); + type = signature.ReadTypeToken (); + break; + } + + return new ImportTarget (kind) { + alias = alias, + type = type, + @namespace = @namespace, + reference = reference, + }; + } + + void InitializeStateMachineMethods () + { + if (metadata.StateMachineMethods != null) + return; + + var length = MoveTo (Table.StateMachineMethod); + + metadata.StateMachineMethods = new Dictionary (length); + + for (int i = 0; i < length; i++) + metadata.StateMachineMethods.Add (ReadTableIndex (Table.Method), ReadTableIndex (Table.Method)); + } + + public MethodDefinition ReadStateMachineKickoffMethod (MethodDefinition method) + { + InitializeStateMachineMethods (); + + uint rid; + if (!metadata.TryGetStateMachineKickOffMethod (method, out rid)) + return null; + + return GetMethodDefinition (rid); + } + + void InitializeCustomDebugInformations () + { + if (metadata.CustomDebugInformations != null) + return; + + var length = MoveTo (Table.CustomDebugInformation); + + metadata.CustomDebugInformations = new Dictionary []> (); + + for (uint i = 1; i <= length; i++) { + var token = ReadMetadataToken (CodedIndex.HasCustomDebugInformation); + var info = new Row (ReadGuid (), ReadBlobIndex (), i); + + Row [] infos; + metadata.CustomDebugInformations.TryGetValue (token, out infos); + metadata.CustomDebugInformations [token] = infos.Add (info); + } + } + + public Collection GetCustomDebugInformation (ICustomDebugInformationProvider provider) + { + InitializeCustomDebugInformations (); + + Row [] rows; + if (!metadata.CustomDebugInformations.TryGetValue (provider.MetadataToken, out rows)) + return null; + + var infos = new Collection (rows.Length); + + for (int i = 0; i < rows.Length; i++) { + if (rows [i].Col1 == StateMachineScopeDebugInformation.KindIdentifier) { + var signature = ReadSignature (rows [i].Col2); + var scopes = new Collection (); + + while (signature.CanReadMore ()) { + var start = signature.ReadInt32 (); + var end = start + signature.ReadInt32 (); + scopes.Add (new StateMachineScope (start, end)); + } + + var state_machine = new StateMachineScopeDebugInformation (); + state_machine.scopes = scopes; + + infos.Add (state_machine); + } else if (rows [i].Col1 == AsyncMethodBodyDebugInformation.KindIdentifier) { + var signature = ReadSignature (rows [i].Col2); + + var catch_offset = signature.ReadInt32 () - 1; + var yields = new Collection (); + var resumes = new Collection (); + var resume_methods = new Collection (); + + while (signature.CanReadMore ()) { + yields.Add (new InstructionOffset (signature.ReadInt32 ())); + resumes.Add (new InstructionOffset (signature.ReadInt32 ())); + resume_methods.Add (GetMethodDefinition (signature.ReadCompressedUInt32 ())); + } + + var async_body = new AsyncMethodBodyDebugInformation (catch_offset); + async_body.yields = yields; + async_body.resumes = resumes; + async_body.resume_methods = resume_methods; + + infos.Add (async_body); + } else if (rows [i].Col1 == EmbeddedSourceDebugInformation.KindIdentifier) { + infos.Add (new EmbeddedSourceDebugInformation (rows [i].Col2, this)); + } else if (rows [i].Col1 == SourceLinkDebugInformation.KindIdentifier) { + infos.Add (new SourceLinkDebugInformation (Encoding.UTF8.GetString (ReadBlob (rows [i].Col2)))); + } else { + infos.Add (new BinaryCustomDebugInformation (rows [i].Col1, ReadBlob (rows [i].Col2))); + } + + infos [i].token = new MetadataToken (TokenType.CustomDebugInformation, rows [i].Col3); + } + + return infos; + } + + public byte [] ReadRawEmbeddedSourceDebugInformation (uint index) + { + var signature = ReadSignature (index); + return signature.ReadBytes ((int)signature.sig_length); + } + + public Row ReadEmbeddedSourceDebugInformation (uint index) + { + var signature = ReadSignature (index); + var format = signature.ReadInt32 (); + var length = signature.sig_length - 4; + + if (format == 0) { + return new Row (signature.ReadBytes ((int)length), false); + } else if (format > 0) { + var compressed_stream = new MemoryStream (signature.ReadBytes ((int)length)); + var decompressed_document = new byte [format]; // if positive, format is the decompressed length of the document + var decompressed_stream = new MemoryStream (decompressed_document); + + using (var deflate_stream = new DeflateStream (compressed_stream, CompressionMode.Decompress, leaveOpen: true)) + deflate_stream.CopyTo (decompressed_stream); + + return new Row (decompressed_document, true); + } else + throw new NotSupportedException (); + } + } + + sealed class SignatureReader : ByteBuffer { + + readonly MetadataReader reader; + readonly internal uint start, sig_length; + + TypeSystem TypeSystem { + get { return reader.module.TypeSystem; } + } + + public SignatureReader (uint blob, MetadataReader reader) + : base (reader.image.BlobHeap.data) + { + this.reader = reader; + this.position = (int)blob; + this.sig_length = ReadCompressedUInt32 (); + this.start = (uint)this.position; + } + + MetadataToken ReadTypeTokenSignature () + { + return CodedIndex.TypeDefOrRef.GetMetadataToken (ReadCompressedUInt32 ()); + } + + GenericParameter GetGenericParameter (GenericParameterType type, uint var) + { + var context = reader.context; + int index = (int)var; + + if (context == null) + return GetUnboundGenericParameter (type, index); + + IGenericParameterProvider provider; + + switch (type) { + case GenericParameterType.Type: + provider = context.Type; + break; + case GenericParameterType.Method: + provider = context.Method; + break; + default: + throw new NotSupportedException (); + } + + if (!context.IsDefinition) + CheckGenericContext (provider, index); + + if (index >= provider.GenericParameters.Count) + return GetUnboundGenericParameter (type, index); + + return provider.GenericParameters [index]; + } + + GenericParameter GetUnboundGenericParameter (GenericParameterType type, int index) + { + return new GenericParameter (index, type, reader.module); + } + + static void CheckGenericContext (IGenericParameterProvider owner, int index) + { + var owner_parameters = owner.GenericParameters; + + for (int i = owner_parameters.Count; i <= index; i++) + owner_parameters.Add (new GenericParameter (owner)); + } + + public void ReadGenericInstanceSignature (IGenericParameterProvider provider, IGenericInstance instance, uint arity) + { + if (!provider.IsDefinition) + CheckGenericContext (provider, (int)arity - 1); + + var instance_arguments = instance.GenericArguments; + + for (int i = 0; i < arity; i++) + instance_arguments.Add (ReadTypeSignature ()); + } + + ArrayType ReadArrayTypeSignature () + { + var array = new ArrayType (ReadTypeSignature ()); + + var rank = ReadCompressedUInt32 (); + + var sizes = new uint [ReadCompressedUInt32 ()]; + for (int i = 0; i < sizes.Length; i++) + sizes [i] = ReadCompressedUInt32 (); + + var low_bounds = new int [ReadCompressedUInt32 ()]; + for (int i = 0; i < low_bounds.Length; i++) + low_bounds [i] = ReadCompressedInt32 (); + + array.Dimensions.Clear (); + + for (int i = 0; i < rank; i++) { + int? lower = null, upper = null; + + if (i < low_bounds.Length) + lower = low_bounds [i]; + + if (i < sizes.Length) + upper = lower + (int)sizes [i] - 1; + + array.Dimensions.Add (new ArrayDimension (lower, upper)); + } + + return array; + } + + TypeReference GetTypeDefOrRef (MetadataToken token) + { + return reader.GetTypeDefOrRef (token); + } + + public TypeReference ReadTypeSignature () + { + return ReadTypeSignature ((ElementType)ReadByte ()); + } + + public TypeReference ReadTypeToken () + { + return GetTypeDefOrRef (ReadTypeTokenSignature ()); + } + + TypeReference ReadTypeSignature (ElementType etype) + { + switch (etype) { + case ElementType.ValueType: { + var value_type = GetTypeDefOrRef (ReadTypeTokenSignature ()); + value_type.KnownValueType (); + return value_type; + } + case ElementType.Class: + return GetTypeDefOrRef (ReadTypeTokenSignature ()); + case ElementType.Ptr: + return new PointerType (ReadTypeSignature ()); + case ElementType.FnPtr: { + var fptr = new FunctionPointerType (); + ReadMethodSignature (fptr); + return fptr; + } + case ElementType.ByRef: + return new ByReferenceType (ReadTypeSignature ()); + case ElementType.Pinned: + return new PinnedType (ReadTypeSignature ()); + case ElementType.SzArray: + return new ArrayType (ReadTypeSignature ()); + case ElementType.Array: + return ReadArrayTypeSignature (); + case ElementType.CModOpt: + return new OptionalModifierType ( + GetTypeDefOrRef (ReadTypeTokenSignature ()), ReadTypeSignature ()); + case ElementType.CModReqD: + return new RequiredModifierType ( + GetTypeDefOrRef (ReadTypeTokenSignature ()), ReadTypeSignature ()); + case ElementType.Sentinel: + return new SentinelType (ReadTypeSignature ()); + case ElementType.Var: + return GetGenericParameter (GenericParameterType.Type, ReadCompressedUInt32 ()); + case ElementType.MVar: + return GetGenericParameter (GenericParameterType.Method, ReadCompressedUInt32 ()); + case ElementType.GenericInst: { + var is_value_type = ReadByte () == (byte)ElementType.ValueType; + var element_type = GetTypeDefOrRef (ReadTypeTokenSignature ()); + + var arity = ReadCompressedUInt32 (); + var generic_instance = new GenericInstanceType (element_type, (int)arity); + + ReadGenericInstanceSignature (element_type, generic_instance, arity); + + if (is_value_type) { + generic_instance.KnownValueType (); + element_type.GetElementType ().KnownValueType (); + } + + return generic_instance; + } + case ElementType.Object: return TypeSystem.Object; + case ElementType.Void: return TypeSystem.Void; + case ElementType.TypedByRef: return TypeSystem.TypedReference; + case ElementType.I: return TypeSystem.IntPtr; + case ElementType.U: return TypeSystem.UIntPtr; + default: return GetPrimitiveType (etype); + } + } + + public void ReadMethodSignature (IMethodSignature method) + { + var calling_convention = ReadByte (); + + const byte has_this = 0x20; + const byte explicit_this = 0x40; + + if ((calling_convention & has_this) != 0) { + method.HasThis = true; + calling_convention = (byte)(calling_convention & ~has_this); + } + + if ((calling_convention & explicit_this) != 0) { + method.ExplicitThis = true; + calling_convention = (byte)(calling_convention & ~explicit_this); + } + + method.CallingConvention = (MethodCallingConvention)calling_convention; + + var generic_context = method as MethodReference; + if (generic_context != null && !generic_context.DeclaringType.IsArray) + reader.context = generic_context; + + if ((calling_convention & 0x10) != 0) { + var arity = ReadCompressedUInt32 (); + + if (generic_context != null && !generic_context.IsDefinition) + CheckGenericContext (generic_context, (int)arity - 1); + } + + var param_count = ReadCompressedUInt32 (); + + method.MethodReturnType.ReturnType = ReadTypeSignature (); + + if (param_count == 0) + return; + + Collection parameters; + + var method_ref = method as MethodReference; + if (method_ref != null) + parameters = method_ref.parameters = new ParameterDefinitionCollection (method, (int)param_count); + else + parameters = method.Parameters; + + for (int i = 0; i < param_count; i++) + parameters.Add (new ParameterDefinition (ReadTypeSignature ())); + } + + public object ReadConstantSignature (ElementType type) + { + return ReadPrimitiveValue (type); + } + + public void ReadCustomAttributeConstructorArguments (CustomAttribute attribute, Collection parameters) + { + var count = parameters.Count; + if (count == 0) + return; + + attribute.arguments = new Collection (count); + + for (int i = 0; i < count; i++) + attribute.arguments.Add ( + ReadCustomAttributeFixedArgument (parameters [i].ParameterType)); + } + + CustomAttributeArgument ReadCustomAttributeFixedArgument (TypeReference type) + { + if (type.IsArray) + return ReadCustomAttributeFixedArrayArgument ((ArrayType)type); + + return ReadCustomAttributeElement (type); + } + + public void ReadCustomAttributeNamedArguments (ushort count, ref Collection fields, ref Collection properties) + { + for (int i = 0; i < count; i++) { + if (!CanReadMore ()) + return; + ReadCustomAttributeNamedArgument (ref fields, ref properties); + } + } + + void ReadCustomAttributeNamedArgument (ref Collection fields, ref Collection properties) + { + var kind = ReadByte (); + var type = ReadCustomAttributeFieldOrPropType (); + var name = ReadUTF8String (); + + Collection container; + switch (kind) { + case 0x53: + container = GetCustomAttributeNamedArgumentCollection (ref fields); + break; + case 0x54: + container = GetCustomAttributeNamedArgumentCollection (ref properties); + break; + default: + throw new NotSupportedException (); + } + + container.Add (new CustomAttributeNamedArgument (name, ReadCustomAttributeFixedArgument (type))); + } + + static Collection GetCustomAttributeNamedArgumentCollection (ref Collection collection) + { + if (collection != null) + return collection; + + return collection = new Collection (); + } + + CustomAttributeArgument ReadCustomAttributeFixedArrayArgument (ArrayType type) + { + var length = ReadUInt32 (); + + if (length == 0xffffffff) + return new CustomAttributeArgument (type, null); + + if (length == 0) + return new CustomAttributeArgument (type, Empty.Array); + + var arguments = new CustomAttributeArgument [length]; + var element_type = type.ElementType; + + for (int i = 0; i < length; i++) + arguments [i] = ReadCustomAttributeElement (element_type); + + return new CustomAttributeArgument (type, arguments); + } + + CustomAttributeArgument ReadCustomAttributeElement (TypeReference type) + { + if (type.IsArray) + return ReadCustomAttributeFixedArrayArgument ((ArrayType)type); + + return new CustomAttributeArgument ( + type, + type.etype == ElementType.Object + ? ReadCustomAttributeElement (ReadCustomAttributeFieldOrPropType ()) + : ReadCustomAttributeElementValue (type)); + } + + object ReadCustomAttributeElementValue (TypeReference type) + { + var etype = type.etype; + + switch (etype) { + case ElementType.String: + return ReadUTF8String (); + case ElementType.None: + if (type.IsTypeOf ("System", "Type")) + return ReadTypeReference (); + + return ReadCustomAttributeEnum (type); + default: + return ReadPrimitiveValue (etype); + } + } + + object ReadPrimitiveValue (ElementType type) + { + switch (type) { + case ElementType.Boolean: + return ReadByte () == 1; + case ElementType.I1: + return (sbyte)ReadByte (); + case ElementType.U1: + return ReadByte (); + case ElementType.Char: + return (char)ReadUInt16 (); + case ElementType.I2: + return ReadInt16 (); + case ElementType.U2: + return ReadUInt16 (); + case ElementType.I4: + return ReadInt32 (); + case ElementType.U4: + return ReadUInt32 (); + case ElementType.I8: + return ReadInt64 (); + case ElementType.U8: + return ReadUInt64 (); + case ElementType.R4: + return ReadSingle (); + case ElementType.R8: + return ReadDouble (); + default: + throw new NotImplementedException (type.ToString ()); + } + } + + TypeReference GetPrimitiveType (ElementType etype) + { + switch (etype) { + case ElementType.Boolean: + return TypeSystem.Boolean; + case ElementType.Char: + return TypeSystem.Char; + case ElementType.I1: + return TypeSystem.SByte; + case ElementType.U1: + return TypeSystem.Byte; + case ElementType.I2: + return TypeSystem.Int16; + case ElementType.U2: + return TypeSystem.UInt16; + case ElementType.I4: + return TypeSystem.Int32; + case ElementType.U4: + return TypeSystem.UInt32; + case ElementType.I8: + return TypeSystem.Int64; + case ElementType.U8: + return TypeSystem.UInt64; + case ElementType.R4: + return TypeSystem.Single; + case ElementType.R8: + return TypeSystem.Double; + case ElementType.String: + return TypeSystem.String; + default: + throw new NotImplementedException (etype.ToString ()); + } + } + + TypeReference ReadCustomAttributeFieldOrPropType () + { + var etype = (ElementType)ReadByte (); + + switch (etype) { + case ElementType.Boxed: + return TypeSystem.Object; + case ElementType.SzArray: + return new ArrayType (ReadCustomAttributeFieldOrPropType ()); + case ElementType.Enum: + return ReadTypeReference (); + case ElementType.Type: + return TypeSystem.LookupType ("System", "Type"); + default: + return GetPrimitiveType (etype); + } + } + + public TypeReference ReadTypeReference () + { + return TypeParser.ParseType (reader.module, ReadUTF8String ()); + } + + object ReadCustomAttributeEnum (TypeReference enum_type) + { + var type = enum_type.CheckedResolve (); + if (!type.IsEnum) + throw new ArgumentException (); + + return ReadCustomAttributeElementValue (type.GetEnumUnderlyingType ()); + } + + public SecurityAttribute ReadSecurityAttribute () + { + var attribute = new SecurityAttribute (ReadTypeReference ()); + + ReadCompressedUInt32 (); + + ReadCustomAttributeNamedArguments ( + (ushort)ReadCompressedUInt32 (), + ref attribute.fields, + ref attribute.properties); + + return attribute; + } + + public MarshalInfo ReadMarshalInfo () + { + var native = ReadNativeType (); + switch (native) { + case NativeType.Array: { + var array = new ArrayMarshalInfo (); + if (CanReadMore ()) + array.element_type = ReadNativeType (); + if (CanReadMore ()) + array.size_parameter_index = (int)ReadCompressedUInt32 (); + if (CanReadMore ()) + array.size = (int)ReadCompressedUInt32 (); + if (CanReadMore ()) + array.size_parameter_multiplier = (int)ReadCompressedUInt32 (); + return array; + } + case NativeType.SafeArray: { + var array = new SafeArrayMarshalInfo (); + if (CanReadMore ()) + array.element_type = ReadVariantType (); + return array; + } + case NativeType.FixedArray: { + var array = new FixedArrayMarshalInfo (); + if (CanReadMore ()) + array.size = (int)ReadCompressedUInt32 (); + if (CanReadMore ()) + array.element_type = ReadNativeType (); + return array; + } + case NativeType.FixedSysString: { + var sys_string = new FixedSysStringMarshalInfo (); + if (CanReadMore ()) + sys_string.size = (int)ReadCompressedUInt32 (); + return sys_string; + } + case NativeType.CustomMarshaler: { + var marshaler = new CustomMarshalInfo (); + var guid_value = ReadUTF8String (); + marshaler.guid = !string.IsNullOrEmpty (guid_value) ? new Guid (guid_value) : Guid.Empty; + marshaler.unmanaged_type = ReadUTF8String (); + marshaler.managed_type = ReadTypeReference (); + marshaler.cookie = ReadUTF8String (); + return marshaler; + } + default: + return new MarshalInfo (native); + } + } + + NativeType ReadNativeType () + { + return (NativeType)ReadByte (); + } + + VariantType ReadVariantType () + { + return (VariantType)ReadByte (); + } + + string ReadUTF8String () + { + if (buffer [position] == 0xff) { + position++; + return null; + } + + var length = (int)ReadCompressedUInt32 (); + if (length == 0) + return string.Empty; + + if (position + length > buffer.Length) + return string.Empty; + + var @string = Encoding.UTF8.GetString (buffer, position, length); + + position += length; + return @string; + } + + public string ReadDocumentName () + { + var separator = (char)buffer [position]; + position++; + + var builder = new StringBuilder (); + for (int i = 0; CanReadMore (); i++) { + if (i > 0 && separator != 0) + builder.Append (separator); + + uint part = ReadCompressedUInt32 (); + if (part != 0) + builder.Append (reader.ReadUTF8StringBlob (part)); + } + + return builder.ToString (); + } + + public Collection ReadSequencePoints (Document document) + { + ReadCompressedUInt32 (); // local_sig_token + + if (document == null) + document = reader.GetDocument (ReadCompressedUInt32 ()); + + var offset = 0; + var start_line = 0; + var start_column = 0; + var first_non_hidden = true; + + //there's about 5 compressed int32's per sequenec points. we don't know exactly how many + //but let's take a conservative guess so we dont end up reallocating the sequence_points collection + //as it grows. + var bytes_remaining_for_sequencepoints = sig_length - (position - start); + var estimated_sequencepoint_amount = (int)bytes_remaining_for_sequencepoints / 5; + var sequence_points = new Collection (estimated_sequencepoint_amount); + + for (var i = 0; CanReadMore (); i++) { + var delta_il = (int)ReadCompressedUInt32 (); + if (i > 0 && delta_il == 0) { + document = reader.GetDocument (ReadCompressedUInt32 ()); + continue; + } + + offset += delta_il; + + var delta_lines = (int)ReadCompressedUInt32 (); + var delta_columns = delta_lines == 0 + ? (int)ReadCompressedUInt32 () + : ReadCompressedInt32 (); + + if (delta_lines == 0 && delta_columns == 0) { + sequence_points.Add (new SequencePoint (offset, document) { + StartLine = 0xfeefee, + EndLine = 0xfeefee, + StartColumn = 0, + EndColumn = 0, + }); + continue; + } + + if (first_non_hidden) { + start_line = (int)ReadCompressedUInt32 (); + start_column = (int)ReadCompressedUInt32 (); + } else { + start_line += ReadCompressedInt32 (); + start_column += ReadCompressedInt32 (); + } + + sequence_points.Add (new SequencePoint (offset, document) { + StartLine = start_line, + StartColumn = start_column, + EndLine = start_line + delta_lines, + EndColumn = start_column + delta_columns, + }); + first_non_hidden = false; + } + + return sequence_points; + } + + public bool CanReadMore () + { + return (position - start) < sig_length; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyReader.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyReader.cs.meta new file mode 100644 index 0000000..810883e --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyReader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d8fb74d16029713429e831cb3b5b0861 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyWriter.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyWriter.cs new file mode 100644 index 0000000..5d74689 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyWriter.cs @@ -0,0 +1,3336 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Metadata; +using MonoFN.Cecil.PE; +using MonoFN.Collections.Generic; +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Text; +using BlobIndex = System.UInt32; +using CodedRID = System.UInt32; +using GuidIndex = System.UInt32; +using RID = System.UInt32; +using RVA = System.UInt32; +using StringIndex = System.UInt32; + +namespace MonoFN.Cecil { + + using AssemblyRefRow = Row; + using AssemblyRow = Row; + using ClassLayoutRow = Row; + using ConstantRow = Row; + using CustomAttributeRow = Row; + using CustomDebugInformationRow = Row; + using DeclSecurityRow = Row; + using DocumentRow = Row; + using EventMapRow = Row; + using EventRow = Row; + using ExportedTypeRow = Row; + using FieldLayoutRow = Row; + using FieldMarshalRow = Row; + using FieldRow = Row; + using FieldRVARow = Row; + using FileRow = Row; + using GenericParamConstraintRow = Row; + using GenericParamRow = Row; + using ImplMapRow = Row; + using ImportScopeRow = Row; + using InterfaceImplRow = Row; + using LocalConstantRow = Row; + using LocalScopeRow = Row; + using LocalVariableRow = Row; + using ManifestResourceRow = Row; + using MemberRefRow = Row; + using MethodDebugInformationRow = Row; + using MethodImplRow = Row; + using MethodRow = Row; + using MethodSemanticsRow = Row; + using MethodSpecRow = Row; + using ModuleRow = Row; + using NestedClassRow = Row; + using ParamRow = Row; + using PropertyMapRow = Row; + using PropertyRow = Row; + using StateMachineMethodRow = Row; + using TypeDefRow = Row; + using TypeRefRow = Row; + + static class ModuleWriter { + + public static void WriteModule (ModuleDefinition module, Disposable stream, WriterParameters parameters) + { + using (stream) + Write (module, stream, parameters); + } + + static void Write (ModuleDefinition module, Disposable stream, WriterParameters parameters) + { + if ((module.Attributes & ModuleAttributes.ILOnly) == 0) + throw new NotSupportedException ("Writing mixed-mode assemblies is not supported"); + + if (module.HasImage && module.ReadingMode == ReadingMode.Deferred) { + var immediate_reader = new ImmediateModuleReader (module.Image); + immediate_reader.ReadModule (module, resolve_attributes: false); + immediate_reader.ReadSymbols (module); + } + + module.MetadataSystem.Clear (); + + if (module.symbol_reader != null) + module.symbol_reader.Dispose (); + + var name = module.assembly != null && module.kind != ModuleKind.NetModule ? module.assembly.Name : null; + var fq_name = stream.value.GetFileName (); + var timestamp = parameters.Timestamp ?? module.timestamp; + var symbol_writer_provider = parameters.SymbolWriterProvider; + + if (symbol_writer_provider == null && parameters.WriteSymbols) + symbol_writer_provider = new DefaultSymbolWriterProvider (); + + if (parameters.HasStrongNameKey && name != null) { + name.PublicKey = CryptoService.GetPublicKey (parameters); + module.Attributes |= ModuleAttributes.StrongNameSigned; + } + + if (parameters.DeterministicMvid) + module.Mvid = Guid.Empty; + + var metadata = new MetadataBuilder (module, fq_name, timestamp, symbol_writer_provider); + try { + module.metadata_builder = metadata; + + using (var symbol_writer = GetSymbolWriter (module, fq_name, symbol_writer_provider, parameters)) { + metadata.SetSymbolWriter (symbol_writer); + BuildMetadata (module, metadata); + + if (parameters.DeterministicMvid) + metadata.ComputeDeterministicMvid (); + + var writer = ImageWriter.CreateWriter (module, metadata, stream); + stream.value.SetLength (0); + writer.WriteImage (); + + if (parameters.HasStrongNameKey) + CryptoService.StrongName (stream.value, writer, parameters); + } + } + finally { + module.metadata_builder = null; + } + } + + static void BuildMetadata (ModuleDefinition module, MetadataBuilder metadata) + { + if (!module.HasImage) { + metadata.BuildMetadata (); + return; + } + + module.Read (metadata, (builder, _) => { + builder.BuildMetadata (); + return builder; + }); + } + + static ISymbolWriter GetSymbolWriter (ModuleDefinition module, string fq_name, ISymbolWriterProvider symbol_writer_provider, WriterParameters parameters) + { + if (symbol_writer_provider == null) + return null; + + if (parameters.SymbolStream != null) + return symbol_writer_provider.GetSymbolWriter (module, parameters.SymbolStream); + + return symbol_writer_provider.GetSymbolWriter (module, fq_name); + } + } + + abstract class MetadataTable { + + public abstract int Length { get; } + + public bool IsLarge { + get { return Length > ushort.MaxValue; } + } + + public abstract void Write (TableHeapBuffer buffer); + public abstract void Sort (); + } + + abstract class OneRowTable : MetadataTable where TRow : struct { + + internal TRow row; + + public sealed override int Length { + get { return 1; } + } + + public sealed override void Sort () + { + } + } + + abstract class MetadataTable : MetadataTable where TRow : struct { + + internal TRow [] rows = new TRow [2]; + internal int length; + + public sealed override int Length { + get { return length; } + } + + public int AddRow (TRow row) + { + if (rows.Length == length) + Grow (); + + rows [length++] = row; + return length; + } + + void Grow () + { + var rows = new TRow [this.rows.Length * 2]; + Array.Copy (this.rows, rows, this.rows.Length); + this.rows = rows; + } + + public override void Sort () + { + } + } + + abstract class SortedTable : MetadataTable, IComparer where TRow : struct { + + public sealed override void Sort () + { + MergeSort.Sort (rows, 0, this.length, this); + } + + protected static int Compare (uint x, uint y) + { + return x == y ? 0 : x > y ? 1 : -1; + } + + public abstract int Compare (TRow x, TRow y); + } + + sealed class ModuleTable : OneRowTable { + + public override void Write (TableHeapBuffer buffer) + { + buffer.WriteUInt16 (0); // Generation + buffer.WriteString (row.Col1); // Name + buffer.WriteGuid (row.Col2); // Mvid + buffer.WriteUInt16 (0); // EncId + buffer.WriteUInt16 (0); // EncBaseId + } + } + + sealed class TypeRefTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteCodedRID ( + rows [i].Col1, CodedIndex.ResolutionScope); // Scope + buffer.WriteString (rows [i].Col2); // Name + buffer.WriteString (rows [i].Col3); // Namespace + } + } + } + + sealed class TypeDefTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt32 ((uint)rows [i].Col1); // Attributes + buffer.WriteString (rows [i].Col2); // Name + buffer.WriteString (rows [i].Col3); // Namespace + buffer.WriteCodedRID ( + rows [i].Col4, CodedIndex.TypeDefOrRef); // Extends + buffer.WriteRID (rows [i].Col5, Table.Field); // FieldList + buffer.WriteRID (rows [i].Col6, Table.Method); // MethodList + } + } + } + + sealed class FieldTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 ((ushort)rows [i].Col1); // Attributes + buffer.WriteString (rows [i].Col2); // Name + buffer.WriteBlob (rows [i].Col3); // Signature + } + } + } + + sealed class MethodTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt32 (rows [i].Col1); // RVA + buffer.WriteUInt16 ((ushort)rows [i].Col2); // ImplFlags + buffer.WriteUInt16 ((ushort)rows [i].Col3); // Flags + buffer.WriteString (rows [i].Col4); // Name + buffer.WriteBlob (rows [i].Col5); // Signature + buffer.WriteRID (rows [i].Col6, Table.Param); // ParamList + } + } + } + + sealed class ParamTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 ((ushort)rows [i].Col1); // Attributes + buffer.WriteUInt16 (rows [i].Col2); // Sequence + buffer.WriteString (rows [i].Col3); // Name + } + } + } + + sealed class InterfaceImplTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteRID (rows [i].Col1, Table.TypeDef); // Class + buffer.WriteCodedRID (rows [i].Col2, CodedIndex.TypeDefOrRef); // Interface + } + } + + /*public override int Compare (InterfaceImplRow x, InterfaceImplRow y) + { + return (int) (x.Col1 == y.Col1 ? y.Col2 - x.Col2 : x.Col1 - y.Col1); + }*/ + } + + sealed class MemberRefTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteCodedRID (rows [i].Col1, CodedIndex.MemberRefParent); + buffer.WriteString (rows [i].Col2); + buffer.WriteBlob (rows [i].Col3); + } + } + } + + sealed class ConstantTable : SortedTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 ((ushort)rows [i].Col1); + buffer.WriteCodedRID (rows [i].Col2, CodedIndex.HasConstant); + buffer.WriteBlob (rows [i].Col3); + } + } + + public override int Compare (ConstantRow x, ConstantRow y) + { + return Compare (x.Col2, y.Col2); + } + } + + sealed class CustomAttributeTable : SortedTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteCodedRID (rows [i].Col1, CodedIndex.HasCustomAttribute); // Parent + buffer.WriteCodedRID (rows [i].Col2, CodedIndex.CustomAttributeType); // Type + buffer.WriteBlob (rows [i].Col3); + } + } + + public override int Compare (CustomAttributeRow x, CustomAttributeRow y) + { + return Compare (x.Col1, y.Col1); + } + } + + sealed class FieldMarshalTable : SortedTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteCodedRID (rows [i].Col1, CodedIndex.HasFieldMarshal); + buffer.WriteBlob (rows [i].Col2); + } + } + + public override int Compare (FieldMarshalRow x, FieldMarshalRow y) + { + return Compare (x.Col1, y.Col1); + } + } + + sealed class DeclSecurityTable : SortedTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 ((ushort)rows [i].Col1); + buffer.WriteCodedRID (rows [i].Col2, CodedIndex.HasDeclSecurity); + buffer.WriteBlob (rows [i].Col3); + } + } + + public override int Compare (DeclSecurityRow x, DeclSecurityRow y) + { + return Compare (x.Col2, y.Col2); + } + } + + sealed class ClassLayoutTable : SortedTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 (rows [i].Col1); // PackingSize + buffer.WriteUInt32 (rows [i].Col2); // ClassSize + buffer.WriteRID (rows [i].Col3, Table.TypeDef); // Parent + } + } + + public override int Compare (ClassLayoutRow x, ClassLayoutRow y) + { + return Compare (x.Col3, y.Col3); + } + } + + sealed class FieldLayoutTable : SortedTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt32 (rows [i].Col1); // Offset + buffer.WriteRID (rows [i].Col2, Table.Field); // Parent + } + } + + public override int Compare (FieldLayoutRow x, FieldLayoutRow y) + { + return Compare (x.Col2, y.Col2); + } + } + + sealed class StandAloneSigTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) + buffer.WriteBlob (rows [i]); + } + } + + sealed class EventMapTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteRID (rows [i].Col1, Table.TypeDef); // Parent + buffer.WriteRID (rows [i].Col2, Table.Event); // EventList + } + } + } + + sealed class EventTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 ((ushort)rows [i].Col1); // Flags + buffer.WriteString (rows [i].Col2); // Name + buffer.WriteCodedRID (rows [i].Col3, CodedIndex.TypeDefOrRef); // EventType + } + } + } + + sealed class PropertyMapTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteRID (rows [i].Col1, Table.TypeDef); // Parent + buffer.WriteRID (rows [i].Col2, Table.Property); // PropertyList + } + } + } + + sealed class PropertyTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 ((ushort)rows [i].Col1); // Flags + buffer.WriteString (rows [i].Col2); // Name + buffer.WriteBlob (rows [i].Col3); // Type + } + } + } + + sealed class MethodSemanticsTable : SortedTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 ((ushort)rows [i].Col1); // Flags + buffer.WriteRID (rows [i].Col2, Table.Method); // Method + buffer.WriteCodedRID (rows [i].Col3, CodedIndex.HasSemantics); // Association + } + } + + public override int Compare (MethodSemanticsRow x, MethodSemanticsRow y) + { + return Compare (x.Col3, y.Col3); + } + } + + sealed class MethodImplTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteRID (rows [i].Col1, Table.TypeDef); // Class + buffer.WriteCodedRID (rows [i].Col2, CodedIndex.MethodDefOrRef); // MethodBody + buffer.WriteCodedRID (rows [i].Col3, CodedIndex.MethodDefOrRef); // MethodDeclaration + } + } + } + + sealed class ModuleRefTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) + buffer.WriteString (rows [i]); // Name + } + } + + sealed class TypeSpecTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) + buffer.WriteBlob (rows [i]); // Signature + } + } + + sealed class ImplMapTable : SortedTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 ((ushort)rows [i].Col1); // Flags + buffer.WriteCodedRID (rows [i].Col2, CodedIndex.MemberForwarded); // MemberForwarded + buffer.WriteString (rows [i].Col3); // ImportName + buffer.WriteRID (rows [i].Col4, Table.ModuleRef); // ImportScope + } + } + + public override int Compare (ImplMapRow x, ImplMapRow y) + { + return Compare (x.Col2, y.Col2); + } + } + + sealed class FieldRVATable : SortedTable { + + internal int position; + + public override void Write (TableHeapBuffer buffer) + { + position = buffer.position; + for (int i = 0; i < length; i++) { + buffer.WriteUInt32 (rows [i].Col1); // RVA + buffer.WriteRID (rows [i].Col2, Table.Field); // Field + } + } + + public override int Compare (FieldRVARow x, FieldRVARow y) + { + return Compare (x.Col2, y.Col2); + } + } + + sealed class AssemblyTable : OneRowTable { + + public override void Write (TableHeapBuffer buffer) + { + buffer.WriteUInt32 ((uint)row.Col1); // AssemblyHashAlgorithm + buffer.WriteUInt16 (row.Col2); // MajorVersion + buffer.WriteUInt16 (row.Col3); // MinorVersion + buffer.WriteUInt16 (row.Col4); // Build + buffer.WriteUInt16 (row.Col5); // Revision + buffer.WriteUInt32 ((uint)row.Col6); // Flags + buffer.WriteBlob (row.Col7); // PublicKey + buffer.WriteString (row.Col8); // Name + buffer.WriteString (row.Col9); // Culture + } + } + + sealed class AssemblyRefTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 (rows [i].Col1); // MajorVersion + buffer.WriteUInt16 (rows [i].Col2); // MinorVersion + buffer.WriteUInt16 (rows [i].Col3); // Build + buffer.WriteUInt16 (rows [i].Col4); // Revision + buffer.WriteUInt32 ((uint)rows [i].Col5); // Flags + buffer.WriteBlob (rows [i].Col6); // PublicKeyOrToken + buffer.WriteString (rows [i].Col7); // Name + buffer.WriteString (rows [i].Col8); // Culture + buffer.WriteBlob (rows [i].Col9); // Hash + } + } + } + + sealed class FileTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt32 ((uint)rows [i].Col1); + buffer.WriteString (rows [i].Col2); + buffer.WriteBlob (rows [i].Col3); + } + } + } + + sealed class ExportedTypeTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt32 ((uint)rows [i].Col1); + buffer.WriteUInt32 (rows [i].Col2); + buffer.WriteString (rows [i].Col3); + buffer.WriteString (rows [i].Col4); + buffer.WriteCodedRID (rows [i].Col5, CodedIndex.Implementation); + } + } + } + + sealed class ManifestResourceTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt32 (rows [i].Col1); + buffer.WriteUInt32 ((uint)rows [i].Col2); + buffer.WriteString (rows [i].Col3); + buffer.WriteCodedRID (rows [i].Col4, CodedIndex.Implementation); + } + } + } + + sealed class NestedClassTable : SortedTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteRID (rows [i].Col1, Table.TypeDef); // NestedClass + buffer.WriteRID (rows [i].Col2, Table.TypeDef); // EnclosingClass + } + } + + public override int Compare (NestedClassRow x, NestedClassRow y) + { + return Compare (x.Col1, y.Col1); + } + } + + sealed class GenericParamTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 (rows [i].Col1); // Number + buffer.WriteUInt16 ((ushort)rows [i].Col2); // Flags + buffer.WriteCodedRID (rows [i].Col3, CodedIndex.TypeOrMethodDef); // Owner + buffer.WriteString (rows [i].Col4); // Name + } + } + } + + sealed class MethodSpecTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteCodedRID (rows [i].Col1, CodedIndex.MethodDefOrRef); // Method + buffer.WriteBlob (rows [i].Col2); // Instantiation + } + } + } + + sealed class GenericParamConstraintTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteRID (rows [i].Col1, Table.GenericParam); // Owner + buffer.WriteCodedRID (rows [i].Col2, CodedIndex.TypeDefOrRef); // Constraint + } + } + } + + sealed class DocumentTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteBlob (rows [i].Col1); // Name + buffer.WriteGuid (rows [i].Col2); // HashAlgorithm + buffer.WriteBlob (rows [i].Col3); // Hash + buffer.WriteGuid (rows [i].Col4); // Language + } + } + } + + sealed class MethodDebugInformationTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteRID (rows [i].Col1, Table.Document); // Document + buffer.WriteBlob (rows [i].Col2); // SequencePoints + } + } + } + + sealed class LocalScopeTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteRID (rows [i].Col1, Table.Method); // Method + buffer.WriteRID (rows [i].Col2, Table.ImportScope); // ImportScope + buffer.WriteRID (rows [i].Col3, Table.LocalVariable); // VariableList + buffer.WriteRID (rows [i].Col4, Table.LocalConstant); // ConstantList + buffer.WriteUInt32 (rows [i].Col5); // StartOffset + buffer.WriteUInt32 (rows [i].Col6); // Length + } + } + } + + sealed class LocalVariableTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteUInt16 ((ushort)rows [i].Col1); // Attributes + buffer.WriteUInt16 (rows [i].Col2); // Index + buffer.WriteString (rows [i].Col3); // Name + } + } + } + + sealed class LocalConstantTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteString (rows [i].Col1); // Name + buffer.WriteBlob (rows [i].Col2); // Signature + } + } + } + + sealed class ImportScopeTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteRID (rows [i].Col1, Table.ImportScope); // Parent + buffer.WriteBlob (rows [i].Col2); // Imports + } + } + } + + sealed class StateMachineMethodTable : MetadataTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteRID (rows [i].Col1, Table.Method); // MoveNextMethod + buffer.WriteRID (rows [i].Col2, Table.Method); // KickoffMethod + } + } + } + + sealed class CustomDebugInformationTable : SortedTable { + + public override void Write (TableHeapBuffer buffer) + { + for (int i = 0; i < length; i++) { + buffer.WriteCodedRID (rows [i].Col1, CodedIndex.HasCustomDebugInformation); // Parent + buffer.WriteGuid (rows [i].Col2); // Kind + buffer.WriteBlob (rows [i].Col3); // Value + } + } + + public override int Compare (CustomDebugInformationRow x, CustomDebugInformationRow y) + { + return Compare (x.Col1, y.Col1); + } + } + + sealed class MetadataBuilder { + + readonly internal ModuleDefinition module; + readonly internal ISymbolWriterProvider symbol_writer_provider; + internal ISymbolWriter symbol_writer; + readonly internal TextMap text_map; + readonly internal string fq_name; + readonly internal uint timestamp; + + readonly Dictionary type_ref_map; + readonly Dictionary type_spec_map; + readonly Dictionary member_ref_map; + readonly Dictionary method_spec_map; + readonly Collection generic_parameters; + + readonly internal CodeWriter code; + readonly internal DataBuffer data; + readonly internal ResourceBuffer resources; + readonly internal StringHeapBuffer string_heap; + readonly internal GuidHeapBuffer guid_heap; + readonly internal UserStringHeapBuffer user_string_heap; + readonly internal BlobHeapBuffer blob_heap; + readonly internal TableHeapBuffer table_heap; + readonly internal PdbHeapBuffer pdb_heap; + + internal MetadataToken entry_point; + + internal RID type_rid = 1; + internal RID field_rid = 1; + internal RID method_rid = 1; + internal RID param_rid = 1; + internal RID property_rid = 1; + internal RID event_rid = 1; + internal RID local_variable_rid = 1; + internal RID local_constant_rid = 1; + + readonly TypeRefTable type_ref_table; + readonly TypeDefTable type_def_table; + readonly FieldTable field_table; + readonly MethodTable method_table; + readonly ParamTable param_table; + readonly InterfaceImplTable iface_impl_table; + readonly MemberRefTable member_ref_table; + readonly ConstantTable constant_table; + readonly CustomAttributeTable custom_attribute_table; + readonly DeclSecurityTable declsec_table; + readonly StandAloneSigTable standalone_sig_table; + readonly EventMapTable event_map_table; + readonly EventTable event_table; + readonly PropertyMapTable property_map_table; + readonly PropertyTable property_table; + readonly TypeSpecTable typespec_table; + readonly MethodSpecTable method_spec_table; + + internal MetadataBuilder metadata_builder; + + readonly DocumentTable document_table; + readonly MethodDebugInformationTable method_debug_information_table; + readonly LocalScopeTable local_scope_table; + readonly LocalVariableTable local_variable_table; + readonly LocalConstantTable local_constant_table; + readonly ImportScopeTable import_scope_table; + readonly StateMachineMethodTable state_machine_method_table; + readonly CustomDebugInformationTable custom_debug_information_table; + + readonly Dictionary import_scope_map; + readonly Dictionary document_map; + + public MetadataBuilder (ModuleDefinition module, string fq_name, uint timestamp, ISymbolWriterProvider symbol_writer_provider) + { + this.module = module; + this.text_map = CreateTextMap (); + this.fq_name = fq_name; + this.timestamp = timestamp; + this.symbol_writer_provider = symbol_writer_provider; + + this.code = new CodeWriter (this); + this.data = new DataBuffer (); + this.resources = new ResourceBuffer (); + this.string_heap = new StringHeapBuffer (); + this.guid_heap = new GuidHeapBuffer (); + this.user_string_heap = new UserStringHeapBuffer (); + this.blob_heap = new BlobHeapBuffer (); + this.table_heap = new TableHeapBuffer (module, this); + + this.type_ref_table = GetTable (Table.TypeRef); + this.type_def_table = GetTable (Table.TypeDef); + this.field_table = GetTable (Table.Field); + this.method_table = GetTable (Table.Method); + this.param_table = GetTable (Table.Param); + this.iface_impl_table = GetTable (Table.InterfaceImpl); + this.member_ref_table = GetTable (Table.MemberRef); + this.constant_table = GetTable (Table.Constant); + this.custom_attribute_table = GetTable (Table.CustomAttribute); + this.declsec_table = GetTable (Table.DeclSecurity); + this.standalone_sig_table = GetTable (Table.StandAloneSig); + this.event_map_table = GetTable (Table.EventMap); + this.event_table = GetTable (Table.Event); + this.property_map_table = GetTable (Table.PropertyMap); + this.property_table = GetTable (Table.Property); + this.typespec_table = GetTable (Table.TypeSpec); + this.method_spec_table = GetTable (Table.MethodSpec); + + var row_equality_comparer = new RowEqualityComparer (); + type_ref_map = new Dictionary (row_equality_comparer); + type_spec_map = new Dictionary (); + member_ref_map = new Dictionary (row_equality_comparer); + method_spec_map = new Dictionary (row_equality_comparer); + generic_parameters = new Collection (); + + this.document_table = GetTable (Table.Document); + this.method_debug_information_table = GetTable (Table.MethodDebugInformation); + this.local_scope_table = GetTable (Table.LocalScope); + this.local_variable_table = GetTable (Table.LocalVariable); + this.local_constant_table = GetTable (Table.LocalConstant); + this.import_scope_table = GetTable (Table.ImportScope); + this.state_machine_method_table = GetTable (Table.StateMachineMethod); + this.custom_debug_information_table = GetTable (Table.CustomDebugInformation); + + this.document_map = new Dictionary (StringComparer.Ordinal); + this.import_scope_map = new Dictionary (row_equality_comparer); + } + + public MetadataBuilder (ModuleDefinition module, PortablePdbWriterProvider writer_provider) + { + this.module = module; + this.text_map = new TextMap (); + this.symbol_writer_provider = writer_provider; + + this.string_heap = new StringHeapBuffer (); + this.guid_heap = new GuidHeapBuffer (); + this.user_string_heap = new UserStringHeapBuffer (); + this.blob_heap = new BlobHeapBuffer (); + this.table_heap = new TableHeapBuffer (module, this); + this.pdb_heap = new PdbHeapBuffer (); + + this.document_table = GetTable (Table.Document); + this.method_debug_information_table = GetTable (Table.MethodDebugInformation); + this.local_scope_table = GetTable (Table.LocalScope); + this.local_variable_table = GetTable (Table.LocalVariable); + this.local_constant_table = GetTable (Table.LocalConstant); + this.import_scope_table = GetTable (Table.ImportScope); + this.state_machine_method_table = GetTable (Table.StateMachineMethod); + this.custom_debug_information_table = GetTable (Table.CustomDebugInformation); + + var row_equality_comparer = new RowEqualityComparer (); + + this.document_map = new Dictionary (); + this.import_scope_map = new Dictionary (row_equality_comparer); + } + + public void SetSymbolWriter (ISymbolWriter writer) + { + symbol_writer = writer; + + if (symbol_writer == null && module.HasImage && module.Image.HasDebugTables ()) + symbol_writer = new PortablePdbWriter (this, module); + } + + TextMap CreateTextMap () + { + var map = new TextMap (); + map.AddMap (TextSegment.ImportAddressTable, module.Architecture == TargetArchitecture.I386 ? 8 : 0); + map.AddMap (TextSegment.CLIHeader, 0x48, 8); + return map; + } + + TTable GetTable (Table table) where TTable : MetadataTable, new() + { + return table_heap.GetTable (table); + } + + uint GetStringIndex (string @string) + { + if (string.IsNullOrEmpty (@string)) + return 0; + + return string_heap.GetStringIndex (@string); + } + + uint GetGuidIndex (Guid guid) + { + return guid_heap.GetGuidIndex (guid); + } + + uint GetBlobIndex (ByteBuffer blob) + { + if (blob.length == 0) + return 0; + + return blob_heap.GetBlobIndex (blob); + } + + uint GetBlobIndex (byte [] blob) + { + if (blob.IsNullOrEmpty ()) + return 0; + + return GetBlobIndex (new ByteBuffer (blob)); + } + + public void BuildMetadata () + { + BuildModule (); + + table_heap.string_offsets = string_heap.WriteStrings (); + table_heap.ComputeTableInformations (); + table_heap.WriteTableHeap (); + } + + void BuildModule () + { + var table = GetTable (Table.Module); + table.row.Col1 = GetStringIndex (module.Name); + table.row.Col2 = GetGuidIndex (module.Mvid); + + var assembly = module.Assembly; + + if (module.kind != ModuleKind.NetModule && assembly != null) + BuildAssembly (); + + if (module.HasAssemblyReferences) + AddAssemblyReferences (); + + if (module.HasModuleReferences) + AddModuleReferences (); + + if (module.HasResources) + AddResources (); + + if (module.HasExportedTypes) + AddExportedTypes (); + + BuildTypes (); + + if (module.kind != ModuleKind.NetModule && assembly != null) { + if (assembly.HasCustomAttributes) + AddCustomAttributes (assembly); + + if (assembly.HasSecurityDeclarations) + AddSecurityDeclarations (assembly); + } + + if (module.HasCustomAttributes) + AddCustomAttributes (module); + + if (module.EntryPoint != null) + entry_point = LookupToken (module.EntryPoint); + } + + void BuildAssembly () + { + var assembly = module.Assembly; + var name = assembly.Name; + + var table = GetTable (Table.Assembly); + + table.row = new AssemblyRow ( + name.HashAlgorithm, + (ushort)name.Version.Major, + (ushort)name.Version.Minor, + (ushort)name.Version.Build, + (ushort)name.Version.Revision, + name.Attributes, + GetBlobIndex (name.PublicKey), + GetStringIndex (name.Name), + GetStringIndex (name.Culture)); + + if (assembly.Modules.Count > 1) + BuildModules (); + } + + void BuildModules () + { + var modules = this.module.Assembly.Modules; + var table = GetTable (Table.File); + + for (int i = 0; i < modules.Count; i++) { + var module = modules [i]; + if (module.IsMain) + continue; + +#if NET_CORE + throw new NotSupportedException (); +#else + var parameters = new WriterParameters { + SymbolWriterProvider = symbol_writer_provider, + }; + + var file_name = GetModuleFileName (module.Name); + module.Write (file_name, parameters); + + var hash = CryptoService.ComputeHash (file_name); + + table.AddRow (new FileRow ( + FileAttributes.ContainsMetaData, + GetStringIndex (module.Name), + GetBlobIndex (hash))); +#endif + } + } + +#if !NET_CORE + string GetModuleFileName (string name) + { + if (string.IsNullOrEmpty (name)) + throw new NotSupportedException (); + + var path = Path.GetDirectoryName (fq_name); + return Path.Combine (path, name); + } +#endif + + void AddAssemblyReferences () + { + var references = module.AssemblyReferences; + var table = GetTable (Table.AssemblyRef); + + if (module.IsWindowsMetadata ()) + module.Projections.RemoveVirtualReferences (references); + + for (int i = 0; i < references.Count; i++) { + var reference = references [i]; + + var key_or_token = reference.PublicKey.IsNullOrEmpty () + ? reference.PublicKeyToken + : reference.PublicKey; + + var version = reference.Version; + + var rid = table.AddRow (new AssemblyRefRow ( + (ushort)version.Major, + (ushort)version.Minor, + (ushort)version.Build, + (ushort)version.Revision, + reference.Attributes, + GetBlobIndex (key_or_token), + GetStringIndex (reference.Name), + GetStringIndex (reference.Culture), + GetBlobIndex (reference.Hash))); + + reference.token = new MetadataToken (TokenType.AssemblyRef, rid); + } + + if (module.IsWindowsMetadata ()) + module.Projections.AddVirtualReferences (references); + } + + void AddModuleReferences () + { + var references = module.ModuleReferences; + var table = GetTable (Table.ModuleRef); + + for (int i = 0; i < references.Count; i++) { + var reference = references [i]; + + reference.token = new MetadataToken ( + TokenType.ModuleRef, + table.AddRow (GetStringIndex (reference.Name))); + } + } + + void AddResources () + { + var resources = module.Resources; + var table = GetTable (Table.ManifestResource); + + for (int i = 0; i < resources.Count; i++) { + var resource = resources [i]; + + var row = new ManifestResourceRow ( + 0, + resource.Attributes, + GetStringIndex (resource.Name), + 0); + + switch (resource.ResourceType) { + case ResourceType.Embedded: + row.Col1 = AddEmbeddedResource ((EmbeddedResource)resource); + break; + case ResourceType.Linked: + row.Col4 = CodedIndex.Implementation.CompressMetadataToken ( + new MetadataToken ( + TokenType.File, + AddLinkedResource ((LinkedResource)resource))); + break; + case ResourceType.AssemblyLinked: + row.Col4 = CodedIndex.Implementation.CompressMetadataToken ( + ((AssemblyLinkedResource)resource).Assembly.MetadataToken); + break; + default: + throw new NotSupportedException (); + } + + table.AddRow (row); + } + } + + uint AddLinkedResource (LinkedResource resource) + { + var table = GetTable (Table.File); + var hash = resource.Hash; + + if (hash.IsNullOrEmpty ()) + hash = CryptoService.ComputeHash (resource.File); + + return (uint)table.AddRow (new FileRow ( + FileAttributes.ContainsNoMetaData, + GetStringIndex (resource.File), + GetBlobIndex (hash))); + } + + uint AddEmbeddedResource (EmbeddedResource resource) + { + return resources.AddResource (resource.GetResourceData ()); + } + + void AddExportedTypes () + { + var exported_types = module.ExportedTypes; + var table = GetTable (Table.ExportedType); + + for (int i = 0; i < exported_types.Count; i++) { + var exported_type = exported_types [i]; + + var rid = table.AddRow (new ExportedTypeRow ( + exported_type.Attributes, + (uint)exported_type.Identifier, + GetStringIndex (exported_type.Name), + GetStringIndex (exported_type.Namespace), + MakeCodedRID (GetExportedTypeScope (exported_type), CodedIndex.Implementation))); + + exported_type.token = new MetadataToken (TokenType.ExportedType, rid); + } + } + + MetadataToken GetExportedTypeScope (ExportedType exported_type) + { + if (exported_type.DeclaringType != null) + return exported_type.DeclaringType.MetadataToken; + + var scope = exported_type.Scope; + switch (scope.MetadataToken.TokenType) { + case TokenType.AssemblyRef: + return scope.MetadataToken; + case TokenType.ModuleRef: + var file_table = GetTable (Table.File); + for (int i = 0; i < file_table.length; i++) + if (file_table.rows [i].Col2 == GetStringIndex (scope.Name)) + return new MetadataToken (TokenType.File, i + 1); + + break; + } + + throw new NotSupportedException (); + } + + void BuildTypes () + { + if (!module.HasTypes) + return; + + AttachTokens (); + AddTypes (); + AddGenericParameters (); + } + + void AttachTokens () + { + var types = module.Types; + + for (int i = 0; i < types.Count; i++) + AttachTypeToken (types [i]); + } + + void AttachTypeToken (TypeDefinition type) + { + var treatment = WindowsRuntimeProjections.RemoveProjection (type); + + type.token = new MetadataToken (TokenType.TypeDef, type_rid++); + type.fields_range.Start = field_rid; + type.methods_range.Start = method_rid; + + if (type.HasFields) + AttachFieldsToken (type); + + if (type.HasMethods) + AttachMethodsToken (type); + + if (type.HasNestedTypes) + AttachNestedTypesToken (type); + + WindowsRuntimeProjections.ApplyProjection (type, treatment); + } + + void AttachNestedTypesToken (TypeDefinition type) + { + var nested_types = type.NestedTypes; + for (int i = 0; i < nested_types.Count; i++) + AttachTypeToken (nested_types [i]); + } + + void AttachFieldsToken (TypeDefinition type) + { + var fields = type.Fields; + type.fields_range.Length = (uint)fields.Count; + for (int i = 0; i < fields.Count; i++) + fields [i].token = new MetadataToken (TokenType.Field, field_rid++); + } + + void AttachMethodsToken (TypeDefinition type) + { + var methods = type.Methods; + type.methods_range.Length = (uint)methods.Count; + for (int i = 0; i < methods.Count; i++) + methods [i].token = new MetadataToken (TokenType.Method, method_rid++); + } + + MetadataToken GetTypeToken (TypeReference type) + { + if (type == null) + return MetadataToken.Zero; + + if (type.IsDefinition) + return type.token; + + if (type.IsTypeSpecification ()) + return GetTypeSpecToken (type); + + return GetTypeRefToken (type); + } + + MetadataToken GetTypeSpecToken (TypeReference type) + { + var row = GetBlobIndex (GetTypeSpecSignature (type)); + + MetadataToken token; + if (type_spec_map.TryGetValue (row, out token)) + return token; + + return AddTypeSpecification (type, row); + } + + MetadataToken AddTypeSpecification (TypeReference type, uint row) + { + type.token = new MetadataToken (TokenType.TypeSpec, typespec_table.AddRow (row)); + + var token = type.token; + type_spec_map.Add (row, token); + return token; + } + + MetadataToken GetTypeRefToken (TypeReference type) + { + var projection = WindowsRuntimeProjections.RemoveProjection (type); + + var row = CreateTypeRefRow (type); + + MetadataToken token; + if (!type_ref_map.TryGetValue (row, out token)) + token = AddTypeReference (type, row); + + WindowsRuntimeProjections.ApplyProjection (type, projection); + + return token; + } + + TypeRefRow CreateTypeRefRow (TypeReference type) + { + var scope_token = GetScopeToken (type); + + return new TypeRefRow ( + MakeCodedRID (scope_token, CodedIndex.ResolutionScope), + GetStringIndex (type.Name), + GetStringIndex (type.Namespace)); + } + + MetadataToken GetScopeToken (TypeReference type) + { + if (type.IsNested) + return GetTypeRefToken (type.DeclaringType); + + var scope = type.Scope; + + if (scope == null) + return MetadataToken.Zero; + + return scope.MetadataToken; + } + + static CodedRID MakeCodedRID (IMetadataTokenProvider provider, CodedIndex index) + { + return MakeCodedRID (provider.MetadataToken, index); + } + + static CodedRID MakeCodedRID (MetadataToken token, CodedIndex index) + { + return index.CompressMetadataToken (token); + } + + MetadataToken AddTypeReference (TypeReference type, TypeRefRow row) + { + type.token = new MetadataToken (TokenType.TypeRef, type_ref_table.AddRow (row)); + + var token = type.token; + type_ref_map.Add (row, token); + return token; + } + + void AddTypes () + { + var types = module.Types; + + for (int i = 0; i < types.Count; i++) + AddType (types [i]); + } + + void AddType (TypeDefinition type) + { + var treatment = WindowsRuntimeProjections.RemoveProjection (type); + + type_def_table.AddRow (new TypeDefRow ( + type.Attributes, + GetStringIndex (type.Name), + GetStringIndex (type.Namespace), + MakeCodedRID (GetTypeToken (type.BaseType), CodedIndex.TypeDefOrRef), + type.fields_range.Start, + type.methods_range.Start)); + + if (type.HasGenericParameters) + AddGenericParameters (type); + + if (type.HasInterfaces) + AddInterfaces (type); + + if (type.HasLayoutInfo) + AddLayoutInfo (type); + + if (type.HasFields) + AddFields (type); + + if (type.HasMethods) + AddMethods (type); + + if (type.HasProperties) + AddProperties (type); + + if (type.HasEvents) + AddEvents (type); + + if (type.HasCustomAttributes) + AddCustomAttributes (type); + + if (type.HasSecurityDeclarations) + AddSecurityDeclarations (type); + + if (type.HasNestedTypes) + AddNestedTypes (type); + + WindowsRuntimeProjections.ApplyProjection (type, treatment); + } + + void AddGenericParameters (IGenericParameterProvider owner) + { + var parameters = owner.GenericParameters; + + for (int i = 0; i < parameters.Count; i++) + generic_parameters.Add (parameters [i]); + } + + sealed class GenericParameterComparer : IComparer { + + public int Compare (GenericParameter a, GenericParameter b) + { + var a_owner = MakeCodedRID (a.Owner, CodedIndex.TypeOrMethodDef); + var b_owner = MakeCodedRID (b.Owner, CodedIndex.TypeOrMethodDef); + if (a_owner == b_owner) { + var a_pos = a.Position; + var b_pos = b.Position; + return a_pos == b_pos ? 0 : a_pos > b_pos ? 1 : -1; + } + + return a_owner > b_owner ? 1 : -1; + } + } + + void AddGenericParameters () + { + var items = this.generic_parameters.items; + var size = this.generic_parameters.size; + Array.Sort (items, 0, size, new GenericParameterComparer ()); + + var generic_param_table = GetTable (Table.GenericParam); + var generic_param_constraint_table = GetTable (Table.GenericParamConstraint); + + for (int i = 0; i < size; i++) { + var generic_parameter = items [i]; + + var rid = generic_param_table.AddRow (new GenericParamRow ( + (ushort)generic_parameter.Position, + generic_parameter.Attributes, + MakeCodedRID (generic_parameter.Owner, CodedIndex.TypeOrMethodDef), + GetStringIndex (generic_parameter.Name))); + + generic_parameter.token = new MetadataToken (TokenType.GenericParam, rid); + + if (generic_parameter.HasConstraints) + AddConstraints (generic_parameter, generic_param_constraint_table); + + if (generic_parameter.HasCustomAttributes) + AddCustomAttributes (generic_parameter); + } + } + + void AddConstraints (GenericParameter generic_parameter, GenericParamConstraintTable table) + { + var constraints = generic_parameter.Constraints; + + var gp_rid = generic_parameter.token.RID; + + for (int i = 0; i < constraints.Count; i++) { + var constraint = constraints [i]; + + var rid = table.AddRow (new GenericParamConstraintRow ( + gp_rid, + MakeCodedRID (GetTypeToken (constraint.ConstraintType), CodedIndex.TypeDefOrRef))); + + constraint.token = new MetadataToken (TokenType.GenericParamConstraint, rid); + + if (constraint.HasCustomAttributes) + AddCustomAttributes (constraint); + } + } + + void AddInterfaces (TypeDefinition type) + { + var interfaces = type.Interfaces; + var type_rid = type.token.RID; + + for (int i = 0; i < interfaces.Count; i++) { + var iface_impl = interfaces [i]; + + var rid = iface_impl_table.AddRow (new InterfaceImplRow ( + type_rid, + MakeCodedRID (GetTypeToken (iface_impl.InterfaceType), CodedIndex.TypeDefOrRef))); + + iface_impl.token = new MetadataToken (TokenType.InterfaceImpl, rid); + + if (iface_impl.HasCustomAttributes) + AddCustomAttributes (iface_impl); + } + } + + void AddLayoutInfo (TypeDefinition type) + { + var table = GetTable (Table.ClassLayout); + + table.AddRow (new ClassLayoutRow ( + (ushort)type.PackingSize, + (uint)type.ClassSize, + type.token.RID)); + } + + void AddNestedTypes (TypeDefinition type) + { + var nested_types = type.NestedTypes; + var nested_table = GetTable (Table.NestedClass); + + for (int i = 0; i < nested_types.Count; i++) { + var nested = nested_types [i]; + AddType (nested); + nested_table.AddRow (new NestedClassRow (nested.token.RID, type.token.RID)); + } + } + + void AddFields (TypeDefinition type) + { + var fields = type.Fields; + + for (int i = 0; i < fields.Count; i++) + AddField (fields [i]); + } + + void AddField (FieldDefinition field) + { + var projection = WindowsRuntimeProjections.RemoveProjection (field); + + field_table.AddRow (new FieldRow ( + field.Attributes, + GetStringIndex (field.Name), + GetBlobIndex (GetFieldSignature (field)))); + + if (!field.InitialValue.IsNullOrEmpty ()) + AddFieldRVA (field); + + if (field.HasLayoutInfo) + AddFieldLayout (field); + + if (field.HasCustomAttributes) + AddCustomAttributes (field); + + if (field.HasConstant) + AddConstant (field, field.FieldType); + + if (field.HasMarshalInfo) + AddMarshalInfo (field); + + WindowsRuntimeProjections.ApplyProjection (field, projection); + } + + void AddFieldRVA (FieldDefinition field) + { + var table = GetTable (Table.FieldRVA); + table.AddRow (new FieldRVARow ( + data.AddData (field.InitialValue), + field.token.RID)); + } + + void AddFieldLayout (FieldDefinition field) + { + var table = GetTable (Table.FieldLayout); + table.AddRow (new FieldLayoutRow ((uint)field.Offset, field.token.RID)); + } + + void AddMethods (TypeDefinition type) + { + var methods = type.Methods; + + for (int i = 0; i < methods.Count; i++) + AddMethod (methods [i]); + } + + void AddMethod (MethodDefinition method) + { + var projection = WindowsRuntimeProjections.RemoveProjection (method); + + method_table.AddRow (new MethodRow ( + method.HasBody ? code.WriteMethodBody (method) : 0, + method.ImplAttributes, + method.Attributes, + GetStringIndex (method.Name), + GetBlobIndex (GetMethodSignature (method)), + param_rid)); + + AddParameters (method); + + if (method.HasGenericParameters) + AddGenericParameters (method); + + if (method.IsPInvokeImpl) + AddPInvokeInfo (method); + + if (method.HasCustomAttributes) + AddCustomAttributes (method); + + if (method.HasSecurityDeclarations) + AddSecurityDeclarations (method); + + if (method.HasOverrides) + AddOverrides (method); + + WindowsRuntimeProjections.ApplyProjection (method, projection); + } + + void AddParameters (MethodDefinition method) + { + var return_parameter = method.MethodReturnType.parameter; + + if (return_parameter != null && RequiresParameterRow (return_parameter)) + AddParameter (0, return_parameter, param_table); + + if (!method.HasParameters) + return; + + var parameters = method.Parameters; + + for (int i = 0; i < parameters.Count; i++) { + var parameter = parameters [i]; + if (!RequiresParameterRow (parameter)) + continue; + + AddParameter ((ushort)(i + 1), parameter, param_table); + } + } + + void AddPInvokeInfo (MethodDefinition method) + { + var pinvoke = method.PInvokeInfo; + if (pinvoke == null) + return; + + var table = GetTable (Table.ImplMap); + table.AddRow (new ImplMapRow ( + pinvoke.Attributes, + MakeCodedRID (method, CodedIndex.MemberForwarded), + GetStringIndex (pinvoke.EntryPoint), + pinvoke.Module.MetadataToken.RID)); + } + + void AddOverrides (MethodDefinition method) + { + var overrides = method.Overrides; + var table = GetTable (Table.MethodImpl); + + for (int i = 0; i < overrides.Count; i++) { + table.AddRow (new MethodImplRow ( + method.DeclaringType.token.RID, + MakeCodedRID (method, CodedIndex.MethodDefOrRef), + MakeCodedRID (LookupToken (overrides [i]), CodedIndex.MethodDefOrRef))); + } + } + + static bool RequiresParameterRow (ParameterDefinition parameter) + { + return !string.IsNullOrEmpty (parameter.Name) + || parameter.Attributes != ParameterAttributes.None + || parameter.HasMarshalInfo + || parameter.HasConstant + || parameter.HasCustomAttributes; + } + + void AddParameter (ushort sequence, ParameterDefinition parameter, ParamTable table) + { + table.AddRow (new ParamRow ( + parameter.Attributes, + sequence, + GetStringIndex (parameter.Name))); + + parameter.token = new MetadataToken (TokenType.Param, param_rid++); + + if (parameter.HasCustomAttributes) + AddCustomAttributes (parameter); + + if (parameter.HasConstant) + AddConstant (parameter, parameter.ParameterType); + + if (parameter.HasMarshalInfo) + AddMarshalInfo (parameter); + } + + void AddMarshalInfo (IMarshalInfoProvider owner) + { + var table = GetTable (Table.FieldMarshal); + + table.AddRow (new FieldMarshalRow ( + MakeCodedRID (owner, CodedIndex.HasFieldMarshal), + GetBlobIndex (GetMarshalInfoSignature (owner)))); + } + + void AddProperties (TypeDefinition type) + { + var properties = type.Properties; + + property_map_table.AddRow (new PropertyMapRow (type.token.RID, property_rid)); + + for (int i = 0; i < properties.Count; i++) + AddProperty (properties [i]); + } + + void AddProperty (PropertyDefinition property) + { + property_table.AddRow (new PropertyRow ( + property.Attributes, + GetStringIndex (property.Name), + GetBlobIndex (GetPropertySignature (property)))); + property.token = new MetadataToken (TokenType.Property, property_rid++); + + var method = property.GetMethod; + if (method != null) + AddSemantic (MethodSemanticsAttributes.Getter, property, method); + + method = property.SetMethod; + if (method != null) + AddSemantic (MethodSemanticsAttributes.Setter, property, method); + + if (property.HasOtherMethods) + AddOtherSemantic (property, property.OtherMethods); + + if (property.HasCustomAttributes) + AddCustomAttributes (property); + + if (property.HasConstant) + AddConstant (property, property.PropertyType); + } + + void AddOtherSemantic (IMetadataTokenProvider owner, Collection others) + { + for (int i = 0; i < others.Count; i++) + AddSemantic (MethodSemanticsAttributes.Other, owner, others [i]); + } + + void AddEvents (TypeDefinition type) + { + var events = type.Events; + + event_map_table.AddRow (new EventMapRow (type.token.RID, event_rid)); + + for (int i = 0; i < events.Count; i++) + AddEvent (events [i]); + } + + void AddEvent (EventDefinition @event) + { + event_table.AddRow (new EventRow ( + @event.Attributes, + GetStringIndex (@event.Name), + MakeCodedRID (GetTypeToken (@event.EventType), CodedIndex.TypeDefOrRef))); + @event.token = new MetadataToken (TokenType.Event, event_rid++); + + var method = @event.AddMethod; + if (method != null) + AddSemantic (MethodSemanticsAttributes.AddOn, @event, method); + + method = @event.InvokeMethod; + if (method != null) + AddSemantic (MethodSemanticsAttributes.Fire, @event, method); + + method = @event.RemoveMethod; + if (method != null) + AddSemantic (MethodSemanticsAttributes.RemoveOn, @event, method); + + if (@event.HasOtherMethods) + AddOtherSemantic (@event, @event.OtherMethods); + + if (@event.HasCustomAttributes) + AddCustomAttributes (@event); + } + + void AddSemantic (MethodSemanticsAttributes semantics, IMetadataTokenProvider provider, MethodDefinition method) + { + method.SemanticsAttributes = semantics; + var table = GetTable (Table.MethodSemantics); + + table.AddRow (new MethodSemanticsRow ( + semantics, + method.token.RID, + MakeCodedRID (provider, CodedIndex.HasSemantics))); + } + + void AddConstant (IConstantProvider owner, TypeReference type) + { + var constant = owner.Constant; + var etype = GetConstantType (type, constant); + + constant_table.AddRow (new ConstantRow ( + etype, + MakeCodedRID (owner.MetadataToken, CodedIndex.HasConstant), + GetBlobIndex (GetConstantSignature (etype, constant)))); + } + + static ElementType GetConstantType (TypeReference constant_type, object constant) + { + if (constant == null) + return ElementType.Class; + + var etype = constant_type.etype; + switch (etype) { + case ElementType.None: + var type = constant_type.CheckedResolve (); + if (type.IsEnum) + return GetConstantType (type.GetEnumUnderlyingType (), constant); + + return ElementType.Class; + case ElementType.String: + return ElementType.String; + case ElementType.Object: + return GetConstantType (constant.GetType ()); + case ElementType.Array: + case ElementType.SzArray: + case ElementType.MVar: + case ElementType.Var: + return ElementType.Class; + case ElementType.GenericInst: + var generic_instance = (GenericInstanceType)constant_type; + if (generic_instance.ElementType.IsTypeOf ("System", "Nullable`1")) + return GetConstantType (generic_instance.GenericArguments [0], constant); + + return GetConstantType (((TypeSpecification)constant_type).ElementType, constant); + case ElementType.CModOpt: + case ElementType.CModReqD: + case ElementType.ByRef: + case ElementType.Sentinel: + return GetConstantType (((TypeSpecification)constant_type).ElementType, constant); + case ElementType.Boolean: + case ElementType.Char: + case ElementType.I: + case ElementType.I1: + case ElementType.I2: + case ElementType.I4: + case ElementType.I8: + case ElementType.U: + case ElementType.U1: + case ElementType.U2: + case ElementType.U4: + case ElementType.U8: + case ElementType.R4: + case ElementType.R8: + return GetConstantType (constant.GetType ()); + default: + return etype; + } + } + + static ElementType GetConstantType (Type type) + { + switch (Type.GetTypeCode (type)) { + case TypeCode.Boolean: + return ElementType.Boolean; + case TypeCode.Byte: + return ElementType.U1; + case TypeCode.SByte: + return ElementType.I1; + case TypeCode.Char: + return ElementType.Char; + case TypeCode.Int16: + return ElementType.I2; + case TypeCode.UInt16: + return ElementType.U2; + case TypeCode.Int32: + return ElementType.I4; + case TypeCode.UInt32: + return ElementType.U4; + case TypeCode.Int64: + return ElementType.I8; + case TypeCode.UInt64: + return ElementType.U8; + case TypeCode.Single: + return ElementType.R4; + case TypeCode.Double: + return ElementType.R8; + case TypeCode.String: + return ElementType.String; + default: + throw new NotSupportedException (type.FullName); + } + } + + void AddCustomAttributes (ICustomAttributeProvider owner) + { + var custom_attributes = owner.CustomAttributes; + + for (int i = 0; i < custom_attributes.Count; i++) { + var attribute = custom_attributes [i]; + + var projection = WindowsRuntimeProjections.RemoveProjection (attribute); + + custom_attribute_table.AddRow (new CustomAttributeRow ( + MakeCodedRID (owner, CodedIndex.HasCustomAttribute), + MakeCodedRID (LookupToken (attribute.Constructor), CodedIndex.CustomAttributeType), + GetBlobIndex (GetCustomAttributeSignature (attribute)))); + + WindowsRuntimeProjections.ApplyProjection (attribute, projection); + } + } + + void AddSecurityDeclarations (ISecurityDeclarationProvider owner) + { + var declarations = owner.SecurityDeclarations; + + for (int i = 0; i < declarations.Count; i++) { + var declaration = declarations [i]; + + declsec_table.AddRow (new DeclSecurityRow ( + declaration.Action, + MakeCodedRID (owner, CodedIndex.HasDeclSecurity), + GetBlobIndex (GetSecurityDeclarationSignature (declaration)))); + } + } + + MetadataToken GetMemberRefToken (MemberReference member) + { + var row = CreateMemberRefRow (member); + + MetadataToken token; + if (!member_ref_map.TryGetValue (row, out token)) + token = AddMemberReference (member, row); + + return token; + } + + MemberRefRow CreateMemberRefRow (MemberReference member) + { + return new MemberRefRow ( + MakeCodedRID (GetTypeToken (member.DeclaringType), CodedIndex.MemberRefParent), + GetStringIndex (member.Name), + GetBlobIndex (GetMemberRefSignature (member))); + } + + MetadataToken AddMemberReference (MemberReference member, MemberRefRow row) + { + member.token = new MetadataToken (TokenType.MemberRef, member_ref_table.AddRow (row)); + + var token = member.token; + member_ref_map.Add (row, token); + return token; + } + + MetadataToken GetMethodSpecToken (MethodSpecification method_spec) + { + var row = CreateMethodSpecRow (method_spec); + + MetadataToken token; + if (method_spec_map.TryGetValue (row, out token)) + return token; + + AddMethodSpecification (method_spec, row); + + return method_spec.token; + } + + void AddMethodSpecification (MethodSpecification method_spec, MethodSpecRow row) + { + method_spec.token = new MetadataToken (TokenType.MethodSpec, method_spec_table.AddRow (row)); + method_spec_map.Add (row, method_spec.token); + } + + MethodSpecRow CreateMethodSpecRow (MethodSpecification method_spec) + { + return new MethodSpecRow ( + MakeCodedRID (LookupToken (method_spec.ElementMethod), CodedIndex.MethodDefOrRef), + GetBlobIndex (GetMethodSpecSignature (method_spec))); + } + + SignatureWriter CreateSignatureWriter () + { + return new SignatureWriter (this); + } + + SignatureWriter GetMethodSpecSignature (MethodSpecification method_spec) + { + if (!method_spec.IsGenericInstance) + throw new NotSupportedException (); + + var generic_instance = (GenericInstanceMethod)method_spec; + + var signature = CreateSignatureWriter (); + signature.WriteByte (0x0a); + + signature.WriteGenericInstanceSignature (generic_instance); + + return signature; + } + + public uint AddStandAloneSignature (uint signature) + { + return (uint)standalone_sig_table.AddRow (signature); + } + + public uint GetLocalVariableBlobIndex (Collection variables) + { + return GetBlobIndex (GetVariablesSignature (variables)); + } + + public uint GetCallSiteBlobIndex (CallSite call_site) + { + return GetBlobIndex (GetMethodSignature (call_site)); + } + + public uint GetConstantTypeBlobIndex (TypeReference constant_type) + { + return GetBlobIndex (GetConstantTypeSignature (constant_type)); + } + + SignatureWriter GetVariablesSignature (Collection variables) + { + var signature = CreateSignatureWriter (); + signature.WriteByte (0x7); + signature.WriteCompressedUInt32 ((uint)variables.Count); + for (int i = 0; i < variables.Count; i++) + signature.WriteTypeSignature (variables [i].VariableType); + return signature; + } + + SignatureWriter GetConstantTypeSignature (TypeReference constant_type) + { + var signature = CreateSignatureWriter (); + signature.WriteByte (0x6); + signature.WriteTypeSignature (constant_type); + return signature; + } + + SignatureWriter GetFieldSignature (FieldReference field) + { + var signature = CreateSignatureWriter (); + signature.WriteByte (0x6); + signature.WriteTypeSignature (field.FieldType); + return signature; + } + + SignatureWriter GetMethodSignature (IMethodSignature method) + { + var signature = CreateSignatureWriter (); + signature.WriteMethodSignature (method); + return signature; + } + + SignatureWriter GetMemberRefSignature (MemberReference member) + { + var field = member as FieldReference; + if (field != null) + return GetFieldSignature (field); + + var method = member as MethodReference; + if (method != null) + return GetMethodSignature (method); + + throw new NotSupportedException (); + } + + SignatureWriter GetPropertySignature (PropertyDefinition property) + { + var signature = CreateSignatureWriter (); + byte calling_convention = 0x8; + if (property.HasThis) + calling_convention |= 0x20; + + uint param_count = 0; + Collection parameters = null; + + if (property.HasParameters) { + parameters = property.Parameters; + param_count = (uint)parameters.Count; + } + + signature.WriteByte (calling_convention); + signature.WriteCompressedUInt32 (param_count); + signature.WriteTypeSignature (property.PropertyType); + + if (param_count == 0) + return signature; + + for (int i = 0; i < param_count; i++) + signature.WriteTypeSignature (parameters [i].ParameterType); + + return signature; + } + + SignatureWriter GetTypeSpecSignature (TypeReference type) + { + var signature = CreateSignatureWriter (); + signature.WriteTypeSignature (type); + return signature; + } + + SignatureWriter GetConstantSignature (ElementType type, object value) + { + var signature = CreateSignatureWriter (); + + switch (type) { + case ElementType.Array: + case ElementType.SzArray: + case ElementType.Class: + case ElementType.Object: + case ElementType.None: + case ElementType.Var: + case ElementType.MVar: + signature.WriteInt32 (0); + break; + case ElementType.String: + signature.WriteConstantString ((string)value); + break; + default: + signature.WriteConstantPrimitive (value); + break; + } + + return signature; + } + + SignatureWriter GetCustomAttributeSignature (CustomAttribute attribute) + { + var signature = CreateSignatureWriter (); + if (!attribute.resolved) { + signature.WriteBytes (attribute.GetBlob ()); + return signature; + } + + signature.WriteUInt16 (0x0001); + + signature.WriteCustomAttributeConstructorArguments (attribute); + + signature.WriteCustomAttributeNamedArguments (attribute); + + return signature; + } + + SignatureWriter GetSecurityDeclarationSignature (SecurityDeclaration declaration) + { + var signature = CreateSignatureWriter (); + + if (!declaration.resolved) + signature.WriteBytes (declaration.GetBlob ()); + else if (module.Runtime < TargetRuntime.Net_2_0) + signature.WriteXmlSecurityDeclaration (declaration); + else + signature.WriteSecurityDeclaration (declaration); + + return signature; + } + + SignatureWriter GetMarshalInfoSignature (IMarshalInfoProvider owner) + { + var signature = CreateSignatureWriter (); + + signature.WriteMarshalInfo (owner.MarshalInfo); + + return signature; + } + + static Exception CreateForeignMemberException (MemberReference member) + { + return new ArgumentException (string.Format ("Member '{0}' is declared in another module and needs to be imported", member)); + } + + public MetadataToken LookupToken (IMetadataTokenProvider provider) + { + if (provider == null) + throw new ArgumentNullException (); + + if (metadata_builder != null) + return metadata_builder.LookupToken (provider); + + var member = provider as MemberReference; + if (member == null || member.Module != module) + throw CreateForeignMemberException (member); + + var token = provider.MetadataToken; + + switch (token.TokenType) { + case TokenType.TypeDef: + case TokenType.Method: + case TokenType.Field: + case TokenType.Event: + case TokenType.Property: + return token; + case TokenType.TypeRef: + case TokenType.TypeSpec: + case TokenType.GenericParam: + return GetTypeToken ((TypeReference)provider); + case TokenType.MethodSpec: + return GetMethodSpecToken ((MethodSpecification)provider); + case TokenType.MemberRef: + return GetMemberRefToken (member); + default: + throw new NotSupportedException (); + } + } + + public void AddMethodDebugInformation (MethodDebugInformation method_info) + { + if (method_info.HasSequencePoints) + AddSequencePoints (method_info); + + if (method_info.Scope != null) + AddLocalScope (method_info, method_info.Scope); + + if (method_info.StateMachineKickOffMethod != null) + AddStateMachineMethod (method_info); + + AddCustomDebugInformations (method_info.Method); + } + + void AddStateMachineMethod (MethodDebugInformation method_info) + { + state_machine_method_table.AddRow (new StateMachineMethodRow (method_info.Method.MetadataToken.RID, method_info.StateMachineKickOffMethod.MetadataToken.RID)); + } + + void AddLocalScope (MethodDebugInformation method_info, ScopeDebugInformation scope) + { + var rid = local_scope_table.AddRow (new LocalScopeRow ( + method_info.Method.MetadataToken.RID, + scope.import != null ? AddImportScope (scope.import) : 0, + local_variable_rid, + local_constant_rid, + (uint)scope.Start.Offset, + (uint)((scope.End.IsEndOfMethod ? method_info.code_size : scope.End.Offset) - scope.Start.Offset))); + + scope.token = new MetadataToken (TokenType.LocalScope, rid); + + AddCustomDebugInformations (scope); + + if (scope.HasVariables) + AddLocalVariables (scope); + + if (scope.HasConstants) + AddLocalConstants (scope); + + for (int i = 0; i < scope.Scopes.Count; i++) + AddLocalScope (method_info, scope.Scopes [i]); + } + + void AddLocalVariables (ScopeDebugInformation scope) + { + for (int i = 0; i < scope.Variables.Count; i++) { + var variable = scope.Variables [i]; + local_variable_table.AddRow (new LocalVariableRow (variable.Attributes, (ushort)variable.Index, GetStringIndex (variable.Name))); + variable.token = new MetadataToken (TokenType.LocalVariable, local_variable_rid); + local_variable_rid++; + + AddCustomDebugInformations (variable); + } + } + + void AddLocalConstants (ScopeDebugInformation scope) + { + for (int i = 0; i < scope.Constants.Count; i++) { + var constant = scope.Constants [i]; + local_constant_table.AddRow (new LocalConstantRow (GetStringIndex (constant.Name), GetBlobIndex (GetConstantSignature (constant)))); + constant.token = new MetadataToken (TokenType.LocalConstant, local_constant_rid); + local_constant_rid++; + } + } + + SignatureWriter GetConstantSignature (ConstantDebugInformation constant) + { + var type = constant.ConstantType; + + var signature = CreateSignatureWriter (); + signature.WriteTypeSignature (type); + + if (type.IsTypeOf ("System", "Decimal")) { + var bits = decimal.GetBits ((decimal)constant.Value); + + var low = (uint)bits [0]; + var mid = (uint)bits [1]; + var high = (uint)bits [2]; + + var scale = (byte)(bits [3] >> 16); + var negative = (bits [3] & 0x80000000) != 0; + + signature.WriteByte ((byte)(scale | (negative ? 0x80 : 0x00))); + signature.WriteUInt32 (low); + signature.WriteUInt32 (mid); + signature.WriteUInt32 (high); + + return signature; + } + + if (type.IsTypeOf ("System", "DateTime")) { + var date = (DateTime)constant.Value; + signature.WriteInt64 (date.Ticks); + return signature; + } + + signature.WriteBytes (GetConstantSignature (type.etype, constant.Value)); + + return signature; + } + + public void AddCustomDebugInformations (ICustomDebugInformationProvider provider) + { + if (!provider.HasCustomDebugInformations) + return; + + var custom_infos = provider.CustomDebugInformations; + + for (int i = 0; i < custom_infos.Count; i++) { + var custom_info = custom_infos [i]; + switch (custom_info.Kind) { + case CustomDebugInformationKind.Binary: + var binary_info = (BinaryCustomDebugInformation)custom_info; + AddCustomDebugInformation (provider, binary_info, GetBlobIndex (binary_info.Data)); + break; + case CustomDebugInformationKind.AsyncMethodBody: + AddAsyncMethodBodyDebugInformation (provider, (AsyncMethodBodyDebugInformation)custom_info); + break; + case CustomDebugInformationKind.StateMachineScope: + AddStateMachineScopeDebugInformation (provider, (StateMachineScopeDebugInformation)custom_info); + break; + case CustomDebugInformationKind.EmbeddedSource: + AddEmbeddedSourceDebugInformation (provider, (EmbeddedSourceDebugInformation)custom_info); + break; + case CustomDebugInformationKind.SourceLink: + AddSourceLinkDebugInformation (provider, (SourceLinkDebugInformation)custom_info); + break; + default: + throw new NotImplementedException (); + } + } + } + + void AddStateMachineScopeDebugInformation (ICustomDebugInformationProvider provider, StateMachineScopeDebugInformation state_machine_scope) + { + var method_info = ((MethodDefinition)provider).DebugInformation; + + var signature = CreateSignatureWriter (); + + var scopes = state_machine_scope.Scopes; + + for (int i = 0; i < scopes.Count; i++) { + var scope = scopes [i]; + signature.WriteUInt32 ((uint)scope.Start.Offset); + + var end_offset = scope.End.IsEndOfMethod + ? method_info.code_size + : scope.End.Offset; + + signature.WriteUInt32 ((uint)(end_offset - scope.Start.Offset)); + } + + AddCustomDebugInformation (provider, state_machine_scope, signature); + } + + void AddAsyncMethodBodyDebugInformation (ICustomDebugInformationProvider provider, AsyncMethodBodyDebugInformation async_method) + { + var signature = CreateSignatureWriter (); + signature.WriteUInt32 ((uint)async_method.catch_handler.Offset + 1); + + if (!async_method.yields.IsNullOrEmpty ()) { + for (int i = 0; i < async_method.yields.Count; i++) { + signature.WriteUInt32 ((uint)async_method.yields [i].Offset); + signature.WriteUInt32 ((uint)async_method.resumes [i].Offset); + signature.WriteCompressedUInt32 (async_method.resume_methods [i].MetadataToken.RID); + } + } + + AddCustomDebugInformation (provider, async_method, signature); + } + + void AddEmbeddedSourceDebugInformation (ICustomDebugInformationProvider provider, EmbeddedSourceDebugInformation embedded_source) + { + var signature = CreateSignatureWriter (); + + if (!embedded_source.resolved) { + signature.WriteBytes (embedded_source.ReadRawEmbeddedSourceDebugInformation ()); + AddCustomDebugInformation (provider, embedded_source, signature); + return; + } + + var content = embedded_source.content ?? Empty.Array; + if (embedded_source.compress) { + signature.WriteInt32 (content.Length); + + var decompressed_stream = new MemoryStream (content); + var content_stream = new MemoryStream (); + + using (var compress_stream = new DeflateStream (content_stream, CompressionMode.Compress, leaveOpen: true)) + decompressed_stream.CopyTo (compress_stream); + + signature.WriteBytes (content_stream.ToArray ()); + } else { + signature.WriteInt32 (0); + signature.WriteBytes (content); + } + + AddCustomDebugInformation (provider, embedded_source, signature); + } + + void AddSourceLinkDebugInformation (ICustomDebugInformationProvider provider, SourceLinkDebugInformation source_link) + { + var signature = CreateSignatureWriter (); + signature.WriteBytes (Encoding.UTF8.GetBytes (source_link.content)); + + AddCustomDebugInformation (provider, source_link, signature); + } + + void AddCustomDebugInformation (ICustomDebugInformationProvider provider, CustomDebugInformation custom_info, SignatureWriter signature) + { + AddCustomDebugInformation (provider, custom_info, GetBlobIndex (signature)); + } + + void AddCustomDebugInformation (ICustomDebugInformationProvider provider, CustomDebugInformation custom_info, uint blob_index) + { + var rid = custom_debug_information_table.AddRow (new CustomDebugInformationRow ( + MakeCodedRID (provider.MetadataToken, CodedIndex.HasCustomDebugInformation), + GetGuidIndex (custom_info.Identifier), + blob_index)); + + custom_info.token = new MetadataToken (TokenType.CustomDebugInformation, rid); + } + + uint AddImportScope (ImportDebugInformation import) + { + uint parent = 0; + if (import.Parent != null) + parent = AddImportScope (import.Parent); + + uint targets_index = 0; + if (import.HasTargets) { + var signature = CreateSignatureWriter (); + + for (int i = 0; i < import.Targets.Count; i++) + AddImportTarget (import.Targets [i], signature); + + targets_index = GetBlobIndex (signature); + } + + var row = new ImportScopeRow (parent, targets_index); + + MetadataToken import_token; + if (import_scope_map.TryGetValue (row, out import_token)) + return import_token.RID; + + import_token = new MetadataToken (TokenType.ImportScope, import_scope_table.AddRow (row)); + import_scope_map.Add (row, import_token); + + return import_token.RID; + } + + void AddImportTarget (ImportTarget target, SignatureWriter signature) + { + signature.WriteCompressedUInt32 ((uint)target.kind); + + switch (target.kind) { + case ImportTargetKind.ImportNamespace: + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (target.@namespace)); + break; + case ImportTargetKind.ImportNamespaceInAssembly: + signature.WriteCompressedUInt32 (target.reference.MetadataToken.RID); + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (target.@namespace)); + break; + case ImportTargetKind.ImportType: + signature.WriteTypeToken (target.type); + break; + case ImportTargetKind.ImportXmlNamespaceWithAlias: + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (target.alias)); + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (target.@namespace)); + break; + case ImportTargetKind.ImportAlias: + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (target.alias)); + break; + case ImportTargetKind.DefineAssemblyAlias: + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (target.alias)); + signature.WriteCompressedUInt32 (target.reference.MetadataToken.RID); + break; + case ImportTargetKind.DefineNamespaceAlias: + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (target.alias)); + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (target.@namespace)); + break; + case ImportTargetKind.DefineNamespaceInAssemblyAlias: + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (target.alias)); + signature.WriteCompressedUInt32 (target.reference.MetadataToken.RID); + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (target.@namespace)); + break; + case ImportTargetKind.DefineTypeAlias: + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (target.alias)); + signature.WriteTypeToken (target.type); + break; + } + } + + uint GetUTF8StringBlobIndex (string s) + { + return GetBlobIndex (Encoding.UTF8.GetBytes (s)); + } + + public MetadataToken GetDocumentToken (Document document) + { + MetadataToken token; + if (document_map.TryGetValue (document.Url, out token)) + return token; + + token = new MetadataToken (TokenType.Document, document_table.AddRow ( + new DocumentRow (GetBlobIndex (GetDocumentNameSignature (document)), + GetGuidIndex (document.HashAlgorithm.ToGuid ()), + GetBlobIndex (document.Hash), + GetGuidIndex (document.Language.ToGuid ())))); + + document.token = token; + + AddCustomDebugInformations (document); + + document_map.Add (document.Url, token); + + return token; + } + + SignatureWriter GetDocumentNameSignature (Document document) + { + var name = document.Url; + var signature = CreateSignatureWriter (); + + char separator; + if (!TryGetDocumentNameSeparator (name, out separator)) { + signature.WriteByte (0); + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (name)); + return signature; + } + + signature.WriteByte ((byte)separator); + var parts = name.Split (new [] { separator }); + for (int i = 0; i < parts.Length; i++) { + if (parts [i] == String.Empty) + signature.WriteCompressedUInt32 (0); + else + signature.WriteCompressedUInt32 (GetUTF8StringBlobIndex (parts [i])); + } + + return signature; + } + + static bool TryGetDocumentNameSeparator (string path, out char separator) + { + const char unix = '/'; + const char win = '\\'; + const char zero = (char)0; + + separator = zero; + if (string.IsNullOrEmpty (path)) + return false; + + int unix_count = 0; + int win_count = 0; + + for (int i = 0; i < path.Length; i++) { + if (path [i] == unix) + unix_count++; + else if (path [i] == win) + win_count++; + } + + if (unix_count == 0 && win_count == 0) + return false; + + if (unix_count >= win_count) { + separator = unix; + return true; + } + + separator = win; + return true; + } + + void AddSequencePoints (MethodDebugInformation info) + { + var rid = info.Method.MetadataToken.RID; + + Document document; + if (info.TryGetUniqueDocument (out document)) + method_debug_information_table.rows [rid - 1].Col1 = GetDocumentToken (document).RID; + + var signature = CreateSignatureWriter (); + signature.WriteSequencePoints (info); + + method_debug_information_table.rows [rid - 1].Col2 = GetBlobIndex (signature); + } + + public void ComputeDeterministicMvid () + { + var guid = CryptoService.ComputeGuid (CryptoService.ComputeHash ( + data, + resources, + string_heap, + user_string_heap, + blob_heap, + table_heap, + code)); + + var position = guid_heap.position; + guid_heap.position = 0; + guid_heap.WriteBytes (guid.ToByteArray ()); + guid_heap.position = position; + + module.Mvid = guid; + } + } + + sealed class SignatureWriter : ByteBuffer { + + readonly MetadataBuilder metadata; + + public SignatureWriter (MetadataBuilder metadata) + : base (6) + { + this.metadata = metadata; + } + + public void WriteElementType (ElementType element_type) + { + WriteByte ((byte)element_type); + } + + public void WriteUTF8String (string @string) + { + if (@string == null) { + WriteByte (0xff); + return; + } + + var bytes = Encoding.UTF8.GetBytes (@string); + WriteCompressedUInt32 ((uint)bytes.Length); + WriteBytes (bytes); + } + + public void WriteMethodSignature (IMethodSignature method) + { + byte calling_convention = (byte)method.CallingConvention; + if (method.HasThis) + calling_convention |= 0x20; + if (method.ExplicitThis) + calling_convention |= 0x40; + + var generic_provider = method as IGenericParameterProvider; + var generic_arity = generic_provider != null && generic_provider.HasGenericParameters + ? generic_provider.GenericParameters.Count + : 0; + + if (generic_arity > 0) + calling_convention |= 0x10; + + var param_count = method.HasParameters ? method.Parameters.Count : 0; + + WriteByte (calling_convention); + + if (generic_arity > 0) + WriteCompressedUInt32 ((uint)generic_arity); + + WriteCompressedUInt32 ((uint)param_count); + WriteTypeSignature (method.ReturnType); + + if (param_count == 0) + return; + + var parameters = method.Parameters; + + for (int i = 0; i < param_count; i++) + WriteTypeSignature (parameters [i].ParameterType); + } + + uint MakeTypeDefOrRefCodedRID (TypeReference type) + { + return CodedIndex.TypeDefOrRef.CompressMetadataToken (metadata.LookupToken (type)); + } + + public void WriteTypeToken (TypeReference type) + { + WriteCompressedUInt32 (MakeTypeDefOrRefCodedRID (type)); + } + + public void WriteTypeSignature (TypeReference type) + { + if (type == null) + throw new ArgumentNullException (); + + var etype = type.etype; + + switch (etype) { + case ElementType.MVar: + case ElementType.Var: { + var generic_parameter = (GenericParameter)type; + + WriteElementType (etype); + var position = generic_parameter.Position; + if (position == -1) + throw new NotSupportedException (); + + WriteCompressedUInt32 ((uint)position); + break; + } + + case ElementType.GenericInst: { + var generic_instance = (GenericInstanceType)type; + WriteElementType (ElementType.GenericInst); + WriteElementType (generic_instance.IsValueType ? ElementType.ValueType : ElementType.Class); + WriteCompressedUInt32 (MakeTypeDefOrRefCodedRID (generic_instance.ElementType)); + + WriteGenericInstanceSignature (generic_instance); + break; + } + + case ElementType.Ptr: + case ElementType.ByRef: + case ElementType.Pinned: + case ElementType.Sentinel: { + var type_spec = (TypeSpecification)type; + WriteElementType (etype); + WriteTypeSignature (type_spec.ElementType); + break; + } + + case ElementType.FnPtr: { + var fptr = (FunctionPointerType)type; + WriteElementType (ElementType.FnPtr); + WriteMethodSignature (fptr); + break; + } + + case ElementType.CModOpt: + case ElementType.CModReqD: { + var modifier = (IModifierType)type; + WriteModifierSignature (etype, modifier); + break; + } + + case ElementType.Array: { + var array = (ArrayType)type; + if (!array.IsVector) { + WriteArrayTypeSignature (array); + break; + } + + WriteElementType (ElementType.SzArray); + WriteTypeSignature (array.ElementType); + break; + } + + case ElementType.None: { + WriteElementType (type.IsValueType ? ElementType.ValueType : ElementType.Class); + WriteCompressedUInt32 (MakeTypeDefOrRefCodedRID (type)); + break; + } + + default: + if (!TryWriteElementType (type)) + throw new NotSupportedException (); + + break; + + } + } + + void WriteArrayTypeSignature (ArrayType array) + { + WriteElementType (ElementType.Array); + WriteTypeSignature (array.ElementType); + + var dimensions = array.Dimensions; + var rank = dimensions.Count; + + WriteCompressedUInt32 ((uint)rank); + + var sized = 0; + var lbounds = 0; + + for (int i = 0; i < rank; i++) { + var dimension = dimensions [i]; + + if (dimension.UpperBound.HasValue) { + sized++; + lbounds++; + } else if (dimension.LowerBound.HasValue) + lbounds++; + } + + var sizes = new int [sized]; + var low_bounds = new int [lbounds]; + + for (int i = 0; i < lbounds; i++) { + var dimension = dimensions [i]; + low_bounds [i] = dimension.LowerBound.GetValueOrDefault (); + if (dimension.UpperBound.HasValue) + sizes [i] = dimension.UpperBound.Value - low_bounds [i] + 1; + } + + WriteCompressedUInt32 ((uint)sized); + for (int i = 0; i < sized; i++) + WriteCompressedUInt32 ((uint)sizes [i]); + + WriteCompressedUInt32 ((uint)lbounds); + for (int i = 0; i < lbounds; i++) + WriteCompressedInt32 (low_bounds [i]); + } + + public void WriteGenericInstanceSignature (IGenericInstance instance) + { + var generic_arguments = instance.GenericArguments; + var arity = generic_arguments.Count; + + WriteCompressedUInt32 ((uint)arity); + for (int i = 0; i < arity; i++) + WriteTypeSignature (generic_arguments [i]); + } + + void WriteModifierSignature (ElementType element_type, IModifierType type) + { + WriteElementType (element_type); + WriteCompressedUInt32 (MakeTypeDefOrRefCodedRID (type.ModifierType)); + WriteTypeSignature (type.ElementType); + } + + bool TryWriteElementType (TypeReference type) + { + var element = type.etype; + + if (element == ElementType.None) + return false; + + WriteElementType (element); + return true; + } + + public void WriteConstantString (string value) + { + if (value != null) + WriteBytes (Encoding.Unicode.GetBytes (value)); + else + WriteByte (0xff); + } + + public void WriteConstantPrimitive (object value) + { + WritePrimitiveValue (value); + } + + public void WriteCustomAttributeConstructorArguments (CustomAttribute attribute) + { + if (!attribute.HasConstructorArguments) + return; + + var arguments = attribute.ConstructorArguments; + var parameters = attribute.Constructor.Parameters; + + if (parameters.Count != arguments.Count) + throw new InvalidOperationException (); + + for (int i = 0; i < arguments.Count; i++) + WriteCustomAttributeFixedArgument (parameters [i].ParameterType, arguments [i]); + } + + void WriteCustomAttributeFixedArgument (TypeReference type, CustomAttributeArgument argument) + { + if (type.IsArray) { + WriteCustomAttributeFixedArrayArgument ((ArrayType)type, argument); + return; + } + + WriteCustomAttributeElement (type, argument); + } + + void WriteCustomAttributeFixedArrayArgument (ArrayType type, CustomAttributeArgument argument) + { + var values = argument.Value as CustomAttributeArgument []; + + if (values == null) { + WriteUInt32 (0xffffffff); + return; + } + + WriteInt32 (values.Length); + + if (values.Length == 0) + return; + + var element_type = type.ElementType; + + for (int i = 0; i < values.Length; i++) + WriteCustomAttributeElement (element_type, values [i]); + } + + void WriteCustomAttributeElement (TypeReference type, CustomAttributeArgument argument) + { + if (type.IsArray) { + WriteCustomAttributeFixedArrayArgument ((ArrayType)type, argument); + return; + } + + if (type.etype == ElementType.Object) { + argument = (CustomAttributeArgument)argument.Value; + type = argument.Type; + + WriteCustomAttributeFieldOrPropType (type); + WriteCustomAttributeElement (type, argument); + return; + } + + WriteCustomAttributeValue (type, argument.Value); + } + + void WriteCustomAttributeValue (TypeReference type, object value) + { + var etype = type.etype; + + switch (etype) { + case ElementType.String: + var @string = (string)value; + if (@string == null) + WriteByte (0xff); + else + WriteUTF8String (@string); + break; + case ElementType.None: + if (type.IsTypeOf ("System", "Type")) + WriteCustomAttributeTypeValue ((TypeReference)value); + else + WriteCustomAttributeEnumValue (type, value); + break; + default: + WritePrimitiveValue (value); + break; + } + } + + private void WriteCustomAttributeTypeValue (TypeReference value) + { + var typeDefinition = value as TypeDefinition; + + if (typeDefinition != null) { + TypeDefinition outermostDeclaringType = typeDefinition; + while (outermostDeclaringType.DeclaringType != null) + outermostDeclaringType = outermostDeclaringType.DeclaringType; + + // In CLR .winmd files, custom attribute arguments reference unmangled type names (rather than Name) + if (WindowsRuntimeProjections.IsClrImplementationType (outermostDeclaringType)) { + WindowsRuntimeProjections.Project (outermostDeclaringType); + WriteTypeReference (value); + WindowsRuntimeProjections.RemoveProjection (outermostDeclaringType); + return; + } + } + + WriteTypeReference (value); + } + + void WritePrimitiveValue (object value) + { + if (value == null) + throw new ArgumentNullException (); + + switch (Type.GetTypeCode (value.GetType ())) { + case TypeCode.Boolean: + WriteByte ((byte)(((bool)value) ? 1 : 0)); + break; + case TypeCode.Byte: + WriteByte ((byte)value); + break; + case TypeCode.SByte: + WriteSByte ((sbyte)value); + break; + case TypeCode.Int16: + WriteInt16 ((short)value); + break; + case TypeCode.UInt16: + WriteUInt16 ((ushort)value); + break; + case TypeCode.Char: + WriteInt16 ((short)(char)value); + break; + case TypeCode.Int32: + WriteInt32 ((int)value); + break; + case TypeCode.UInt32: + WriteUInt32 ((uint)value); + break; + case TypeCode.Single: + WriteSingle ((float)value); + break; + case TypeCode.Int64: + WriteInt64 ((long)value); + break; + case TypeCode.UInt64: + WriteUInt64 ((ulong)value); + break; + case TypeCode.Double: + WriteDouble ((double)value); + break; + default: + throw new NotSupportedException (value.GetType ().FullName); + } + } + + void WriteCustomAttributeEnumValue (TypeReference enum_type, object value) + { + var type = enum_type.CheckedResolve (); + if (!type.IsEnum) + throw new ArgumentException (); + + WriteCustomAttributeValue (type.GetEnumUnderlyingType (), value); + } + + void WriteCustomAttributeFieldOrPropType (TypeReference type) + { + if (type.IsArray) { + var array = (ArrayType)type; + WriteElementType (ElementType.SzArray); + WriteCustomAttributeFieldOrPropType (array.ElementType); + return; + } + + var etype = type.etype; + + switch (etype) { + case ElementType.Object: + WriteElementType (ElementType.Boxed); + return; + case ElementType.None: + if (type.IsTypeOf ("System", "Type")) + WriteElementType (ElementType.Type); + else { + WriteElementType (ElementType.Enum); + WriteTypeReference (type); + } + return; + default: + WriteElementType (etype); + return; + } + } + + public void WriteCustomAttributeNamedArguments (CustomAttribute attribute) + { + var count = GetNamedArgumentCount (attribute); + + WriteUInt16 ((ushort)count); + + if (count == 0) + return; + + WriteICustomAttributeNamedArguments (attribute); + } + + static int GetNamedArgumentCount (ICustomAttribute attribute) + { + int count = 0; + + if (attribute.HasFields) + count += attribute.Fields.Count; + + if (attribute.HasProperties) + count += attribute.Properties.Count; + + return count; + } + + void WriteICustomAttributeNamedArguments (ICustomAttribute attribute) + { + if (attribute.HasFields) + WriteCustomAttributeNamedArguments (0x53, attribute.Fields); + + if (attribute.HasProperties) + WriteCustomAttributeNamedArguments (0x54, attribute.Properties); + } + + void WriteCustomAttributeNamedArguments (byte kind, Collection named_arguments) + { + for (int i = 0; i < named_arguments.Count; i++) + WriteCustomAttributeNamedArgument (kind, named_arguments [i]); + } + + void WriteCustomAttributeNamedArgument (byte kind, CustomAttributeNamedArgument named_argument) + { + var argument = named_argument.Argument; + + WriteByte (kind); + WriteCustomAttributeFieldOrPropType (argument.Type); + WriteUTF8String (named_argument.Name); + WriteCustomAttributeFixedArgument (argument.Type, argument); + } + + void WriteSecurityAttribute (SecurityAttribute attribute) + { + WriteTypeReference (attribute.AttributeType); + + var count = GetNamedArgumentCount (attribute); + + if (count == 0) { + WriteCompressedUInt32 (1); // length + WriteCompressedUInt32 (0); // count + return; + } + + var buffer = new SignatureWriter (metadata); + buffer.WriteCompressedUInt32 ((uint)count); + buffer.WriteICustomAttributeNamedArguments (attribute); + + WriteCompressedUInt32 ((uint)buffer.length); + WriteBytes (buffer); + } + + public void WriteSecurityDeclaration (SecurityDeclaration declaration) + { + WriteByte ((byte)'.'); + + var attributes = declaration.security_attributes; + if (attributes == null) + throw new NotSupportedException (); + + WriteCompressedUInt32 ((uint)attributes.Count); + + for (int i = 0; i < attributes.Count; i++) + WriteSecurityAttribute (attributes [i]); + } + + public void WriteXmlSecurityDeclaration (SecurityDeclaration declaration) + { + var xml = GetXmlSecurityDeclaration (declaration); + if (xml == null) + throw new NotSupportedException (); + + WriteBytes (Encoding.Unicode.GetBytes (xml)); + } + + static string GetXmlSecurityDeclaration (SecurityDeclaration declaration) + { + if (declaration.security_attributes == null || declaration.security_attributes.Count != 1) + return null; + + var attribute = declaration.security_attributes [0]; + + if (!attribute.AttributeType.IsTypeOf ("System.Security.Permissions", "PermissionSetAttribute")) + return null; + + if (attribute.properties == null || attribute.properties.Count != 1) + return null; + + var property = attribute.properties [0]; + if (property.Name != "XML") + return null; + + return (string)property.Argument.Value; + } + + void WriteTypeReference (TypeReference type) + { + WriteUTF8String (TypeParser.ToParseable (type, top_level: false)); + } + + public void WriteMarshalInfo (MarshalInfo marshal_info) + { + WriteNativeType (marshal_info.native); + + switch (marshal_info.native) { + case NativeType.Array: { + var array = (ArrayMarshalInfo)marshal_info; + if (array.element_type != NativeType.None) + WriteNativeType (array.element_type); + if (array.size_parameter_index > -1) + WriteCompressedUInt32 ((uint)array.size_parameter_index); + if (array.size > -1) + WriteCompressedUInt32 ((uint)array.size); + if (array.size_parameter_multiplier > -1) + WriteCompressedUInt32 ((uint)array.size_parameter_multiplier); + return; + } + case NativeType.SafeArray: { + var array = (SafeArrayMarshalInfo)marshal_info; + if (array.element_type != VariantType.None) + WriteVariantType (array.element_type); + return; + } + case NativeType.FixedArray: { + var array = (FixedArrayMarshalInfo)marshal_info; + if (array.size > -1) + WriteCompressedUInt32 ((uint)array.size); + if (array.element_type != NativeType.None) + WriteNativeType (array.element_type); + return; + } + case NativeType.FixedSysString: + var sys_string = (FixedSysStringMarshalInfo)marshal_info; + if (sys_string.size > -1) + WriteCompressedUInt32 ((uint)sys_string.size); + return; + case NativeType.CustomMarshaler: + var marshaler = (CustomMarshalInfo)marshal_info; + WriteUTF8String (marshaler.guid != Guid.Empty ? marshaler.guid.ToString () : string.Empty); + WriteUTF8String (marshaler.unmanaged_type); + WriteTypeReference (marshaler.managed_type); + WriteUTF8String (marshaler.cookie); + return; + } + } + + void WriteNativeType (NativeType native) + { + WriteByte ((byte)native); + } + + void WriteVariantType (VariantType variant) + { + WriteByte ((byte)variant); + } + + public void WriteSequencePoints (MethodDebugInformation info) + { + var start_line = -1; + var start_column = -1; + + WriteCompressedUInt32 (info.local_var_token.RID); + + Document previous_document; + if (!info.TryGetUniqueDocument (out previous_document)) + previous_document = null; + + for (int i = 0; i < info.SequencePoints.Count; i++) { + var sequence_point = info.SequencePoints [i]; + + var document = sequence_point.Document; + if (previous_document != document) { + var document_token = metadata.GetDocumentToken (document); + + if (previous_document != null) + WriteCompressedUInt32 (0); + + WriteCompressedUInt32 (document_token.RID); + previous_document = document; + } + + if (i > 0) + WriteCompressedUInt32 ((uint)(sequence_point.Offset - info.SequencePoints [i - 1].Offset)); + else + WriteCompressedUInt32 ((uint)sequence_point.Offset); + + if (sequence_point.IsHidden) { + WriteInt16 (0); + continue; + } + + var delta_lines = sequence_point.EndLine - sequence_point.StartLine; + var delta_columns = sequence_point.EndColumn - sequence_point.StartColumn; + + WriteCompressedUInt32 ((uint)delta_lines); + + if (delta_lines == 0) + WriteCompressedUInt32 ((uint)delta_columns); + else + WriteCompressedInt32 (delta_columns); + + if (start_line < 0) { + WriteCompressedUInt32 ((uint)sequence_point.StartLine); + WriteCompressedUInt32 ((uint)sequence_point.StartColumn); + } else { + WriteCompressedInt32 (sequence_point.StartLine - start_line); + WriteCompressedInt32 (sequence_point.StartColumn - start_column); + } + + start_line = sequence_point.StartLine; + start_column = sequence_point.StartColumn; + } + } + } + + static partial class Mixin { + + public static bool TryGetUniqueDocument (this MethodDebugInformation info, out Document document) + { + document = info.SequencePoints [0].Document; + + for (int i = 1; i < info.SequencePoints.Count; i++) { + var sequence_point = info.SequencePoints [i]; + if (sequence_point.Document != document) + return false; + } + + return true; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyWriter.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyWriter.cs.meta new file mode 100644 index 0000000..a25718a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/AssemblyWriter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a88ce645df13da4aa9eca43f013f6ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/BaseAssemblyResolver.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/BaseAssemblyResolver.cs new file mode 100644 index 0000000..cb3c16a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/BaseAssemblyResolver.cs @@ -0,0 +1,406 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace MonoFN.Cecil { + + public delegate AssemblyDefinition AssemblyResolveEventHandler (object sender, AssemblyNameReference reference); + + public sealed class AssemblyResolveEventArgs : EventArgs { + + readonly AssemblyNameReference reference; + + public AssemblyNameReference AssemblyReference { + get { return reference; } + } + + public AssemblyResolveEventArgs (AssemblyNameReference reference) + { + this.reference = reference; + } + } + +#if !NET_CORE + [Serializable] +#endif + public sealed class AssemblyResolutionException : FileNotFoundException { + + readonly AssemblyNameReference reference; + + public AssemblyNameReference AssemblyReference { + get { return reference; } + } + + public AssemblyResolutionException (AssemblyNameReference reference) + : this (reference, null) + { + } + + public AssemblyResolutionException (AssemblyNameReference reference, Exception innerException) + : base (string.Format ("Failed to resolve assembly: '{0}'", reference), innerException) + { + this.reference = reference; + } + +#if !NET_CORE + AssemblyResolutionException ( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) + : base (info, context) + { + } +#endif + } + + public abstract class BaseAssemblyResolver : IAssemblyResolver { + + static readonly bool on_mono = Type.GetType ("MonoFN.Runtime") != null; + + readonly Collection directories; + +#if NET_CORE + // Maps file names of available trusted platform assemblies to their full paths. + // Internal for testing. + internal static readonly Lazy> TrustedPlatformAssemblies = new Lazy> (CreateTrustedPlatformAssemblyMap); +#else + Collection gac_paths; +#endif + + public void AddSearchDirectory (string directory) + { + directories.Add (directory); + } + + public void RemoveSearchDirectory (string directory) + { + directories.Remove (directory); + } + + public string [] GetSearchDirectories () + { + var directories = new string [this.directories.size]; + Array.Copy (this.directories.items, directories, directories.Length); + return directories; + } + + public event AssemblyResolveEventHandler ResolveFailure; + + protected BaseAssemblyResolver () + { + directories = new Collection (2) { ".", "bin" }; + } + + AssemblyDefinition GetAssembly (string file, ReaderParameters parameters) + { + if (parameters.AssemblyResolver == null) + parameters.AssemblyResolver = this; + + return ModuleDefinition.ReadModule (file, parameters).Assembly; + } + + public virtual AssemblyDefinition Resolve (AssemblyNameReference name) + { + return Resolve (name, new ReaderParameters ()); + } + + public virtual AssemblyDefinition Resolve (AssemblyNameReference name, ReaderParameters parameters) + { + Mixin.CheckName (name); + Mixin.CheckParameters (parameters); + + var assembly = SearchDirectory (name, directories, parameters); + if (assembly != null) + return assembly; + + if (name.IsRetargetable) { + // if the reference is retargetable, zero it + name = new AssemblyNameReference (name.Name, Mixin.ZeroVersion) { + PublicKeyToken = Empty.Array, + }; + } + +#if NET_CORE + assembly = SearchTrustedPlatformAssemblies (name, parameters); + if (assembly != null) + return assembly; +#else + var framework_dir = Path.GetDirectoryName (typeof (object).Module.FullyQualifiedName); + var framework_dirs = on_mono + ? new [] { framework_dir, Path.Combine (framework_dir, "Facades") } + : new [] { framework_dir }; + + if (IsZero (name.Version)) { + assembly = SearchDirectory (name, framework_dirs, parameters); + if (assembly != null) + return assembly; + } + + if (name.Name == "mscorlib") { + assembly = GetCorlib (name, parameters); + if (assembly != null) + return assembly; + } + + assembly = GetAssemblyInGac (name, parameters); + if (assembly != null) + return assembly; + + assembly = SearchDirectory (name, framework_dirs, parameters); + if (assembly != null) + return assembly; +#endif + if (ResolveFailure != null) { + assembly = ResolveFailure (this, name); + if (assembly != null) + return assembly; + } + + throw new AssemblyResolutionException (name); + } + +#if NET_CORE + AssemblyDefinition SearchTrustedPlatformAssemblies (AssemblyNameReference name, ReaderParameters parameters) + { + if (name.IsWindowsRuntime) + return null; + + if (TrustedPlatformAssemblies.Value.TryGetValue (name.Name, out string path)) + return GetAssembly (path, parameters); + + return null; + } + + static Dictionary CreateTrustedPlatformAssemblyMap () + { + var result = new Dictionary (StringComparer.OrdinalIgnoreCase); + + string paths; + + try { + paths = (string) AppDomain.CurrentDomain.GetData ("TRUSTED_PLATFORM_ASSEMBLIES"); + } catch { + paths = null; + } + + if (paths == null) + return result; + + foreach (var path in paths.Split (Path.PathSeparator)) + if (string.Equals (Path.GetExtension (path), ".dll", StringComparison.OrdinalIgnoreCase)) + result [Path.GetFileNameWithoutExtension (path)] = path; + + return result; + } +#endif + + protected virtual AssemblyDefinition SearchDirectory (AssemblyNameReference name, IEnumerable directories, ReaderParameters parameters) + { + var extensions = name.IsWindowsRuntime ? new [] { ".winmd", ".dll" } : new [] { ".exe", ".dll" }; + foreach (var directory in directories) { + foreach (var extension in extensions) { + string file = Path.Combine (directory, name.Name + extension); + if (!File.Exists (file)) + continue; + try { + return GetAssembly (file, parameters); + } + catch (System.BadImageFormatException) { + continue; + } + } + } + + return null; + } + + static bool IsZero (Version version) + { + return version.Major == 0 && version.Minor == 0 && version.Build == 0 && version.Revision == 0; + } + +#if !NET_CORE + AssemblyDefinition GetCorlib (AssemblyNameReference reference, ReaderParameters parameters) + { + var version = reference.Version; + var corlib = typeof (object).Assembly.GetName (); + if (corlib.Version == version || IsZero (version)) + return GetAssembly (typeof (object).Module.FullyQualifiedName, parameters); + + var path = Directory.GetParent ( + Directory.GetParent ( + typeof (object).Module.FullyQualifiedName).FullName + ).FullName; + + if (on_mono) { + if (version.Major == 1) + path = Path.Combine (path, "1.0"); + else if (version.Major == 2) { + if (version.MajorRevision == 5) + path = Path.Combine (path, "2.1"); + else + path = Path.Combine (path, "2.0"); + } else if (version.Major == 4) + path = Path.Combine (path, "4.0"); + else + throw new NotSupportedException ("Version not supported: " + version); + } else { + switch (version.Major) { + case 1: + if (version.MajorRevision == 3300) + path = Path.Combine (path, "v1.0.3705"); + else + path = Path.Combine (path, "v1.1.4322"); + break; + case 2: + path = Path.Combine (path, "v2.0.50727"); + break; + case 4: + path = Path.Combine (path, "v4.0.30319"); + break; + default: + throw new NotSupportedException ("Version not supported: " + version); + } + } + + var file = Path.Combine (path, "mscorlib.dll"); + if (File.Exists (file)) + return GetAssembly (file, parameters); + + if (on_mono && Directory.Exists (path + "-api")) { + file = Path.Combine (path + "-api", "mscorlib.dll"); + if (File.Exists (file)) + return GetAssembly (file, parameters); + } + + return null; + } + + static Collection GetGacPaths () + { + if (on_mono) + return GetDefaultMonoGacPaths (); + + var paths = new Collection (2); + var windir = Environment.GetEnvironmentVariable ("WINDIR"); + if (windir == null) + return paths; + + paths.Add (Path.Combine (windir, "assembly")); + paths.Add (Path.Combine (windir, Path.Combine ("Microsoft.NET", "assembly"))); + return paths; + } + + static Collection GetDefaultMonoGacPaths () + { + var paths = new Collection (1); + var gac = GetCurrentMonoGac (); + if (gac != null) + paths.Add (gac); + + var gac_paths_env = Environment.GetEnvironmentVariable ("MONO_GAC_PREFIX"); + if (string.IsNullOrEmpty (gac_paths_env)) + return paths; + + var prefixes = gac_paths_env.Split (Path.PathSeparator); + foreach (var prefix in prefixes) { + if (string.IsNullOrEmpty (prefix)) + continue; + + var gac_path = Path.Combine (Path.Combine (Path.Combine (prefix, "lib"), "mono"), "gac"); + if (Directory.Exists (gac_path) && !paths.Contains (gac)) + paths.Add (gac_path); + } + + return paths; + } + + static string GetCurrentMonoGac () + { + return Path.Combine ( + Directory.GetParent ( + Path.GetDirectoryName (typeof (object).Module.FullyQualifiedName)).FullName, + "gac"); + } + + AssemblyDefinition GetAssemblyInGac (AssemblyNameReference reference, ReaderParameters parameters) + { + if (reference.PublicKeyToken == null || reference.PublicKeyToken.Length == 0) + return null; + + if (gac_paths == null) + gac_paths = GetGacPaths (); + + if (on_mono) + return GetAssemblyInMonoGac (reference, parameters); + + return GetAssemblyInNetGac (reference, parameters); + } + + AssemblyDefinition GetAssemblyInMonoGac (AssemblyNameReference reference, ReaderParameters parameters) + { + for (int i = 0; i < gac_paths.Count; i++) { + var gac_path = gac_paths [i]; + var file = GetAssemblyFile (reference, string.Empty, gac_path); + if (File.Exists (file)) + return GetAssembly (file, parameters); + } + + return null; + } + + AssemblyDefinition GetAssemblyInNetGac (AssemblyNameReference reference, ReaderParameters parameters) + { + var gacs = new [] { "GAC_MSIL", "GAC_32", "GAC_64", "GAC" }; + var prefixes = new [] { string.Empty, "v4.0_" }; + + for (int i = 0; i < gac_paths.Count; i++) { + for (int j = 0; j < gacs.Length; j++) { + var gac = Path.Combine (gac_paths [i], gacs [j]); + var file = GetAssemblyFile (reference, prefixes [i], gac); + if (Directory.Exists (gac) && File.Exists (file)) + return GetAssembly (file, parameters); + } + } + + return null; + } + + static string GetAssemblyFile (AssemblyNameReference reference, string prefix, string gac) + { + var gac_folder = new StringBuilder () + .Append (prefix) + .Append (reference.Version) + .Append ("__"); + + for (int i = 0; i < reference.PublicKeyToken.Length; i++) + gac_folder.Append (reference.PublicKeyToken [i].ToString ("x2")); + + return Path.Combine ( + Path.Combine ( + Path.Combine (gac, reference.Name), gac_folder.ToString ()), + reference.Name + ".dll"); + } +#endif + public void Dispose () + { + Dispose (true); + GC.SuppressFinalize (this); + } + + protected virtual void Dispose (bool disposing) + { + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/BaseAssemblyResolver.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/BaseAssemblyResolver.cs.meta new file mode 100644 index 0000000..87211a6 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/BaseAssemblyResolver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ab1d53794ef7444c81e276b5a3a5c2b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CallSite.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CallSite.cs new file mode 100644 index 0000000..34e8ac7 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CallSite.cs @@ -0,0 +1,105 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; +using System.Text; + +namespace MonoFN.Cecil { + + public sealed class CallSite : IMethodSignature { + + readonly MethodReference signature; + + public bool HasThis { + get { return signature.HasThis; } + set { signature.HasThis = value; } + } + + public bool ExplicitThis { + get { return signature.ExplicitThis; } + set { signature.ExplicitThis = value; } + } + + public MethodCallingConvention CallingConvention { + get { return signature.CallingConvention; } + set { signature.CallingConvention = value; } + } + + public bool HasParameters { + get { return signature.HasParameters; } + } + + public Collection Parameters { + get { return signature.Parameters; } + } + + public TypeReference ReturnType { + get { return signature.MethodReturnType.ReturnType; } + set { signature.MethodReturnType.ReturnType = value; } + } + + public MethodReturnType MethodReturnType { + get { return signature.MethodReturnType; } + } + + public string Name { + get { return string.Empty; } + set { throw new InvalidOperationException (); } + } + + public string Namespace { + get { return string.Empty; } + set { throw new InvalidOperationException (); } + } + + public ModuleDefinition Module { + get { return ReturnType.Module; } + } + + public IMetadataScope Scope { + get { return signature.ReturnType.Scope; } + } + + public MetadataToken MetadataToken { + get { return signature.token; } + set { signature.token = value; } + } + + public string FullName { + get { + var signature = new StringBuilder (); + signature.Append (ReturnType.FullName); + this.MethodSignatureFullName (signature); + return signature.ToString (); + } + } + + internal CallSite () + { + this.signature = new MethodReference (); + this.signature.token = new MetadataToken (TokenType.Signature, 0); + } + + public CallSite (TypeReference returnType) + : this () + { + if (returnType == null) + throw new ArgumentNullException ("returnType"); + + this.signature.ReturnType = returnType; + } + + public override string ToString () + { + return FullName; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CallSite.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CallSite.cs.meta new file mode 100644 index 0000000..8eac3ae --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CallSite.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 087823dce9623d348927f193f95a1807 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Consts.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Consts.cs new file mode 100644 index 0000000..e19f2c8 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Consts.cs @@ -0,0 +1,10 @@ +namespace MonoFN.Cecil +{ + + static class Consts + { + public const string AssemblyName = "MonoFN.Cecil"; + public const string PublicKey = "00240000048000009400000006020000002400005253413100040000010001002b5c9f7f04346c324a3176f8d3ee823bbf2d60efdbc35f86fd9e65ea3e6cd11bcdcba3a353e55133c8ac5c4caaba581b2c6dfff2cc2d0edc43959ddb86b973300a479a82419ef489c3225f1fe429a708507bd515835160e10bc743d20ca33ab9570cfd68d479fcf0bc797a763bec5d1000f0159ef619e709d915975e87beebaf"; + } + +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Consts.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Consts.cs.meta new file mode 100644 index 0000000..2491449 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Consts.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da413e0e98056364a9512beb26e9aea5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CustomAttribute.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CustomAttribute.cs new file mode 100644 index 0000000..d9bda73 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CustomAttribute.cs @@ -0,0 +1,221 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; +using System.Diagnostics; +using System.Threading; + +namespace MonoFN.Cecil { + + public struct CustomAttributeArgument { + + readonly TypeReference type; + readonly object value; + + public TypeReference Type { + get { return type; } + } + + public object Value { + get { return value; } + } + + public CustomAttributeArgument (TypeReference type, object value) + { + Mixin.CheckType (type); + this.type = type; + this.value = value; + } + } + + public struct CustomAttributeNamedArgument { + + readonly string name; + readonly CustomAttributeArgument argument; + + public string Name { + get { return name; } + } + + public CustomAttributeArgument Argument { + get { return argument; } + } + + public CustomAttributeNamedArgument (string name, CustomAttributeArgument argument) + { + Mixin.CheckName (name); + this.name = name; + this.argument = argument; + } + } + + public interface ICustomAttribute { + + TypeReference AttributeType { get; } + + bool HasFields { get; } + bool HasProperties { get; } + bool HasConstructorArguments { get; } + Collection Fields { get; } + Collection Properties { get; } + Collection ConstructorArguments { get; } + } + + [DebuggerDisplay ("{AttributeType}")] + public sealed class CustomAttribute : ICustomAttribute { + + internal CustomAttributeValueProjection projection; + readonly internal uint signature; + internal bool resolved; + MethodReference constructor; + byte [] blob; + internal Collection arguments; + internal Collection fields; + internal Collection properties; + + public MethodReference Constructor { + get { return constructor; } + set { constructor = value; } + } + + public TypeReference AttributeType { + get { return constructor.DeclaringType; } + } + + public bool IsResolved { + get { return resolved; } + } + + public bool HasConstructorArguments { + get { + Resolve (); + + return !arguments.IsNullOrEmpty (); + } + } + + public Collection ConstructorArguments { + get { + Resolve (); + + if (arguments == null) + Interlocked.CompareExchange (ref arguments, new Collection (), null); + + return arguments; + } + } + + public bool HasFields { + get { + Resolve (); + + return !fields.IsNullOrEmpty (); + } + } + + public Collection Fields { + get { + Resolve (); + + if (fields == null) + Interlocked.CompareExchange (ref fields, new Collection (), null); + + return fields; + } + } + + public bool HasProperties { + get { + Resolve (); + + return !properties.IsNullOrEmpty (); + } + } + + public Collection Properties { + get { + Resolve (); + + if (properties == null) + Interlocked.CompareExchange (ref properties, new Collection (), null); + + return properties; + } + } + + internal bool HasImage { + get { return constructor != null && constructor.HasImage; } + } + + internal ModuleDefinition Module { + get { return constructor.Module; } + } + + internal CustomAttribute (uint signature, MethodReference constructor) + { + this.signature = signature; + this.constructor = constructor; + this.resolved = false; + } + + public CustomAttribute (MethodReference constructor) + { + this.constructor = constructor; + this.resolved = true; + } + + public CustomAttribute (MethodReference constructor, byte [] blob) + { + this.constructor = constructor; + this.resolved = false; + this.blob = blob; + } + + public byte [] GetBlob () + { + if (blob != null) + return blob; + + if (!HasImage) + throw new NotSupportedException (); + + return Module.Read (ref blob, this, (attribute, reader) => reader.ReadCustomAttributeBlob (attribute.signature)); + } + + void Resolve () + { + if (resolved || !HasImage) + return; + + lock (Module.SyncRoot) { + if (resolved) + return; + + Module.Read (this, (attribute, reader) => { + try { + reader.ReadCustomAttributeSignature (attribute); + resolved = true; + } + catch (ResolutionException) { + if (arguments != null) + arguments.Clear (); + if (fields != null) + fields.Clear (); + if (properties != null) + properties.Clear (); + + resolved = false; + } + }); + } + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CustomAttribute.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CustomAttribute.cs.meta new file mode 100644 index 0000000..d60edbe --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/CustomAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91db4bc8250b4b949bf262a196c9c0c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/DefaultAssemblyResolver.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/DefaultAssemblyResolver.cs new file mode 100644 index 0000000..6bbcf96 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/DefaultAssemblyResolver.cs @@ -0,0 +1,61 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; +using System.Collections.Generic; + +namespace MonoFN.Cecil { + + public class DefaultAssemblyResolver : BaseAssemblyResolver { + + readonly IDictionary cache; + + public DefaultAssemblyResolver () + { + cache = new Dictionary (StringComparer.Ordinal); + } + + public override AssemblyDefinition Resolve (AssemblyNameReference name) + { + Mixin.CheckName (name); + + AssemblyDefinition assembly; + if (cache.TryGetValue (name.FullName, out assembly)) + return assembly; + + assembly = base.Resolve (name); + cache [name.FullName] = assembly; + + return assembly; + } + + protected void RegisterAssembly (AssemblyDefinition assembly) + { + if (assembly == null) + throw new ArgumentNullException ("assembly"); + + var name = assembly.Name.FullName; + if (cache.ContainsKey (name)) + return; + + cache [name] = assembly; + } + + protected override void Dispose (bool disposing) + { + foreach (var assembly in cache.Values) + assembly.Dispose (); + + cache.Clear (); + + base.Dispose (disposing); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/DefaultAssemblyResolver.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/DefaultAssemblyResolver.cs.meta new file mode 100644 index 0000000..75e60fb --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/DefaultAssemblyResolver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5390b4f18cb83c046baaaa937fec06a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EmbeddedResource.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EmbeddedResource.cs new file mode 100644 index 0000000..693283e --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EmbeddedResource.cs @@ -0,0 +1,98 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; +using System.IO; + +namespace MonoFN.Cecil { + + public sealed class EmbeddedResource : Resource { + + readonly MetadataReader reader; + + uint? offset; + byte [] data; + Stream stream; + + public override ResourceType ResourceType { + get { return ResourceType.Embedded; } + } + + public EmbeddedResource (string name, ManifestResourceAttributes attributes, byte [] data) : + base (name, attributes) + { + this.data = data; + } + + public EmbeddedResource (string name, ManifestResourceAttributes attributes, Stream stream) : + base (name, attributes) + { + this.stream = stream; + } + + internal EmbeddedResource (string name, ManifestResourceAttributes attributes, uint offset, MetadataReader reader) + : base (name, attributes) + { + this.offset = offset; + this.reader = reader; + } + + public Stream GetResourceStream () + { + if (stream != null) + return stream; + + if (data != null) + return new MemoryStream (data); + + if (offset.HasValue) + return new MemoryStream (reader.GetManagedResource (offset.Value)); + + throw new InvalidOperationException (); + } + + public byte [] GetResourceData () + { + if (stream != null) + return ReadStream (stream); + + if (data != null) + return data; + + if (offset.HasValue) + return reader.GetManagedResource (offset.Value); + + throw new InvalidOperationException (); + } + + static byte [] ReadStream (Stream stream) + { + int read; + + if (stream.CanSeek) { + var length = (int)stream.Length; + var data = new byte [length]; + int offset = 0; + + while ((read = stream.Read (data, offset, length - offset)) > 0) + offset += read; + + return data; + } + + var buffer = new byte [1024 * 8]; + var memory = new MemoryStream (); + while ((read = stream.Read (buffer, 0, buffer.Length)) > 0) + memory.Write (buffer, 0, read); + + return memory.ToArray (); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EmbeddedResource.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EmbeddedResource.cs.meta new file mode 100644 index 0000000..d7d8b36 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EmbeddedResource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b5874acd8fee1b4499a3249dd4648428 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventAttributes.cs new file mode 100644 index 0000000..7be266a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventAttributes.cs @@ -0,0 +1,21 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum EventAttributes : ushort { + None = 0x0000, + SpecialName = 0x0200, // Event is special + RTSpecialName = 0x0400 // CLI provides 'special' behavior, depending upon the name of the event + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventAttributes.cs.meta new file mode 100644 index 0000000..11259a6 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 20c18be3d45bbf84d82732fd16751df3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventDefinition.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventDefinition.cs new file mode 100644 index 0000000..28776b5 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventDefinition.cs @@ -0,0 +1,156 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System.Threading; + +namespace MonoFN.Cecil { + + public sealed class EventDefinition : EventReference, IMemberDefinition { + + ushort attributes; + + Collection custom_attributes; + + internal MethodDefinition add_method; + internal MethodDefinition invoke_method; + internal MethodDefinition remove_method; + internal Collection other_methods; + + public EventAttributes Attributes { + get { return (EventAttributes)attributes; } + set { attributes = (ushort)value; } + } + + public MethodDefinition AddMethod { + get { + if (add_method != null) + return add_method; + + InitializeMethods (); + return add_method; + } + set { add_method = value; } + } + + public MethodDefinition InvokeMethod { + get { + if (invoke_method != null) + return invoke_method; + + InitializeMethods (); + return invoke_method; + } + set { invoke_method = value; } + } + + public MethodDefinition RemoveMethod { + get { + if (remove_method != null) + return remove_method; + + InitializeMethods (); + return remove_method; + } + set { remove_method = value; } + } + + public bool HasOtherMethods { + get { + if (other_methods != null) + return other_methods.Count > 0; + + InitializeMethods (); + return !other_methods.IsNullOrEmpty (); + } + } + + public Collection OtherMethods { + get { + if (other_methods != null) + return other_methods; + + InitializeMethods (); + + if (other_methods == null) + Interlocked.CompareExchange (ref other_methods, new Collection (), null); + + return other_methods; + } + } + + public bool HasCustomAttributes { + get { + if (custom_attributes != null) + return custom_attributes.Count > 0; + + return this.GetHasCustomAttributes (Module); + } + } + + public Collection CustomAttributes { + get { return custom_attributes ?? (this.GetCustomAttributes (ref custom_attributes, Module)); } + } + + #region EventAttributes + + public bool IsSpecialName { + get { return attributes.GetAttributes ((ushort)EventAttributes.SpecialName); } + set { attributes = attributes.SetAttributes ((ushort)EventAttributes.SpecialName, value); } + } + + public bool IsRuntimeSpecialName { + get { return attributes.GetAttributes ((ushort)EventAttributes.RTSpecialName); } + set { attributes = attributes.SetAttributes ((ushort)EventAttributes.RTSpecialName, value); } + } + + #endregion + + public new TypeDefinition DeclaringType { + get { return (TypeDefinition)base.DeclaringType; } + set { base.DeclaringType = value; } + } + + public override bool IsDefinition { + get { return true; } + } + + public EventDefinition (string name, EventAttributes attributes, TypeReference eventType) + : base (name, eventType) + { + this.attributes = (ushort)attributes; + this.token = new MetadataToken (TokenType.Event); + } + + void InitializeMethods () + { + var module = this.Module; + if (module == null) + return; + + lock (module.SyncRoot) { + if (add_method != null + || invoke_method != null + || remove_method != null) + return; + + if (!module.HasImage ()) + return; + + module.Read (this, (@event, reader) => reader.ReadMethods (@event)); + } + } + + public override EventDefinition Resolve () + { + return this; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventDefinition.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventDefinition.cs.meta new file mode 100644 index 0000000..c8daf6b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b201911ff1f925438edbe5b91275268 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventReference.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventReference.cs new file mode 100644 index 0000000..d188a37 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventReference.cs @@ -0,0 +1,40 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public abstract class EventReference : MemberReference { + + TypeReference event_type; + + public TypeReference EventType { + get { return event_type; } + set { event_type = value; } + } + + public override string FullName { + get { return event_type.FullName + " " + MemberFullName (); } + } + + protected EventReference (string name, TypeReference eventType) + : base (name) + { + Mixin.CheckType (eventType, Mixin.Argument.eventType); + event_type = eventType; + } + + protected override IMemberDefinition ResolveDefinition () + { + return this.Resolve (); + } + + public new abstract EventDefinition Resolve (); + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventReference.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventReference.cs.meta new file mode 100644 index 0000000..80e4e71 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/EventReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94d9b58b6c4033343b975f6730127514 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ExportedType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ExportedType.cs new file mode 100644 index 0000000..68b4410 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ExportedType.cs @@ -0,0 +1,238 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public sealed class ExportedType : IMetadataTokenProvider { + + string @namespace; + string name; + uint attributes; + IMetadataScope scope; + ModuleDefinition module; + int identifier; + ExportedType declaring_type; + internal MetadataToken token; + + public string Namespace { + get { return @namespace; } + set { @namespace = value; } + } + + public string Name { + get { return name; } + set { name = value; } + } + + public TypeAttributes Attributes { + get { return (TypeAttributes)attributes; } + set { attributes = (uint)value; } + } + + public IMetadataScope Scope { + get { + if (declaring_type != null) + return declaring_type.Scope; + + return scope; + } + set { + if (declaring_type != null) { + declaring_type.Scope = value; + return; + } + + scope = value; + } + } + + public ExportedType DeclaringType { + get { return declaring_type; } + set { declaring_type = value; } + } + + public MetadataToken MetadataToken { + get { return token; } + set { token = value; } + } + + public int Identifier { + get { return identifier; } + set { identifier = value; } + } + + #region TypeAttributes + + public bool IsNotPublic { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NotPublic); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NotPublic, value); } + } + + public bool IsPublic { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.Public); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.Public, value); } + } + + public bool IsNestedPublic { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedPublic); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedPublic, value); } + } + + public bool IsNestedPrivate { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedPrivate); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedPrivate, value); } + } + + public bool IsNestedFamily { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamily); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamily, value); } + } + + public bool IsNestedAssembly { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedAssembly); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedAssembly, value); } + } + + public bool IsNestedFamilyAndAssembly { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamANDAssem); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamANDAssem, value); } + } + + public bool IsNestedFamilyOrAssembly { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamORAssem); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamORAssem, value); } + } + + public bool IsAutoLayout { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.AutoLayout); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.AutoLayout, value); } + } + + public bool IsSequentialLayout { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.SequentialLayout); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.SequentialLayout, value); } + } + + public bool IsExplicitLayout { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.ExplicitLayout); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.ExplicitLayout, value); } + } + + public bool IsClass { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.ClassSemanticMask, (uint)TypeAttributes.Class); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.ClassSemanticMask, (uint)TypeAttributes.Class, value); } + } + + public bool IsInterface { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.ClassSemanticMask, (uint)TypeAttributes.Interface); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.ClassSemanticMask, (uint)TypeAttributes.Interface, value); } + } + + public bool IsAbstract { + get { return attributes.GetAttributes ((uint)TypeAttributes.Abstract); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.Abstract, value); } + } + + public bool IsSealed { + get { return attributes.GetAttributes ((uint)TypeAttributes.Sealed); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.Sealed, value); } + } + + public bool IsSpecialName { + get { return attributes.GetAttributes ((uint)TypeAttributes.SpecialName); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.SpecialName, value); } + } + + public bool IsImport { + get { return attributes.GetAttributes ((uint)TypeAttributes.Import); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.Import, value); } + } + + public bool IsSerializable { + get { return attributes.GetAttributes ((uint)TypeAttributes.Serializable); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.Serializable, value); } + } + + public bool IsAnsiClass { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.AnsiClass); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.AnsiClass, value); } + } + + public bool IsUnicodeClass { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.UnicodeClass); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.UnicodeClass, value); } + } + + public bool IsAutoClass { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.AutoClass); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.AutoClass, value); } + } + + public bool IsBeforeFieldInit { + get { return attributes.GetAttributes ((uint)TypeAttributes.BeforeFieldInit); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.BeforeFieldInit, value); } + } + + public bool IsRuntimeSpecialName { + get { return attributes.GetAttributes ((uint)TypeAttributes.RTSpecialName); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.RTSpecialName, value); } + } + + public bool HasSecurity { + get { return attributes.GetAttributes ((uint)TypeAttributes.HasSecurity); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.HasSecurity, value); } + } + + #endregion + + public bool IsForwarder { + get { return attributes.GetAttributes ((uint)TypeAttributes.Forwarder); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.Forwarder, value); } + } + + public string FullName { + get { + var fullname = string.IsNullOrEmpty (@namespace) + ? name + : @namespace + '.' + name; + + if (declaring_type != null) + return declaring_type.FullName + "/" + fullname; + + return fullname; + } + } + + public ExportedType (string @namespace, string name, ModuleDefinition module, IMetadataScope scope) + { + this.@namespace = @namespace; + this.name = name; + this.scope = scope; + this.module = module; + } + + public override string ToString () + { + return FullName; + } + + public TypeDefinition Resolve () + { + return module.Resolve (CreateReference ()); + } + + internal TypeReference CreateReference () + { + return new TypeReference (@namespace, name, module, scope) { + DeclaringType = declaring_type != null ? declaring_type.CreateReference () : null, + }; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ExportedType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ExportedType.cs.meta new file mode 100644 index 0000000..27b33ff --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ExportedType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b7fa6f0bdd43c0d44a63cd789a765eeb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldAttributes.cs new file mode 100644 index 0000000..e4afd2c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldAttributes.cs @@ -0,0 +1,41 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum FieldAttributes : ushort { + FieldAccessMask = 0x0007, + CompilerControlled = 0x0000, // Member not referenceable + Private = 0x0001, // Accessible only by the parent type + FamANDAssem = 0x0002, // Accessible by sub-types only in this assembly + Assembly = 0x0003, // Accessible by anyone in the Assembly + Family = 0x0004, // Accessible only by type and sub-types + FamORAssem = 0x0005, // Accessible by sub-types anywhere, plus anyone in the assembly + Public = 0x0006, // Accessible by anyone who has visibility to this scope field contract attributes + + Static = 0x0010, // Defined on type, else per instance + InitOnly = 0x0020, // Field may only be initialized, not written after init + Literal = 0x0040, // Value is compile time constant + NotSerialized = 0x0080, // Field does not have to be serialized when type is remoted + SpecialName = 0x0200, // Field is special + + // Interop Attributes + PInvokeImpl = 0x2000, // Implementation is forwarded through PInvoke + + // Additional flags + RTSpecialName = 0x0400, // CLI provides 'special' behavior, depending upon the name of the field + HasFieldMarshal = 0x1000, // Field has marshalling information + HasDefault = 0x8000, // Field has default + HasFieldRVA = 0x0100 // Field has RVA + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldAttributes.cs.meta new file mode 100644 index 0000000..767a61d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8e9187082e8fc1446a8c2aa12d8f3fa4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldDefinition.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldDefinition.cs new file mode 100644 index 0000000..73cdbc9 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldDefinition.cs @@ -0,0 +1,281 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; + +namespace MonoFN.Cecil { + + public sealed class FieldDefinition : FieldReference, IMemberDefinition, IConstantProvider, IMarshalInfoProvider { + + ushort attributes; + Collection custom_attributes; + + int offset = Mixin.NotResolvedMarker; + + internal int rva = Mixin.NotResolvedMarker; + byte [] initial_value; + + object constant = Mixin.NotResolved; + + MarshalInfo marshal_info; + + void ResolveLayout () + { + if (offset != Mixin.NotResolvedMarker) + return; + + if (!HasImage) { + offset = Mixin.NoDataMarker; + return; + } + + lock (Module.SyncRoot) { + if (offset != Mixin.NotResolvedMarker) + return; + offset = Module.Read (this, (field, reader) => reader.ReadFieldLayout (field)); + } + } + + public bool HasLayoutInfo { + get { + if (offset >= 0) + return true; + + ResolveLayout (); + + return offset >= 0; + } + } + + public int Offset { + get { + if (offset >= 0) + return offset; + + ResolveLayout (); + + return offset >= 0 ? offset : -1; + } + set { offset = value; } + } + + internal FieldDefinitionProjection WindowsRuntimeProjection { + get { return (FieldDefinitionProjection)projection; } + set { projection = value; } + } + + void ResolveRVA () + { + if (rva != Mixin.NotResolvedMarker) + return; + + if (!HasImage) + return; + + lock (Module.SyncRoot) { + if (rva != Mixin.NotResolvedMarker) + return; + rva = Module.Read (this, (field, reader) => reader.ReadFieldRVA (field)); + } + } + + public int RVA { + get { + if (rva > 0) + return rva; + + ResolveRVA (); + + return rva > 0 ? rva : 0; + } + } + + public byte [] InitialValue { + get { + if (initial_value != null) + return initial_value; + + ResolveRVA (); + + if (initial_value == null) + initial_value = Empty.Array; + + return initial_value; + } + set { + initial_value = value; + HasFieldRVA = !initial_value.IsNullOrEmpty (); + rva = 0; + } + } + + public FieldAttributes Attributes { + get { return (FieldAttributes)attributes; } + set { + if (IsWindowsRuntimeProjection && (ushort)value != attributes) + throw new InvalidOperationException (); + + attributes = (ushort)value; + } + } + + public bool HasConstant { + get { + this.ResolveConstant (ref constant, Module); + + return constant != Mixin.NoValue; + } + set { if (!value) constant = Mixin.NoValue; } + } + + public object Constant { + get { return HasConstant ? constant : null; } + set { constant = value; } + } + + public bool HasCustomAttributes { + get { + if (custom_attributes != null) + return custom_attributes.Count > 0; + + return this.GetHasCustomAttributes (Module); + } + } + + public Collection CustomAttributes { + get { return custom_attributes ?? (this.GetCustomAttributes (ref custom_attributes, Module)); } + } + + public bool HasMarshalInfo { + get { + if (marshal_info != null) + return true; + + return this.GetHasMarshalInfo (Module); + } + } + + public MarshalInfo MarshalInfo { + get { return marshal_info ?? (this.GetMarshalInfo (ref marshal_info, Module)); } + set { marshal_info = value; } + } + + #region FieldAttributes + + public bool IsCompilerControlled { + get { return attributes.GetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.CompilerControlled); } + set { attributes = attributes.SetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.CompilerControlled, value); } + } + + public bool IsPrivate { + get { return attributes.GetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.Private); } + set { attributes = attributes.SetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.Private, value); } + } + + public bool IsFamilyAndAssembly { + get { return attributes.GetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.FamANDAssem); } + set { attributes = attributes.SetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.FamANDAssem, value); } + } + + public bool IsAssembly { + get { return attributes.GetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.Assembly); } + set { attributes = attributes.SetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.Assembly, value); } + } + + public bool IsFamily { + get { return attributes.GetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.Family); } + set { attributes = attributes.SetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.Family, value); } + } + + public bool IsFamilyOrAssembly { + get { return attributes.GetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.FamORAssem); } + set { attributes = attributes.SetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.FamORAssem, value); } + } + + public bool IsPublic { + get { return attributes.GetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.Public); } + set { attributes = attributes.SetMaskedAttributes ((ushort)FieldAttributes.FieldAccessMask, (ushort)FieldAttributes.Public, value); } + } + + public bool IsStatic { + get { return attributes.GetAttributes ((ushort)FieldAttributes.Static); } + set { attributes = attributes.SetAttributes ((ushort)FieldAttributes.Static, value); } + } + + public bool IsInitOnly { + get { return attributes.GetAttributes ((ushort)FieldAttributes.InitOnly); } + set { attributes = attributes.SetAttributes ((ushort)FieldAttributes.InitOnly, value); } + } + + public bool IsLiteral { + get { return attributes.GetAttributes ((ushort)FieldAttributes.Literal); } + set { attributes = attributes.SetAttributes ((ushort)FieldAttributes.Literal, value); } + } + + public bool IsNotSerialized { + get { return attributes.GetAttributes ((ushort)FieldAttributes.NotSerialized); } + set { attributes = attributes.SetAttributes ((ushort)FieldAttributes.NotSerialized, value); } + } + + public bool IsSpecialName { + get { return attributes.GetAttributes ((ushort)FieldAttributes.SpecialName); } + set { attributes = attributes.SetAttributes ((ushort)FieldAttributes.SpecialName, value); } + } + + public bool IsPInvokeImpl { + get { return attributes.GetAttributes ((ushort)FieldAttributes.PInvokeImpl); } + set { attributes = attributes.SetAttributes ((ushort)FieldAttributes.PInvokeImpl, value); } + } + + public bool IsRuntimeSpecialName { + get { return attributes.GetAttributes ((ushort)FieldAttributes.RTSpecialName); } + set { attributes = attributes.SetAttributes ((ushort)FieldAttributes.RTSpecialName, value); } + } + + public bool HasDefault { + get { return attributes.GetAttributes ((ushort)FieldAttributes.HasDefault); } + set { attributes = attributes.SetAttributes ((ushort)FieldAttributes.HasDefault, value); } + } + + public bool HasFieldRVA { + get { return attributes.GetAttributes ((ushort)FieldAttributes.HasFieldRVA); } + set { attributes = attributes.SetAttributes ((ushort)FieldAttributes.HasFieldRVA, value); } + } + + #endregion + + public override bool IsDefinition { + get { return true; } + } + + public new TypeDefinition DeclaringType { + get { return (TypeDefinition)base.DeclaringType; } + set { base.DeclaringType = value; } + } + + public FieldDefinition (string name, FieldAttributes attributes, TypeReference fieldType) + : base (name, fieldType) + { + this.attributes = (ushort)attributes; + } + + public override FieldDefinition Resolve () + { + return this; + } + } + + static partial class Mixin { + + public const int NotResolvedMarker = -2; + public const int NoDataMarker = -1; + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldDefinition.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldDefinition.cs.meta new file mode 100644 index 0000000..99dac2a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00dcb95135f39ec4c923f7923bcc93ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldReference.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldReference.cs new file mode 100644 index 0000000..1e9d3e3 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldReference.cs @@ -0,0 +1,68 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + public class FieldReference : MemberReference { + + TypeReference field_type; + + public TypeReference FieldType { + get { return field_type; } + set { field_type = value; } + } + + public override string FullName { + get { return field_type.FullName + " " + MemberFullName (); } + } + + public override bool ContainsGenericParameter { + get { return field_type.ContainsGenericParameter || base.ContainsGenericParameter; } + } + + internal FieldReference () + { + this.token = new MetadataToken (TokenType.MemberRef); + } + + public FieldReference (string name, TypeReference fieldType) + : base (name) + { + Mixin.CheckType (fieldType, Mixin.Argument.fieldType); + + this.field_type = fieldType; + this.token = new MetadataToken (TokenType.MemberRef); + } + + public FieldReference (string name, TypeReference fieldType, TypeReference declaringType) + : this (name, fieldType) + { + Mixin.CheckType (declaringType, Mixin.Argument.declaringType); + + this.DeclaringType = declaringType; + } + + protected override IMemberDefinition ResolveDefinition () + { + return this.Resolve (); + } + + public new virtual FieldDefinition Resolve () + { + var module = this.Module; + if (module == null) + throw new NotSupportedException (); + + return module.Resolve (this); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldReference.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldReference.cs.meta new file mode 100644 index 0000000..6f1c541 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FieldReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 990be2becde06b4468f79bd17646a47a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FileAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FileAttributes.cs new file mode 100644 index 0000000..32715d5 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FileAttributes.cs @@ -0,0 +1,17 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + enum FileAttributes : uint { + ContainsMetaData = 0x0000, // This is not a resource file + ContainsNoMetaData = 0x0001, // This is a resource file or other non-metadata-containing file + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FileAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FileAttributes.cs.meta new file mode 100644 index 0000000..58c3fe0 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FileAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56e662d580c0894489669cc8058a2783 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FunctionPointerType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FunctionPointerType.cs new file mode 100644 index 0000000..8558c54 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FunctionPointerType.cs @@ -0,0 +1,111 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; +using System.Text; +using MD = MonoFN.Cecil.Metadata; + +namespace MonoFN.Cecil { + + public sealed class FunctionPointerType : TypeSpecification, IMethodSignature { + + readonly MethodReference function; + + public bool HasThis { + get { return function.HasThis; } + set { function.HasThis = value; } + } + + public bool ExplicitThis { + get { return function.ExplicitThis; } + set { function.ExplicitThis = value; } + } + + public MethodCallingConvention CallingConvention { + get { return function.CallingConvention; } + set { function.CallingConvention = value; } + } + + public bool HasParameters { + get { return function.HasParameters; } + } + + public Collection Parameters { + get { return function.Parameters; } + } + + public TypeReference ReturnType { + get { return function.MethodReturnType.ReturnType; } + set { function.MethodReturnType.ReturnType = value; } + } + + public MethodReturnType MethodReturnType { + get { return function.MethodReturnType; } + } + + public override string Name { + get { return function.Name; } + set { throw new InvalidOperationException (); } + } + + public override string Namespace { + get { return string.Empty; } + set { throw new InvalidOperationException (); } + } + + public override ModuleDefinition Module { + get { return ReturnType.Module; } + } + + public override IMetadataScope Scope { + get { return function.ReturnType.Scope; } + set { throw new InvalidOperationException (); } + } + + public override bool IsFunctionPointer { + get { return true; } + } + + public override bool ContainsGenericParameter { + get { return function.ContainsGenericParameter; } + } + + public override string FullName { + get { + var signature = new StringBuilder (); + signature.Append (function.Name); + signature.Append (" "); + signature.Append (function.ReturnType.FullName); + signature.Append (" *"); + this.MethodSignatureFullName (signature); + return signature.ToString (); + } + } + + public FunctionPointerType () + : base (null) + { + this.function = new MethodReference (); + this.function.Name = "method"; + this.etype = MD.ElementType.FnPtr; + } + + public override TypeDefinition Resolve () + { + return null; + } + + public override TypeReference GetElementType () + { + return this; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FunctionPointerType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FunctionPointerType.cs.meta new file mode 100644 index 0000000..a576fd7 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/FunctionPointerType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91d84cd146416f945acbfce1b1dbcacb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceMethod.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceMethod.cs new file mode 100644 index 0000000..64737a9 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceMethod.cs @@ -0,0 +1,77 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System.Text; +using System.Threading; + +namespace MonoFN.Cecil { + + public sealed class GenericInstanceMethod : MethodSpecification, IGenericInstance, IGenericContext { + + Collection arguments; + + public bool HasGenericArguments { + get { return !arguments.IsNullOrEmpty (); } + } + + public Collection GenericArguments { + get { + if (arguments == null) + Interlocked.CompareExchange (ref arguments, new Collection (), null); + + return arguments; + } + } + + public override bool IsGenericInstance { + get { return true; } + } + + IGenericParameterProvider IGenericContext.Method { + get { return ElementMethod; } + } + + IGenericParameterProvider IGenericContext.Type { + get { return ElementMethod.DeclaringType; } + } + + public override bool ContainsGenericParameter { + get { return this.ContainsGenericParameter () || base.ContainsGenericParameter; } + } + + public override string FullName { + get { + var signature = new StringBuilder (); + var method = this.ElementMethod; + signature.Append (method.ReturnType.FullName) + .Append (" ") + .Append (method.DeclaringType.FullName) + .Append ("::") + .Append (method.Name); + this.GenericInstanceFullName (signature); + this.MethodSignatureFullName (signature); + return signature.ToString (); + + } + } + + public GenericInstanceMethod (MethodReference method) + : base (method) + { + } + + internal GenericInstanceMethod (MethodReference method, int arity) + : this (method) + { + this.arguments = new Collection (arity); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceMethod.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceMethod.cs.meta new file mode 100644 index 0000000..cee2434 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceMethod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fd61b82dc3c653d42a1fc0f4e4c003f8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceType.cs new file mode 100644 index 0000000..4f40314 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceType.cs @@ -0,0 +1,75 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; +using System.Text; +using System.Threading; +using MD = MonoFN.Cecil.Metadata; + +namespace MonoFN.Cecil { + + public sealed class GenericInstanceType : TypeSpecification, IGenericInstance, IGenericContext { + + Collection arguments; + + public bool HasGenericArguments { + get { return !arguments.IsNullOrEmpty (); } + } + + public Collection GenericArguments { + get { + if (arguments == null) + Interlocked.CompareExchange (ref arguments, new Collection (), null); + + return arguments; + } + } + + public override TypeReference DeclaringType { + get { return ElementType.DeclaringType; } + set { throw new NotSupportedException (); } + } + + public override string FullName { + get { + var name = new StringBuilder (); + name.Append (base.FullName); + this.GenericInstanceFullName (name); + return name.ToString (); + } + } + + public override bool IsGenericInstance { + get { return true; } + } + + public override bool ContainsGenericParameter { + get { return this.ContainsGenericParameter () || base.ContainsGenericParameter; } + } + + IGenericParameterProvider IGenericContext.Type { + get { return ElementType; } + } + + public GenericInstanceType (TypeReference type) + : base (type) + { + base.IsValueType = type.IsValueType; + this.etype = MD.ElementType.GenericInst; + } + + internal GenericInstanceType (TypeReference type, int arity) + : this (type) + { + this.arguments = new Collection (arity); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceType.cs.meta new file mode 100644 index 0000000..3d8278d --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericInstanceType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 536e7e359f0fa6c449a352476e8af197 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameter.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameter.cs new file mode 100644 index 0000000..6b7ada6 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameter.cs @@ -0,0 +1,360 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Metadata; +using MonoFN.Collections.Generic; +using System; +using System.Threading; + +namespace MonoFN.Cecil { + + public sealed class GenericParameter : TypeReference, ICustomAttributeProvider { + + internal int position; + internal GenericParameterType type; + internal IGenericParameterProvider owner; + + ushort attributes; + GenericParameterConstraintCollection constraints; + Collection custom_attributes; + + public GenericParameterAttributes Attributes { + get { return (GenericParameterAttributes)attributes; } + set { attributes = (ushort)value; } + } + + public int Position { + get { return position; } + } + + public GenericParameterType Type { + get { return type; } + } + + public IGenericParameterProvider Owner { + get { return owner; } + } + + public bool HasConstraints { + get { + if (constraints != null) + return constraints.Count > 0; + + return HasImage && Module.Read (this, (generic_parameter, reader) => reader.HasGenericConstraints (generic_parameter)); + } + } + + public Collection Constraints { + get { + if (constraints != null) + return constraints; + + if (HasImage) + return Module.Read (ref constraints, this, (generic_parameter, reader) => reader.ReadGenericConstraints (generic_parameter)); + + Interlocked.CompareExchange (ref constraints, new GenericParameterConstraintCollection (this), null); + return constraints; + } + } + + public bool HasCustomAttributes { + get { + if (custom_attributes != null) + return custom_attributes.Count > 0; + + return this.GetHasCustomAttributes (Module); + } + } + + public Collection CustomAttributes { + get { return custom_attributes ?? (this.GetCustomAttributes (ref custom_attributes, Module)); } + } + + public override IMetadataScope Scope { + get { + if (owner == null) + return null; + + return owner.GenericParameterType == GenericParameterType.Method + ? ((MethodReference)owner).DeclaringType.Scope + : ((TypeReference)owner).Scope; + } + set { throw new InvalidOperationException (); } + } + + public override TypeReference DeclaringType { + get { return owner as TypeReference; } + set { throw new InvalidOperationException (); } + } + + public MethodReference DeclaringMethod { + get { return owner as MethodReference; } + } + + public override ModuleDefinition Module { + get { return module ?? owner.Module; } + } + + public override string Name { + get { + if (!string.IsNullOrEmpty (base.Name)) + return base.Name; + + return base.Name = (type == GenericParameterType.Method ? "!!" : "!") + position; + } + } + + public override string Namespace { + get { return string.Empty; } + set { throw new InvalidOperationException (); } + } + + public override string FullName { + get { return Name; } + } + + public override bool IsGenericParameter { + get { return true; } + } + + public override bool ContainsGenericParameter { + get { return true; } + } + + public override MetadataType MetadataType { + get { return (MetadataType)etype; } + } + + #region GenericParameterAttributes + + public bool IsNonVariant { + get { return attributes.GetMaskedAttributes ((ushort)GenericParameterAttributes.VarianceMask, (ushort)GenericParameterAttributes.NonVariant); } + set { attributes = attributes.SetMaskedAttributes ((ushort)GenericParameterAttributes.VarianceMask, (ushort)GenericParameterAttributes.NonVariant, value); } + } + + public bool IsCovariant { + get { return attributes.GetMaskedAttributes ((ushort)GenericParameterAttributes.VarianceMask, (ushort)GenericParameterAttributes.Covariant); } + set { attributes = attributes.SetMaskedAttributes ((ushort)GenericParameterAttributes.VarianceMask, (ushort)GenericParameterAttributes.Covariant, value); } + } + + public bool IsContravariant { + get { return attributes.GetMaskedAttributes ((ushort)GenericParameterAttributes.VarianceMask, (ushort)GenericParameterAttributes.Contravariant); } + set { attributes = attributes.SetMaskedAttributes ((ushort)GenericParameterAttributes.VarianceMask, (ushort)GenericParameterAttributes.Contravariant, value); } + } + + public bool HasReferenceTypeConstraint { + get { return attributes.GetAttributes ((ushort)GenericParameterAttributes.ReferenceTypeConstraint); } + set { attributes = attributes.SetAttributes ((ushort)GenericParameterAttributes.ReferenceTypeConstraint, value); } + } + + public bool HasNotNullableValueTypeConstraint { + get { return attributes.GetAttributes ((ushort)GenericParameterAttributes.NotNullableValueTypeConstraint); } + set { attributes = attributes.SetAttributes ((ushort)GenericParameterAttributes.NotNullableValueTypeConstraint, value); } + } + + public bool HasDefaultConstructorConstraint { + get { return attributes.GetAttributes ((ushort)GenericParameterAttributes.DefaultConstructorConstraint); } + set { attributes = attributes.SetAttributes ((ushort)GenericParameterAttributes.DefaultConstructorConstraint, value); } + } + + #endregion + + public GenericParameter (IGenericParameterProvider owner) + : this (string.Empty, owner) + { + } + + public GenericParameter (string name, IGenericParameterProvider owner) + : base (string.Empty, name) + { + if (owner == null) + throw new ArgumentNullException (); + + this.position = -1; + this.owner = owner; + this.type = owner.GenericParameterType; + this.etype = ConvertGenericParameterType (this.type); + this.token = new MetadataToken (TokenType.GenericParam); + + } + + internal GenericParameter (int position, GenericParameterType type, ModuleDefinition module) + : base (string.Empty, string.Empty) + { + Mixin.CheckModule (module); + + this.position = position; + this.type = type; + this.etype = ConvertGenericParameterType (type); + this.module = module; + this.token = new MetadataToken (TokenType.GenericParam); + } + + static ElementType ConvertGenericParameterType (GenericParameterType type) + { + switch (type) { + case GenericParameterType.Type: + return ElementType.Var; + case GenericParameterType.Method: + return ElementType.MVar; + } + + throw new ArgumentOutOfRangeException (); + } + + public override TypeDefinition Resolve () + { + return null; + } + } + + sealed class GenericParameterCollection : Collection { + + readonly IGenericParameterProvider owner; + + internal GenericParameterCollection (IGenericParameterProvider owner) + { + this.owner = owner; + } + + internal GenericParameterCollection (IGenericParameterProvider owner, int capacity) + : base (capacity) + { + this.owner = owner; + } + + protected override void OnAdd (GenericParameter item, int index) + { + UpdateGenericParameter (item, index); + } + + protected override void OnInsert (GenericParameter item, int index) + { + UpdateGenericParameter (item, index); + + for (int i = index; i < size; i++) + items [i].position = i + 1; + } + + protected override void OnSet (GenericParameter item, int index) + { + UpdateGenericParameter (item, index); + } + + void UpdateGenericParameter (GenericParameter item, int index) + { + item.owner = owner; + item.position = index; + item.type = owner.GenericParameterType; + } + + protected override void OnRemove (GenericParameter item, int index) + { + item.owner = null; + item.position = -1; + item.type = GenericParameterType.Type; + + for (int i = index + 1; i < size; i++) + items [i].position = i - 1; + } + } + + public sealed class GenericParameterConstraint : ICustomAttributeProvider { + + internal GenericParameter generic_parameter; + internal MetadataToken token; + + TypeReference constraint_type; + Collection custom_attributes; + + public TypeReference ConstraintType { + get { return constraint_type; } + set { constraint_type = value; } + } + + public bool HasCustomAttributes { + get { + if (custom_attributes != null) + return custom_attributes.Count > 0; + + if (generic_parameter == null) + return false; + + return this.GetHasCustomAttributes (generic_parameter.Module); + } + } + + public Collection CustomAttributes { + get { + if (generic_parameter == null) { + if (custom_attributes == null) + Interlocked.CompareExchange (ref custom_attributes, new Collection (), null); + return custom_attributes; + } + + return custom_attributes ?? (this.GetCustomAttributes (ref custom_attributes, generic_parameter.Module)); + } + } + + public MetadataToken MetadataToken { + get { return token; } + set { token = value; } + } + + internal GenericParameterConstraint (TypeReference constraintType, MetadataToken token) + { + this.constraint_type = constraintType; + this.token = token; + } + + public GenericParameterConstraint (TypeReference constraintType) + { + Mixin.CheckType (constraintType, Mixin.Argument.constraintType); + + this.constraint_type = constraintType; + this.token = new MetadataToken (TokenType.GenericParamConstraint); + } + } + + class GenericParameterConstraintCollection : Collection { + readonly GenericParameter generic_parameter; + + internal GenericParameterConstraintCollection (GenericParameter genericParameter) + { + this.generic_parameter = genericParameter; + } + + internal GenericParameterConstraintCollection (GenericParameter genericParameter, int length) + : base (length) + { + this.generic_parameter = genericParameter; + } + + protected override void OnAdd (GenericParameterConstraint item, int index) + { + item.generic_parameter = generic_parameter; + } + + protected override void OnInsert (GenericParameterConstraint item, int index) + { + item.generic_parameter = generic_parameter; + } + + protected override void OnSet (GenericParameterConstraint item, int index) + { + item.generic_parameter = generic_parameter; + } + + protected override void OnRemove (GenericParameterConstraint item, int index) + { + item.generic_parameter = null; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameter.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameter.cs.meta new file mode 100644 index 0000000..73db53b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a20d39eab5fe7884c8cdf55fde143904 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterAttributes.cs new file mode 100644 index 0000000..a5ae0fc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterAttributes.cs @@ -0,0 +1,27 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum GenericParameterAttributes : ushort { + VarianceMask = 0x0003, + NonVariant = 0x0000, + Covariant = 0x0001, + Contravariant = 0x0002, + + SpecialConstraintMask = 0x001c, + ReferenceTypeConstraint = 0x0004, + NotNullableValueTypeConstraint = 0x0008, + DefaultConstructorConstraint = 0x0010 + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterAttributes.cs.meta new file mode 100644 index 0000000..b4e1bf9 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 406369465fc07a643b3923d53fb1e941 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterResolver.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterResolver.cs new file mode 100644 index 0000000..b3677e6 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterResolver.cs @@ -0,0 +1,175 @@ +using MonoFN.Cecil.Cil; +using System; + +namespace MonoFN.Cecil { + internal sealed class GenericParameterResolver { + internal static TypeReference ResolveReturnTypeIfNeeded (MethodReference methodReference) + { + if (methodReference.DeclaringType.IsArray && methodReference.Name == "Get") + return methodReference.ReturnType; + + var genericInstanceMethod = methodReference as GenericInstanceMethod; + var declaringGenericInstanceType = methodReference.DeclaringType as GenericInstanceType; + + if (genericInstanceMethod == null && declaringGenericInstanceType == null) + return methodReference.ReturnType; + + return ResolveIfNeeded (genericInstanceMethod, declaringGenericInstanceType, methodReference.ReturnType); + } + + internal static TypeReference ResolveFieldTypeIfNeeded (FieldReference fieldReference) + { + return ResolveIfNeeded (null, fieldReference.DeclaringType as GenericInstanceType, fieldReference.FieldType); + } + + internal static TypeReference ResolveParameterTypeIfNeeded (MethodReference method, ParameterReference parameter) + { + var genericInstanceMethod = method as GenericInstanceMethod; + var declaringGenericInstanceType = method.DeclaringType as GenericInstanceType; + + if (genericInstanceMethod == null && declaringGenericInstanceType == null) + return parameter.ParameterType; + + return ResolveIfNeeded (genericInstanceMethod, declaringGenericInstanceType, parameter.ParameterType); + } + + internal static TypeReference ResolveVariableTypeIfNeeded (MethodReference method, VariableReference variable) + { + var genericInstanceMethod = method as GenericInstanceMethod; + var declaringGenericInstanceType = method.DeclaringType as GenericInstanceType; + + if (genericInstanceMethod == null && declaringGenericInstanceType == null) + return variable.VariableType; + + return ResolveIfNeeded (genericInstanceMethod, declaringGenericInstanceType, variable.VariableType); + } + + private static TypeReference ResolveIfNeeded (IGenericInstance genericInstanceMethod, IGenericInstance declaringGenericInstanceType, TypeReference parameterType) + { + var byRefType = parameterType as ByReferenceType; + if (byRefType != null) + return ResolveIfNeeded (genericInstanceMethod, declaringGenericInstanceType, byRefType); + + var arrayType = parameterType as ArrayType; + if (arrayType != null) + return ResolveIfNeeded (genericInstanceMethod, declaringGenericInstanceType, arrayType); + + var genericInstanceType = parameterType as GenericInstanceType; + if (genericInstanceType != null) + return ResolveIfNeeded (genericInstanceMethod, declaringGenericInstanceType, genericInstanceType); + + var genericParameter = parameterType as GenericParameter; + if (genericParameter != null) + return ResolveIfNeeded (genericInstanceMethod, declaringGenericInstanceType, genericParameter); + + var requiredModifierType = parameterType as RequiredModifierType; + if (requiredModifierType != null && ContainsGenericParameters (requiredModifierType)) + return ResolveIfNeeded (genericInstanceMethod, declaringGenericInstanceType, requiredModifierType.ElementType); + + if (ContainsGenericParameters (parameterType)) + throw new Exception ("Unexpected generic parameter."); + + return parameterType; + } + + private static TypeReference ResolveIfNeeded (IGenericInstance genericInstanceMethod, IGenericInstance genericInstanceType, GenericParameter genericParameterElement) + { + return (genericParameterElement.MetadataType == MetadataType.MVar) + ? (genericInstanceMethod != null ? genericInstanceMethod.GenericArguments [genericParameterElement.Position] : genericParameterElement) + : genericInstanceType.GenericArguments [genericParameterElement.Position]; + } + + private static ArrayType ResolveIfNeeded (IGenericInstance genericInstanceMethod, IGenericInstance genericInstanceType, ArrayType arrayType) + { + return new ArrayType (ResolveIfNeeded (genericInstanceMethod, genericInstanceType, arrayType.ElementType), arrayType.Rank); + } + + private static ByReferenceType ResolveIfNeeded (IGenericInstance genericInstanceMethod, IGenericInstance genericInstanceType, ByReferenceType byReferenceType) + { + return new ByReferenceType (ResolveIfNeeded (genericInstanceMethod, genericInstanceType, byReferenceType.ElementType)); + } + + private static GenericInstanceType ResolveIfNeeded (IGenericInstance genericInstanceMethod, IGenericInstance genericInstanceType, GenericInstanceType genericInstanceType1) + { + if (!ContainsGenericParameters (genericInstanceType1)) + return genericInstanceType1; + + var newGenericInstance = new GenericInstanceType (genericInstanceType1.ElementType); + + foreach (var genericArgument in genericInstanceType1.GenericArguments) { + if (!genericArgument.IsGenericParameter) { + newGenericInstance.GenericArguments.Add (ResolveIfNeeded (genericInstanceMethod, genericInstanceType, genericArgument)); + continue; + } + + var genParam = (GenericParameter)genericArgument; + + switch (genParam.Type) { + case GenericParameterType.Type: { + if (genericInstanceType == null) + throw new NotSupportedException (); + + newGenericInstance.GenericArguments.Add (genericInstanceType.GenericArguments [genParam.Position]); + } + break; + + case GenericParameterType.Method: { + if (genericInstanceMethod == null) + newGenericInstance.GenericArguments.Add (genParam); + else + newGenericInstance.GenericArguments.Add (genericInstanceMethod.GenericArguments [genParam.Position]); + } + break; + } + } + + return newGenericInstance; + } + + private static bool ContainsGenericParameters (TypeReference typeReference) + { + var genericParameter = typeReference as GenericParameter; + if (genericParameter != null) + return true; + + var arrayType = typeReference as ArrayType; + if (arrayType != null) + return ContainsGenericParameters (arrayType.ElementType); + + var pointerType = typeReference as PointerType; + if (pointerType != null) + return ContainsGenericParameters (pointerType.ElementType); + + var byRefType = typeReference as ByReferenceType; + if (byRefType != null) + return ContainsGenericParameters (byRefType.ElementType); + + var sentinelType = typeReference as SentinelType; + if (sentinelType != null) + return ContainsGenericParameters (sentinelType.ElementType); + + var pinnedType = typeReference as PinnedType; + if (pinnedType != null) + return ContainsGenericParameters (pinnedType.ElementType); + + var requiredModifierType = typeReference as RequiredModifierType; + if (requiredModifierType != null) + return ContainsGenericParameters (requiredModifierType.ElementType); + + var genericInstance = typeReference as GenericInstanceType; + if (genericInstance != null) { + foreach (var genericArgument in genericInstance.GenericArguments) { + if (ContainsGenericParameters (genericArgument)) + return true; + } + + return false; + } + + if (typeReference is TypeSpecification) + throw new NotSupportedException (); + + return false; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterResolver.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterResolver.cs.meta new file mode 100644 index 0000000..c982dd5 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/GenericParameterResolver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4151464170fe40440a031e1f4f2ecf53 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IConstantProvider.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IConstantProvider.cs new file mode 100644 index 0000000..3631258 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IConstantProvider.cs @@ -0,0 +1,44 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public interface IConstantProvider : IMetadataTokenProvider { + + bool HasConstant { get; set; } + object Constant { get; set; } + } + + static partial class Mixin { + + internal static object NoValue = new object (); + internal static object NotResolved = new object (); + + public static void ResolveConstant ( + this IConstantProvider self, + ref object constant, + ModuleDefinition module) + { + if (module == null) { + constant = Mixin.NoValue; + return; + } + + lock (module.SyncRoot) { + if (constant != Mixin.NotResolved) + return; + if (module.HasImage ()) + constant = module.Read (self, (provider, reader) => reader.ReadConstant (provider)); + else + constant = Mixin.NoValue; + } + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IConstantProvider.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IConstantProvider.cs.meta new file mode 100644 index 0000000..8f377d7 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IConstantProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 58315b928b9e49540b9d1591523c92c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ICustomAttributeProvider.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ICustomAttributeProvider.cs new file mode 100644 index 0000000..39b8f01 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ICustomAttributeProvider.cs @@ -0,0 +1,44 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System.Threading; + +namespace MonoFN.Cecil { + + public interface ICustomAttributeProvider : IMetadataTokenProvider { + + Collection CustomAttributes { get; } + + bool HasCustomAttributes { get; } + } + + static partial class Mixin { + + public static bool GetHasCustomAttributes ( + this ICustomAttributeProvider self, + ModuleDefinition module) + { + return module.HasImage () && module.Read (self, (provider, reader) => reader.HasCustomAttributes (provider)); + } + + public static Collection GetCustomAttributes ( + this ICustomAttributeProvider self, + ref Collection variable, + ModuleDefinition module) + { + if (module.HasImage ()) + return module.Read (ref variable, self, (provider, reader) => reader.ReadCustomAttributes (provider)); + + Interlocked.CompareExchange (ref variable, new Collection (), null); + return variable; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ICustomAttributeProvider.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ICustomAttributeProvider.cs.meta new file mode 100644 index 0000000..e61f1f9 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ICustomAttributeProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1585603aa3fe4f1409c42694378a557c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericInstance.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericInstance.cs new file mode 100644 index 0000000..ecee2cc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericInstance.cs @@ -0,0 +1,47 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System.Text; + +namespace MonoFN.Cecil { + + public interface IGenericInstance : IMetadataTokenProvider { + + bool HasGenericArguments { get; } + Collection GenericArguments { get; } + } + + static partial class Mixin { + + public static bool ContainsGenericParameter (this IGenericInstance self) + { + var arguments = self.GenericArguments; + + for (int i = 0; i < arguments.Count; i++) + if (arguments [i].ContainsGenericParameter) + return true; + + return false; + } + + public static void GenericInstanceFullName (this IGenericInstance self, StringBuilder builder) + { + builder.Append ("<"); + var arguments = self.GenericArguments; + for (int i = 0; i < arguments.Count; i++) { + if (i > 0) + builder.Append (","); + builder.Append (arguments [i].FullName); + } + builder.Append (">"); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericInstance.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericInstance.cs.meta new file mode 100644 index 0000000..3907d65 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericInstance.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 22b3a8ddd25a989449e5e9ffc632bc00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericParameterProvider.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericParameterProvider.cs new file mode 100644 index 0000000..da27ad3 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericParameterProvider.cs @@ -0,0 +1,58 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System.Threading; + +namespace MonoFN.Cecil { + + public interface IGenericParameterProvider : IMetadataTokenProvider { + + bool HasGenericParameters { get; } + bool IsDefinition { get; } + ModuleDefinition Module { get; } + Collection GenericParameters { get; } + GenericParameterType GenericParameterType { get; } + } + + public enum GenericParameterType { + Type, + Method + } + + interface IGenericContext { + + bool IsDefinition { get; } + IGenericParameterProvider Type { get; } + IGenericParameterProvider Method { get; } + } + + static partial class Mixin { + + public static bool GetHasGenericParameters ( + this IGenericParameterProvider self, + ModuleDefinition module) + { + return module.HasImage () && module.Read (self, (provider, reader) => reader.HasGenericParameters (provider)); + } + + public static Collection GetGenericParameters ( + this IGenericParameterProvider self, + ref Collection collection, + ModuleDefinition module) + { + if (module.HasImage ()) + return module.Read (ref collection, self, (provider, reader) => reader.ReadGenericParameters (provider)); + + Interlocked.CompareExchange (ref collection, new GenericParameterCollection (self), null); + return collection; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericParameterProvider.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericParameterProvider.cs.meta new file mode 100644 index 0000000..d11d967 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IGenericParameterProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c81842a9d1ff34f4b94b047da954469f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMarshalInfoProvider.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMarshalInfoProvider.cs new file mode 100644 index 0000000..75faa1a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMarshalInfoProvider.cs @@ -0,0 +1,38 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public interface IMarshalInfoProvider : IMetadataTokenProvider { + + bool HasMarshalInfo { get; } + MarshalInfo MarshalInfo { get; set; } + } + + static partial class Mixin { + + public static bool GetHasMarshalInfo ( + this IMarshalInfoProvider self, + ModuleDefinition module) + { + return module.HasImage () && module.Read (self, (provider, reader) => reader.HasMarshalInfo (provider)); + } + + public static MarshalInfo GetMarshalInfo ( + this IMarshalInfoProvider self, + ref MarshalInfo variable, + ModuleDefinition module) + { + return module.HasImage () + ? module.Read (ref variable, self, (provider, reader) => reader.ReadMarshalInfo (provider)) + : null; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMarshalInfoProvider.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMarshalInfoProvider.cs.meta new file mode 100644 index 0000000..8ce8f0c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMarshalInfoProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a73829f4e35521e4892ef4e0cce2e4f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMemberDefinition.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMemberDefinition.cs new file mode 100644 index 0000000..743e8d4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMemberDefinition.cs @@ -0,0 +1,82 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public interface IMemberDefinition : ICustomAttributeProvider { + + string Name { get; set; } + string FullName { get; } + + bool IsSpecialName { get; set; } + bool IsRuntimeSpecialName { get; set; } + + TypeDefinition DeclaringType { get; set; } + } + + static partial class Mixin { + + public static bool GetAttributes (this uint self, uint attributes) + { + return (self & attributes) != 0; + } + + public static uint SetAttributes (this uint self, uint attributes, bool value) + { + if (value) + return self | attributes; + + return self & ~attributes; + } + + public static bool GetMaskedAttributes (this uint self, uint mask, uint attributes) + { + return (self & mask) == attributes; + } + + public static uint SetMaskedAttributes (this uint self, uint mask, uint attributes, bool value) + { + if (value) { + self &= ~mask; + return self | attributes; + } + + return self & ~(mask & attributes); + } + + public static bool GetAttributes (this ushort self, ushort attributes) + { + return (self & attributes) != 0; + } + + public static ushort SetAttributes (this ushort self, ushort attributes, bool value) + { + if (value) + return (ushort)(self | attributes); + + return (ushort)(self & ~attributes); + } + + public static bool GetMaskedAttributes (this ushort self, ushort mask, uint attributes) + { + return (self & mask) == attributes; + } + + public static ushort SetMaskedAttributes (this ushort self, ushort mask, uint attributes, bool value) + { + if (value) { + self = (ushort)(self & ~mask); + return (ushort)(self | attributes); + } + + return (ushort)(self & ~(mask & attributes)); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMemberDefinition.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMemberDefinition.cs.meta new file mode 100644 index 0000000..b78f8dc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMemberDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 482577ba8693d3f438504e54d6edb971 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataScope.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataScope.cs new file mode 100644 index 0000000..7604a9e --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataScope.cs @@ -0,0 +1,23 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public enum MetadataScopeType { + AssemblyNameReference, + ModuleReference, + ModuleDefinition, + } + + public interface IMetadataScope : IMetadataTokenProvider { + MetadataScopeType MetadataScopeType { get; } + string Name { get; set; } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataScope.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataScope.cs.meta new file mode 100644 index 0000000..0b8b2bc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataScope.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da1ce103d170a414c8c8c6849a8856a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataTokenProvider.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataTokenProvider.cs new file mode 100644 index 0000000..a82c759 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataTokenProvider.cs @@ -0,0 +1,17 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public interface IMetadataTokenProvider { + + MetadataToken MetadataToken { get; set; } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataTokenProvider.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataTokenProvider.cs.meta new file mode 100644 index 0000000..eb83452 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMetadataTokenProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c01133d3a99e95542b153987746696d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMethodSignature.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMethodSignature.cs new file mode 100644 index 0000000..57be39c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMethodSignature.cs @@ -0,0 +1,56 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System.Text; + +namespace MonoFN.Cecil { + + public interface IMethodSignature : IMetadataTokenProvider { + + bool HasThis { get; set; } + bool ExplicitThis { get; set; } + MethodCallingConvention CallingConvention { get; set; } + + bool HasParameters { get; } + Collection Parameters { get; } + TypeReference ReturnType { get; set; } + MethodReturnType MethodReturnType { get; } + } + + static partial class Mixin { + + public static bool HasImplicitThis (this IMethodSignature self) + { + return self.HasThis && !self.ExplicitThis; + } + + public static void MethodSignatureFullName (this IMethodSignature self, StringBuilder builder) + { + builder.Append ("("); + + if (self.HasParameters) { + var parameters = self.Parameters; + for (int i = 0; i < parameters.Count; i++) { + var parameter = parameters [i]; + if (i > 0) + builder.Append (","); + + if (parameter.ParameterType.IsSentinel) + builder.Append ("...,"); + + builder.Append (parameter.ParameterType.FullName); + } + } + + builder.Append (")"); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMethodSignature.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMethodSignature.cs.meta new file mode 100644 index 0000000..2f3a715 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/IMethodSignature.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8fdcc55987f0a4f4b93358d994704a98 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Import.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Import.cs new file mode 100644 index 0000000..e021176 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Import.cs @@ -0,0 +1,858 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Metadata; +using MonoFN.Collections.Generic; +using System; +using System.Collections.Generic; +using SR = System.Reflection; + +namespace MonoFN.Cecil +{ + + public interface IMetadataImporterProvider + { + IMetadataImporter GetMetadataImporter(ModuleDefinition module); + } + + public interface IMetadataImporter + { + AssemblyNameReference ImportReference(AssemblyNameReference reference); + TypeReference ImportReference(TypeReference type, IGenericParameterProvider context); + FieldReference ImportReference(FieldReference field, IGenericParameterProvider context); + MethodReference ImportReference(MethodReference method, IGenericParameterProvider context); + } + + public interface IReflectionImporterProvider + { + IReflectionImporter GetReflectionImporter(ModuleDefinition module); + } + + public interface IReflectionImporter + { + AssemblyNameReference ImportReference(SR.AssemblyName reference); + TypeReference ImportReference(Type type, IGenericParameterProvider context); + FieldReference ImportReference(SR.FieldInfo field, IGenericParameterProvider context); + MethodReference ImportReference(SR.MethodBase method, IGenericParameterProvider context); + } + + struct ImportGenericContext + { + + Collection stack; + + public bool IsEmpty { get { return stack == null; } } + + public ImportGenericContext(IGenericParameterProvider provider) + { + if (provider == null) + throw new ArgumentNullException("provider"); + + stack = null; + + Push(provider); + } + + public void Push(IGenericParameterProvider provider) + { + if (stack == null) + stack = new Collection(1) { provider }; + else + stack.Add(provider); + } + + public void Pop() + { + stack.RemoveAt(stack.Count - 1); + } + + public TypeReference MethodParameter(string method, int position) + { + for (int i = stack.Count - 1; i >= 0; i--) + { + var candidate = stack[i] as MethodReference; + if (candidate == null) + continue; + + if (method != NormalizeMethodName(candidate)) + continue; + + return candidate.GenericParameters[position]; + } + + throw new InvalidOperationException(); + } + + public string NormalizeMethodName(MethodReference method) + { + return method.DeclaringType.GetElementType().FullName + "." + method.Name; + } + + public TypeReference TypeParameter(string type, int position) + { + for (int i = stack.Count - 1; i >= 0; i--) + { + var candidate = GenericTypeFor(stack[i]); + + if (candidate.FullName != type) + continue; + + return candidate.GenericParameters[position]; + } + + throw new InvalidOperationException(); + } + + static TypeReference GenericTypeFor(IGenericParameterProvider context) + { + var type = context as TypeReference; + if (type != null) + return type.GetElementType(); + + var method = context as MethodReference; + if (method != null) + return method.DeclaringType.GetElementType(); + + throw new InvalidOperationException(); + } + + public static ImportGenericContext For(IGenericParameterProvider context) + { + return context != null ? new ImportGenericContext(context) : default(ImportGenericContext); + } + } + + public class DefaultReflectionImporter : IReflectionImporter + { + + readonly protected ModuleDefinition module; + + public DefaultReflectionImporter(ModuleDefinition module) + { + Mixin.CheckModule(module); + this.module = module; + } + + enum ImportGenericKind + { + Definition, + Open, + } + + static readonly Dictionary type_etype_mapping = new Dictionary(18) { + { typeof (void), ElementType.Void }, + { typeof (bool), ElementType.Boolean }, + { typeof (char), ElementType.Char }, + { typeof (sbyte), ElementType.I1 }, + { typeof (byte), ElementType.U1 }, + { typeof (short), ElementType.I2 }, + { typeof (ushort), ElementType.U2 }, + { typeof (int), ElementType.I4 }, + { typeof (uint), ElementType.U4 }, + { typeof (long), ElementType.I8 }, + { typeof (ulong), ElementType.U8 }, + { typeof (float), ElementType.R4 }, + { typeof (double), ElementType.R8 }, + { typeof (string), ElementType.String }, + { typeof (TypedReference), ElementType.TypedByRef }, + { typeof (IntPtr), ElementType.I }, + { typeof (UIntPtr), ElementType.U }, + { typeof (object), ElementType.Object }, + }; + + TypeReference ImportType(Type type, ImportGenericContext context) + { + return ImportType(type, context, ImportGenericKind.Open); + } + + TypeReference ImportType(Type type, ImportGenericContext context, ImportGenericKind import_kind) + { + if (IsTypeSpecification(type) || ImportOpenGenericType(type, import_kind)) + return ImportTypeSpecification(type, context); + + var reference = new TypeReference( + string.Empty, + type.Name, + module, + ImportScope(type), + type.IsValueType); + + reference.etype = ImportElementType(type); + + if (IsNestedType(type)) + reference.DeclaringType = ImportType(type.DeclaringType, context, import_kind); + else + reference.Namespace = type.Namespace ?? string.Empty; + + if (type.IsGenericType) + ImportGenericParameters(reference, type.GetGenericArguments()); + + return reference; + } + + protected virtual IMetadataScope ImportScope(Type type) + { + return ImportScope(type.Assembly); + } + + static bool ImportOpenGenericType(Type type, ImportGenericKind import_kind) + { + return type.IsGenericType && type.IsGenericTypeDefinition && import_kind == ImportGenericKind.Open; + } + + static bool ImportOpenGenericMethod(SR.MethodBase method, ImportGenericKind import_kind) + { + return method.IsGenericMethod && method.IsGenericMethodDefinition && import_kind == ImportGenericKind.Open; + } + + static bool IsNestedType(Type type) + { + return type.IsNested; + } + + TypeReference ImportTypeSpecification(Type type, ImportGenericContext context) + { + if (type.IsByRef) + return new ByReferenceType(ImportType(type.GetElementType(), context)); + + if (type.IsPointer) + return new PointerType(ImportType(type.GetElementType(), context)); + + if (type.IsArray) + return new ArrayType(ImportType(type.GetElementType(), context), type.GetArrayRank()); + + if (type.IsGenericType) + return ImportGenericInstance(type, context); + + if (type.IsGenericParameter) + return ImportGenericParameter(type, context); + + throw new NotSupportedException(type.FullName); + } + + static TypeReference ImportGenericParameter(Type type, ImportGenericContext context) + { + if (context.IsEmpty) + throw new InvalidOperationException(); + + if (type.DeclaringMethod != null) + return context.MethodParameter(NormalizeMethodName(type.DeclaringMethod), type.GenericParameterPosition); + + if (type.DeclaringType != null) + return context.TypeParameter(NormalizeTypeFullName(type.DeclaringType), type.GenericParameterPosition); + + throw new InvalidOperationException(); + } + + static string NormalizeMethodName(SR.MethodBase method) + { + return NormalizeTypeFullName(method.DeclaringType) + "." + method.Name; + } + + static string NormalizeTypeFullName(Type type) + { + if (IsNestedType(type)) + return NormalizeTypeFullName(type.DeclaringType) + "/" + type.Name; + + return type.FullName; + } + + TypeReference ImportGenericInstance(Type type, ImportGenericContext context) + { + var element_type = ImportType(type.GetGenericTypeDefinition(), context, ImportGenericKind.Definition); + var arguments = type.GetGenericArguments(); + var instance = new GenericInstanceType(element_type, arguments.Length); + var instance_arguments = instance.GenericArguments; + + context.Push(element_type); + try + { + for (int i = 0; i < arguments.Length; i++) + instance_arguments.Add(ImportType(arguments[i], context)); + + return instance; + } + finally + { + context.Pop(); + } + } + + static bool IsTypeSpecification(Type type) + { + return type.HasElementType + || IsGenericInstance(type) + || type.IsGenericParameter; + } + + static bool IsGenericInstance(Type type) + { + return type.IsGenericType && !type.IsGenericTypeDefinition; + } + + static ElementType ImportElementType(Type type) + { + ElementType etype; + if (!type_etype_mapping.TryGetValue(type, out etype)) + return ElementType.None; + + return etype; + } + + protected AssemblyNameReference ImportScope(SR.Assembly assembly) + { + return ImportReference(assembly.GetName()); + } + + public virtual AssemblyNameReference ImportReference(SR.AssemblyName name) + { + Mixin.CheckName(name); + + AssemblyNameReference reference; + if (TryGetAssemblyNameReference(name, out reference)) + return reference; + + reference = new AssemblyNameReference(name.Name, name.Version) + { + PublicKeyToken = name.GetPublicKeyToken(), + Culture = name.CultureInfo.Name, + HashAlgorithm = (AssemblyHashAlgorithm)name.HashAlgorithm, + }; + + module.AssemblyReferences.Add(reference); + return reference; + } + + bool TryGetAssemblyNameReference(SR.AssemblyName name, out AssemblyNameReference assembly_reference) + { + var references = module.AssemblyReferences; + + for (int i = 0; i < references.Count; i++) + { + var reference = references[i]; + if (name.FullName != reference.FullName) // TODO compare field by field + continue; + + assembly_reference = reference; + return true; + } + + assembly_reference = null; + return false; + } + + FieldReference ImportField(SR.FieldInfo field, ImportGenericContext context) + { + var declaring_type = ImportType(field.DeclaringType, context); + + if (IsGenericInstance(field.DeclaringType)) + field = ResolveFieldDefinition(field); + + context.Push(declaring_type); + try + { + return new FieldReference + { + Name = field.Name, + DeclaringType = declaring_type, + FieldType = ImportType(field.FieldType, context), + }; + } + finally + { + context.Pop(); + } + } + + static SR.FieldInfo ResolveFieldDefinition(SR.FieldInfo field) + { + return field.Module.ResolveField(field.MetadataToken); + } + + static SR.MethodBase ResolveMethodDefinition(SR.MethodBase method) + { + return method.Module.ResolveMethod(method.MetadataToken); + } + + MethodReference ImportMethod(SR.MethodBase method, ImportGenericContext context, ImportGenericKind import_kind) + { + if (IsMethodSpecification(method) || ImportOpenGenericMethod(method, import_kind)) + return ImportMethodSpecification(method, context); + + var declaring_type = ImportType(method.DeclaringType, context); + + if (IsGenericInstance(method.DeclaringType)) + method = ResolveMethodDefinition(method); + + var reference = new MethodReference + { + Name = method.Name, + HasThis = HasCallingConvention(method, SR.CallingConventions.HasThis), + ExplicitThis = HasCallingConvention(method, SR.CallingConventions.ExplicitThis), + DeclaringType = ImportType(method.DeclaringType, context, ImportGenericKind.Definition), + }; + + if (HasCallingConvention(method, SR.CallingConventions.VarArgs)) + reference.CallingConvention &= MethodCallingConvention.VarArg; + + if (method.IsGenericMethod) + ImportGenericParameters(reference, method.GetGenericArguments()); + + context.Push(reference); + try + { + var method_info = method as SR.MethodInfo; + reference.ReturnType = method_info != null + ? ImportType(method_info.ReturnType, context) + : ImportType(typeof(void), default(ImportGenericContext)); + + var parameters = method.GetParameters(); + var reference_parameters = reference.Parameters; + + for (int i = 0; i < parameters.Length; i++) + reference_parameters.Add( + new ParameterDefinition(ImportType(parameters[i].ParameterType, context))); + + reference.DeclaringType = declaring_type; + + return reference; + } + finally + { + context.Pop(); + } + } + + static void ImportGenericParameters(IGenericParameterProvider provider, Type[] arguments) + { + var provider_parameters = provider.GenericParameters; + + for (int i = 0; i < arguments.Length; i++) + provider_parameters.Add(new GenericParameter(arguments[i].Name, provider)); + } + + static bool IsMethodSpecification(SR.MethodBase method) + { + return method.IsGenericMethod && !method.IsGenericMethodDefinition; + } + + MethodReference ImportMethodSpecification(SR.MethodBase method, ImportGenericContext context) + { + var method_info = method as SR.MethodInfo; + if (method_info == null) + throw new InvalidOperationException(); + + var element_method = ImportMethod(method_info.GetGenericMethodDefinition(), context, ImportGenericKind.Definition); + var instance = new GenericInstanceMethod(element_method); + var arguments = method.GetGenericArguments(); + var instance_arguments = instance.GenericArguments; + + context.Push(element_method); + try + { + for (int i = 0; i < arguments.Length; i++) + instance_arguments.Add(ImportType(arguments[i], context)); + + return instance; + } + finally + { + context.Pop(); + } + } + + static bool HasCallingConvention(SR.MethodBase method, SR.CallingConventions conventions) + { + return (method.CallingConvention & conventions) != 0; + } + + public virtual TypeReference ImportReference(Type type, IGenericParameterProvider context) + { + Mixin.CheckType(type); + return ImportType( + type, + ImportGenericContext.For(context), + context != null ? ImportGenericKind.Open : ImportGenericKind.Definition); + } + + public virtual FieldReference ImportReference(SR.FieldInfo field, IGenericParameterProvider context) + { + Mixin.CheckField(field); + return ImportField(field, ImportGenericContext.For(context)); + } + + public virtual MethodReference ImportReference(SR.MethodBase method, IGenericParameterProvider context) + { + Mixin.CheckMethod(method); + return ImportMethod(method, + ImportGenericContext.For(context), + context != null ? ImportGenericKind.Open : ImportGenericKind.Definition); + } + } + + public class DefaultMetadataImporter : IMetadataImporter + { + + readonly protected ModuleDefinition module; + + public DefaultMetadataImporter(ModuleDefinition module) + { + Mixin.CheckModule(module); + + this.module = module; + } + + TypeReference ImportType(TypeReference type, ImportGenericContext context) + { + if (type.IsTypeSpecification()) + return ImportTypeSpecification(type, context); + + var reference = new TypeReference( + type.Namespace, + type.Name, + module, + ImportScope(type), + type.IsValueType); + + MetadataSystem.TryProcessPrimitiveTypeReference(reference); + + if (type.IsNested) + reference.DeclaringType = ImportType(type.DeclaringType, context); + + if (type.HasGenericParameters) + ImportGenericParameters(reference, type); + + return reference; + } + + protected virtual IMetadataScope ImportScope(TypeReference type) + { + return ImportScope(type.Scope); + } + + protected IMetadataScope ImportScope(IMetadataScope scope) + { + switch (scope.MetadataScopeType) + { + case MetadataScopeType.AssemblyNameReference: + return ImportReference((AssemblyNameReference)scope); + case MetadataScopeType.ModuleDefinition: + if (scope == module) return scope; + return ImportReference(((ModuleDefinition)scope).Assembly.Name); + case MetadataScopeType.ModuleReference: + throw new NotImplementedException(); + } + + throw new NotSupportedException(); + } + + public virtual AssemblyNameReference ImportReference(AssemblyNameReference name) + { + Mixin.CheckName(name); + + AssemblyNameReference reference; + if (module.TryGetAssemblyNameReference(name, out reference)) + return reference; + + reference = new AssemblyNameReference(name.Name, name.Version) + { + Culture = name.Culture, + HashAlgorithm = name.HashAlgorithm, + IsRetargetable = name.IsRetargetable, + IsWindowsRuntime = name.IsWindowsRuntime, + }; + + var pk_token = !name.PublicKeyToken.IsNullOrEmpty() + ? new byte[name.PublicKeyToken.Length] + : Empty.Array; + + if (pk_token.Length > 0) + Buffer.BlockCopy(name.PublicKeyToken, 0, pk_token, 0, pk_token.Length); + + reference.PublicKeyToken = pk_token; + + //Only add if not self. + if (CanAddAssemblyNameReference(module, reference)) + module.AssemblyReferences.Add(reference); + + return reference; + } + + private bool CanAddAssemblyNameReference(ModuleDefinition module, AssemblyNameReference nameRef) + { + return true; + //return (module.assembly.FullName != nameRef.FullName); + } + + static void ImportGenericParameters(IGenericParameterProvider imported, IGenericParameterProvider original) + { + var parameters = original.GenericParameters; + var imported_parameters = imported.GenericParameters; + + for (int i = 0; i < parameters.Count; i++) + imported_parameters.Add(new GenericParameter(parameters[i].Name, imported)); + } + + TypeReference ImportTypeSpecification(TypeReference type, ImportGenericContext context) + { + switch (type.etype) + { + case ElementType.SzArray: + var vector = (ArrayType)type; + return new ArrayType(ImportType(vector.ElementType, context)); + case ElementType.Ptr: + var pointer = (PointerType)type; + return new PointerType(ImportType(pointer.ElementType, context)); + case ElementType.ByRef: + var byref = (ByReferenceType)type; + return new ByReferenceType(ImportType(byref.ElementType, context)); + case ElementType.Pinned: + var pinned = (PinnedType)type; + return new PinnedType(ImportType(pinned.ElementType, context)); + case ElementType.Sentinel: + var sentinel = (SentinelType)type; + return new SentinelType(ImportType(sentinel.ElementType, context)); + case ElementType.FnPtr: + var fnptr = (FunctionPointerType)type; + var imported_fnptr = new FunctionPointerType() + { + HasThis = fnptr.HasThis, + ExplicitThis = fnptr.ExplicitThis, + CallingConvention = fnptr.CallingConvention, + ReturnType = ImportType(fnptr.ReturnType, context), + }; + + if (!fnptr.HasParameters) + return imported_fnptr; + + for (int i = 0; i < fnptr.Parameters.Count; i++) + imported_fnptr.Parameters.Add(new ParameterDefinition( + ImportType(fnptr.Parameters[i].ParameterType, context))); + + return imported_fnptr; + case ElementType.CModOpt: + var modopt = (OptionalModifierType)type; + return new OptionalModifierType( + ImportType(modopt.ModifierType, context), + ImportType(modopt.ElementType, context)); + case ElementType.CModReqD: + var modreq = (RequiredModifierType)type; + return new RequiredModifierType( + ImportType(modreq.ModifierType, context), + ImportType(modreq.ElementType, context)); + case ElementType.Array: + var array = (ArrayType)type; + var imported_array = new ArrayType(ImportType(array.ElementType, context)); + if (array.IsVector) + return imported_array; + + var dimensions = array.Dimensions; + var imported_dimensions = imported_array.Dimensions; + + imported_dimensions.Clear(); + + for (int i = 0; i < dimensions.Count; i++) + { + var dimension = dimensions[i]; + + imported_dimensions.Add(new ArrayDimension(dimension.LowerBound, dimension.UpperBound)); + } + + return imported_array; + case ElementType.GenericInst: + var instance = (GenericInstanceType)type; + var element_type = ImportType(instance.ElementType, context); + var arguments = instance.GenericArguments; + var imported_instance = new GenericInstanceType(element_type, arguments.Count); + var imported_arguments = imported_instance.GenericArguments; + + for (int i = 0; i < arguments.Count; i++) + imported_arguments.Add(ImportType(arguments[i], context)); + + return imported_instance; + case ElementType.Var: + var var_parameter = (GenericParameter)type; + if (var_parameter.DeclaringType == null) + throw new InvalidOperationException(); + return context.TypeParameter(var_parameter.DeclaringType.FullName, var_parameter.Position); + case ElementType.MVar: + var mvar_parameter = (GenericParameter)type; + if (mvar_parameter.DeclaringMethod == null) + throw new InvalidOperationException(); + return context.MethodParameter(context.NormalizeMethodName(mvar_parameter.DeclaringMethod), mvar_parameter.Position); + } + + throw new NotSupportedException(type.etype.ToString()); + } + + FieldReference ImportField(FieldReference field, ImportGenericContext context) + { + var declaring_type = ImportType(field.DeclaringType, context); + + context.Push(declaring_type); + try + { + return new FieldReference + { + Name = field.Name, + DeclaringType = declaring_type, + FieldType = ImportType(field.FieldType, context), + }; + } + finally + { + context.Pop(); + } + } + + MethodReference ImportMethod(MethodReference method, ImportGenericContext context) + { + if (method.IsGenericInstance) + return ImportMethodSpecification(method, context); + + var declaring_type = ImportType(method.DeclaringType, context); + + var reference = new MethodReference + { + Name = method.Name, + HasThis = method.HasThis, + ExplicitThis = method.ExplicitThis, + DeclaringType = declaring_type, + CallingConvention = method.CallingConvention, + }; + + if (method.HasGenericParameters) + ImportGenericParameters(reference, method); + + context.Push(reference); + try + { + reference.ReturnType = ImportType(method.ReturnType, context); + + if (!method.HasParameters) + return reference; + + var parameters = method.Parameters; + var reference_parameters = reference.parameters = new ParameterDefinitionCollection(reference, parameters.Count); + for (int i = 0; i < parameters.Count; i++) + reference_parameters.Add( + new ParameterDefinition(ImportType(parameters[i].ParameterType, context))); + + return reference; + } + finally + { + context.Pop(); + } + } + + MethodSpecification ImportMethodSpecification(MethodReference method, ImportGenericContext context) + { + if (!method.IsGenericInstance) + throw new NotSupportedException(); + + var instance = (GenericInstanceMethod)method; + var element_method = ImportMethod(instance.ElementMethod, context); + var imported_instance = new GenericInstanceMethod(element_method); + + var arguments = instance.GenericArguments; + var imported_arguments = imported_instance.GenericArguments; + + for (int i = 0; i < arguments.Count; i++) + imported_arguments.Add(ImportType(arguments[i], context)); + + return imported_instance; + } + + public virtual TypeReference ImportReference(TypeReference type, IGenericParameterProvider context) + { + Mixin.CheckType(type); + return ImportType(type, ImportGenericContext.For(context)); + } + + public virtual FieldReference ImportReference(FieldReference field, IGenericParameterProvider context) + { + Mixin.CheckField(field); + return ImportField(field, ImportGenericContext.For(context)); + } + + public virtual MethodReference ImportReference(MethodReference method, IGenericParameterProvider context) + { + Mixin.CheckMethod(method); + return ImportMethod(method, ImportGenericContext.For(context)); + } + } + + static partial class Mixin + { + + public static void CheckModule(ModuleDefinition module) + { + if (module == null) + throw new ArgumentNullException(Argument.module.ToString()); + } + + public static bool TryGetAssemblyNameReference(this ModuleDefinition module, AssemblyNameReference name_reference, out AssemblyNameReference assembly_reference) + { + var references = module.AssemblyReferences; + + for (int i = 0; i < references.Count; i++) + { + var reference = references[i]; + if (!Equals(name_reference, reference)) + continue; + + assembly_reference = reference; + return true; + } + + assembly_reference = null; + return false; + } + + static bool Equals(byte[] a, byte[] b) + { + if (ReferenceEquals(a, b)) + return true; + if (a == null) + return false; + if (a.Length != b.Length) + return false; + for (int i = 0; i < a.Length; i++) + if (a[i] != b[i]) + return false; + return true; + } + + static bool Equals(T a, T b) where T : class, IEquatable + { + if (ReferenceEquals(a, b)) + return true; + if (a == null) + return false; + return a.Equals(b); + } + + static bool Equals(AssemblyNameReference a, AssemblyNameReference b) + { + if (ReferenceEquals(a, b)) + return true; + if (a.Name != b.Name) + return false; + if (!Equals(a.Version, b.Version)) + return false; + if (a.Culture != b.Culture) + return false; + if (!Equals(a.PublicKeyToken, b.PublicKeyToken)) + return false; + return true; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Import.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Import.cs.meta new file mode 100644 index 0000000..f898f90 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Import.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa57d261f1a90c746abaef3d59b4c655 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/LinkedResource.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/LinkedResource.cs new file mode 100644 index 0000000..392ffdb --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/LinkedResource.cs @@ -0,0 +1,42 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public sealed class LinkedResource : Resource { + + internal byte [] hash; + string file; + + public byte [] Hash { + get { return hash; } + } + + public string File { + get { return file; } + set { file = value; } + } + + public override ResourceType ResourceType { + get { return ResourceType.Linked; } + } + + public LinkedResource (string name, ManifestResourceAttributes flags) + : base (name, flags) + { + } + + public LinkedResource (string name, ManifestResourceAttributes flags, string file) + : base (name, flags) + { + this.file = file; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/LinkedResource.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/LinkedResource.cs.meta new file mode 100644 index 0000000..531db4c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/LinkedResource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 18c45c1a0891fdc40a07d309b564ec6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ManifestResourceAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ManifestResourceAttributes.cs new file mode 100644 index 0000000..693004c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ManifestResourceAttributes.cs @@ -0,0 +1,21 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum ManifestResourceAttributes : uint { + VisibilityMask = 0x0007, + Public = 0x0001, // The resource is exported from the Assembly + Private = 0x0002 // The resource is private to the Assembly + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ManifestResourceAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ManifestResourceAttributes.cs.meta new file mode 100644 index 0000000..a88aad4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ManifestResourceAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 136b98b695702f048857ea31d91193fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MarshalInfo.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MarshalInfo.cs new file mode 100644 index 0000000..e93d1ef --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MarshalInfo.cs @@ -0,0 +1,153 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + public class MarshalInfo { + + internal NativeType native; + + public NativeType NativeType { + get { return native; } + set { native = value; } + } + + public MarshalInfo (NativeType native) + { + this.native = native; + } + } + + public sealed class ArrayMarshalInfo : MarshalInfo { + + internal NativeType element_type; + internal int size_parameter_index; + internal int size; + internal int size_parameter_multiplier; + + public NativeType ElementType { + get { return element_type; } + set { element_type = value; } + } + + public int SizeParameterIndex { + get { return size_parameter_index; } + set { size_parameter_index = value; } + } + + public int Size { + get { return size; } + set { size = value; } + } + + public int SizeParameterMultiplier { + get { return size_parameter_multiplier; } + set { size_parameter_multiplier = value; } + } + + public ArrayMarshalInfo () + : base (NativeType.Array) + { + element_type = NativeType.None; + size_parameter_index = -1; + size = -1; + size_parameter_multiplier = -1; + } + } + + public sealed class CustomMarshalInfo : MarshalInfo { + + internal Guid guid; + internal string unmanaged_type; + internal TypeReference managed_type; + internal string cookie; + + public Guid Guid { + get { return guid; } + set { guid = value; } + } + + public string UnmanagedType { + get { return unmanaged_type; } + set { unmanaged_type = value; } + } + + public TypeReference ManagedType { + get { return managed_type; } + set { managed_type = value; } + } + + public string Cookie { + get { return cookie; } + set { cookie = value; } + } + + public CustomMarshalInfo () + : base (NativeType.CustomMarshaler) + { + } + } + + public sealed class SafeArrayMarshalInfo : MarshalInfo { + + internal VariantType element_type; + + public VariantType ElementType { + get { return element_type; } + set { element_type = value; } + } + + public SafeArrayMarshalInfo () + : base (NativeType.SafeArray) + { + element_type = VariantType.None; + } + } + + public sealed class FixedArrayMarshalInfo : MarshalInfo { + + internal NativeType element_type; + internal int size; + + public NativeType ElementType { + get { return element_type; } + set { element_type = value; } + } + + public int Size { + get { return size; } + set { size = value; } + } + + public FixedArrayMarshalInfo () + : base (NativeType.FixedArray) + { + element_type = NativeType.None; + } + } + + public sealed class FixedSysStringMarshalInfo : MarshalInfo { + + internal int size; + + public int Size { + get { return size; } + set { size = value; } + } + + public FixedSysStringMarshalInfo () + : base (NativeType.FixedSysString) + { + size = -1; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MarshalInfo.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MarshalInfo.cs.meta new file mode 100644 index 0000000..1a110e3 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MarshalInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 081d03dc18ced1648ae4d9f2eefd3370 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberDefinitionCollection.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberDefinitionCollection.cs new file mode 100644 index 0000000..172d349 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberDefinitionCollection.cs @@ -0,0 +1,73 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; + +namespace MonoFN.Cecil { + + sealed class MemberDefinitionCollection : Collection where T : IMemberDefinition { + + TypeDefinition container; + + internal MemberDefinitionCollection (TypeDefinition container) + { + this.container = container; + } + + internal MemberDefinitionCollection (TypeDefinition container, int capacity) + : base (capacity) + { + this.container = container; + } + + protected override void OnAdd (T item, int index) + { + Attach (item); + } + + protected sealed override void OnSet (T item, int index) + { + Attach (item); + } + + protected sealed override void OnInsert (T item, int index) + { + Attach (item); + } + + protected sealed override void OnRemove (T item, int index) + { + Detach (item); + } + + protected sealed override void OnClear () + { + foreach (var definition in this) + Detach (definition); + } + + void Attach (T element) + { + if (element.DeclaringType == container) + return; + + if (element.DeclaringType != null) + throw new ArgumentException ("Member already attached"); + + element.DeclaringType = this.container; + } + + static void Detach (T element) + { + element.DeclaringType = null; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberDefinitionCollection.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberDefinitionCollection.cs.meta new file mode 100644 index 0000000..6684de2 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberDefinitionCollection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5caa999f42a585459c62b7b65eefdd8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberReference.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberReference.cs new file mode 100644 index 0000000..4f75843 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberReference.cs @@ -0,0 +1,102 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + public abstract class MemberReference : IMetadataTokenProvider { + + string name; + TypeReference declaring_type; + + internal MetadataToken token; + internal object projection; + + public virtual string Name { + get { return name; } + set { + if (IsWindowsRuntimeProjection && value != name) + throw new InvalidOperationException (); + + name = value; + } + } + + public abstract string FullName { + get; + } + + public virtual TypeReference DeclaringType { + get { return declaring_type; } + set { declaring_type = value; } + } + + public MetadataToken MetadataToken { + get { return token; } + set { token = value; } + } + + public bool IsWindowsRuntimeProjection { + get { return projection != null; } + } + + internal bool HasImage { + get { + var module = Module; + if (module == null) + return false; + + return module.HasImage; + } + } + + public virtual ModuleDefinition Module { + get { return declaring_type != null ? declaring_type.Module : null; } + } + + public virtual bool IsDefinition { + get { return false; } + } + + public virtual bool ContainsGenericParameter { + get { return declaring_type != null && declaring_type.ContainsGenericParameter; } + } + + internal MemberReference () + { + } + + internal MemberReference (string name) + { + this.name = name ?? string.Empty; + } + + internal string MemberFullName () + { + if (declaring_type == null) + return name; + + return declaring_type.FullName + "::" + name; + } + + public IMemberDefinition Resolve () + { + return ResolveDefinition (); + } + + protected abstract IMemberDefinition ResolveDefinition (); + + public override string ToString () + { + return FullName; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberReference.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberReference.cs.meta new file mode 100644 index 0000000..c3d8f54 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MemberReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2dcf551ad731c204fa148ec1ee0ce881 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataResolver.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataResolver.cs new file mode 100644 index 0000000..ce212e4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataResolver.cs @@ -0,0 +1,391 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; + +namespace MonoFN.Cecil { + + public interface IAssemblyResolver : IDisposable { + AssemblyDefinition Resolve (AssemblyNameReference name); + AssemblyDefinition Resolve (AssemblyNameReference name, ReaderParameters parameters); + } + + public interface IMetadataResolver { + TypeDefinition Resolve (TypeReference type); + FieldDefinition Resolve (FieldReference field); + MethodDefinition Resolve (MethodReference method); + } + +#if !NET_CORE + [Serializable] +#endif + public sealed class ResolutionException : Exception { + + readonly MemberReference member; + + public MemberReference Member { + get { return member; } + } + + public IMetadataScope Scope { + get { + var type = member as TypeReference; + if (type != null) + return type.Scope; + + var declaring_type = member.DeclaringType; + if (declaring_type != null) + return declaring_type.Scope; + + throw new NotSupportedException (); + } + } + + public ResolutionException (MemberReference member) + : base ("Failed to resolve " + member.FullName) + { + if (member == null) + throw new ArgumentNullException ("member"); + + this.member = member; + } + + public ResolutionException (MemberReference member, Exception innerException) + : base ("Failed to resolve " + member.FullName, innerException) + { + if (member == null) + throw new ArgumentNullException ("member"); + + this.member = member; + } + +#if !NET_CORE + ResolutionException ( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) + : base (info, context) + { + } +#endif + } + + public class MetadataResolver : IMetadataResolver { + + readonly IAssemblyResolver assembly_resolver; + + public IAssemblyResolver AssemblyResolver { + get { return assembly_resolver; } + } + + public MetadataResolver (IAssemblyResolver assemblyResolver) + { + if (assemblyResolver == null) + throw new ArgumentNullException ("assemblyResolver"); + + assembly_resolver = assemblyResolver; + } + + public virtual TypeDefinition Resolve (TypeReference type) + { + Mixin.CheckType (type); + + type = type.GetElementType (); + + var scope = type.Scope; + + if (scope == null) + return null; + + switch (scope.MetadataScopeType) { + case MetadataScopeType.AssemblyNameReference: + var assembly = assembly_resolver.Resolve ((AssemblyNameReference)scope); + if (assembly == null) + return null; + + return GetType (assembly.MainModule, type); + case MetadataScopeType.ModuleDefinition: + return GetType ((ModuleDefinition)scope, type); + case MetadataScopeType.ModuleReference: + if (type.Module.Assembly == null) + return null; + + var modules = type.Module.Assembly.Modules; + var module_ref = (ModuleReference)scope; + for (int i = 0; i < modules.Count; i++) { + var netmodule = modules [i]; + if (netmodule.Name == module_ref.Name) + return GetType (netmodule, type); + } + break; + } + + throw new NotSupportedException (); + } + + static TypeDefinition GetType (ModuleDefinition module, TypeReference reference) + { + var type = GetTypeDefinition (module, reference); + if (type != null) + return type; + + if (!module.HasExportedTypes) + return null; + + var exported_types = module.ExportedTypes; + + for (int i = 0; i < exported_types.Count; i++) { + var exported_type = exported_types [i]; + if (exported_type.Name != reference.Name) + continue; + + if (exported_type.Namespace != reference.Namespace) + continue; + + return exported_type.Resolve (); + } + + return null; + } + + static TypeDefinition GetTypeDefinition (ModuleDefinition module, TypeReference type) + { + if (!type.IsNested) + return module.GetType (type.Namespace, type.Name); + + var declaring_type = type.DeclaringType.Resolve (); + if (declaring_type == null) + return null; + + return declaring_type.GetNestedType (type.TypeFullName ()); + } + + public virtual FieldDefinition Resolve (FieldReference field) + { + Mixin.CheckField (field); + + var type = Resolve (field.DeclaringType); + if (type == null) + return null; + + if (!type.HasFields) + return null; + + return GetField (type, field); + } + + FieldDefinition GetField (TypeDefinition type, FieldReference reference) + { + while (type != null) { + var field = GetField (type.Fields, reference); + if (field != null) + return field; + + if (type.BaseType == null) + return null; + + type = Resolve (type.BaseType); + } + + return null; + } + + static FieldDefinition GetField (Collection fields, FieldReference reference) + { + for (int i = 0; i < fields.Count; i++) { + var field = fields [i]; + + if (field.Name != reference.Name) + continue; + + if (!AreSame (field.FieldType, reference.FieldType)) + continue; + + return field; + } + + return null; + } + + public virtual MethodDefinition Resolve (MethodReference method) + { + Mixin.CheckMethod (method); + + var type = Resolve (method.DeclaringType); + if (type == null) + return null; + + method = method.GetElementMethod (); + + if (!type.HasMethods) + return null; + + return GetMethod (type, method); + } + + MethodDefinition GetMethod (TypeDefinition type, MethodReference reference) + { + while (type != null) { + var method = GetMethod (type.Methods, reference); + if (method != null) + return method; + + if (type.BaseType == null) + return null; + + type = Resolve (type.BaseType); + } + + return null; + } + + public static MethodDefinition GetMethod (Collection methods, MethodReference reference) + { + for (int i = 0; i < methods.Count; i++) { + var method = methods [i]; + + if (method.Name != reference.Name) + continue; + + if (method.HasGenericParameters != reference.HasGenericParameters) + continue; + + if (method.HasGenericParameters && method.GenericParameters.Count != reference.GenericParameters.Count) + continue; + + if (!AreSame (method.ReturnType, reference.ReturnType)) + continue; + + if (method.IsVarArg () != reference.IsVarArg ()) + continue; + + if (method.IsVarArg () && IsVarArgCallTo (method, reference)) + return method; + + if (method.HasParameters != reference.HasParameters) + continue; + + if (!method.HasParameters && !reference.HasParameters) + return method; + + if (!AreSame (method.Parameters, reference.Parameters)) + continue; + + return method; + } + + return null; + } + + static bool AreSame (Collection a, Collection b) + { + var count = a.Count; + + if (count != b.Count) + return false; + + if (count == 0) + return true; + + for (int i = 0; i < count; i++) + if (!AreSame (a [i].ParameterType, b [i].ParameterType)) + return false; + + return true; + } + + static bool IsVarArgCallTo (MethodDefinition method, MethodReference reference) + { + if (method.Parameters.Count >= reference.Parameters.Count) + return false; + + if (reference.GetSentinelPosition () != method.Parameters.Count) + return false; + + for (int i = 0; i < method.Parameters.Count; i++) + if (!AreSame (method.Parameters [i].ParameterType, reference.Parameters [i].ParameterType)) + return false; + + return true; + } + + static bool AreSame (TypeSpecification a, TypeSpecification b) + { + if (!AreSame (a.ElementType, b.ElementType)) + return false; + + if (a.IsGenericInstance) + return AreSame ((GenericInstanceType)a, (GenericInstanceType)b); + + if (a.IsRequiredModifier || a.IsOptionalModifier) + return AreSame ((IModifierType)a, (IModifierType)b); + + if (a.IsArray) + return AreSame ((ArrayType)a, (ArrayType)b); + + return true; + } + + static bool AreSame (ArrayType a, ArrayType b) + { + if (a.Rank != b.Rank) + return false; + + // TODO: dimensions + + return true; + } + + static bool AreSame (IModifierType a, IModifierType b) + { + return AreSame (a.ModifierType, b.ModifierType); + } + + static bool AreSame (GenericInstanceType a, GenericInstanceType b) + { + if (a.GenericArguments.Count != b.GenericArguments.Count) + return false; + + for (int i = 0; i < a.GenericArguments.Count; i++) + if (!AreSame (a.GenericArguments [i], b.GenericArguments [i])) + return false; + + return true; + } + + static bool AreSame (GenericParameter a, GenericParameter b) + { + return a.Position == b.Position; + } + + static bool AreSame (TypeReference a, TypeReference b) + { + if (ReferenceEquals (a, b)) + return true; + + if (a == null || b == null) + return false; + + if (a.etype != b.etype) + return false; + + if (a.IsGenericParameter) + return AreSame ((GenericParameter)a, (GenericParameter)b); + + if (a.IsTypeSpecification ()) + return AreSame ((TypeSpecification)a, (TypeSpecification)b); + + if (a.Name != b.Name || a.Namespace != b.Namespace) + return false; + + return AreSame (a.DeclaringType, b.DeclaringType); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataResolver.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataResolver.cs.meta new file mode 100644 index 0000000..9a42f6b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataResolver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fdd2c926d773ffd4692e2d042135fd2b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataSystem.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataSystem.cs new file mode 100644 index 0000000..00ef319 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataSystem.cs @@ -0,0 +1,431 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Metadata; +using MonoFN.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace MonoFN.Cecil { + + struct Range { + public uint Start; + public uint Length; + + public Range (uint index, uint length) + { + this.Start = index; + this.Length = length; + } + } + + sealed class MetadataSystem { + + internal AssemblyNameReference [] AssemblyReferences; + internal ModuleReference [] ModuleReferences; + + internal TypeDefinition [] Types; + internal TypeReference [] TypeReferences; + + internal FieldDefinition [] Fields; + internal MethodDefinition [] Methods; + internal MemberReference [] MemberReferences; + + internal Dictionary> NestedTypes; + internal Dictionary ReverseNestedTypes; + internal Dictionary>> Interfaces; + internal Dictionary> ClassLayouts; + internal Dictionary FieldLayouts; + internal Dictionary FieldRVAs; + internal Dictionary FieldMarshals; + internal Dictionary> Constants; + internal Dictionary> Overrides; + internal Dictionary CustomAttributes; + internal Dictionary SecurityDeclarations; + internal Dictionary Events; + internal Dictionary Properties; + internal Dictionary> Semantics; + internal Dictionary> PInvokes; + internal Dictionary GenericParameters; + internal Dictionary>> GenericConstraints; + + internal Document [] Documents; + internal Dictionary>> LocalScopes; + internal ImportDebugInformation [] ImportScopes; + internal Dictionary StateMachineMethods; + internal Dictionary []> CustomDebugInformations; + + static Dictionary> primitive_value_types; + + static void InitializePrimitives () + { + var types = new Dictionary> (18, StringComparer.Ordinal) { + { "Void", new Row (ElementType.Void, false) }, + { "Boolean", new Row (ElementType.Boolean, true) }, + { "Char", new Row (ElementType.Char, true) }, + { "SByte", new Row (ElementType.I1, true) }, + { "Byte", new Row (ElementType.U1, true) }, + { "Int16", new Row (ElementType.I2, true) }, + { "UInt16", new Row (ElementType.U2, true) }, + { "Int32", new Row (ElementType.I4, true) }, + { "UInt32", new Row (ElementType.U4, true) }, + { "Int64", new Row (ElementType.I8, true) }, + { "UInt64", new Row (ElementType.U8, true) }, + { "Single", new Row (ElementType.R4, true) }, + { "Double", new Row (ElementType.R8, true) }, + { "String", new Row (ElementType.String, false) }, + { "TypedReference", new Row (ElementType.TypedByRef, false) }, + { "IntPtr", new Row (ElementType.I, true) }, + { "UIntPtr", new Row (ElementType.U, true) }, + { "Object", new Row (ElementType.Object, false) }, + }; + + Interlocked.CompareExchange (ref primitive_value_types, types, null); + } + + public static void TryProcessPrimitiveTypeReference (TypeReference type) + { + if (type.Namespace != "System") + return; + + var scope = type.scope; + if (scope == null || scope.MetadataScopeType != MetadataScopeType.AssemblyNameReference) + return; + + Row primitive_data; + if (!TryGetPrimitiveData (type, out primitive_data)) + return; + + type.etype = primitive_data.Col1; + type.IsValueType = primitive_data.Col2; + } + + public static bool TryGetPrimitiveElementType (TypeDefinition type, out ElementType etype) + { + etype = ElementType.None; + + if (type.Namespace != "System") + return false; + + Row primitive_data; + if (TryGetPrimitiveData (type, out primitive_data)) { + etype = primitive_data.Col1; + return true; + } + + return false; + } + + static bool TryGetPrimitiveData (TypeReference type, out Row primitive_data) + { + if (primitive_value_types == null) + InitializePrimitives (); + + return primitive_value_types.TryGetValue (type.Name, out primitive_data); + } + + public void Clear () + { + if (NestedTypes != null) NestedTypes = new Dictionary> (capacity: 0); + if (ReverseNestedTypes != null) ReverseNestedTypes = new Dictionary (capacity: 0); + if (Interfaces != null) Interfaces = new Dictionary>> (capacity: 0); + if (ClassLayouts != null) ClassLayouts = new Dictionary> (capacity: 0); + if (FieldLayouts != null) FieldLayouts = new Dictionary (capacity: 0); + if (FieldRVAs != null) FieldRVAs = new Dictionary (capacity: 0); + if (FieldMarshals != null) FieldMarshals = new Dictionary (capacity: 0); + if (Constants != null) Constants = new Dictionary> (capacity: 0); + if (Overrides != null) Overrides = new Dictionary> (capacity: 0); + if (CustomAttributes != null) CustomAttributes = new Dictionary (capacity: 0); + if (SecurityDeclarations != null) SecurityDeclarations = new Dictionary (capacity: 0); + if (Events != null) Events = new Dictionary (capacity: 0); + if (Properties != null) Properties = new Dictionary (capacity: 0); + if (Semantics != null) Semantics = new Dictionary> (capacity: 0); + if (PInvokes != null) PInvokes = new Dictionary> (capacity: 0); + if (GenericParameters != null) GenericParameters = new Dictionary (capacity: 0); + if (GenericConstraints != null) GenericConstraints = new Dictionary>> (capacity: 0); + + Documents = Empty.Array; + ImportScopes = Empty.Array; + if (LocalScopes != null) LocalScopes = new Dictionary>> (capacity: 0); + if (StateMachineMethods != null) StateMachineMethods = new Dictionary (capacity: 0); + } + + public AssemblyNameReference GetAssemblyNameReference (uint rid) + { + if (rid < 1 || rid > AssemblyReferences.Length) + return null; + + return AssemblyReferences [rid - 1]; + } + + public TypeDefinition GetTypeDefinition (uint rid) + { + if (rid < 1 || rid > Types.Length) + return null; + + return Types [rid - 1]; + } + + public void AddTypeDefinition (TypeDefinition type) + { + Types [type.token.RID - 1] = type; + } + + public TypeReference GetTypeReference (uint rid) + { + if (rid < 1 || rid > TypeReferences.Length) + return null; + + return TypeReferences [rid - 1]; + } + + public void AddTypeReference (TypeReference type) + { + TypeReferences [type.token.RID - 1] = type; + } + + public FieldDefinition GetFieldDefinition (uint rid) + { + if (rid < 1 || rid > Fields.Length) + return null; + + return Fields [rid - 1]; + } + + public void AddFieldDefinition (FieldDefinition field) + { + Fields [field.token.RID - 1] = field; + } + + public MethodDefinition GetMethodDefinition (uint rid) + { + if (rid < 1 || rid > Methods.Length) + return null; + + return Methods [rid - 1]; + } + + public void AddMethodDefinition (MethodDefinition method) + { + Methods [method.token.RID - 1] = method; + } + + public MemberReference GetMemberReference (uint rid) + { + if (rid < 1 || rid > MemberReferences.Length) + return null; + + return MemberReferences [rid - 1]; + } + + public void AddMemberReference (MemberReference member) + { + MemberReferences [member.token.RID - 1] = member; + } + + public bool TryGetNestedTypeMapping (TypeDefinition type, out Collection mapping) + { + return NestedTypes.TryGetValue (type.token.RID, out mapping); + } + + public void SetNestedTypeMapping (uint type_rid, Collection mapping) + { + NestedTypes [type_rid] = mapping; + } + + public void RemoveNestedTypeMapping (TypeDefinition type) + { + NestedTypes.Remove (type.token.RID); + } + + public bool TryGetReverseNestedTypeMapping (TypeDefinition type, out uint declaring) + { + return ReverseNestedTypes.TryGetValue (type.token.RID, out declaring); + } + + public void SetReverseNestedTypeMapping (uint nested, uint declaring) + { + ReverseNestedTypes [nested] = declaring; + } + + public void RemoveReverseNestedTypeMapping (TypeDefinition type) + { + ReverseNestedTypes.Remove (type.token.RID); + } + + public bool TryGetInterfaceMapping (TypeDefinition type, out Collection> mapping) + { + return Interfaces.TryGetValue (type.token.RID, out mapping); + } + + public void SetInterfaceMapping (uint type_rid, Collection> mapping) + { + Interfaces [type_rid] = mapping; + } + + public void RemoveInterfaceMapping (TypeDefinition type) + { + Interfaces.Remove (type.token.RID); + } + + public void AddPropertiesRange (uint type_rid, Range range) + { + Properties.Add (type_rid, range); + } + + public bool TryGetPropertiesRange (TypeDefinition type, out Range range) + { + return Properties.TryGetValue (type.token.RID, out range); + } + + public void RemovePropertiesRange (TypeDefinition type) + { + Properties.Remove (type.token.RID); + } + + public void AddEventsRange (uint type_rid, Range range) + { + Events.Add (type_rid, range); + } + + public bool TryGetEventsRange (TypeDefinition type, out Range range) + { + return Events.TryGetValue (type.token.RID, out range); + } + + public void RemoveEventsRange (TypeDefinition type) + { + Events.Remove (type.token.RID); + } + + public bool TryGetGenericParameterRanges (IGenericParameterProvider owner, out Range [] ranges) + { + return GenericParameters.TryGetValue (owner.MetadataToken, out ranges); + } + + public void RemoveGenericParameterRange (IGenericParameterProvider owner) + { + GenericParameters.Remove (owner.MetadataToken); + } + + public bool TryGetCustomAttributeRanges (ICustomAttributeProvider owner, out Range [] ranges) + { + return CustomAttributes.TryGetValue (owner.MetadataToken, out ranges); + } + + public void RemoveCustomAttributeRange (ICustomAttributeProvider owner) + { + CustomAttributes.Remove (owner.MetadataToken); + } + + public bool TryGetSecurityDeclarationRanges (ISecurityDeclarationProvider owner, out Range [] ranges) + { + return SecurityDeclarations.TryGetValue (owner.MetadataToken, out ranges); + } + + public void RemoveSecurityDeclarationRange (ISecurityDeclarationProvider owner) + { + SecurityDeclarations.Remove (owner.MetadataToken); + } + + public bool TryGetGenericConstraintMapping (GenericParameter generic_parameter, out Collection> mapping) + { + return GenericConstraints.TryGetValue (generic_parameter.token.RID, out mapping); + } + + public void SetGenericConstraintMapping (uint gp_rid, Collection> mapping) + { + GenericConstraints [gp_rid] = mapping; + } + + public void RemoveGenericConstraintMapping (GenericParameter generic_parameter) + { + GenericConstraints.Remove (generic_parameter.token.RID); + } + + public bool TryGetOverrideMapping (MethodDefinition method, out Collection mapping) + { + return Overrides.TryGetValue (method.token.RID, out mapping); + } + + public void SetOverrideMapping (uint rid, Collection mapping) + { + Overrides [rid] = mapping; + } + + public void RemoveOverrideMapping (MethodDefinition method) + { + Overrides.Remove (method.token.RID); + } + + public Document GetDocument (uint rid) + { + if (rid < 1 || rid > Documents.Length) + return null; + + return Documents [rid - 1]; + } + + public bool TryGetLocalScopes (MethodDefinition method, out Collection> scopes) + { + return LocalScopes.TryGetValue (method.MetadataToken.RID, out scopes); + } + + public void SetLocalScopes (uint method_rid, Collection> records) + { + LocalScopes [method_rid] = records; + } + + public ImportDebugInformation GetImportScope (uint rid) + { + if (rid < 1 || rid > ImportScopes.Length) + return null; + + return ImportScopes [rid - 1]; + } + + public bool TryGetStateMachineKickOffMethod (MethodDefinition method, out uint rid) + { + return StateMachineMethods.TryGetValue (method.MetadataToken.RID, out rid); + } + + public TypeDefinition GetFieldDeclaringType (uint field_rid) + { + return BinaryRangeSearch (Types, field_rid, true); + } + + public TypeDefinition GetMethodDeclaringType (uint method_rid) + { + return BinaryRangeSearch (Types, method_rid, false); + } + + static TypeDefinition BinaryRangeSearch (TypeDefinition [] types, uint rid, bool field) + { + int min = 0; + int max = types.Length - 1; + while (min <= max) { + int mid = min + ((max - min) / 2); + var type = types [mid]; + var range = field ? type.fields_range : type.methods_range; + + if (rid < range.Start) + max = mid - 1; + else if (rid >= range.Start + range.Length) + min = mid + 1; + else + return type; + } + + return null; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataSystem.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataSystem.cs.meta new file mode 100644 index 0000000..46912ce --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MetadataSystem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6ea39c5122499d14fbca126d3ed39890 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodAttributes.cs new file mode 100644 index 0000000..043e77a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodAttributes.cs @@ -0,0 +1,48 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum MethodAttributes : ushort { + MemberAccessMask = 0x0007, + CompilerControlled = 0x0000, // Member not referenceable + Private = 0x0001, // Accessible only by the parent type + FamANDAssem = 0x0002, // Accessible by sub-types only in this Assembly + Assembly = 0x0003, // Accessibly by anyone in the Assembly + Family = 0x0004, // Accessible only by type and sub-types + FamORAssem = 0x0005, // Accessibly by sub-types anywhere, plus anyone in assembly + Public = 0x0006, // Accessibly by anyone who has visibility to this scope + + Static = 0x0010, // Defined on type, else per instance + Final = 0x0020, // Method may not be overridden + Virtual = 0x0040, // Method is virtual + HideBySig = 0x0080, // Method hides by name+sig, else just by name + + VtableLayoutMask = 0x0100, // Use this mask to retrieve vtable attributes + ReuseSlot = 0x0000, // Method reuses existing slot in vtable + NewSlot = 0x0100, // Method always gets a new slot in the vtable + + CheckAccessOnOverride = 0x0200, // Method can only be overriden if also accessible + Abstract = 0x0400, // Method does not provide an implementation + SpecialName = 0x0800, // Method is special + + // Interop Attributes + PInvokeImpl = 0x2000, // Implementation is forwarded through PInvoke + UnmanagedExport = 0x0008, // Reserved: shall be zero for conforming implementations + + // Additional flags + RTSpecialName = 0x1000, // CLI provides 'special' behavior, depending upon the name of the method + HasSecurity = 0x4000, // Method has security associate with it + RequireSecObject = 0x8000 // Method calls another method containing security code + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodAttributes.cs.meta new file mode 100644 index 0000000..6060bf0 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 84996fdfc826be145836c454e3781c51 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodCallingConvention.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodCallingConvention.cs new file mode 100644 index 0000000..2c219ba --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodCallingConvention.cs @@ -0,0 +1,22 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public enum MethodCallingConvention : byte { + Default = 0x0, + C = 0x1, + StdCall = 0x2, + ThisCall = 0x3, + FastCall = 0x4, + VarArg = 0x5, + Generic = 0x10, + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodCallingConvention.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodCallingConvention.cs.meta new file mode 100644 index 0000000..0897aab --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodCallingConvention.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d279830051a3cf4a9a8198756171875 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodDefinition.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodDefinition.cs new file mode 100644 index 0000000..164c0fb --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodDefinition.cs @@ -0,0 +1,558 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Cil; +using MonoFN.Collections.Generic; +using System; +using System.Threading; +using RVA = System.UInt32; + +namespace MonoFN.Cecil { + + public sealed class MethodDefinition : MethodReference, IMemberDefinition, ISecurityDeclarationProvider, ICustomDebugInformationProvider { + + ushort attributes; + ushort impl_attributes; + internal volatile bool sem_attrs_ready; + internal MethodSemanticsAttributes sem_attrs; + Collection custom_attributes; + Collection security_declarations; + + internal RVA rva; + internal PInvokeInfo pinvoke; + Collection overrides; + + internal MethodBody body; + internal MethodDebugInformation debug_info; + internal Collection custom_infos; + + public override string Name { + get { return base.Name; } + set { + if (IsWindowsRuntimeProjection && value != base.Name) + throw new InvalidOperationException (); + + base.Name = value; + } + } + + public MethodAttributes Attributes { + get { return (MethodAttributes)attributes; } + set { + if (IsWindowsRuntimeProjection && (ushort)value != attributes) + throw new InvalidOperationException (); + + attributes = (ushort)value; + } + } + + public MethodImplAttributes ImplAttributes { + get { return (MethodImplAttributes)impl_attributes; } + set { + if (IsWindowsRuntimeProjection && (ushort)value != impl_attributes) + throw new InvalidOperationException (); + + impl_attributes = (ushort)value; + } + } + + public MethodSemanticsAttributes SemanticsAttributes { + get { + if (sem_attrs_ready) + return sem_attrs; + + if (HasImage) { + ReadSemantics (); + return sem_attrs; + } + + sem_attrs = MethodSemanticsAttributes.None; + sem_attrs_ready = true; + return sem_attrs; + } + set { sem_attrs = value; } + } + + internal MethodDefinitionProjection WindowsRuntimeProjection { + get { return (MethodDefinitionProjection)projection; } + set { projection = value; } + } + + internal void ReadSemantics () + { + if (sem_attrs_ready) + return; + + var module = this.Module; + if (module == null) + return; + + if (!module.HasImage) + return; + + lock (module.SyncRoot) { + if (sem_attrs_ready) + return; + + module.Read (this, (method, reader) => reader.ReadAllSemantics (method)); + } + } + + public bool HasSecurityDeclarations { + get { + if (security_declarations != null) + return security_declarations.Count > 0; + + return this.GetHasSecurityDeclarations (Module); + } + } + + public Collection SecurityDeclarations { + get { return security_declarations ?? (this.GetSecurityDeclarations (ref security_declarations, Module)); } + } + + public bool HasCustomAttributes { + get { + if (custom_attributes != null) + return custom_attributes.Count > 0; + + return this.GetHasCustomAttributes (Module); + } + } + + public Collection CustomAttributes { + get { return custom_attributes ?? (this.GetCustomAttributes (ref custom_attributes, Module)); } + } + + public int RVA { + get { return (int)rva; } + } + + public bool HasBody { + get { + return (attributes & (ushort)MethodAttributes.Abstract) == 0 && + (attributes & (ushort)MethodAttributes.PInvokeImpl) == 0 && + (impl_attributes & (ushort)MethodImplAttributes.InternalCall) == 0 && + (impl_attributes & (ushort)MethodImplAttributes.Native) == 0 && + (impl_attributes & (ushort)MethodImplAttributes.Unmanaged) == 0 && + (impl_attributes & (ushort)MethodImplAttributes.Runtime) == 0; + } + } + + public MethodBody Body { + get { + var local = this.body; + if (local != null) + return local; + + if (!HasBody) + return null; + + if (HasImage && rva != 0) + return Module.Read (ref body, this, (method, reader) => reader.ReadMethodBody (method)); + + Interlocked.CompareExchange (ref body, new MethodBody (this), null); + + return body; + } + set { + var module = this.Module; + if (module == null) { + body = value; + return; + } + + // we reset Body to null in ILSpy to save memory; so we need that operation to be thread-safe + lock (module.SyncRoot) { + body = value; + if (value == null) + this.debug_info = null; + } + } + } + + public MethodDebugInformation DebugInformation { + get { + Mixin.Read (Body); + + if (debug_info == null) { + Interlocked.CompareExchange (ref debug_info, new MethodDebugInformation (this), null); + } + + return debug_info; + } + set { + debug_info = value; + } + } + + public bool HasPInvokeInfo { + get { + if (pinvoke != null) + return true; + + return IsPInvokeImpl; + } + } + + public PInvokeInfo PInvokeInfo { + get { + if (pinvoke != null) + return pinvoke; + + if (HasImage && IsPInvokeImpl) + return Module.Read (ref pinvoke, this, (method, reader) => reader.ReadPInvokeInfo (method)); + + return null; + } + set { + IsPInvokeImpl = true; + pinvoke = value; + } + } + + public bool HasOverrides { + get { + if (overrides != null) + return overrides.Count > 0; + + return HasImage && Module.Read (this, (method, reader) => reader.HasOverrides (method)); + } + } + + public Collection Overrides { + get { + if (overrides != null) + return overrides; + + if (HasImage) + return Module.Read (ref overrides, this, (method, reader) => reader.ReadOverrides (method)); + + Interlocked.CompareExchange (ref overrides, new Collection (), null); + + return overrides; + } + } + + public override bool HasGenericParameters { + get { + if (generic_parameters != null) + return generic_parameters.Count > 0; + + return this.GetHasGenericParameters (Module); + } + } + + public override Collection GenericParameters { + get { return generic_parameters ?? (this.GetGenericParameters (ref generic_parameters, Module)); } + } + + public bool HasCustomDebugInformations { + get { + Mixin.Read (Body); + + return !custom_infos.IsNullOrEmpty (); + } + } + + public Collection CustomDebugInformations { + get { + Mixin.Read (Body); + + if (custom_infos == null) + Interlocked.CompareExchange (ref custom_infos, new Collection (), null); + + return custom_infos; + } + } + + #region MethodAttributes + + public bool IsCompilerControlled { + get { return attributes.GetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.CompilerControlled); } + set { attributes = attributes.SetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.CompilerControlled, value); } + } + + public bool IsPrivate { + get { return attributes.GetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Private); } + set { attributes = attributes.SetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Private, value); } + } + + public bool IsFamilyAndAssembly { + get { return attributes.GetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.FamANDAssem); } + set { attributes = attributes.SetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.FamANDAssem, value); } + } + + public bool IsAssembly { + get { return attributes.GetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Assembly); } + set { attributes = attributes.SetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Assembly, value); } + } + + public bool IsFamily { + get { return attributes.GetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Family); } + set { attributes = attributes.SetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Family, value); } + } + + public bool IsFamilyOrAssembly { + get { return attributes.GetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.FamORAssem); } + set { attributes = attributes.SetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.FamORAssem, value); } + } + + public bool IsPublic { + get { return attributes.GetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Public); } + set { attributes = attributes.SetMaskedAttributes ((ushort)MethodAttributes.MemberAccessMask, (ushort)MethodAttributes.Public, value); } + } + + public bool IsStatic { + get { return attributes.GetAttributes ((ushort)MethodAttributes.Static); } + set { attributes = attributes.SetAttributes ((ushort)MethodAttributes.Static, value); } + } + + public bool IsFinal { + get { return attributes.GetAttributes ((ushort)MethodAttributes.Final); } + set { attributes = attributes.SetAttributes ((ushort)MethodAttributes.Final, value); } + } + + public bool IsVirtual { + get { return attributes.GetAttributes ((ushort)MethodAttributes.Virtual); } + set { attributes = attributes.SetAttributes ((ushort)MethodAttributes.Virtual, value); } + } + + public bool IsHideBySig { + get { return attributes.GetAttributes ((ushort)MethodAttributes.HideBySig); } + set { attributes = attributes.SetAttributes ((ushort)MethodAttributes.HideBySig, value); } + } + + public bool IsReuseSlot { + get { return attributes.GetMaskedAttributes ((ushort)MethodAttributes.VtableLayoutMask, (ushort)MethodAttributes.ReuseSlot); } + set { attributes = attributes.SetMaskedAttributes ((ushort)MethodAttributes.VtableLayoutMask, (ushort)MethodAttributes.ReuseSlot, value); } + } + + public bool IsNewSlot { + get { return attributes.GetMaskedAttributes ((ushort)MethodAttributes.VtableLayoutMask, (ushort)MethodAttributes.NewSlot); } + set { attributes = attributes.SetMaskedAttributes ((ushort)MethodAttributes.VtableLayoutMask, (ushort)MethodAttributes.NewSlot, value); } + } + + public bool IsCheckAccessOnOverride { + get { return attributes.GetAttributes ((ushort)MethodAttributes.CheckAccessOnOverride); } + set { attributes = attributes.SetAttributes ((ushort)MethodAttributes.CheckAccessOnOverride, value); } + } + + public bool IsAbstract { + get { return attributes.GetAttributes ((ushort)MethodAttributes.Abstract); } + set { attributes = attributes.SetAttributes ((ushort)MethodAttributes.Abstract, value); } + } + + public bool IsSpecialName { + get { return attributes.GetAttributes ((ushort)MethodAttributes.SpecialName); } + set { attributes = attributes.SetAttributes ((ushort)MethodAttributes.SpecialName, value); } + } + + public bool IsPInvokeImpl { + get { return attributes.GetAttributes ((ushort)MethodAttributes.PInvokeImpl); } + set { attributes = attributes.SetAttributes ((ushort)MethodAttributes.PInvokeImpl, value); } + } + + public bool IsUnmanagedExport { + get { return attributes.GetAttributes ((ushort)MethodAttributes.UnmanagedExport); } + set { attributes = attributes.SetAttributes ((ushort)MethodAttributes.UnmanagedExport, value); } + } + + public bool IsRuntimeSpecialName { + get { return attributes.GetAttributes ((ushort)MethodAttributes.RTSpecialName); } + set { attributes = attributes.SetAttributes ((ushort)MethodAttributes.RTSpecialName, value); } + } + + public bool HasSecurity { + get { return attributes.GetAttributes ((ushort)MethodAttributes.HasSecurity); } + set { attributes = attributes.SetAttributes ((ushort)MethodAttributes.HasSecurity, value); } + } + + #endregion + + #region MethodImplAttributes + + public bool IsIL { + get { return impl_attributes.GetMaskedAttributes ((ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.IL); } + set { impl_attributes = impl_attributes.SetMaskedAttributes ((ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.IL, value); } + } + + public bool IsNative { + get { return impl_attributes.GetMaskedAttributes ((ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.Native); } + set { impl_attributes = impl_attributes.SetMaskedAttributes ((ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.Native, value); } + } + + public bool IsRuntime { + get { return impl_attributes.GetMaskedAttributes ((ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.Runtime); } + set { impl_attributes = impl_attributes.SetMaskedAttributes ((ushort)MethodImplAttributes.CodeTypeMask, (ushort)MethodImplAttributes.Runtime, value); } + } + + public bool IsUnmanaged { + get { return impl_attributes.GetMaskedAttributes ((ushort)MethodImplAttributes.ManagedMask, (ushort)MethodImplAttributes.Unmanaged); } + set { impl_attributes = impl_attributes.SetMaskedAttributes ((ushort)MethodImplAttributes.ManagedMask, (ushort)MethodImplAttributes.Unmanaged, value); } + } + + public bool IsManaged { + get { return impl_attributes.GetMaskedAttributes ((ushort)MethodImplAttributes.ManagedMask, (ushort)MethodImplAttributes.Managed); } + set { impl_attributes = impl_attributes.SetMaskedAttributes ((ushort)MethodImplAttributes.ManagedMask, (ushort)MethodImplAttributes.Managed, value); } + } + + public bool IsForwardRef { + get { return impl_attributes.GetAttributes ((ushort)MethodImplAttributes.ForwardRef); } + set { impl_attributes = impl_attributes.SetAttributes ((ushort)MethodImplAttributes.ForwardRef, value); } + } + + public bool IsPreserveSig { + get { return impl_attributes.GetAttributes ((ushort)MethodImplAttributes.PreserveSig); } + set { impl_attributes = impl_attributes.SetAttributes ((ushort)MethodImplAttributes.PreserveSig, value); } + } + + public bool IsInternalCall { + get { return impl_attributes.GetAttributes ((ushort)MethodImplAttributes.InternalCall); } + set { impl_attributes = impl_attributes.SetAttributes ((ushort)MethodImplAttributes.InternalCall, value); } + } + + public bool IsSynchronized { + get { return impl_attributes.GetAttributes ((ushort)MethodImplAttributes.Synchronized); } + set { impl_attributes = impl_attributes.SetAttributes ((ushort)MethodImplAttributes.Synchronized, value); } + } + + public bool NoInlining { + get { return impl_attributes.GetAttributes ((ushort)MethodImplAttributes.NoInlining); } + set { impl_attributes = impl_attributes.SetAttributes ((ushort)MethodImplAttributes.NoInlining, value); } + } + + public bool NoOptimization { + get { return impl_attributes.GetAttributes ((ushort)MethodImplAttributes.NoOptimization); } + set { impl_attributes = impl_attributes.SetAttributes ((ushort)MethodImplAttributes.NoOptimization, value); } + } + + public bool AggressiveInlining { + get { return impl_attributes.GetAttributes ((ushort)MethodImplAttributes.AggressiveInlining); } + set { impl_attributes = impl_attributes.SetAttributes ((ushort)MethodImplAttributes.AggressiveInlining, value); } + } + + #endregion + + #region MethodSemanticsAttributes + + public bool IsSetter { + get { return this.GetSemantics (MethodSemanticsAttributes.Setter); } + set { this.SetSemantics (MethodSemanticsAttributes.Setter, value); } + } + + public bool IsGetter { + get { return this.GetSemantics (MethodSemanticsAttributes.Getter); } + set { this.SetSemantics (MethodSemanticsAttributes.Getter, value); } + } + + public bool IsOther { + get { return this.GetSemantics (MethodSemanticsAttributes.Other); } + set { this.SetSemantics (MethodSemanticsAttributes.Other, value); } + } + + public bool IsAddOn { + get { return this.GetSemantics (MethodSemanticsAttributes.AddOn); } + set { this.SetSemantics (MethodSemanticsAttributes.AddOn, value); } + } + + public bool IsRemoveOn { + get { return this.GetSemantics (MethodSemanticsAttributes.RemoveOn); } + set { this.SetSemantics (MethodSemanticsAttributes.RemoveOn, value); } + } + + public bool IsFire { + get { return this.GetSemantics (MethodSemanticsAttributes.Fire); } + set { this.SetSemantics (MethodSemanticsAttributes.Fire, value); } + } + + #endregion + + public new TypeDefinition DeclaringType { + get { return (TypeDefinition)base.DeclaringType; } + set { base.DeclaringType = value; } + } + + public bool IsConstructor { + get { + return this.IsRuntimeSpecialName + && this.IsSpecialName + && (this.Name == ".cctor" || this.Name == ".ctor"); + } + } + + public override bool IsDefinition { + get { return true; } + } + + internal MethodDefinition () + { + this.token = new MetadataToken (TokenType.Method); + } + + public MethodDefinition (string name, MethodAttributes attributes, TypeReference returnType) + : base (name, returnType) + { + this.attributes = (ushort)attributes; + this.HasThis = !this.IsStatic; + this.token = new MetadataToken (TokenType.Method); + } + + public override MethodDefinition Resolve () + { + return this; + } + } + + static partial class Mixin { + + public static ParameterDefinition GetParameter (this MethodBody self, int index) + { + var method = self.method; + + if (method.HasThis) { + if (index == 0) + return self.ThisParameter; + + index--; + } + + var parameters = method.Parameters; + + if (index < 0 || index >= parameters.size) + return null; + + return parameters [index]; + } + + public static VariableDefinition GetVariable (this MethodBody self, int index) + { + var variables = self.Variables; + + if (index < 0 || index >= variables.size) + return null; + + return variables [index]; + } + + public static bool GetSemantics (this MethodDefinition self, MethodSemanticsAttributes semantics) + { + return (self.SemanticsAttributes & semantics) != 0; + } + + public static void SetSemantics (this MethodDefinition self, MethodSemanticsAttributes semantics, bool value) + { + if (value) + self.SemanticsAttributes |= semantics; + else + self.SemanticsAttributes &= ~semantics; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodDefinition.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodDefinition.cs.meta new file mode 100644 index 0000000..9fbc7fd --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 51ade7e624f84ae4abb8dc28a51b3082 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodImplAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodImplAttributes.cs new file mode 100644 index 0000000..722d5c5 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodImplAttributes.cs @@ -0,0 +1,36 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum MethodImplAttributes : ushort { + CodeTypeMask = 0x0003, + IL = 0x0000, // Method impl is CIL + Native = 0x0001, // Method impl is native + OPTIL = 0x0002, // Reserved: shall be zero in conforming implementations + Runtime = 0x0003, // Method impl is provided by the runtime + + ManagedMask = 0x0004, // Flags specifying whether the code is managed or unmanaged + Unmanaged = 0x0004, // Method impl is unmanaged, otherwise managed + Managed = 0x0000, // Method impl is managed + + // Implementation info and interop + ForwardRef = 0x0010, // Indicates method is defined; used primarily in merge scenarios + PreserveSig = 0x0080, // Reserved: conforming implementations may ignore + InternalCall = 0x1000, // Reserved: shall be zero in conforming implementations + Synchronized = 0x0020, // Method is single threaded through the body + NoOptimization = 0x0040, // Method is not optimized by the JIT. + NoInlining = 0x0008, // Method may not be inlined + AggressiveInlining = 0x0100, // Method should be inlined, if possible. + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodImplAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodImplAttributes.cs.meta new file mode 100644 index 0000000..bc1d0fc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodImplAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bbe7f8d150d8c6b48abd24ac7718c9f4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReference.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReference.cs new file mode 100644 index 0000000..6280983 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReference.cs @@ -0,0 +1,202 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; +using System.Text; +using System.Threading; + +namespace MonoFN.Cecil { + + public class MethodReference : MemberReference, IMethodSignature, IGenericParameterProvider, IGenericContext { + + internal ParameterDefinitionCollection parameters; + MethodReturnType return_type; + + bool has_this; + bool explicit_this; + MethodCallingConvention calling_convention; + internal Collection generic_parameters; + + public virtual bool HasThis { + get { return has_this; } + set { has_this = value; } + } + + public virtual bool ExplicitThis { + get { return explicit_this; } + set { explicit_this = value; } + } + + public virtual MethodCallingConvention CallingConvention { + get { return calling_convention; } + set { calling_convention = value; } + } + + public virtual bool HasParameters { + get { return !parameters.IsNullOrEmpty (); } + } + + public virtual Collection Parameters { + get { + if (parameters == null) + Interlocked.CompareExchange (ref parameters, new ParameterDefinitionCollection (this), null); + + return parameters; + } + } + + IGenericParameterProvider IGenericContext.Type { + get { + var declaring_type = this.DeclaringType; + var instance = declaring_type as GenericInstanceType; + if (instance != null) + return instance.ElementType; + + return declaring_type; + } + } + + IGenericParameterProvider IGenericContext.Method { + get { return this; } + } + + GenericParameterType IGenericParameterProvider.GenericParameterType { + get { return GenericParameterType.Method; } + } + + public virtual bool HasGenericParameters { + get { return !generic_parameters.IsNullOrEmpty (); } + } + + public virtual Collection GenericParameters { + get { + if (generic_parameters == null) + Interlocked.CompareExchange (ref generic_parameters, new GenericParameterCollection (this), null); + + return generic_parameters; + } + } + + public TypeReference ReturnType { + get { + var return_type = MethodReturnType; + return return_type != null ? return_type.ReturnType : null; + } + set { + var return_type = MethodReturnType; + if (return_type != null) + return_type.ReturnType = value; + } + } + + public virtual MethodReturnType MethodReturnType { + get { return return_type; } + set { return_type = value; } + } + + public override string FullName { + get { + var builder = new StringBuilder (); + builder.Append (ReturnType.FullName) + .Append (" ") + .Append (MemberFullName ()); + this.MethodSignatureFullName (builder); + return builder.ToString (); + } + } + + public virtual bool IsGenericInstance { + get { return false; } + } + + public override bool ContainsGenericParameter { + get { + if (this.ReturnType.ContainsGenericParameter || base.ContainsGenericParameter) + return true; + + if (!HasParameters) + return false; + + var parameters = this.Parameters; + + for (int i = 0; i < parameters.Count; i++) + if (parameters [i].ParameterType.ContainsGenericParameter) + return true; + + return false; + } + } + + internal MethodReference () + { + this.return_type = new MethodReturnType (this); + this.token = new MetadataToken (TokenType.MemberRef); + } + + public MethodReference (string name, TypeReference returnType) + : base (name) + { + Mixin.CheckType (returnType, Mixin.Argument.returnType); + + this.return_type = new MethodReturnType (this); + this.return_type.ReturnType = returnType; + this.token = new MetadataToken (TokenType.MemberRef); + } + + public MethodReference (string name, TypeReference returnType, TypeReference declaringType) + : this (name, returnType) + { + Mixin.CheckType (declaringType, Mixin.Argument.declaringType); + + this.DeclaringType = declaringType; + } + + public virtual MethodReference GetElementMethod () + { + return this; + } + + protected override IMemberDefinition ResolveDefinition () + { + return this.Resolve (); + } + + public new virtual MethodDefinition Resolve () + { + var module = this.Module; + if (module == null) + throw new NotSupportedException (); + + return module.Resolve (this); + } + } + + static partial class Mixin { + + public static bool IsVarArg (this IMethodSignature self) + { + return self.CallingConvention == MethodCallingConvention.VarArg; + } + + public static int GetSentinelPosition (this IMethodSignature self) + { + if (!self.HasParameters) + return -1; + + var parameters = self.Parameters; + for (int i = 0; i < parameters.Count; i++) + if (parameters [i].ParameterType.IsSentinel) + return i; + + return -1; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReference.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReference.cs.meta new file mode 100644 index 0000000..2f0eb25 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e894eb84c10b07f42bf952d556a35c1c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReferenceComparer.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReferenceComparer.cs new file mode 100644 index 0000000..e8df3fd --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReferenceComparer.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; + +namespace MonoFN.Cecil { + internal sealed class MethodReferenceComparer : EqualityComparer { + // Initialized lazily for each thread + [ThreadStatic] + static List xComparisonStack = null; + + [ThreadStatic] + static List yComparisonStack = null; + + public override bool Equals (MethodReference x, MethodReference y) + { + return AreEqual (x, y); + } + + public override int GetHashCode (MethodReference obj) + { + return GetHashCodeFor (obj); + } + + public static bool AreEqual (MethodReference x, MethodReference y) + { + if (ReferenceEquals (x, y)) + return true; + + if (x.HasThis != y.HasThis) + return false; + + if (x.HasParameters != y.HasParameters) + return false; + + if (x.HasGenericParameters != y.HasGenericParameters) + return false; + + if (x.Parameters.Count != y.Parameters.Count) + return false; + + if (x.Name != y.Name) + return false; + + if (!TypeReferenceEqualityComparer.AreEqual (x.DeclaringType, y.DeclaringType)) + return false; + + var xGeneric = x as GenericInstanceMethod; + var yGeneric = y as GenericInstanceMethod; + if (xGeneric != null || yGeneric != null) { + if (xGeneric == null || yGeneric == null) + return false; + + if (xGeneric.GenericArguments.Count != yGeneric.GenericArguments.Count) + return false; + + for (int i = 0; i < xGeneric.GenericArguments.Count; i++) + if (!TypeReferenceEqualityComparer.AreEqual (xGeneric.GenericArguments [i], yGeneric.GenericArguments [i])) + return false; + } + + var xResolved = x.Resolve (); + var yResolved = y.Resolve (); + + if (xResolved != yResolved) + return false; + + if (xResolved == null) { + // We couldn't resolve either method. In order for them to be equal, their parameter types _must_ match. But wait, there's a twist! + // There exists a situation where we might get into a recursive state: parameter type comparison might lead to comparing the same + // methods again if the parameter types are generic parameters whose owners are these methods. We guard against these by using a + // thread static list of all our comparisons carried out in the stack so far, and if we're in progress of comparing them already, + // we'll just say that they match. + + if (xComparisonStack == null) + xComparisonStack = new List (); + + if (yComparisonStack == null) + yComparisonStack = new List (); + + for (int i = 0; i < xComparisonStack.Count; i++) { + if (xComparisonStack [i] == x && yComparisonStack [i] == y) + return true; + } + + xComparisonStack.Add (x); + + try { + yComparisonStack.Add (y); + + try { + for (int i = 0; i < x.Parameters.Count; i++) { + if (!TypeReferenceEqualityComparer.AreEqual (x.Parameters [i].ParameterType, y.Parameters [i].ParameterType)) + return false; + } + } + finally { + yComparisonStack.RemoveAt (yComparisonStack.Count - 1); + } + } + finally { + xComparisonStack.RemoveAt (xComparisonStack.Count - 1); + } + } + + return true; + } + + public static bool AreSignaturesEqual (MethodReference x, MethodReference y, TypeComparisonMode comparisonMode = TypeComparisonMode.Exact) + { + if (x.HasThis != y.HasThis) + return false; + + if (x.Parameters.Count != y.Parameters.Count) + return false; + + if (x.GenericParameters.Count != y.GenericParameters.Count) + return false; + + for (var i = 0; i < x.Parameters.Count; i++) + if (!TypeReferenceEqualityComparer.AreEqual (x.Parameters [i].ParameterType, y.Parameters [i].ParameterType, comparisonMode)) + return false; + + if (!TypeReferenceEqualityComparer.AreEqual (x.ReturnType, y.ReturnType, comparisonMode)) + return false; + + return true; + } + + public static int GetHashCodeFor (MethodReference obj) + { + // a very good prime number + const int hashCodeMultiplier = 486187739; + + var genericInstanceMethod = obj as GenericInstanceMethod; + if (genericInstanceMethod != null) { + var hashCode = GetHashCodeFor (genericInstanceMethod.ElementMethod); + for (var i = 0; i < genericInstanceMethod.GenericArguments.Count; i++) + hashCode = hashCode * hashCodeMultiplier + TypeReferenceEqualityComparer.GetHashCodeFor (genericInstanceMethod.GenericArguments [i]); + return hashCode; + } + + return TypeReferenceEqualityComparer.GetHashCodeFor (obj.DeclaringType) * hashCodeMultiplier + obj.Name.GetHashCode (); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReferenceComparer.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReferenceComparer.cs.meta new file mode 100644 index 0000000..901496a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReferenceComparer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e61a3569af766524884d80a918529ab8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReturnType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReturnType.cs new file mode 100644 index 0000000..c833565 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReturnType.cs @@ -0,0 +1,97 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System.Threading; + +namespace MonoFN.Cecil { + + public sealed class MethodReturnType : IConstantProvider, ICustomAttributeProvider, IMarshalInfoProvider { + + internal IMethodSignature method; + internal ParameterDefinition parameter; + TypeReference return_type; + + public IMethodSignature Method { + get { return method; } + } + + public TypeReference ReturnType { + get { return return_type; } + set { return_type = value; } + } + + internal ParameterDefinition Parameter { + get { + if (parameter == null) + Interlocked.CompareExchange (ref parameter, new ParameterDefinition (return_type, method), null); + + return parameter; + } + } + + public MetadataToken MetadataToken { + get { return Parameter.MetadataToken; } + set { Parameter.MetadataToken = value; } + } + + public ParameterAttributes Attributes { + get { return Parameter.Attributes; } + set { Parameter.Attributes = value; } + } + + public string Name { + get { return Parameter.Name; } + set { Parameter.Name = value; } + } + + public bool HasCustomAttributes { + get { return parameter != null && parameter.HasCustomAttributes; } + } + + public Collection CustomAttributes { + get { return Parameter.CustomAttributes; } + } + + public bool HasDefault { + get { return parameter != null && parameter.HasDefault; } + set { Parameter.HasDefault = value; } + } + + public bool HasConstant { + get { return parameter != null && parameter.HasConstant; } + set { Parameter.HasConstant = value; } + } + + public object Constant { + get { return Parameter.Constant; } + set { Parameter.Constant = value; } + } + + public bool HasFieldMarshal { + get { return parameter != null && parameter.HasFieldMarshal; } + set { Parameter.HasFieldMarshal = value; } + } + + public bool HasMarshalInfo { + get { return parameter != null && parameter.HasMarshalInfo; } + } + + public MarshalInfo MarshalInfo { + get { return Parameter.MarshalInfo; } + set { Parameter.MarshalInfo = value; } + } + + public MethodReturnType (IMethodSignature method) + { + this.method = method; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReturnType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReturnType.cs.meta new file mode 100644 index 0000000..1cab923 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodReturnType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 51d33467d0e0c6f46a788d5da23d7b23 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSemanticsAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSemanticsAttributes.cs new file mode 100644 index 0000000..10b9ef9 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSemanticsAttributes.cs @@ -0,0 +1,25 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum MethodSemanticsAttributes : ushort { + None = 0x0000, + Setter = 0x0001, // Setter for property + Getter = 0x0002, // Getter for property + Other = 0x0004, // Other method for property or event + AddOn = 0x0008, // AddOn method for event + RemoveOn = 0x0010, // RemoveOn method for event + Fire = 0x0020 // Fire method for event + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSemanticsAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSemanticsAttributes.cs.meta new file mode 100644 index 0000000..7e68665 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSemanticsAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d6ed7cb61b1647749854923d7f4f2c4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSpecification.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSpecification.cs new file mode 100644 index 0000000..b4bc4ed --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSpecification.cs @@ -0,0 +1,83 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; + +namespace MonoFN.Cecil { + + public abstract class MethodSpecification : MethodReference { + + readonly MethodReference method; + + public MethodReference ElementMethod { + get { return method; } + } + + public override string Name { + get { return method.Name; } + set { throw new InvalidOperationException (); } + } + + public override MethodCallingConvention CallingConvention { + get { return method.CallingConvention; } + set { throw new InvalidOperationException (); } + } + + public override bool HasThis { + get { return method.HasThis; } + set { throw new InvalidOperationException (); } + } + + public override bool ExplicitThis { + get { return method.ExplicitThis; } + set { throw new InvalidOperationException (); } + } + + public override MethodReturnType MethodReturnType { + get { return method.MethodReturnType; } + set { throw new InvalidOperationException (); } + } + + public override TypeReference DeclaringType { + get { return method.DeclaringType; } + set { throw new InvalidOperationException (); } + } + + public override ModuleDefinition Module { + get { return method.Module; } + } + + public override bool HasParameters { + get { return method.HasParameters; } + } + + public override Collection Parameters { + get { return method.Parameters; } + } + + public override bool ContainsGenericParameter { + get { return method.ContainsGenericParameter; } + } + + internal MethodSpecification (MethodReference method) + { + Mixin.CheckMethod (method); + + this.method = method; + this.token = new MetadataToken (TokenType.MethodSpec); + } + + public sealed override MethodReference GetElementMethod () + { + return method.GetElementMethod (); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSpecification.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSpecification.cs.meta new file mode 100644 index 0000000..0ab0565 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/MethodSpecification.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aab27df5116b6ef46ac37993c843e4f0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Modifiers.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Modifiers.cs new file mode 100644 index 0000000..13367cd --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Modifiers.cs @@ -0,0 +1,112 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +using MD = MonoFN.Cecil.Metadata; + +namespace MonoFN.Cecil { + + public interface IModifierType { + TypeReference ModifierType { get; } + TypeReference ElementType { get; } + } + + public sealed class OptionalModifierType : TypeSpecification, IModifierType { + + TypeReference modifier_type; + + public TypeReference ModifierType { + get { return modifier_type; } + set { modifier_type = value; } + } + + public override string Name { + get { return base.Name + Suffix; } + } + + public override string FullName { + get { return base.FullName + Suffix; } + } + + string Suffix { + get { return " modopt(" + modifier_type + ")"; } + } + + public override bool IsValueType { + get { return false; } + set { throw new InvalidOperationException (); } + } + + public override bool IsOptionalModifier { + get { return true; } + } + + public override bool ContainsGenericParameter { + get { return modifier_type.ContainsGenericParameter || base.ContainsGenericParameter; } + } + + public OptionalModifierType (TypeReference modifierType, TypeReference type) + : base (type) + { + if (modifierType == null) + throw new ArgumentNullException (Mixin.Argument.modifierType.ToString ()); + Mixin.CheckType (type); + this.modifier_type = modifierType; + this.etype = MD.ElementType.CModOpt; + } + } + + public sealed class RequiredModifierType : TypeSpecification, IModifierType { + + TypeReference modifier_type; + + public TypeReference ModifierType { + get { return modifier_type; } + set { modifier_type = value; } + } + + public override string Name { + get { return base.Name + Suffix; } + } + + public override string FullName { + get { return base.FullName + Suffix; } + } + + string Suffix { + get { return " modreq(" + modifier_type + ")"; } + } + + public override bool IsValueType { + get { return false; } + set { throw new InvalidOperationException (); } + } + + public override bool IsRequiredModifier { + get { return true; } + } + + public override bool ContainsGenericParameter { + get { return modifier_type.ContainsGenericParameter || base.ContainsGenericParameter; } + } + + public RequiredModifierType (TypeReference modifierType, TypeReference type) + : base (type) + { + if (modifierType == null) + throw new ArgumentNullException (Mixin.Argument.modifierType.ToString ()); + Mixin.CheckType (type); + this.modifier_type = modifierType; + this.etype = MD.ElementType.CModReqD; + } + + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Modifiers.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Modifiers.cs.meta new file mode 100644 index 0000000..7678d47 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Modifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1fc5ce450d74933428a568f51cb49c16 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleDefinition.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleDefinition.cs new file mode 100644 index 0000000..9af60a5 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleDefinition.cs @@ -0,0 +1,1353 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Cil; +using MonoFN.Cecil.Metadata; +using MonoFN.Cecil.PE; +using MonoFN.Collections.Generic; +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using SR = System.Reflection; + +namespace MonoFN.Cecil { + + public enum ReadingMode { + Immediate = 1, + Deferred = 2, + } + + public sealed class ReaderParameters { + + ReadingMode reading_mode; + internal IAssemblyResolver assembly_resolver; + internal IMetadataResolver metadata_resolver; + internal IMetadataImporterProvider metadata_importer_provider; + internal IReflectionImporterProvider reflection_importer_provider; + Stream symbol_stream; + ISymbolReaderProvider symbol_reader_provider; + bool read_symbols; + bool throw_symbols_mismatch; + bool projections; + bool in_memory; + bool read_write; + + public ReadingMode ReadingMode { + get { return reading_mode; } + set { reading_mode = value; } + } + + public bool InMemory { + get { return in_memory; } + set { in_memory = value; } + } + + public IAssemblyResolver AssemblyResolver { + get { return assembly_resolver; } + set { assembly_resolver = value; } + } + + public IMetadataResolver MetadataResolver { + get { return metadata_resolver; } + set { metadata_resolver = value; } + } + + public IMetadataImporterProvider MetadataImporterProvider { + get { return metadata_importer_provider; } + set { metadata_importer_provider = value; } + } + + public IReflectionImporterProvider ReflectionImporterProvider { + get { return reflection_importer_provider; } + set { reflection_importer_provider = value; } + } + + public Stream SymbolStream { + get { return symbol_stream; } + set { symbol_stream = value; } + } + + public ISymbolReaderProvider SymbolReaderProvider { + get { return symbol_reader_provider; } + set { symbol_reader_provider = value; } + } + + public bool ReadSymbols { + get { return read_symbols; } + set { read_symbols = value; } + } + + public bool ThrowIfSymbolsAreNotMatching { + get { return throw_symbols_mismatch; } + set { throw_symbols_mismatch = value; } + } + + public bool ReadWrite { + get { return read_write; } + set { read_write = value; } + } + + public bool ApplyWindowsRuntimeProjections { + get { return projections; } + set { projections = value; } + } + + public ReaderParameters () + : this (ReadingMode.Deferred) + { + } + + public ReaderParameters (ReadingMode readingMode) + { + this.reading_mode = readingMode; + this.throw_symbols_mismatch = true; + } + } + + public sealed class ModuleParameters { + + ModuleKind kind; + TargetRuntime runtime; + uint? timestamp; + TargetArchitecture architecture; + IAssemblyResolver assembly_resolver; + IMetadataResolver metadata_resolver; + IMetadataImporterProvider metadata_importer_provider; + IReflectionImporterProvider reflection_importer_provider; + + public ModuleKind Kind { + get { return kind; } + set { kind = value; } + } + + public TargetRuntime Runtime { + get { return runtime; } + set { runtime = value; } + } + + public uint? Timestamp { + get { return timestamp; } + set { timestamp = value; } + } + + public TargetArchitecture Architecture { + get { return architecture; } + set { architecture = value; } + } + + public IAssemblyResolver AssemblyResolver { + get { return assembly_resolver; } + set { assembly_resolver = value; } + } + + public IMetadataResolver MetadataResolver { + get { return metadata_resolver; } + set { metadata_resolver = value; } + } + + public IMetadataImporterProvider MetadataImporterProvider { + get { return metadata_importer_provider; } + set { metadata_importer_provider = value; } + } + + public IReflectionImporterProvider ReflectionImporterProvider { + get { return reflection_importer_provider; } + set { reflection_importer_provider = value; } + } + + public ModuleParameters () + { + this.kind = ModuleKind.Dll; + this.Runtime = GetCurrentRuntime (); + this.architecture = TargetArchitecture.I386; + } + + static TargetRuntime GetCurrentRuntime () + { + return typeof (object).Assembly.ImageRuntimeVersion.ParseRuntime (); + } + } + + public sealed class WriterParameters { + + uint? timestamp; + Stream symbol_stream; + ISymbolWriterProvider symbol_writer_provider; + bool write_symbols; + byte [] key_blob; + string key_container; + SR.StrongNameKeyPair key_pair; + + public uint? Timestamp { + get { return timestamp; } + set { timestamp = value; } + } + + public Stream SymbolStream { + get { return symbol_stream; } + set { symbol_stream = value; } + } + + public ISymbolWriterProvider SymbolWriterProvider { + get { return symbol_writer_provider; } + set { symbol_writer_provider = value; } + } + + public bool WriteSymbols { + get { return write_symbols; } + set { write_symbols = value; } + } + + public bool HasStrongNameKey { + get { return key_pair != null || key_blob != null || key_container != null; } + } + + public byte [] StrongNameKeyBlob { + get { return key_blob; } + set { key_blob = value; } + } + + public string StrongNameKeyContainer { + get { return key_container; } + set { key_container = value; } + } + + public SR.StrongNameKeyPair StrongNameKeyPair { + get { return key_pair; } + set { key_pair = value; } + } + + public bool DeterministicMvid { get; set; } + } + + public sealed class ModuleDefinition : ModuleReference, ICustomAttributeProvider, ICustomDebugInformationProvider, IDisposable { + + internal Image Image; + internal MetadataSystem MetadataSystem; + internal ReadingMode ReadingMode; + internal ISymbolReaderProvider SymbolReaderProvider; + + internal ISymbolReader symbol_reader; + internal Disposable assembly_resolver; + internal IMetadataResolver metadata_resolver; + internal TypeSystem type_system; + internal readonly MetadataReader reader; + readonly string file_name; + + internal string runtime_version; + internal ModuleKind kind; + WindowsRuntimeProjections projections; + MetadataKind metadata_kind; + TargetRuntime runtime; + TargetArchitecture architecture; + ModuleAttributes attributes; + ModuleCharacteristics characteristics; + Guid mvid; + + internal ushort linker_version = 8; + internal ushort subsystem_major = 4; + internal ushort subsystem_minor = 0; + internal uint timestamp; + + internal AssemblyDefinition assembly; + MethodDefinition entry_point; + bool entry_point_set; + + internal IReflectionImporter reflection_importer; + internal IMetadataImporter metadata_importer; + + Collection custom_attributes; + Collection references; + Collection modules; + Collection resources; + Collection exported_types; + TypeDefinitionCollection types; + + internal Collection custom_infos; + + internal MetadataBuilder metadata_builder; + + public bool IsMain { + get { return kind != ModuleKind.NetModule; } + } + + public ModuleKind Kind { + get { return kind; } + set { kind = value; } + } + + public MetadataKind MetadataKind { + get { return metadata_kind; } + set { metadata_kind = value; } + } + + internal WindowsRuntimeProjections Projections { + get { + if (projections == null) + Interlocked.CompareExchange (ref projections, new WindowsRuntimeProjections (this), null); + + return projections; + } + } + + public TargetRuntime Runtime { + get { return runtime; } + set { + runtime = value; + runtime_version = runtime.RuntimeVersionString (); + } + } + + public string RuntimeVersion { + get { return runtime_version; } + set { + runtime_version = value; + runtime = runtime_version.ParseRuntime (); + } + } + + public TargetArchitecture Architecture { + get { return architecture; } + set { architecture = value; } + } + + public ModuleAttributes Attributes { + get { return attributes; } + set { attributes = value; } + } + + public ModuleCharacteristics Characteristics { + get { return characteristics; } + set { characteristics = value; } + } + + [Obsolete ("Use FileName")] + public string FullyQualifiedName { + get { return file_name; } + } + + public string FileName { + get { return file_name; } + } + + public Guid Mvid { + get { return mvid; } + set { mvid = value; } + } + + internal bool HasImage { + get { return Image != null; } + } + + public bool HasSymbols { + get { return symbol_reader != null; } + } + + public ISymbolReader SymbolReader { + get { return symbol_reader; } + } + + public override MetadataScopeType MetadataScopeType { + get { return MetadataScopeType.ModuleDefinition; } + } + + public AssemblyDefinition Assembly { + get { return assembly; } + } + + internal IReflectionImporter ReflectionImporter { + get { + if (reflection_importer == null) + Interlocked.CompareExchange (ref reflection_importer, new DefaultReflectionImporter (this), null); + + return reflection_importer; + } + } + + internal IMetadataImporter MetadataImporter { + get { + if (metadata_importer == null) + Interlocked.CompareExchange (ref metadata_importer, new DefaultMetadataImporter (this), null); + + return metadata_importer; + } + } + + public IAssemblyResolver AssemblyResolver { + get { + if (assembly_resolver.value == null) { + lock (module_lock) { + assembly_resolver = Disposable.Owned (new DefaultAssemblyResolver () as IAssemblyResolver); + } + } + + return assembly_resolver.value; + } + } + + public IMetadataResolver MetadataResolver { + get { + if (metadata_resolver == null) + Interlocked.CompareExchange (ref metadata_resolver, new MetadataResolver (this.AssemblyResolver), null); + + return metadata_resolver; + } + } + + public TypeSystem TypeSystem { + get { + if (type_system == null) + Interlocked.CompareExchange (ref type_system, TypeSystem.CreateTypeSystem (this), null); + + return type_system; + } + } + + public bool HasAssemblyReferences { + get { + if (references != null) + return references.Count > 0; + + return HasImage && Image.HasTable (Table.AssemblyRef); + } + } + + public Collection AssemblyReferences { + get { + if (references != null) + return references; + + if (HasImage) + return Read (ref references, this, (_, reader) => reader.ReadAssemblyReferences ()); + + Interlocked.CompareExchange (ref references, new Collection (), null); + return references; + } + } + + public bool HasModuleReferences { + get { + if (modules != null) + return modules.Count > 0; + + return HasImage && Image.HasTable (Table.ModuleRef); + } + } + + public Collection ModuleReferences { + get { + if (modules != null) + return modules; + + if (HasImage) + return Read (ref modules, this, (_, reader) => reader.ReadModuleReferences ()); + + Interlocked.CompareExchange (ref modules, new Collection (), null); + return modules; + } + } + + public bool HasResources { + get { + if (resources != null) + return resources.Count > 0; + + if (HasImage) + return Image.HasTable (Table.ManifestResource) || Read (this, (_, reader) => reader.HasFileResource ()); + + return false; + } + } + + public Collection Resources { + get { + if (resources != null) + return resources; + + if (HasImage) + return Read (ref resources, this, (_, reader) => reader.ReadResources ()); + + Interlocked.CompareExchange (ref resources, new Collection (), null); + return resources; + } + } + + public bool HasCustomAttributes { + get { + if (custom_attributes != null) + return custom_attributes.Count > 0; + + return this.GetHasCustomAttributes (this); + } + } + + public Collection CustomAttributes { + get { return custom_attributes ?? (this.GetCustomAttributes (ref custom_attributes, this)); } + } + + public bool HasTypes { + get { + if (types != null) + return types.Count > 0; + + return HasImage && Image.HasTable (Table.TypeDef); + } + } + + public Collection Types { + get { + if (types != null) + return types; + + if (HasImage) + return Read (ref types, this, (_, reader) => reader.ReadTypes ()); + + Interlocked.CompareExchange (ref types, new TypeDefinitionCollection (this), null); + return types; + } + } + + public bool HasExportedTypes { + get { + if (exported_types != null) + return exported_types.Count > 0; + + return HasImage && Image.HasTable (Table.ExportedType); + } + } + + public Collection ExportedTypes { + get { + if (exported_types != null) + return exported_types; + + if (HasImage) + return Read (ref exported_types, this, (_, reader) => reader.ReadExportedTypes ()); + + Interlocked.CompareExchange (ref exported_types, new Collection (), null); + return exported_types; + } + } + + public MethodDefinition EntryPoint { + get { + if (entry_point_set) + return entry_point; + + if (HasImage) + Read (ref entry_point, this, (_, reader) => reader.ReadEntryPoint ()); + else + entry_point = null; + + entry_point_set = true; + return entry_point; + } + set { + entry_point = value; + entry_point_set = true; + } + } + + public bool HasCustomDebugInformations { + get { + return custom_infos != null && custom_infos.Count > 0; + } + } + + public Collection CustomDebugInformations { + get { + if (custom_infos == null) + Interlocked.CompareExchange (ref custom_infos, new Collection (), null); + + return custom_infos; + } + } + + internal ModuleDefinition () + { + this.MetadataSystem = new MetadataSystem (); + this.token = new MetadataToken (TokenType.Module, 1); + } + + internal ModuleDefinition (Image image) + : this () + { + this.Image = image; + this.kind = image.Kind; + this.RuntimeVersion = image.RuntimeVersion; + this.architecture = image.Architecture; + this.attributes = image.Attributes; + this.characteristics = image.DllCharacteristics; + this.linker_version = image.LinkerVersion; + this.subsystem_major = image.SubSystemMajor; + this.subsystem_minor = image.SubSystemMinor; + this.file_name = image.FileName; + this.timestamp = image.Timestamp; + + this.reader = new MetadataReader (this); + } + + public void Dispose () + { + if (Image != null) + Image.Dispose (); + + if (symbol_reader != null) + symbol_reader.Dispose (); + + if (assembly_resolver.value != null) + assembly_resolver.Dispose (); + } + + public bool HasTypeReference (string fullName) + { + return HasTypeReference (string.Empty, fullName); + } + + public bool HasTypeReference (string scope, string fullName) + { + Mixin.CheckFullName (fullName); + + if (!HasImage) + return false; + + return GetTypeReference (scope, fullName) != null; + } + + public bool TryGetTypeReference (string fullName, out TypeReference type) + { + return TryGetTypeReference (string.Empty, fullName, out type); + } + + public bool TryGetTypeReference (string scope, string fullName, out TypeReference type) + { + Mixin.CheckFullName (fullName); + + if (!HasImage) { + type = null; + return false; + } + + return (type = GetTypeReference (scope, fullName)) != null; + } + + TypeReference GetTypeReference (string scope, string fullname) + { + return Read (new Row (scope, fullname), (row, reader) => reader.GetTypeReference (row.Col1, row.Col2)); + } + + public IEnumerable GetTypeReferences () + { + if (!HasImage) + return Empty.Array; + + return Read (this, (_, reader) => reader.GetTypeReferences ()); + } + + public IEnumerable GetMemberReferences () + { + if (!HasImage) + return Empty.Array; + + return Read (this, (_, reader) => reader.GetMemberReferences ()); + } + + public IEnumerable GetCustomAttributes () + { + if (!HasImage) + return Empty.Array; + + return Read (this, (_, reader) => reader.GetCustomAttributes ()); + } + + public TypeReference GetType (string fullName, bool runtimeName) + { + return runtimeName + ? TypeParser.ParseType (this, fullName, typeDefinitionOnly: true) + : GetType (fullName); + } + + public TypeDefinition GetType (string fullName) + { + Mixin.CheckFullName (fullName); + + var position = fullName.IndexOf ('/'); + if (position > 0) + return GetNestedType (fullName); + + return ((TypeDefinitionCollection)this.Types).GetType (fullName); + } + + public TypeDefinition GetType (string @namespace, string name) + { + Mixin.CheckName (name); + + return ((TypeDefinitionCollection)this.Types).GetType (@namespace ?? string.Empty, name); + } + + public IEnumerable GetTypes () + { + return GetTypes (Types); + } + + static IEnumerable GetTypes (Collection types) + { + for (int i = 0; i < types.Count; i++) { + var type = types [i]; + + yield return type; + + if (!type.HasNestedTypes) + continue; + + foreach (var nested in GetTypes (type.NestedTypes)) + yield return nested; + } + } + + TypeDefinition GetNestedType (string fullname) + { + var names = fullname.Split ('/'); + var type = GetType (names [0]); + + if (type == null) + return null; + + for (int i = 1; i < names.Length; i++) { + var nested_type = type.GetNestedType (names [i]); + if (nested_type == null) + return null; + + type = nested_type; + } + + return type; + } + + internal FieldDefinition Resolve (FieldReference field) + { + return MetadataResolver.Resolve (field); + } + + internal MethodDefinition Resolve (MethodReference method) + { + return MetadataResolver.Resolve (method); + } + + internal TypeDefinition Resolve (TypeReference type) + { + return MetadataResolver.Resolve (type); + } + + static void CheckContext (IGenericParameterProvider context, ModuleDefinition module) + { + if (context == null) + return; + + if (context.Module != module) + throw new ArgumentException (); + } + + [Obsolete ("Use ImportReference", error: false)] + public TypeReference Import (Type type) + { + return ImportReference (type, null); + } + + public TypeReference ImportReference (Type type) + { + return ImportReference (type, null); + } + + [Obsolete ("Use ImportReference", error: false)] + public TypeReference Import (Type type, IGenericParameterProvider context) + { + return ImportReference (type, context); + } + + public TypeReference ImportReference (Type type, IGenericParameterProvider context) + { + Mixin.CheckType (type); + CheckContext (context, this); + + return ReflectionImporter.ImportReference (type, context); + } + + [Obsolete ("Use ImportReference", error: false)] + public FieldReference Import (SR.FieldInfo field) + { + return ImportReference (field, null); + } + + [Obsolete ("Use ImportReference", error: false)] + public FieldReference Import (SR.FieldInfo field, IGenericParameterProvider context) + { + return ImportReference (field, context); + } + + public FieldReference ImportReference (SR.FieldInfo field) + { + return ImportReference (field, null); + } + + public FieldReference ImportReference (SR.FieldInfo field, IGenericParameterProvider context) + { + Mixin.CheckField (field); + CheckContext (context, this); + + return ReflectionImporter.ImportReference (field, context); + } + + [Obsolete ("Use ImportReference", error: false)] + public MethodReference Import (SR.MethodBase method) + { + return ImportReference (method, null); + } + + [Obsolete ("Use ImportReference", error: false)] + public MethodReference Import (SR.MethodBase method, IGenericParameterProvider context) + { + return ImportReference (method, context); + } + + public MethodReference ImportReference (SR.MethodBase method) + { + return ImportReference (method, null); + } + + public MethodReference ImportReference (SR.MethodBase method, IGenericParameterProvider context) + { + Mixin.CheckMethod (method); + CheckContext (context, this); + + return ReflectionImporter.ImportReference (method, context); + } + + [Obsolete ("Use ImportReference", error: false)] + public TypeReference Import (TypeReference type) + { + return ImportReference (type, null); + } + + [Obsolete ("Use ImportReference", error: false)] + public TypeReference Import (TypeReference type, IGenericParameterProvider context) + { + return ImportReference (type, context); + } + + public TypeReference ImportReference (TypeReference type) + { + return ImportReference (type, null); + } + + public TypeReference ImportReference (TypeReference type, IGenericParameterProvider context) + { + Mixin.CheckType (type); + + if (type.Module == this) + return type; + + CheckContext (context, this); + + return MetadataImporter.ImportReference (type, context); + } + + [Obsolete ("Use ImportReference", error: false)] + public FieldReference Import (FieldReference field) + { + return ImportReference (field, null); + } + + [Obsolete ("Use ImportReference", error: false)] + public FieldReference Import (FieldReference field, IGenericParameterProvider context) + { + return ImportReference (field, context); + } + + public FieldReference ImportReference (FieldReference field) + { + return ImportReference (field, null); + } + + public FieldReference ImportReference (FieldReference field, IGenericParameterProvider context) + { + Mixin.CheckField (field); + + if (field.Module == this) + return field; + + CheckContext (context, this); + + return MetadataImporter.ImportReference (field, context); + } + + [Obsolete ("Use ImportReference", error: false)] + public MethodReference Import (MethodReference method) + { + return ImportReference (method, null); + } + + [Obsolete ("Use ImportReference", error: false)] + public MethodReference Import (MethodReference method, IGenericParameterProvider context) + { + return ImportReference (method, context); + } + + public MethodReference ImportReference (MethodReference method) + { + return ImportReference (method, null); + } + + public MethodReference ImportReference (MethodReference method, IGenericParameterProvider context) + { + Mixin.CheckMethod (method); + + if (method.Module == this) + return method; + + CheckContext (context, this); + + return MetadataImporter.ImportReference (method, context); + } + + public IMetadataTokenProvider LookupToken (int token) + { + return LookupToken (new MetadataToken ((uint)token)); + } + + public IMetadataTokenProvider LookupToken (MetadataToken token) + { + return Read (token, (t, reader) => reader.LookupToken (t)); + } + + public void ImmediateRead () + { + if (!HasImage) + return; + ReadingMode = ReadingMode.Immediate; + var moduleReader = new ImmediateModuleReader (Image); + moduleReader.ReadModule (this, resolve_attributes: true); + } + + readonly object module_lock = new object (); + + internal object SyncRoot { + get { return module_lock; } + } + + internal void Read (TItem item, Action read) + { + lock (module_lock) { + var position = reader.position; + var context = reader.context; + + read (item, reader); + + reader.position = position; + reader.context = context; + } + } + + internal TRet Read (TItem item, Func read) + { + lock (module_lock) { + var position = reader.position; + var context = reader.context; + + var ret = read (item, reader); + + reader.position = position; + reader.context = context; + + return ret; + } + } + + internal TRet Read (ref TRet variable, TItem item, Func read) where TRet : class + { + lock (module_lock) { + if (variable != null) + return variable; + + var position = reader.position; + var context = reader.context; + + var ret = read (item, reader); + + reader.position = position; + reader.context = context; + + return variable = ret; + } + } + + public bool HasDebugHeader { + get { return Image != null && Image.DebugHeader != null; } + } + + public ImageDebugHeader GetDebugHeader () + { + return Image.DebugHeader ?? new ImageDebugHeader (); + } + + public static ModuleDefinition CreateModule (string name, ModuleKind kind) + { + return CreateModule (name, new ModuleParameters { Kind = kind }); + } + + public static ModuleDefinition CreateModule (string name, ModuleParameters parameters) + { + Mixin.CheckName (name); + Mixin.CheckParameters (parameters); + + var module = new ModuleDefinition { + Name = name, + kind = parameters.Kind, + timestamp = parameters.Timestamp ?? Mixin.GetTimestamp (), + Runtime = parameters.Runtime, + architecture = parameters.Architecture, + mvid = Guid.NewGuid (), + Attributes = ModuleAttributes.ILOnly, + Characteristics = (ModuleCharacteristics)0x8540, + }; + + if (parameters.AssemblyResolver != null) + module.assembly_resolver = Disposable.NotOwned (parameters.AssemblyResolver); + + if (parameters.MetadataResolver != null) + module.metadata_resolver = parameters.MetadataResolver; + + if (parameters.MetadataImporterProvider != null) + module.metadata_importer = parameters.MetadataImporterProvider.GetMetadataImporter (module); + + if (parameters.ReflectionImporterProvider != null) + module.reflection_importer = parameters.ReflectionImporterProvider.GetReflectionImporter (module); + + if (parameters.Kind != ModuleKind.NetModule) { + var assembly = new AssemblyDefinition (); + module.assembly = assembly; + module.assembly.Name = CreateAssemblyName (name); + assembly.main_module = module; + } + + module.Types.Add (new TypeDefinition (string.Empty, "", TypeAttributes.NotPublic)); + + return module; + } + + static AssemblyNameDefinition CreateAssemblyName (string name) + { + if (name.EndsWith (".dll") || name.EndsWith (".exe")) + name = name.Substring (0, name.Length - 4); + + return new AssemblyNameDefinition (name, Mixin.ZeroVersion); + } + + public void ReadSymbols () + { + if (string.IsNullOrEmpty (file_name)) + throw new InvalidOperationException (); + + var provider = new DefaultSymbolReaderProvider (throwIfNoSymbol: true); + ReadSymbols (provider.GetSymbolReader (this, file_name), throwIfSymbolsAreNotMaching: true); + } + + public void ReadSymbols (ISymbolReader reader) + { + ReadSymbols (reader, throwIfSymbolsAreNotMaching: true); + } + + public void ReadSymbols (ISymbolReader reader, bool throwIfSymbolsAreNotMaching) + { + if (reader == null) + throw new ArgumentNullException ("reader"); + + symbol_reader = reader; + + if (!symbol_reader.ProcessDebugHeader (GetDebugHeader ())) { + symbol_reader = null; + + if (throwIfSymbolsAreNotMaching) + throw new SymbolsNotMatchingException ("Symbols were found but are not matching the assembly"); + + return; + } + + if (HasImage && ReadingMode == ReadingMode.Immediate) { + var immediate_reader = new ImmediateModuleReader (Image); + immediate_reader.ReadSymbols (this); + } + } + + public static ModuleDefinition ReadModule (string fileName) + { + return ReadModule (fileName, new ReaderParameters (ReadingMode.Deferred)); + } + + public static ModuleDefinition ReadModule (string fileName, ReaderParameters parameters) + { + var stream = GetFileStream (fileName, FileMode.Open, parameters.ReadWrite ? FileAccess.ReadWrite : FileAccess.Read, FileShare.Read); + + if (parameters.InMemory) { + var memory = new MemoryStream (stream.CanSeek ? (int)stream.Length : 0); + using (stream) + stream.CopyTo (memory); + + memory.Position = 0; + stream = memory; + } + + try { + return ReadModule (Disposable.Owned (stream), fileName, parameters); + } + catch (Exception) { + stream.Dispose (); + throw; + } + } + + static Stream GetFileStream (string fileName, FileMode mode, FileAccess access, FileShare share) + { + Mixin.CheckFileName (fileName); + + return new FileStream (fileName, mode, access, share); + } + + public static ModuleDefinition ReadModule (Stream stream) + { + return ReadModule (stream, new ReaderParameters (ReadingMode.Deferred)); + } + + public static ModuleDefinition ReadModule (Stream stream, ReaderParameters parameters) + { + Mixin.CheckStream (stream); + Mixin.CheckReadSeek (stream); + + return ReadModule (Disposable.NotOwned (stream), stream.GetFileName (), parameters); + } + + static ModuleDefinition ReadModule (Disposable stream, string fileName, ReaderParameters parameters) + { + Mixin.CheckParameters (parameters); + + return ModuleReader.CreateModule ( + ImageReader.ReadImage (stream, fileName), + parameters); + } + + public void Write (string fileName) + { + Write (fileName, new WriterParameters ()); + } + + public void Write (string fileName, WriterParameters parameters) + { + Mixin.CheckParameters (parameters); + var file = GetFileStream (fileName, FileMode.Create, FileAccess.ReadWrite, FileShare.Read); + ModuleWriter.WriteModule (this, Disposable.Owned (file), parameters); + } + + public void Write () + { + Write (new WriterParameters ()); + } + + public void Write (WriterParameters parameters) + { + if (!HasImage) + throw new InvalidOperationException (); + + Write (Image.Stream.value, parameters); + } + + public void Write (Stream stream) + { + Write (stream, new WriterParameters ()); + } + + public void Write (Stream stream, WriterParameters parameters) + { + Mixin.CheckStream (stream); + Mixin.CheckWriteSeek (stream); + Mixin.CheckParameters (parameters); + + ModuleWriter.WriteModule (this, Disposable.NotOwned (stream), parameters); + } + } + + static partial class Mixin { + + public enum Argument { + name, + fileName, + fullName, + stream, + type, + method, + field, + parameters, + module, + modifierType, + eventType, + fieldType, + declaringType, + returnType, + propertyType, + interfaceType, + constraintType, + } + + public static void CheckName (object name) + { + if (name == null) + throw new ArgumentNullException (Argument.name.ToString ()); + } + + public static void CheckName (string name) + { + if (string.IsNullOrEmpty (name)) + throw new ArgumentNullOrEmptyException (Argument.name.ToString ()); + } + + public static void CheckFileName (string fileName) + { + if (string.IsNullOrEmpty (fileName)) + throw new ArgumentNullOrEmptyException (Argument.fileName.ToString ()); + } + + public static void CheckFullName (string fullName) + { + if (string.IsNullOrEmpty (fullName)) + throw new ArgumentNullOrEmptyException (Argument.fullName.ToString ()); + } + + public static void CheckStream (object stream) + { + if (stream == null) + throw new ArgumentNullException (Argument.stream.ToString ()); + } + + public static void CheckWriteSeek (Stream stream) + { + if (!stream.CanWrite || !stream.CanSeek) + throw new ArgumentException ("Stream must be writable and seekable."); + } + + public static void CheckReadSeek (Stream stream) + { + if (!stream.CanRead || !stream.CanSeek) + throw new ArgumentException ("Stream must be readable and seekable."); + } + + public static void CheckType (object type) + { + if (type == null) + throw new ArgumentNullException (Argument.type.ToString ()); + } + + public static void CheckType (object type, Argument argument) + { + if (type == null) + throw new ArgumentNullException (argument.ToString ()); + } + + public static void CheckField (object field) + { + if (field == null) + throw new ArgumentNullException (Argument.field.ToString ()); + } + + public static void CheckMethod (object method) + { + if (method == null) + throw new ArgumentNullException (Argument.method.ToString ()); + } + + public static void CheckParameters (object parameters) + { + if (parameters == null) + throw new ArgumentNullException (Argument.parameters.ToString ()); + } + + public static uint GetTimestamp () + { + return (uint)DateTime.UtcNow.Subtract (new DateTime (1970, 1, 1)).TotalSeconds; + } + + public static bool HasImage (this ModuleDefinition self) + { + return self != null && self.HasImage; + } + + public static string GetFileName (this Stream self) + { + var file_stream = self as FileStream; + if (file_stream == null) + return string.Empty; + + return Path.GetFullPath (file_stream.Name); + } + + public static TargetRuntime ParseRuntime (this string self) + { + if (string.IsNullOrEmpty (self)) + return TargetRuntime.Net_4_0; + + switch (self [1]) { + case '1': + return self [3] == '0' + ? TargetRuntime.Net_1_0 + : TargetRuntime.Net_1_1; + case '2': + return TargetRuntime.Net_2_0; + case '4': + default: + return TargetRuntime.Net_4_0; + } + } + + public static string RuntimeVersionString (this TargetRuntime runtime) + { + switch (runtime) { + case TargetRuntime.Net_1_0: + return "v1.0.3705"; + case TargetRuntime.Net_1_1: + return "v1.1.4322"; + case TargetRuntime.Net_2_0: + return "v2.0.50727"; + case TargetRuntime.Net_4_0: + default: + return "v4.0.30319"; + } + } + + public static bool IsWindowsMetadata (this ModuleDefinition module) + { + return module.MetadataKind != MetadataKind.Ecma335; + } + + public static byte [] ReadAll (this Stream self) + { + int read; + var memory = new MemoryStream ((int)self.Length); + var buffer = new byte [1024]; + + while ((read = self.Read (buffer, 0, buffer.Length)) != 0) + memory.Write (buffer, 0, read); + + return memory.ToArray (); + } + + public static void Read (object o) + { + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleDefinition.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleDefinition.cs.meta new file mode 100644 index 0000000..d34c5c1 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be36668e876daba419d4cf3aa5e8cac9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleKind.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleKind.cs new file mode 100644 index 0000000..429fa8f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleKind.cs @@ -0,0 +1,55 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + public enum ModuleKind { + Dll, + Console, + Windows, + NetModule, + } + + public enum MetadataKind { + Ecma335, + WindowsMetadata, + ManagedWindowsMetadata, + } + + public enum TargetArchitecture { + I386 = 0x014c, + AMD64 = 0x8664, + IA64 = 0x0200, + ARM = 0x01c0, + ARMv7 = 0x01c4, + ARM64 = 0xaa64, + } + + [Flags] + public enum ModuleAttributes { + ILOnly = 1, + Required32Bit = 2, + ILLibrary = 4, + StrongNameSigned = 8, + Preferred32Bit = 0x00020000, + } + + [Flags] + public enum ModuleCharacteristics { + HighEntropyVA = 0x0020, + DynamicBase = 0x0040, + NoSEH = 0x0400, + NXCompat = 0x0100, + AppContainer = 0x1000, + TerminalServerAware = 0x8000, + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleKind.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleKind.cs.meta new file mode 100644 index 0000000..110cc83 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleKind.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b85d54df2658b6d4bab3d27002f45a01 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleReference.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleReference.cs new file mode 100644 index 0000000..eb22872 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleReference.cs @@ -0,0 +1,49 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public class ModuleReference : IMetadataScope { + + string name; + + internal MetadataToken token; + + public string Name { + get { return name; } + set { name = value; } + } + + public virtual MetadataScopeType MetadataScopeType { + get { return MetadataScopeType.ModuleReference; } + } + + public MetadataToken MetadataToken { + get { return token; } + set { token = value; } + } + + internal ModuleReference () + { + this.token = new MetadataToken (TokenType.ModuleRef); + } + + public ModuleReference (string name) + : this () + { + this.name = name; + } + + public override string ToString () + { + return name; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleReference.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleReference.cs.meta new file mode 100644 index 0000000..3510c8c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ModuleReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2b28049ba3ae6394dbe9f227aaf9c88e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/NativeType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/NativeType.cs new file mode 100644 index 0000000..b2ed6d2 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/NativeType.cs @@ -0,0 +1,55 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public enum NativeType { + None = 0x66, + + Boolean = 0x02, + I1 = 0x03, + U1 = 0x04, + I2 = 0x05, + U2 = 0x06, + I4 = 0x07, + U4 = 0x08, + I8 = 0x09, + U8 = 0x0a, + R4 = 0x0b, + R8 = 0x0c, + LPStr = 0x14, + Int = 0x1f, + UInt = 0x20, + Func = 0x26, + Array = 0x2a, + + // Msft specific + Currency = 0x0f, + BStr = 0x13, + LPWStr = 0x15, + LPTStr = 0x16, + FixedSysString = 0x17, + IUnknown = 0x19, + IDispatch = 0x1a, + Struct = 0x1b, + IntF = 0x1c, + SafeArray = 0x1d, + FixedArray = 0x1e, + ByValStr = 0x22, + ANSIBStr = 0x23, + TBStr = 0x24, + VariantBool = 0x25, + ASAny = 0x28, + LPStruct = 0x2b, + CustomMarshaler = 0x2c, + Error = 0x2d, + Max = 0x50 + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/NativeType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/NativeType.cs.meta new file mode 100644 index 0000000..a6dd298 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/NativeType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb32c8b42f4f314448ff4b2c7eae0533 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeAttributes.cs new file mode 100644 index 0000000..d99aca4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeAttributes.cs @@ -0,0 +1,44 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum PInvokeAttributes : ushort { + NoMangle = 0x0001, // PInvoke is to use the member name as specified + + // Character set + CharSetMask = 0x0006, + CharSetNotSpec = 0x0000, + CharSetAnsi = 0x0002, + CharSetUnicode = 0x0004, + CharSetAuto = 0x0006, + + SupportsLastError = 0x0040, // Information about target function. Not relevant for fields + + // Calling convetion + CallConvMask = 0x0700, + CallConvWinapi = 0x0100, + CallConvCdecl = 0x0200, + CallConvStdCall = 0x0300, + CallConvThiscall = 0x0400, + CallConvFastcall = 0x0500, + + BestFitMask = 0x0030, + BestFitEnabled = 0x0010, + BestFitDisabled = 0x0020, + + ThrowOnUnmappableCharMask = 0x3000, + ThrowOnUnmappableCharEnabled = 0x1000, + ThrowOnUnmappableCharDisabled = 0x2000, + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeAttributes.cs.meta new file mode 100644 index 0000000..e1bed46 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cf3019a5e2270654abca972684f5c2f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeInfo.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeInfo.cs new file mode 100644 index 0000000..079c6bc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeInfo.cs @@ -0,0 +1,120 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public sealed class PInvokeInfo { + + ushort attributes; + string entry_point; + ModuleReference module; + + public PInvokeAttributes Attributes { + get { return (PInvokeAttributes)attributes; } + set { attributes = (ushort)value; } + } + + public string EntryPoint { + get { return entry_point; } + set { entry_point = value; } + } + + public ModuleReference Module { + get { return module; } + set { module = value; } + } + + #region PInvokeAttributes + + public bool IsNoMangle { + get { return attributes.GetAttributes ((ushort)PInvokeAttributes.NoMangle); } + set { attributes = attributes.SetAttributes ((ushort)PInvokeAttributes.NoMangle, value); } + } + + public bool IsCharSetNotSpec { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.CharSetMask, (ushort)PInvokeAttributes.CharSetNotSpec); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.CharSetMask, (ushort)PInvokeAttributes.CharSetNotSpec, value); } + } + + public bool IsCharSetAnsi { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.CharSetMask, (ushort)PInvokeAttributes.CharSetAnsi); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.CharSetMask, (ushort)PInvokeAttributes.CharSetAnsi, value); } + } + + public bool IsCharSetUnicode { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.CharSetMask, (ushort)PInvokeAttributes.CharSetUnicode); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.CharSetMask, (ushort)PInvokeAttributes.CharSetUnicode, value); } + } + + public bool IsCharSetAuto { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.CharSetMask, (ushort)PInvokeAttributes.CharSetAuto); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.CharSetMask, (ushort)PInvokeAttributes.CharSetAuto, value); } + } + + public bool SupportsLastError { + get { return attributes.GetAttributes ((ushort)PInvokeAttributes.SupportsLastError); } + set { attributes = attributes.SetAttributes ((ushort)PInvokeAttributes.SupportsLastError, value); } + } + + public bool IsCallConvWinapi { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.CallConvMask, (ushort)PInvokeAttributes.CallConvWinapi); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.CallConvMask, (ushort)PInvokeAttributes.CallConvWinapi, value); } + } + + public bool IsCallConvCdecl { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.CallConvMask, (ushort)PInvokeAttributes.CallConvCdecl); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.CallConvMask, (ushort)PInvokeAttributes.CallConvCdecl, value); } + } + + public bool IsCallConvStdCall { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.CallConvMask, (ushort)PInvokeAttributes.CallConvStdCall); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.CallConvMask, (ushort)PInvokeAttributes.CallConvStdCall, value); } + } + + public bool IsCallConvThiscall { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.CallConvMask, (ushort)PInvokeAttributes.CallConvThiscall); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.CallConvMask, (ushort)PInvokeAttributes.CallConvThiscall, value); } + } + + public bool IsCallConvFastcall { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.CallConvMask, (ushort)PInvokeAttributes.CallConvFastcall); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.CallConvMask, (ushort)PInvokeAttributes.CallConvFastcall, value); } + } + + public bool IsBestFitEnabled { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.BestFitMask, (ushort)PInvokeAttributes.BestFitEnabled); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.BestFitMask, (ushort)PInvokeAttributes.BestFitEnabled, value); } + } + + public bool IsBestFitDisabled { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.BestFitMask, (ushort)PInvokeAttributes.BestFitDisabled); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.BestFitMask, (ushort)PInvokeAttributes.BestFitDisabled, value); } + } + + public bool IsThrowOnUnmappableCharEnabled { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.ThrowOnUnmappableCharMask, (ushort)PInvokeAttributes.ThrowOnUnmappableCharEnabled); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.ThrowOnUnmappableCharMask, (ushort)PInvokeAttributes.ThrowOnUnmappableCharEnabled, value); } + } + + public bool IsThrowOnUnmappableCharDisabled { + get { return attributes.GetMaskedAttributes ((ushort)PInvokeAttributes.ThrowOnUnmappableCharMask, (ushort)PInvokeAttributes.ThrowOnUnmappableCharDisabled); } + set { attributes = attributes.SetMaskedAttributes ((ushort)PInvokeAttributes.ThrowOnUnmappableCharMask, (ushort)PInvokeAttributes.ThrowOnUnmappableCharDisabled, value); } + } + + #endregion + + public PInvokeInfo (PInvokeAttributes attributes, string entryPoint, ModuleReference module) + { + this.attributes = (ushort)attributes; + this.entry_point = entryPoint; + this.module = module; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeInfo.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeInfo.cs.meta new file mode 100644 index 0000000..4c27d4b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PInvokeInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56eb336b3d1ea2b4094fbb5586a11d49 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterAttributes.cs new file mode 100644 index 0000000..387e1dc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterAttributes.cs @@ -0,0 +1,27 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum ParameterAttributes : ushort { + None = 0x0000, + In = 0x0001, // Param is [In] + Out = 0x0002, // Param is [Out] + Lcid = 0x0004, + Retval = 0x0008, + Optional = 0x0010, // Param is optional + HasDefault = 0x1000, // Param has default value + HasFieldMarshal = 0x2000, // Param has field marshal + Unused = 0xcfe0 // Reserved: shall be zero in a conforming implementation + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterAttributes.cs.meta new file mode 100644 index 0000000..487cc73 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dc153e8db6e9d1b4ca432cd66ecfe423 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinition.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinition.cs new file mode 100644 index 0000000..cd4905a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinition.cs @@ -0,0 +1,146 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; + +namespace MonoFN.Cecil { + + public sealed class ParameterDefinition : ParameterReference, ICustomAttributeProvider, IConstantProvider, IMarshalInfoProvider { + + ushort attributes; + + internal IMethodSignature method; + + object constant = Mixin.NotResolved; + Collection custom_attributes; + MarshalInfo marshal_info; + + public ParameterAttributes Attributes { + get { return (ParameterAttributes)attributes; } + set { attributes = (ushort)value; } + } + + public IMethodSignature Method { + get { return method; } + } + + public int Sequence { + get { + if (method == null) + return -1; + + return method.HasImplicitThis () ? index + 1 : index; + } + } + + public bool HasConstant { + get { + this.ResolveConstant (ref constant, parameter_type.Module); + + return constant != Mixin.NoValue; + } + set { if (!value) constant = Mixin.NoValue; } + } + + public object Constant { + get { return HasConstant ? constant : null; } + set { constant = value; } + } + + public bool HasCustomAttributes { + get { + if (custom_attributes != null) + return custom_attributes.Count > 0; + + return this.GetHasCustomAttributes (parameter_type.Module); + } + } + + public Collection CustomAttributes { + get { return custom_attributes ?? (this.GetCustomAttributes (ref custom_attributes, parameter_type.Module)); } + } + + public bool HasMarshalInfo { + get { + if (marshal_info != null) + return true; + + return this.GetHasMarshalInfo (parameter_type.Module); + } + } + + public MarshalInfo MarshalInfo { + get { return marshal_info ?? (this.GetMarshalInfo (ref marshal_info, parameter_type.Module)); } + set { marshal_info = value; } + } + + #region ParameterAttributes + + public bool IsIn { + get { return attributes.GetAttributes ((ushort)ParameterAttributes.In); } + set { attributes = attributes.SetAttributes ((ushort)ParameterAttributes.In, value); } + } + + public bool IsOut { + get { return attributes.GetAttributes ((ushort)ParameterAttributes.Out); } + set { attributes = attributes.SetAttributes ((ushort)ParameterAttributes.Out, value); } + } + + public bool IsLcid { + get { return attributes.GetAttributes ((ushort)ParameterAttributes.Lcid); } + set { attributes = attributes.SetAttributes ((ushort)ParameterAttributes.Lcid, value); } + } + + public bool IsReturnValue { + get { return attributes.GetAttributes ((ushort)ParameterAttributes.Retval); } + set { attributes = attributes.SetAttributes ((ushort)ParameterAttributes.Retval, value); } + } + + public bool IsOptional { + get { return attributes.GetAttributes ((ushort)ParameterAttributes.Optional); } + set { attributes = attributes.SetAttributes ((ushort)ParameterAttributes.Optional, value); } + } + + public bool HasDefault { + get { return attributes.GetAttributes ((ushort)ParameterAttributes.HasDefault); } + set { attributes = attributes.SetAttributes ((ushort)ParameterAttributes.HasDefault, value); } + } + + public bool HasFieldMarshal { + get { return attributes.GetAttributes ((ushort)ParameterAttributes.HasFieldMarshal); } + set { attributes = attributes.SetAttributes ((ushort)ParameterAttributes.HasFieldMarshal, value); } + } + + #endregion + + internal ParameterDefinition (TypeReference parameterType, IMethodSignature method) + : this (string.Empty, ParameterAttributes.None, parameterType) + { + this.method = method; + } + + public ParameterDefinition (TypeReference parameterType) + : this (string.Empty, ParameterAttributes.None, parameterType) + { + } + + public ParameterDefinition (string name, ParameterAttributes attributes, TypeReference parameterType) + : base (name, parameterType) + { + this.attributes = (ushort)attributes; + this.token = new MetadataToken (TokenType.Param); + } + + public override ParameterDefinition Resolve () + { + return this; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinition.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinition.cs.meta new file mode 100644 index 0000000..06cef24 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6759139d8b53974087e609a88da6072 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinitionCollection.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinitionCollection.cs new file mode 100644 index 0000000..26eaec0 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinitionCollection.cs @@ -0,0 +1,60 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; + +namespace MonoFN.Cecil { + + sealed class ParameterDefinitionCollection : Collection { + + readonly IMethodSignature method; + + internal ParameterDefinitionCollection (IMethodSignature method) + { + this.method = method; + } + + internal ParameterDefinitionCollection (IMethodSignature method, int capacity) + : base (capacity) + { + this.method = method; + } + + protected override void OnAdd (ParameterDefinition item, int index) + { + item.method = method; + item.index = index; + } + + protected override void OnInsert (ParameterDefinition item, int index) + { + item.method = method; + item.index = index; + + for (int i = index; i < size; i++) + items [i].index = i + 1; + } + + protected override void OnSet (ParameterDefinition item, int index) + { + item.method = method; + item.index = index; + } + + protected override void OnRemove (ParameterDefinition item, int index) + { + item.method = null; + item.index = -1; + + for (int i = index + 1; i < size; i++) + items [i].index = i - 1; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinitionCollection.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinitionCollection.cs.meta new file mode 100644 index 0000000..1e96811 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterDefinitionCollection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01e788194a3a3604784e347ac41ec6b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterReference.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterReference.cs new file mode 100644 index 0000000..b84fe3f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterReference.cs @@ -0,0 +1,57 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + public abstract class ParameterReference : IMetadataTokenProvider { + + string name; + internal int index = -1; + protected TypeReference parameter_type; + internal MetadataToken token; + + public string Name { + get { return name; } + set { name = value; } + } + + public int Index { + get { return index; } + } + + public TypeReference ParameterType { + get { return parameter_type; } + set { parameter_type = value; } + } + + public MetadataToken MetadataToken { + get { return token; } + set { token = value; } + } + + internal ParameterReference (string name, TypeReference parameterType) + { + if (parameterType == null) + throw new ArgumentNullException ("parameterType"); + + this.name = name ?? string.Empty; + this.parameter_type = parameterType; + } + + public override string ToString () + { + return name; + } + + public abstract ParameterDefinition Resolve (); + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterReference.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterReference.cs.meta new file mode 100644 index 0000000..69166ca --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ParameterReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0643ce0ca6e47bf4e92518aed8a3a955 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PinnedType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PinnedType.cs new file mode 100644 index 0000000..dc83596 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PinnedType.cs @@ -0,0 +1,35 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +using MD = MonoFN.Cecil.Metadata; + +namespace MonoFN.Cecil { + + public sealed class PinnedType : TypeSpecification { + + public override bool IsValueType { + get { return false; } + set { throw new InvalidOperationException (); } + } + + public override bool IsPinned { + get { return true; } + } + + public PinnedType (TypeReference type) + : base (type) + { + Mixin.CheckType (type); + this.etype = MD.ElementType.Pinned; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PinnedType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PinnedType.cs.meta new file mode 100644 index 0000000..325921b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PinnedType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6840e25b64ef0924d84724d5587cfa68 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PointerType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PointerType.cs new file mode 100644 index 0000000..5c27093 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PointerType.cs @@ -0,0 +1,43 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +using MD = MonoFN.Cecil.Metadata; + +namespace MonoFN.Cecil { + + public sealed class PointerType : TypeSpecification { + + public override string Name { + get { return base.Name + "*"; } + } + + public override string FullName { + get { return base.FullName + "*"; } + } + + public override bool IsValueType { + get { return false; } + set { throw new InvalidOperationException (); } + } + + public override bool IsPointer { + get { return true; } + } + + public PointerType (TypeReference type) + : base (type) + { + Mixin.CheckType (type); + this.etype = MD.ElementType.Ptr; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PointerType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PointerType.cs.meta new file mode 100644 index 0000000..665c696 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PointerType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b6a1c540eedbb04082628ad5dd10583 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyAttributes.cs new file mode 100644 index 0000000..1f32a51 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyAttributes.cs @@ -0,0 +1,23 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum PropertyAttributes : ushort { + None = 0x0000, + SpecialName = 0x0200, // Property is special + RTSpecialName = 0x0400, // Runtime(metadata internal APIs) should check name encoding + HasDefault = 0x1000, // Property has default + Unused = 0xe9ff // Reserved: shall be zero in a conforming implementation + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyAttributes.cs.meta new file mode 100644 index 0000000..6a0dbc7 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 163bf99004c8e294f8b4113c29cae987 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyDefinition.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyDefinition.cs new file mode 100644 index 0000000..3268ffd --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyDefinition.cs @@ -0,0 +1,245 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System.Text; +using System.Threading; + +namespace MonoFN.Cecil { + + public sealed class PropertyDefinition : PropertyReference, IMemberDefinition, IConstantProvider { + + bool? has_this; + ushort attributes; + + Collection custom_attributes; + + internal MethodDefinition get_method; + internal MethodDefinition set_method; + internal Collection other_methods; + + object constant = Mixin.NotResolved; + + public PropertyAttributes Attributes { + get { return (PropertyAttributes)attributes; } + set { attributes = (ushort)value; } + } + + public bool HasThis { + get { + if (has_this.HasValue) + return has_this.Value; + + if (GetMethod != null) + return get_method.HasThis; + + if (SetMethod != null) + return set_method.HasThis; + + return false; + } + set { has_this = value; } + } + + public bool HasCustomAttributes { + get { + if (custom_attributes != null) + return custom_attributes.Count > 0; + + return this.GetHasCustomAttributes (Module); + } + } + + public Collection CustomAttributes { + get { return custom_attributes ?? (this.GetCustomAttributes (ref custom_attributes, Module)); } + } + + public MethodDefinition GetMethod { + get { + if (get_method != null) + return get_method; + + InitializeMethods (); + return get_method; + } + set { get_method = value; } + } + + public MethodDefinition SetMethod { + get { + if (set_method != null) + return set_method; + + InitializeMethods (); + return set_method; + } + set { set_method = value; } + } + + public bool HasOtherMethods { + get { + if (other_methods != null) + return other_methods.Count > 0; + + InitializeMethods (); + return !other_methods.IsNullOrEmpty (); + } + } + + public Collection OtherMethods { + get { + if (other_methods != null) + return other_methods; + + InitializeMethods (); + + if (other_methods != null) + return other_methods; + + Interlocked.CompareExchange (ref other_methods, new Collection (), null); + return other_methods; + } + } + + public bool HasParameters { + get { + InitializeMethods (); + + if (get_method != null) + return get_method.HasParameters; + + if (set_method != null) + return set_method.HasParameters && set_method.Parameters.Count > 1; + + return false; + } + } + + public override Collection Parameters { + get { + InitializeMethods (); + + if (get_method != null) + return MirrorParameters (get_method, 0); + + if (set_method != null) + return MirrorParameters (set_method, 1); + + return new Collection (); + } + } + + static Collection MirrorParameters (MethodDefinition method, int bound) + { + var parameters = new Collection (); + if (!method.HasParameters) + return parameters; + + var original_parameters = method.Parameters; + var end = original_parameters.Count - bound; + + for (int i = 0; i < end; i++) + parameters.Add (original_parameters [i]); + + return parameters; + } + + public bool HasConstant { + get { + this.ResolveConstant (ref constant, Module); + + return constant != Mixin.NoValue; + } + set { if (!value) constant = Mixin.NoValue; } + } + + public object Constant { + get { return HasConstant ? constant : null; } + set { constant = value; } + } + + #region PropertyAttributes + + public bool IsSpecialName { + get { return attributes.GetAttributes ((ushort)PropertyAttributes.SpecialName); } + set { attributes = attributes.SetAttributes ((ushort)PropertyAttributes.SpecialName, value); } + } + + public bool IsRuntimeSpecialName { + get { return attributes.GetAttributes ((ushort)PropertyAttributes.RTSpecialName); } + set { attributes = attributes.SetAttributes ((ushort)PropertyAttributes.RTSpecialName, value); } + } + + public bool HasDefault { + get { return attributes.GetAttributes ((ushort)PropertyAttributes.HasDefault); } + set { attributes = attributes.SetAttributes ((ushort)PropertyAttributes.HasDefault, value); } + } + + #endregion + + public new TypeDefinition DeclaringType { + get { return (TypeDefinition)base.DeclaringType; } + set { base.DeclaringType = value; } + } + + public override bool IsDefinition { + get { return true; } + } + + public override string FullName { + get { + var builder = new StringBuilder (); + builder.Append (PropertyType.ToString ()); + builder.Append (' '); + builder.Append (MemberFullName ()); + builder.Append ('('); + if (HasParameters) { + var parameters = Parameters; + for (int i = 0; i < parameters.Count; i++) { + if (i > 0) + builder.Append (','); + builder.Append (parameters [i].ParameterType.FullName); + } + } + builder.Append (')'); + return builder.ToString (); + } + } + + public PropertyDefinition (string name, PropertyAttributes attributes, TypeReference propertyType) + : base (name, propertyType) + { + this.attributes = (ushort)attributes; + this.token = new MetadataToken (TokenType.Property); + } + + void InitializeMethods () + { + var module = this.Module; + if (module == null) + return; + + lock (module.SyncRoot) { + if (get_method != null || set_method != null) + return; + + if (!module.HasImage ()) + return; + + module.Read (this, (property, reader) => reader.ReadMethods (property)); + } + } + + public override PropertyDefinition Resolve () + { + return this; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyDefinition.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyDefinition.cs.meta new file mode 100644 index 0000000..a372850 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c1878ca62c0e6f4595238eb6a87edfd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyReference.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyReference.cs new file mode 100644 index 0000000..d3f7a4c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyReference.cs @@ -0,0 +1,43 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; + +namespace MonoFN.Cecil { + + public abstract class PropertyReference : MemberReference { + + TypeReference property_type; + + public TypeReference PropertyType { + get { return property_type; } + set { property_type = value; } + } + + public abstract Collection Parameters { + get; + } + + internal PropertyReference (string name, TypeReference propertyType) + : base (name) + { + Mixin.CheckType (propertyType, Mixin.Argument.propertyType); + + property_type = propertyType; + } + + protected override IMemberDefinition ResolveDefinition () + { + return this.Resolve (); + } + + public new abstract PropertyDefinition Resolve (); + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyReference.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyReference.cs.meta new file mode 100644 index 0000000..a218f3c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/PropertyReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a30c5751a554ce649bf88a597e4075e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ReferenceType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ReferenceType.cs new file mode 100644 index 0000000..e2703a4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ReferenceType.cs @@ -0,0 +1,43 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +using MD = MonoFN.Cecil.Metadata; + +namespace MonoFN.Cecil { + + public sealed class ByReferenceType : TypeSpecification { + + public override string Name { + get { return base.Name + "&"; } + } + + public override string FullName { + get { return base.FullName + "&"; } + } + + public override bool IsValueType { + get { return false; } + set { throw new InvalidOperationException (); } + } + + public override bool IsByReference { + get { return true; } + } + + public ByReferenceType (TypeReference type) + : base (type) + { + Mixin.CheckType (type); + this.etype = MD.ElementType.ByRef; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ReferenceType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ReferenceType.cs.meta new file mode 100644 index 0000000..de5a90f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/ReferenceType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32a78d7552e92774cbf44ddd46fb7aa4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Resource.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Resource.cs new file mode 100644 index 0000000..92c007f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Resource.cs @@ -0,0 +1,58 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public enum ResourceType { + Linked, + Embedded, + AssemblyLinked, + } + + public abstract class Resource { + + string name; + uint attributes; + + public string Name { + get { return name; } + set { name = value; } + } + + public ManifestResourceAttributes Attributes { + get { return (ManifestResourceAttributes)attributes; } + set { attributes = (uint)value; } + } + + public abstract ResourceType ResourceType { + get; + } + + #region ManifestResourceAttributes + + public bool IsPublic { + get { return attributes.GetMaskedAttributes ((uint)ManifestResourceAttributes.VisibilityMask, (uint)ManifestResourceAttributes.Public); } + set { attributes = attributes.SetMaskedAttributes ((uint)ManifestResourceAttributes.VisibilityMask, (uint)ManifestResourceAttributes.Public, value); } + } + + public bool IsPrivate { + get { return attributes.GetMaskedAttributes ((uint)ManifestResourceAttributes.VisibilityMask, (uint)ManifestResourceAttributes.Private); } + set { attributes = attributes.SetMaskedAttributes ((uint)ManifestResourceAttributes.VisibilityMask, (uint)ManifestResourceAttributes.Private, value); } + } + + #endregion + + internal Resource (string name, ManifestResourceAttributes attributes) + { + this.name = name; + this.attributes = (uint)attributes; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Resource.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Resource.cs.meta new file mode 100644 index 0000000..c4c82c9 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Resource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8b738634202e694ebec627727698b83 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SecurityDeclaration.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SecurityDeclaration.cs new file mode 100644 index 0000000..c3e27b4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SecurityDeclaration.cs @@ -0,0 +1,201 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; +using System.Diagnostics; +using System.Threading; + +namespace MonoFN.Cecil { + + public enum SecurityAction : ushort { + Request = 1, + Demand = 2, + Assert = 3, + Deny = 4, + PermitOnly = 5, + LinkDemand = 6, + InheritDemand = 7, + RequestMinimum = 8, + RequestOptional = 9, + RequestRefuse = 10, + PreJitGrant = 11, + PreJitDeny = 12, + NonCasDemand = 13, + NonCasLinkDemand = 14, + NonCasInheritance = 15 + } + + public interface ISecurityDeclarationProvider : IMetadataTokenProvider { + + bool HasSecurityDeclarations { get; } + Collection SecurityDeclarations { get; } + } + + [DebuggerDisplay ("{AttributeType}")] + public sealed class SecurityAttribute : ICustomAttribute { + + TypeReference attribute_type; + + internal Collection fields; + internal Collection properties; + + public TypeReference AttributeType { + get { return attribute_type; } + set { attribute_type = value; } + } + + public bool HasFields { + get { return !fields.IsNullOrEmpty (); } + } + + public Collection Fields { + get { + if (fields == null) + Interlocked.CompareExchange (ref fields, new Collection (), null); + + return fields; + } + } + + public bool HasProperties { + get { return !properties.IsNullOrEmpty (); } + } + + public Collection Properties { + get { + if (properties == null) + Interlocked.CompareExchange (ref properties, new Collection (), null); + + return properties; + } + } + + public SecurityAttribute (TypeReference attributeType) + { + this.attribute_type = attributeType; + } + + bool ICustomAttribute.HasConstructorArguments { + get { return false; } + } + + Collection ICustomAttribute.ConstructorArguments { + get { throw new NotSupportedException (); } + } + } + + public sealed class SecurityDeclaration { + + readonly internal uint signature; + byte [] blob; + readonly ModuleDefinition module; + + internal bool resolved; + SecurityAction action; + internal Collection security_attributes; + + public SecurityAction Action { + get { return action; } + set { action = value; } + } + + public bool HasSecurityAttributes { + get { + Resolve (); + + return !security_attributes.IsNullOrEmpty (); + } + } + + public Collection SecurityAttributes { + get { + Resolve (); + + if (security_attributes == null) + Interlocked.CompareExchange (ref security_attributes, new Collection (), null); + + return security_attributes; + } + } + + internal bool HasImage { + get { return module != null && module.HasImage; } + } + + internal SecurityDeclaration (SecurityAction action, uint signature, ModuleDefinition module) + { + this.action = action; + this.signature = signature; + this.module = module; + } + + public SecurityDeclaration (SecurityAction action) + { + this.action = action; + this.resolved = true; + } + + public SecurityDeclaration (SecurityAction action, byte [] blob) + { + this.action = action; + this.resolved = false; + this.blob = blob; + } + + public byte [] GetBlob () + { + if (blob != null) + return blob; + + if (!HasImage || signature == 0) + throw new NotSupportedException (); + + return module.Read (ref blob, this, (declaration, reader) => reader.ReadSecurityDeclarationBlob (declaration.signature)); + } + + void Resolve () + { + if (resolved || !HasImage) + return; + + lock (module.SyncRoot) { + + if (resolved) + return; + + module.Read (this, (declaration, reader) => reader.ReadSecurityDeclarationSignature (declaration)); + resolved = true; + } + } + } + + static partial class Mixin { + + public static bool GetHasSecurityDeclarations ( + this ISecurityDeclarationProvider self, + ModuleDefinition module) + { + return module.HasImage () && module.Read (self, (provider, reader) => reader.HasSecurityDeclarations (provider)); + } + + public static Collection GetSecurityDeclarations ( + this ISecurityDeclarationProvider self, + ref Collection variable, + ModuleDefinition module) + { + if (module.HasImage) + return module.Read (ref variable, self, (provider, reader) => reader.ReadSecurityDeclarations (provider)); + + Interlocked.CompareExchange (ref variable, new Collection (), null); + return variable; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SecurityDeclaration.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SecurityDeclaration.cs.meta new file mode 100644 index 0000000..67a6b92 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SecurityDeclaration.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7a39c3df615f71b409a5aa3d102fb35e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SentinelType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SentinelType.cs new file mode 100644 index 0000000..24e3840 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SentinelType.cs @@ -0,0 +1,35 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +using MD = MonoFN.Cecil.Metadata; + +namespace MonoFN.Cecil { + + public sealed class SentinelType : TypeSpecification { + + public override bool IsValueType { + get { return false; } + set { throw new InvalidOperationException (); } + } + + public override bool IsSentinel { + get { return true; } + } + + public SentinelType (TypeReference type) + : base (type) + { + Mixin.CheckType (type); + this.etype = MD.ElementType.Sentinel; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SentinelType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SentinelType.cs.meta new file mode 100644 index 0000000..f025abf --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/SentinelType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31522df8b7c72c1499a3fb951e73a69a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TargetRuntime.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TargetRuntime.cs new file mode 100644 index 0000000..d2c48f3 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TargetRuntime.cs @@ -0,0 +1,19 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public enum TargetRuntime { + Net_1_0, + Net_1_1, + Net_2_0, + Net_4_0, + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TargetRuntime.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TargetRuntime.cs.meta new file mode 100644 index 0000000..9192b08 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TargetRuntime.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 64ac90055dca01347b6ed93dff5e4284 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Treatments.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Treatments.cs new file mode 100644 index 0000000..4b65d6a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Treatments.cs @@ -0,0 +1,61 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + enum TypeDefinitionTreatment { + None = 0x0, + + KindMask = 0xf, + NormalType = 0x1, + NormalAttribute = 0x2, + UnmangleWindowsRuntimeName = 0x3, + PrefixWindowsRuntimeName = 0x4, + RedirectToClrType = 0x5, + RedirectToClrAttribute = 0x6, + RedirectImplementedMethods = 0x7, + + Abstract = 0x10, + Internal = 0x20, + } + + enum TypeReferenceTreatment { + None = 0x0, + SystemDelegate = 0x1, + SystemAttribute = 0x2, + UseProjectionInfo = 0x3, + } + + [Flags] + enum MethodDefinitionTreatment { + None = 0x0, + Abstract = 0x2, + Private = 0x4, + Public = 0x8, + Runtime = 0x10, + InternalCall = 0x20, + } + + enum FieldDefinitionTreatment { + None = 0x0, + Public = 0x1, + } + + enum CustomAttributeValueTreatment { + None = 0x0, + AllowSingle = 0x1, + AllowMultiple = 0x2, + VersionAttribute = 0x3, + DeprecatedAttribute = 0x4, + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Treatments.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Treatments.cs.meta new file mode 100644 index 0000000..d9698b7 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/Treatments.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d2bba6ea16ba63147b7bff91a65ad5fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeAttributes.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeAttributes.cs new file mode 100644 index 0000000..dae187b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeAttributes.cs @@ -0,0 +1,63 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + [Flags] + public enum TypeAttributes : uint { + // Visibility attributes + VisibilityMask = 0x00000007, // Use this mask to retrieve visibility information + NotPublic = 0x00000000, // Class has no public scope + Public = 0x00000001, // Class has public scope + NestedPublic = 0x00000002, // Class is nested with public visibility + NestedPrivate = 0x00000003, // Class is nested with private visibility + NestedFamily = 0x00000004, // Class is nested with family visibility + NestedAssembly = 0x00000005, // Class is nested with assembly visibility + NestedFamANDAssem = 0x00000006, // Class is nested with family and assembly visibility + NestedFamORAssem = 0x00000007, // Class is nested with family or assembly visibility + + // Class layout attributes + LayoutMask = 0x00000018, // Use this mask to retrieve class layout information + AutoLayout = 0x00000000, // Class fields are auto-laid out + SequentialLayout = 0x00000008, // Class fields are laid out sequentially + ExplicitLayout = 0x00000010, // Layout is supplied explicitly + + // Class semantics attributes + ClassSemanticMask = 0x00000020, // Use this mask to retrieve class semantics information + Class = 0x00000000, // Type is a class + Interface = 0x00000020, // Type is an interface + + // Special semantics in addition to class semantics + Abstract = 0x00000080, // Class is abstract + Sealed = 0x00000100, // Class cannot be extended + SpecialName = 0x00000400, // Class name is special + + // Implementation attributes + Import = 0x00001000, // Class/Interface is imported + Serializable = 0x00002000, // Class is serializable + WindowsRuntime = 0x00004000, // Windows Runtime type + + // String formatting attributes + StringFormatMask = 0x00030000, // Use this mask to retrieve string information for native interop + AnsiClass = 0x00000000, // LPSTR is interpreted as ANSI + UnicodeClass = 0x00010000, // LPSTR is interpreted as Unicode + AutoClass = 0x00020000, // LPSTR is interpreted automatically + + // Class initialization attributes + BeforeFieldInit = 0x00100000, // Initialize the class before first static field access + + // Additional flags + RTSpecialName = 0x00000800, // CLI provides 'special' behavior, depending upon the name of the Type + HasSecurity = 0x00040000, // Type has security associate with it + Forwarder = 0x00200000, // Exported type is a type forwarder + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeAttributes.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeAttributes.cs.meta new file mode 100644 index 0000000..eb01e16 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a634580522059d74bb5ad1f997af1284 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeComparisonMode.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeComparisonMode.cs new file mode 100644 index 0000000..b61e8aa --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeComparisonMode.cs @@ -0,0 +1,11 @@ +namespace MonoFN.Cecil { + internal enum TypeComparisonMode { + Exact, + SignatureOnly, + + /// + /// Types can be in different assemblies, as long as the module, assembly, and type names match they will be considered equal + /// + SignatureOnlyLoose + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeComparisonMode.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeComparisonMode.cs.meta new file mode 100644 index 0000000..235e452 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeComparisonMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3777ff31cb318a8488a68226f53f7381 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinition.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinition.cs new file mode 100644 index 0000000..6562ecc --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinition.cs @@ -0,0 +1,618 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Metadata; +using MonoFN.Collections.Generic; +using System; +using System.Threading; + +namespace MonoFN.Cecil { + + public sealed class TypeDefinition : TypeReference, IMemberDefinition, ISecurityDeclarationProvider { + + uint attributes; + TypeReference base_type; + internal Range fields_range; + internal Range methods_range; + + short packing_size = Mixin.NotResolvedMarker; + int class_size = Mixin.NotResolvedMarker; + + InterfaceImplementationCollection interfaces; + Collection nested_types; + Collection methods; + Collection fields; + Collection events; + Collection properties; + Collection custom_attributes; + Collection security_declarations; + + public TypeAttributes Attributes { + get { return (TypeAttributes)attributes; } + set { + if (IsWindowsRuntimeProjection && (ushort)value != attributes) + throw new InvalidOperationException (); + + attributes = (uint)value; + } + } + + public TypeReference BaseType { + get { return base_type; } + set { base_type = value; } + } + + public override string Name { + get { return base.Name; } + set { + if (IsWindowsRuntimeProjection && value != base.Name) + throw new InvalidOperationException (); + + base.Name = value; + } + } + + void ResolveLayout () + { + if (!HasImage) { + packing_size = Mixin.NoDataMarker; + class_size = Mixin.NoDataMarker; + return; + } + + lock (Module.SyncRoot) { + if (packing_size != Mixin.NotResolvedMarker || class_size != Mixin.NotResolvedMarker) + return; + + var row = Module.Read (this, (type, reader) => reader.ReadTypeLayout (type)); + + packing_size = row.Col1; + class_size = row.Col2; + } + } + + public bool HasLayoutInfo { + get { + if (packing_size >= 0 || class_size >= 0) + return true; + + ResolveLayout (); + + return packing_size >= 0 || class_size >= 0; + } + } + + public short PackingSize { + get { + if (packing_size >= 0) + return packing_size; + + ResolveLayout (); + + return packing_size >= 0 ? packing_size : (short)-1; + } + set { packing_size = value; } + } + + public int ClassSize { + get { + if (class_size >= 0) + return class_size; + + ResolveLayout (); + + return class_size >= 0 ? class_size : -1; + } + set { class_size = value; } + } + + public bool HasInterfaces { + get { + if (interfaces != null) + return interfaces.Count > 0; + + return HasImage && Module.Read (this, (type, reader) => reader.HasInterfaces (type)); + } + } + + public Collection Interfaces { + get { + if (interfaces != null) + return interfaces; + + if (HasImage) + return Module.Read (ref interfaces, this, (type, reader) => reader.ReadInterfaces (type)); + + Interlocked.CompareExchange (ref interfaces, new InterfaceImplementationCollection (this), null); + return interfaces; + } + } + + public bool HasNestedTypes { + get { + if (nested_types != null) + return nested_types.Count > 0; + + return HasImage && Module.Read (this, (type, reader) => reader.HasNestedTypes (type)); + } + } + + public Collection NestedTypes { + get { + if (nested_types != null) + return nested_types; + + if (HasImage) + return Module.Read (ref nested_types, this, (type, reader) => reader.ReadNestedTypes (type)); + + Interlocked.CompareExchange (ref nested_types, new MemberDefinitionCollection (this), null); + return nested_types; + } + } + + public bool HasMethods { + get { + if (methods != null) + return methods.Count > 0; + + return HasImage && methods_range.Length > 0; + } + } + + public Collection Methods { + get { + if (methods != null) + return methods; + + if (HasImage) + return Module.Read (ref methods, this, (type, reader) => reader.ReadMethods (type)); + + Interlocked.CompareExchange (ref methods, new MemberDefinitionCollection (this), null); + return methods; + } + } + + public bool HasFields { + get { + if (fields != null) + return fields.Count > 0; + + return HasImage && fields_range.Length > 0; + } + } + + public Collection Fields { + get { + if (fields != null) + return fields; + + if (HasImage) + return Module.Read (ref fields, this, (type, reader) => reader.ReadFields (type)); + + Interlocked.CompareExchange (ref fields, new MemberDefinitionCollection (this), null); + return fields; + } + } + + public bool HasEvents { + get { + if (events != null) + return events.Count > 0; + + return HasImage && Module.Read (this, (type, reader) => reader.HasEvents (type)); + } + } + + public Collection Events { + get { + if (events != null) + return events; + + if (HasImage) + return Module.Read (ref events, this, (type, reader) => reader.ReadEvents (type)); + + Interlocked.CompareExchange (ref events, new MemberDefinitionCollection (this), null); + return events; + } + } + + public bool HasProperties { + get { + if (properties != null) + return properties.Count > 0; + + return HasImage && Module.Read (this, (type, reader) => reader.HasProperties (type)); + } + } + + public Collection Properties { + get { + if (properties != null) + return properties; + + if (HasImage) + return Module.Read (ref properties, this, (type, reader) => reader.ReadProperties (type)); + + Interlocked.CompareExchange (ref properties, new MemberDefinitionCollection (this), null); + return properties; + } + } + + public bool HasSecurityDeclarations { + get { + if (security_declarations != null) + return security_declarations.Count > 0; + + return this.GetHasSecurityDeclarations (Module); + } + } + + public Collection SecurityDeclarations { + get { return security_declarations ?? (this.GetSecurityDeclarations (ref security_declarations, Module)); } + } + + public bool HasCustomAttributes { + get { + if (custom_attributes != null) + return custom_attributes.Count > 0; + + return this.GetHasCustomAttributes (Module); + } + } + + public Collection CustomAttributes { + get { return custom_attributes ?? (this.GetCustomAttributes (ref custom_attributes, Module)); } + } + + public override bool HasGenericParameters { + get { + if (generic_parameters != null) + return generic_parameters.Count > 0; + + return this.GetHasGenericParameters (Module); + } + } + + public override Collection GenericParameters { + get { return generic_parameters ?? (this.GetGenericParameters (ref generic_parameters, Module)); } + } + + #region TypeAttributes + + public bool IsNotPublic { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NotPublic); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NotPublic, value); } + } + + public bool IsPublic { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.Public); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.Public, value); } + } + + public bool IsNestedPublic { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedPublic); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedPublic, value); } + } + + public bool IsNestedPrivate { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedPrivate); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedPrivate, value); } + } + + public bool IsNestedFamily { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamily); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamily, value); } + } + + public bool IsNestedAssembly { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedAssembly); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedAssembly, value); } + } + + public bool IsNestedFamilyAndAssembly { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamANDAssem); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamANDAssem, value); } + } + + public bool IsNestedFamilyOrAssembly { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamORAssem); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.VisibilityMask, (uint)TypeAttributes.NestedFamORAssem, value); } + } + + public bool IsAutoLayout { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.AutoLayout); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.AutoLayout, value); } + } + + public bool IsSequentialLayout { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.SequentialLayout); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.SequentialLayout, value); } + } + + public bool IsExplicitLayout { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.ExplicitLayout); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.LayoutMask, (uint)TypeAttributes.ExplicitLayout, value); } + } + + public bool IsClass { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.ClassSemanticMask, (uint)TypeAttributes.Class); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.ClassSemanticMask, (uint)TypeAttributes.Class, value); } + } + + public bool IsInterface { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.ClassSemanticMask, (uint)TypeAttributes.Interface); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.ClassSemanticMask, (uint)TypeAttributes.Interface, value); } + } + + public bool IsAbstract { + get { return attributes.GetAttributes ((uint)TypeAttributes.Abstract); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.Abstract, value); } + } + + public bool IsSealed { + get { return attributes.GetAttributes ((uint)TypeAttributes.Sealed); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.Sealed, value); } + } + + public bool IsSpecialName { + get { return attributes.GetAttributes ((uint)TypeAttributes.SpecialName); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.SpecialName, value); } + } + + public bool IsImport { + get { return attributes.GetAttributes ((uint)TypeAttributes.Import); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.Import, value); } + } + + public bool IsSerializable { + get { return attributes.GetAttributes ((uint)TypeAttributes.Serializable); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.Serializable, value); } + } + + public bool IsWindowsRuntime { + get { return attributes.GetAttributes ((uint)TypeAttributes.WindowsRuntime); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.WindowsRuntime, value); } + } + + public bool IsAnsiClass { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.AnsiClass); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.AnsiClass, value); } + } + + public bool IsUnicodeClass { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.UnicodeClass); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.UnicodeClass, value); } + } + + public bool IsAutoClass { + get { return attributes.GetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.AutoClass); } + set { attributes = attributes.SetMaskedAttributes ((uint)TypeAttributes.StringFormatMask, (uint)TypeAttributes.AutoClass, value); } + } + + public bool IsBeforeFieldInit { + get { return attributes.GetAttributes ((uint)TypeAttributes.BeforeFieldInit); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.BeforeFieldInit, value); } + } + + public bool IsRuntimeSpecialName { + get { return attributes.GetAttributes ((uint)TypeAttributes.RTSpecialName); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.RTSpecialName, value); } + } + + public bool HasSecurity { + get { return attributes.GetAttributes ((uint)TypeAttributes.HasSecurity); } + set { attributes = attributes.SetAttributes ((uint)TypeAttributes.HasSecurity, value); } + } + + #endregion + + public bool IsEnum { + get { return base_type != null && base_type.IsTypeOf ("System", "Enum"); } + } + + public override bool IsValueType { + get { + if (base_type == null) + return false; + + return base_type.IsTypeOf ("System", "Enum") || (base_type.IsTypeOf ("System", "ValueType") && !this.IsTypeOf ("System", "Enum")); + } + set { + throw new NotSupportedException (); + } + } + + public override bool IsPrimitive { + get { + ElementType primitive_etype; + return MetadataSystem.TryGetPrimitiveElementType (this, out primitive_etype) && primitive_etype.IsPrimitive (); + } + } + + public override MetadataType MetadataType { + get { + ElementType primitive_etype; + if (MetadataSystem.TryGetPrimitiveElementType (this, out primitive_etype)) + return (MetadataType)primitive_etype; + + return base.MetadataType; + } + } + + public override bool IsDefinition { + get { return true; } + } + + public new TypeDefinition DeclaringType { + get { return (TypeDefinition)base.DeclaringType; } + set { base.DeclaringType = value; } + } + + internal new TypeDefinitionProjection WindowsRuntimeProjection { + get { return (TypeDefinitionProjection)projection; } + set { projection = value; } + } + + public TypeDefinition (string @namespace, string name, TypeAttributes attributes) + : base (@namespace, name) + { + this.attributes = (uint)attributes; + this.token = new MetadataToken (TokenType.TypeDef); + } + + public TypeDefinition (string @namespace, string name, TypeAttributes attributes, TypeReference baseType) : + this (@namespace, name, attributes) + { + this.BaseType = baseType; + } + + protected override void ClearFullName () + { + base.ClearFullName (); + + if (!HasNestedTypes) + return; + + var nested_types = this.NestedTypes; + + for (int i = 0; i < nested_types.Count; i++) + nested_types [i].ClearFullName (); + } + + public override TypeDefinition Resolve () + { + return this; + } + } + + public sealed class InterfaceImplementation : ICustomAttributeProvider { + internal TypeDefinition type; + internal MetadataToken token; + + TypeReference interface_type; + Collection custom_attributes; + + public TypeReference InterfaceType { + get { return interface_type; } + set { interface_type = value; } + } + + public bool HasCustomAttributes { + get { + if (custom_attributes != null) + return custom_attributes.Count > 0; + + if (type == null) + return false; + + return this.GetHasCustomAttributes (type.Module); + } + } + + public Collection CustomAttributes { + get { + if (type == null) { + if (custom_attributes == null) + Interlocked.CompareExchange (ref custom_attributes, new Collection (), null); + return custom_attributes; + } + + return custom_attributes ?? (this.GetCustomAttributes (ref custom_attributes, type.Module)); + } + } + + public MetadataToken MetadataToken { + get { return token; } + set { token = value; } + } + + internal InterfaceImplementation (TypeReference interfaceType, MetadataToken token) + { + this.interface_type = interfaceType; + this.token = token; + } + + public InterfaceImplementation (TypeReference interfaceType) + { + Mixin.CheckType (interfaceType, Mixin.Argument.interfaceType); + + this.interface_type = interfaceType; + this.token = new MetadataToken (TokenType.InterfaceImpl); + } + } + + class InterfaceImplementationCollection : Collection { + readonly TypeDefinition type; + + internal InterfaceImplementationCollection (TypeDefinition type) + { + this.type = type; + } + + internal InterfaceImplementationCollection (TypeDefinition type, int length) + : base (length) + { + this.type = type; + } + + protected override void OnAdd (InterfaceImplementation item, int index) + { + item.type = type; + } + + protected override void OnInsert (InterfaceImplementation item, int index) + { + item.type = type; + } + + protected override void OnSet (InterfaceImplementation item, int index) + { + item.type = type; + } + + protected override void OnRemove (InterfaceImplementation item, int index) + { + item.type = null; + } + } + + static partial class Mixin { + + public static TypeReference GetEnumUnderlyingType (this TypeDefinition self) + { + var fields = self.Fields; + + for (int i = 0; i < fields.Count; i++) { + var field = fields [i]; + if (!field.IsStatic) + return field.FieldType; + } + + throw new ArgumentException (); + } + + public static TypeDefinition GetNestedType (this TypeDefinition self, string fullname) + { + if (!self.HasNestedTypes) + return null; + + var nested_types = self.NestedTypes; + + for (int i = 0; i < nested_types.Count; i++) { + var nested_type = nested_types [i]; + + if (nested_type.TypeFullName () == fullname) + return nested_type; + } + + return null; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinition.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinition.cs.meta new file mode 100644 index 0000000..c55bd55 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4616a4ea6dc219f419ae9ba98109f98c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinitionCollection.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinitionCollection.cs new file mode 100644 index 0000000..aa07389 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinitionCollection.cs @@ -0,0 +1,98 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Metadata; +using MonoFN.Collections.Generic; +using System; +using System.Collections.Generic; + +namespace MonoFN.Cecil { + + using Slot = Row; + + sealed class TypeDefinitionCollection : Collection { + + readonly ModuleDefinition container; + readonly Dictionary name_cache; + + internal TypeDefinitionCollection (ModuleDefinition container) + { + this.container = container; + this.name_cache = new Dictionary (new RowEqualityComparer ()); + } + + internal TypeDefinitionCollection (ModuleDefinition container, int capacity) + : base (capacity) + { + this.container = container; + this.name_cache = new Dictionary (capacity, new RowEqualityComparer ()); + } + + protected override void OnAdd (TypeDefinition item, int index) + { + Attach (item); + } + + protected override void OnSet (TypeDefinition item, int index) + { + Attach (item); + } + + protected override void OnInsert (TypeDefinition item, int index) + { + Attach (item); + } + + protected override void OnRemove (TypeDefinition item, int index) + { + Detach (item); + } + + protected override void OnClear () + { + foreach (var type in this) + Detach (type); + } + + void Attach (TypeDefinition type) + { + if (type.Module != null && type.Module != container) + throw new ArgumentException ("Type already attached"); + + type.module = container; + type.scope = container; + name_cache [new Slot (type.Namespace, type.Name)] = type; + } + + void Detach (TypeDefinition type) + { + type.module = null; + type.scope = null; + name_cache.Remove (new Slot (type.Namespace, type.Name)); + } + + public TypeDefinition GetType (string fullname) + { + string @namespace, name; + TypeParser.SplitFullName (fullname, out @namespace, out name); + + return GetType (@namespace, name); + } + + public TypeDefinition GetType (string @namespace, string name) + { + TypeDefinition type; + if (name_cache.TryGetValue (new Slot (@namespace, name), out type)) + return type; + + return null; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinitionCollection.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinitionCollection.cs.meta new file mode 100644 index 0000000..e800734 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeDefinitionCollection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4440ec34ba0da7b4aac0fc4c009035aa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeParser.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeParser.cs new file mode 100644 index 0000000..c533b98 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeParser.cs @@ -0,0 +1,531 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Metadata; +using System; +using System.Text; + +namespace MonoFN.Cecil { + + class TypeParser { + + class Type { + public const int Ptr = -1; + public const int ByRef = -2; + public const int SzArray = -3; + + public string type_fullname; + public string [] nested_names; + public int arity; + public int [] specs; + public Type [] generic_arguments; + public string assembly; + } + + readonly string fullname; + readonly int length; + + int position; + + TypeParser (string fullname) + { + this.fullname = fullname; + this.length = fullname.Length; + } + + Type ParseType (bool fq_name) + { + var type = new Type (); + type.type_fullname = ParsePart (); + + type.nested_names = ParseNestedNames (); + + if (TryGetArity (type)) + type.generic_arguments = ParseGenericArguments (type.arity); + + type.specs = ParseSpecs (); + + if (fq_name) + type.assembly = ParseAssemblyName (); + + return type; + } + + static bool TryGetArity (Type type) + { + int arity = 0; + + TryAddArity (type.type_fullname, ref arity); + + var nested_names = type.nested_names; + if (!nested_names.IsNullOrEmpty ()) { + for (int i = 0; i < nested_names.Length; i++) + TryAddArity (nested_names [i], ref arity); + } + + type.arity = arity; + return arity > 0; + } + + static bool TryGetArity (string name, out int arity) + { + arity = 0; + var index = name.LastIndexOf ('`'); + if (index == -1) + return false; + + return ParseInt32 (name.Substring (index + 1), out arity); + } + + static bool ParseInt32 (string value, out int result) + { + return int.TryParse (value, out result); + } + + static void TryAddArity (string name, ref int arity) + { + int type_arity; + if (!TryGetArity (name, out type_arity)) + return; + + arity += type_arity; + } + + string ParsePart () + { + var part = new StringBuilder (); + while (position < length && !IsDelimiter (fullname [position])) { + if (fullname [position] == '\\') + position++; + + part.Append (fullname [position++]); + } + + return part.ToString (); + } + + static bool IsDelimiter (char chr) + { + return "+,[]*&".IndexOf (chr) != -1; + } + + void TryParseWhiteSpace () + { + while (position < length && Char.IsWhiteSpace (fullname [position])) + position++; + } + + string [] ParseNestedNames () + { + string [] nested_names = null; + while (TryParse ('+')) + Add (ref nested_names, ParsePart ()); + + return nested_names; + } + + bool TryParse (char chr) + { + if (position < length && fullname [position] == chr) { + position++; + return true; + } + + return false; + } + + static void Add (ref T [] array, T item) + { + array = array.Add (item); + } + + int [] ParseSpecs () + { + int [] specs = null; + + while (position < length) { + switch (fullname [position]) { + case '*': + position++; + Add (ref specs, Type.Ptr); + break; + case '&': + position++; + Add (ref specs, Type.ByRef); + break; + case '[': + position++; + switch (fullname [position]) { + case ']': + position++; + Add (ref specs, Type.SzArray); + break; + case '*': + position++; + Add (ref specs, 1); + break; + default: + var rank = 1; + while (TryParse (',')) + rank++; + + Add (ref specs, rank); + + TryParse (']'); + break; + } + break; + default: + return specs; + } + } + + return specs; + } + + Type [] ParseGenericArguments (int arity) + { + Type [] generic_arguments = null; + + if (position == length || fullname [position] != '[') + return generic_arguments; + + TryParse ('['); + + for (int i = 0; i < arity; i++) { + var fq_argument = TryParse ('['); + Add (ref generic_arguments, ParseType (fq_argument)); + if (fq_argument) + TryParse (']'); + + TryParse (','); + TryParseWhiteSpace (); + } + + TryParse (']'); + + return generic_arguments; + } + + string ParseAssemblyName () + { + if (!TryParse (',')) + return string.Empty; + + TryParseWhiteSpace (); + + var start = position; + while (position < length) { + var chr = fullname [position]; + if (chr == '[' || chr == ']') + break; + + position++; + } + + return fullname.Substring (start, position - start); + } + + public static TypeReference ParseType (ModuleDefinition module, string fullname, bool typeDefinitionOnly = false) + { + if (string.IsNullOrEmpty (fullname)) + return null; + + var parser = new TypeParser (fullname); + return GetTypeReference (module, parser.ParseType (true), typeDefinitionOnly); + } + + static TypeReference GetTypeReference (ModuleDefinition module, Type type_info, bool type_def_only) + { + TypeReference type; + if (!TryGetDefinition (module, type_info, out type)) { + if (type_def_only) + return null; + + type = CreateReference (type_info, module, GetMetadataScope (module, type_info)); + } + + return CreateSpecs (type, type_info); + } + + static TypeReference CreateSpecs (TypeReference type, Type type_info) + { + type = TryCreateGenericInstanceType (type, type_info); + + var specs = type_info.specs; + if (specs.IsNullOrEmpty ()) + return type; + + for (int i = 0; i < specs.Length; i++) { + switch (specs [i]) { + case Type.Ptr: + type = new PointerType (type); + break; + case Type.ByRef: + type = new ByReferenceType (type); + break; + case Type.SzArray: + type = new ArrayType (type); + break; + default: + var array = new ArrayType (type); + array.Dimensions.Clear (); + + for (int j = 0; j < specs [i]; j++) + array.Dimensions.Add (new ArrayDimension ()); + + type = array; + break; + } + } + + return type; + } + + static TypeReference TryCreateGenericInstanceType (TypeReference type, Type type_info) + { + var generic_arguments = type_info.generic_arguments; + if (generic_arguments.IsNullOrEmpty ()) + return type; + + var instance = new GenericInstanceType (type, generic_arguments.Length); + var instance_arguments = instance.GenericArguments; + + for (int i = 0; i < generic_arguments.Length; i++) + instance_arguments.Add (GetTypeReference (type.Module, generic_arguments [i], false)); + + return instance; + } + + public static void SplitFullName (string fullname, out string @namespace, out string name) + { + var last_dot = fullname.LastIndexOf ('.'); + + if (last_dot == -1) { + @namespace = string.Empty; + name = fullname; + } else { + @namespace = fullname.Substring (0, last_dot); + name = fullname.Substring (last_dot + 1); + } + } + + static TypeReference CreateReference (Type type_info, ModuleDefinition module, IMetadataScope scope) + { + string @namespace, name; + SplitFullName (type_info.type_fullname, out @namespace, out name); + + var type = new TypeReference (@namespace, name, module, scope); + MetadataSystem.TryProcessPrimitiveTypeReference (type); + + AdjustGenericParameters (type); + + var nested_names = type_info.nested_names; + if (nested_names.IsNullOrEmpty ()) + return type; + + for (int i = 0; i < nested_names.Length; i++) { + type = new TypeReference (string.Empty, nested_names [i], module, null) { + DeclaringType = type, + }; + + AdjustGenericParameters (type); + } + + return type; + } + + static void AdjustGenericParameters (TypeReference type) + { + int arity; + if (!TryGetArity (type.Name, out arity)) + return; + + for (int i = 0; i < arity; i++) + type.GenericParameters.Add (new GenericParameter (type)); + } + + static IMetadataScope GetMetadataScope (ModuleDefinition module, Type type_info) + { + if (string.IsNullOrEmpty (type_info.assembly)) + return module.TypeSystem.CoreLibrary; + + AssemblyNameReference match; + var reference = AssemblyNameReference.Parse (type_info.assembly); + + return module.TryGetAssemblyNameReference (reference, out match) + ? match + : reference; + } + + static bool TryGetDefinition (ModuleDefinition module, Type type_info, out TypeReference type) + { + type = null; + if (!TryCurrentModule (module, type_info)) + return false; + + var typedef = module.GetType (type_info.type_fullname); + if (typedef == null) + return false; + + var nested_names = type_info.nested_names; + if (!nested_names.IsNullOrEmpty ()) { + for (int i = 0; i < nested_names.Length; i++) { + var nested_type = typedef.GetNestedType (nested_names [i]); + if (nested_type == null) + return false; + + typedef = nested_type; + } + } + + type = typedef; + return true; + } + + static bool TryCurrentModule (ModuleDefinition module, Type type_info) + { + if (string.IsNullOrEmpty (type_info.assembly)) + return true; + + if (module.assembly != null && module.assembly.Name.FullName == type_info.assembly) + return true; + + return false; + } + + public static string ToParseable (TypeReference type, bool top_level = true) + { + if (type == null) + return null; + + var name = new StringBuilder (); + AppendType (type, name, true, top_level); + return name.ToString (); + } + + static void AppendNamePart (string part, StringBuilder name) + { + foreach (var c in part) { + if (IsDelimiter (c)) + name.Append ('\\'); + + name.Append (c); + } + } + + static void AppendType (TypeReference type, StringBuilder name, bool fq_name, bool top_level) + { + var element_type = type.GetElementType (); + + var declaring_type = element_type.DeclaringType; + if (declaring_type != null) { + AppendType (declaring_type, name, false, top_level); + name.Append ('+'); + } + + var @namespace = type.Namespace; + if (!string.IsNullOrEmpty (@namespace)) { + AppendNamePart (@namespace, name); + name.Append ('.'); + } + + AppendNamePart (element_type.Name, name); + + if (!fq_name) + return; + + if (type.IsTypeSpecification ()) + AppendTypeSpecification ((TypeSpecification)type, name); + + if (RequiresFullyQualifiedName (type, top_level)) { + name.Append (", "); + name.Append (GetScopeFullName (type)); + } + } + + static string GetScopeFullName (TypeReference type) + { + var scope = type.Scope; + switch (scope.MetadataScopeType) { + case MetadataScopeType.AssemblyNameReference: + return ((AssemblyNameReference)scope).FullName; + case MetadataScopeType.ModuleDefinition: + return ((ModuleDefinition)scope).Assembly.Name.FullName; + } + + throw new ArgumentException (); + } + + static void AppendTypeSpecification (TypeSpecification type, StringBuilder name) + { + if (type.ElementType.IsTypeSpecification ()) + AppendTypeSpecification ((TypeSpecification)type.ElementType, name); + + switch (type.etype) { + case ElementType.Ptr: + name.Append ('*'); + break; + case ElementType.ByRef: + name.Append ('&'); + break; + case ElementType.SzArray: + case ElementType.Array: + var array = (ArrayType)type; + if (array.IsVector) { + name.Append ("[]"); + } else { + name.Append ('['); + for (int i = 1; i < array.Rank; i++) + name.Append (','); + name.Append (']'); + } + break; + case ElementType.GenericInst: + var instance = (GenericInstanceType)type; + var arguments = instance.GenericArguments; + + name.Append ('['); + + for (int i = 0; i < arguments.Count; i++) { + if (i > 0) + name.Append (','); + + var argument = arguments [i]; + var requires_fqname = argument.Scope != argument.Module; + + if (requires_fqname) + name.Append ('['); + + AppendType (argument, name, true, false); + + if (requires_fqname) + name.Append (']'); + } + + name.Append (']'); + break; + default: + return; + } + } + + static bool RequiresFullyQualifiedName (TypeReference type, bool top_level) + { + if (type.Scope == type.Module) + return false; + + if (type.Scope.Name == "mscorlib" && top_level) + return false; + + return true; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeParser.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeParser.cs.meta new file mode 100644 index 0000000..0cc685b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 14cea45910a5fc94ca89429bd0587148 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReference.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReference.cs new file mode 100644 index 0000000..993daf5 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReference.cs @@ -0,0 +1,352 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Metadata; +using MonoFN.Collections.Generic; +using System; +using System.Threading; + +namespace MonoFN.Cecil { + + public enum MetadataType : byte { + Void = ElementType.Void, + Boolean = ElementType.Boolean, + Char = ElementType.Char, + SByte = ElementType.I1, + Byte = ElementType.U1, + Int16 = ElementType.I2, + UInt16 = ElementType.U2, + Int32 = ElementType.I4, + UInt32 = ElementType.U4, + Int64 = ElementType.I8, + UInt64 = ElementType.U8, + Single = ElementType.R4, + Double = ElementType.R8, + String = ElementType.String, + Pointer = ElementType.Ptr, + ByReference = ElementType.ByRef, + ValueType = ElementType.ValueType, + Class = ElementType.Class, + Var = ElementType.Var, + Array = ElementType.Array, + GenericInstance = ElementType.GenericInst, + TypedByReference = ElementType.TypedByRef, + IntPtr = ElementType.I, + UIntPtr = ElementType.U, + FunctionPointer = ElementType.FnPtr, + Object = ElementType.Object, + MVar = ElementType.MVar, + RequiredModifier = ElementType.CModReqD, + OptionalModifier = ElementType.CModOpt, + Sentinel = ElementType.Sentinel, + Pinned = ElementType.Pinned, + } + + public class TypeReference : MemberReference, IGenericParameterProvider, IGenericContext { + + string @namespace; + bool value_type; + internal IMetadataScope scope; + internal ModuleDefinition module; + + internal ElementType etype = ElementType.None; + + string fullname; + + protected Collection generic_parameters; + + public override string Name { + get { return base.Name; } + set { + if (IsWindowsRuntimeProjection && value != base.Name) + throw new InvalidOperationException ("Projected type reference name can't be changed."); + base.Name = value; + ClearFullName (); + } + } + + public virtual string Namespace { + get { return @namespace; } + set { + if (IsWindowsRuntimeProjection && value != @namespace) + throw new InvalidOperationException ("Projected type reference namespace can't be changed."); + @namespace = value; + ClearFullName (); + } + } + + public virtual bool IsValueType { + get { return value_type; } + set { value_type = value; } + } + + public override ModuleDefinition Module { + get { + if (module != null) + return module; + + var declaring_type = this.DeclaringType; + if (declaring_type != null) + return declaring_type.Module; + + return null; + } + } + + internal TypeReferenceProjection WindowsRuntimeProjection { + get { return (TypeReferenceProjection)projection; } + set { projection = value; } + } + + IGenericParameterProvider IGenericContext.Type { + get { return this; } + } + + IGenericParameterProvider IGenericContext.Method { + get { return null; } + } + + GenericParameterType IGenericParameterProvider.GenericParameterType { + get { return GenericParameterType.Type; } + } + + public virtual bool HasGenericParameters { + get { return !generic_parameters.IsNullOrEmpty (); } + } + + public virtual Collection GenericParameters { + get { + if (generic_parameters == null) + Interlocked.CompareExchange (ref generic_parameters, new GenericParameterCollection (this), null); + + return generic_parameters; + } + } + + public virtual IMetadataScope Scope { + get { + var declaring_type = this.DeclaringType; + if (declaring_type != null) + return declaring_type.Scope; + + return scope; + } + set { + var declaring_type = this.DeclaringType; + if (declaring_type != null) { + if (IsWindowsRuntimeProjection && value != declaring_type.Scope) + throw new InvalidOperationException ("Projected type scope can't be changed."); + declaring_type.Scope = value; + return; + } + + if (IsWindowsRuntimeProjection && value != scope) + throw new InvalidOperationException ("Projected type scope can't be changed."); + scope = value; + } + } + + public bool IsNested { + get { return this.DeclaringType != null; } + } + + public override TypeReference DeclaringType { + get { return base.DeclaringType; } + set { + if (IsWindowsRuntimeProjection && value != base.DeclaringType) + throw new InvalidOperationException ("Projected type declaring type can't be changed."); + base.DeclaringType = value; + ClearFullName (); + } + } + + public override string FullName { + get { + if (fullname != null) + return fullname; + + var new_fullname = this.TypeFullName (); + + if (IsNested) + new_fullname = DeclaringType.FullName + "/" + new_fullname; + Interlocked.CompareExchange (ref fullname, new_fullname, null); + return fullname; + } + } + + public virtual bool IsByReference { + get { return false; } + } + + public virtual bool IsPointer { + get { return false; } + } + + public virtual bool IsSentinel { + get { return false; } + } + + public virtual bool IsArray { + get { return false; } + } + + public virtual bool IsGenericParameter { + get { return false; } + } + + public virtual bool IsGenericInstance { + get { return false; } + } + + public virtual bool IsRequiredModifier { + get { return false; } + } + + public virtual bool IsOptionalModifier { + get { return false; } + } + + public virtual bool IsPinned { + get { return false; } + } + + public virtual bool IsFunctionPointer { + get { return false; } + } + + public virtual bool IsPrimitive { + get { return etype.IsPrimitive (); } + } + + public virtual MetadataType MetadataType { + get { + switch (etype) { + case ElementType.None: + return IsValueType ? MetadataType.ValueType : MetadataType.Class; + default: + return (MetadataType)etype; + } + } + } + + protected TypeReference (string @namespace, string name) + : base (name) + { + this.@namespace = @namespace ?? string.Empty; + this.token = new MetadataToken (TokenType.TypeRef, 0); + } + + public TypeReference (string @namespace, string name, ModuleDefinition module, IMetadataScope scope) + : this (@namespace, name) + { + this.module = module; + this.scope = scope; + } + + public TypeReference (string @namespace, string name, ModuleDefinition module, IMetadataScope scope, bool valueType) : + this (@namespace, name, module, scope) + { + value_type = valueType; + } + + protected virtual void ClearFullName () + { + this.fullname = null; + } + + public virtual TypeReference GetElementType () + { + return this; + } + + protected override IMemberDefinition ResolveDefinition () + { + return this.Resolve (); + } + + public new virtual TypeDefinition Resolve () + { + var module = this.Module; + if (module == null) + throw new NotSupportedException (); + + return module.Resolve (this); + } + } + + static partial class Mixin { + + public static bool IsPrimitive (this ElementType self) + { + switch (self) { + case ElementType.Boolean: + case ElementType.Char: + case ElementType.I: + case ElementType.U: + case ElementType.I1: + case ElementType.U1: + case ElementType.I2: + case ElementType.U2: + case ElementType.I4: + case ElementType.U4: + case ElementType.I8: + case ElementType.U8: + case ElementType.R4: + case ElementType.R8: + return true; + default: + return false; + } + } + + public static string TypeFullName (this TypeReference self) + { + return string.IsNullOrEmpty (self.Namespace) + ? self.Name + : self.Namespace + '.' + self.Name; + } + + public static bool IsTypeOf (this TypeReference self, string @namespace, string name) + { + return self.Name == name + && self.Namespace == @namespace; + } + + public static bool IsTypeSpecification (this TypeReference type) + { + switch (type.etype) { + case ElementType.Array: + case ElementType.ByRef: + case ElementType.CModOpt: + case ElementType.CModReqD: + case ElementType.FnPtr: + case ElementType.GenericInst: + case ElementType.MVar: + case ElementType.Pinned: + case ElementType.Ptr: + case ElementType.SzArray: + case ElementType.Sentinel: + case ElementType.Var: + return true; + } + + return false; + } + + public static TypeDefinition CheckedResolve (this TypeReference self) + { + var type = self.Resolve (); + if (type == null) + throw new ResolutionException (self); + + return type; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReference.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReference.cs.meta new file mode 100644 index 0000000..6133f4f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be8b0c2aa3d8d534a90ff392789fac67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReferenceEqualityComparer.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReferenceEqualityComparer.cs new file mode 100644 index 0000000..a399fba --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReferenceEqualityComparer.cs @@ -0,0 +1,253 @@ +using System; +using System.Collections.Generic; + +namespace MonoFN.Cecil { + internal sealed class TypeReferenceEqualityComparer : EqualityComparer { + public override bool Equals (TypeReference x, TypeReference y) + { + return AreEqual (x, y); + } + + public override int GetHashCode (TypeReference obj) + { + return GetHashCodeFor (obj); + } + + public static bool AreEqual (TypeReference a, TypeReference b, TypeComparisonMode comparisonMode = TypeComparisonMode.Exact) + { + if (ReferenceEquals (a, b)) + return true; + + if (a == null || b == null) + return false; + + var aMetadataType = a.MetadataType; + var bMetadataType = b.MetadataType; + + if (aMetadataType == MetadataType.GenericInstance || bMetadataType == MetadataType.GenericInstance) { + if (aMetadataType != bMetadataType) + return false; + + return AreEqual ((GenericInstanceType)a, (GenericInstanceType)b, comparisonMode); + } + + if (aMetadataType == MetadataType.Array || bMetadataType == MetadataType.Array) { + if (aMetadataType != bMetadataType) + return false; + + var a1 = (ArrayType)a; + var b1 = (ArrayType)b; + if (a1.Rank != b1.Rank) + return false; + + return AreEqual (a1.ElementType, b1.ElementType, comparisonMode); + } + + if (aMetadataType == MetadataType.Var || bMetadataType == MetadataType.Var) { + if (aMetadataType != bMetadataType) + return false; + + return AreEqual ((GenericParameter)a, (GenericParameter)b, comparisonMode); + } + + if (aMetadataType == MetadataType.MVar || bMetadataType == MetadataType.MVar) { + if (aMetadataType != bMetadataType) + return false; + + return AreEqual ((GenericParameter)a, (GenericParameter)b, comparisonMode); + } + + if (aMetadataType == MetadataType.ByReference || bMetadataType == MetadataType.ByReference) { + if (aMetadataType != bMetadataType) + return false; + + return AreEqual (((ByReferenceType)a).ElementType, ((ByReferenceType)b).ElementType, comparisonMode); + } + + if (aMetadataType == MetadataType.Pointer || bMetadataType == MetadataType.Pointer) { + if (aMetadataType != bMetadataType) + return false; + + return AreEqual (((PointerType)a).ElementType, ((PointerType)b).ElementType, comparisonMode); + } + + if (aMetadataType == MetadataType.RequiredModifier || bMetadataType == MetadataType.RequiredModifier) { + if (aMetadataType != bMetadataType) + return false; + + var a1 = (RequiredModifierType)a; + var b1 = (RequiredModifierType)b; + + return AreEqual (a1.ModifierType, b1.ModifierType, comparisonMode) && AreEqual (a1.ElementType, b1.ElementType, comparisonMode); + } + + if (aMetadataType == MetadataType.OptionalModifier || bMetadataType == MetadataType.OptionalModifier) { + if (aMetadataType != bMetadataType) + return false; + + var a1 = (OptionalModifierType)a; + var b1 = (OptionalModifierType)b; + + return AreEqual (a1.ModifierType, b1.ModifierType, comparisonMode) && AreEqual (a1.ElementType, b1.ElementType, comparisonMode); + } + + if (aMetadataType == MetadataType.Pinned || bMetadataType == MetadataType.Pinned) { + if (aMetadataType != bMetadataType) + return false; + + return AreEqual (((PinnedType)a).ElementType, ((PinnedType)b).ElementType, comparisonMode); + } + + if (aMetadataType == MetadataType.Sentinel || bMetadataType == MetadataType.Sentinel) { + if (aMetadataType != bMetadataType) + return false; + + return AreEqual (((SentinelType)a).ElementType, ((SentinelType)b).ElementType, comparisonMode); + } + + if (!a.Name.Equals (b.Name) || !a.Namespace.Equals (b.Namespace)) + return false; + + var xDefinition = a.Resolve (); + var yDefinition = b.Resolve (); + + // For loose signature the types could be in different assemblies, as long as the type names match we will consider them equal + if (comparisonMode == TypeComparisonMode.SignatureOnlyLoose) { + if (xDefinition.Module.Name != yDefinition.Module.Name) + return false; + + if (xDefinition.Module.Assembly.Name.Name != yDefinition.Module.Assembly.Name.Name) + return false; + + return xDefinition.FullName == yDefinition.FullName; + } + + return xDefinition == yDefinition; + } + + static bool AreEqual (GenericParameter a, GenericParameter b, TypeComparisonMode comparisonMode = TypeComparisonMode.Exact) + { + if (ReferenceEquals (a, b)) + return true; + + if (a.Position != b.Position) + return false; + + if (a.Type != b.Type) + return false; + + var aOwnerType = a.Owner as TypeReference; + if (aOwnerType != null && AreEqual (aOwnerType, b.Owner as TypeReference, comparisonMode)) + return true; + + var aOwnerMethod = a.Owner as MethodReference; + if (aOwnerMethod != null && comparisonMode != TypeComparisonMode.SignatureOnlyLoose && MethodReferenceComparer.AreEqual (aOwnerMethod, b.Owner as MethodReference)) + return true; + + return comparisonMode == TypeComparisonMode.SignatureOnly || comparisonMode == TypeComparisonMode.SignatureOnlyLoose; + } + + static bool AreEqual (GenericInstanceType a, GenericInstanceType b, TypeComparisonMode comparisonMode = TypeComparisonMode.Exact) + { + if (ReferenceEquals (a, b)) + return true; + + var aGenericArgumentsCount = a.GenericArguments.Count; + if (aGenericArgumentsCount != b.GenericArguments.Count) + return false; + + if (!AreEqual (a.ElementType, b.ElementType, comparisonMode)) + return false; + + for (int i = 0; i < aGenericArgumentsCount; i++) + if (!AreEqual (a.GenericArguments [i], b.GenericArguments [i], comparisonMode)) + return false; + + return true; + } + + public static int GetHashCodeFor (TypeReference obj) + { + // a very good prime number + const int hashCodeMultiplier = 486187739; + // prime numbers + const int genericInstanceTypeMultiplier = 31; + const int byReferenceMultiplier = 37; + const int pointerMultiplier = 41; + const int requiredModifierMultiplier = 43; + const int optionalModifierMultiplier = 47; + const int pinnedMultiplier = 53; + const int sentinelMultiplier = 59; + + var metadataType = obj.MetadataType; + + if (metadataType == MetadataType.GenericInstance) { + var genericInstanceType = (GenericInstanceType)obj; + var hashCode = GetHashCodeFor (genericInstanceType.ElementType) * hashCodeMultiplier + genericInstanceTypeMultiplier; + for (var i = 0; i < genericInstanceType.GenericArguments.Count; i++) + hashCode = hashCode * hashCodeMultiplier + GetHashCodeFor (genericInstanceType.GenericArguments [i]); + return hashCode; + } + + if (metadataType == MetadataType.Array) { + var arrayType = (ArrayType)obj; + return GetHashCodeFor (arrayType.ElementType) * hashCodeMultiplier + arrayType.Rank.GetHashCode (); + } + + if (metadataType == MetadataType.Var || metadataType == MetadataType.MVar) { + var genericParameter = (GenericParameter)obj; + var hashCode = genericParameter.Position.GetHashCode () * hashCodeMultiplier + ((int)metadataType).GetHashCode (); + + var ownerTypeReference = genericParameter.Owner as TypeReference; + if (ownerTypeReference != null) + return hashCode * hashCodeMultiplier + GetHashCodeFor (ownerTypeReference); + + var ownerMethodReference = genericParameter.Owner as MethodReference; + if (ownerMethodReference != null) + return hashCode * hashCodeMultiplier + MethodReferenceComparer.GetHashCodeFor (ownerMethodReference); + + throw new InvalidOperationException ("Generic parameter encountered with invalid owner"); + } + + if (metadataType == MetadataType.ByReference) { + var byReferenceType = (ByReferenceType)obj; + return GetHashCodeFor (byReferenceType.ElementType) * hashCodeMultiplier * byReferenceMultiplier; + } + + if (metadataType == MetadataType.Pointer) { + var pointerType = (PointerType)obj; + return GetHashCodeFor (pointerType.ElementType) * hashCodeMultiplier * pointerMultiplier; + } + + if (metadataType == MetadataType.RequiredModifier) { + var requiredModifierType = (RequiredModifierType)obj; + var hashCode = GetHashCodeFor (requiredModifierType.ElementType) * requiredModifierMultiplier; + hashCode = hashCode * hashCodeMultiplier + GetHashCodeFor (requiredModifierType.ModifierType); + return hashCode; + } + + if (metadataType == MetadataType.OptionalModifier) { + var optionalModifierType = (OptionalModifierType)obj; + var hashCode = GetHashCodeFor (optionalModifierType.ElementType) * optionalModifierMultiplier; + hashCode = hashCode * hashCodeMultiplier + GetHashCodeFor (optionalModifierType.ModifierType); + return hashCode; + } + + if (metadataType == MetadataType.Pinned) { + var pinnedType = (PinnedType)obj; + return GetHashCodeFor (pinnedType.ElementType) * hashCodeMultiplier * pinnedMultiplier; + } + + if (metadataType == MetadataType.Sentinel) { + var sentinelType = (SentinelType)obj; + return GetHashCodeFor (sentinelType.ElementType) * hashCodeMultiplier * sentinelMultiplier; + } + + if (metadataType == MetadataType.FunctionPointer) { + throw new NotImplementedException ("We currently don't handle function pointer types."); + } + + return obj.Namespace.GetHashCode () * hashCodeMultiplier + obj.FullName.GetHashCode (); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReferenceEqualityComparer.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReferenceEqualityComparer.cs.meta new file mode 100644 index 0000000..e8ce2b4 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeReferenceEqualityComparer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5e048a822386ae34ab1124eaf29e1d84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeResolver.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeResolver.cs new file mode 100644 index 0000000..69b8507 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeResolver.cs @@ -0,0 +1,220 @@ +using MonoFN.Cecil.Cil; +using System; + +namespace MonoFN.Cecil { + internal sealed class TypeResolver { + private readonly IGenericInstance _typeDefinitionContext; + private readonly IGenericInstance _methodDefinitionContext; + + public static TypeResolver For (TypeReference typeReference) + { + return typeReference.IsGenericInstance ? new TypeResolver ((GenericInstanceType)typeReference) : new TypeResolver (); + } + + public static TypeResolver For (TypeReference typeReference, MethodReference methodReference) + { + return new TypeResolver (typeReference as GenericInstanceType, methodReference as GenericInstanceMethod); + } + + public TypeResolver () + { + + } + + public TypeResolver (GenericInstanceType typeDefinitionContext) + { + _typeDefinitionContext = typeDefinitionContext; + } + + public TypeResolver (GenericInstanceMethod methodDefinitionContext) + { + _methodDefinitionContext = methodDefinitionContext; + } + + public TypeResolver (GenericInstanceType typeDefinitionContext, GenericInstanceMethod methodDefinitionContext) + { + _typeDefinitionContext = typeDefinitionContext; + _methodDefinitionContext = methodDefinitionContext; + } + + public MethodReference Resolve (MethodReference method) + { + var methodReference = method; + if (IsDummy ()) + return methodReference; + + var declaringType = Resolve (method.DeclaringType); + + var genericInstanceMethod = method as GenericInstanceMethod; + if (genericInstanceMethod != null) { + methodReference = new MethodReference (method.Name, method.ReturnType, declaringType); + + foreach (var p in method.Parameters) + methodReference.Parameters.Add (new ParameterDefinition (p.Name, p.Attributes, p.ParameterType)); + + foreach (var gp in genericInstanceMethod.ElementMethod.GenericParameters) + methodReference.GenericParameters.Add (new GenericParameter (gp.Name, methodReference)); + + methodReference.HasThis = method.HasThis; + + var m = new GenericInstanceMethod (methodReference); + foreach (var ga in genericInstanceMethod.GenericArguments) { + m.GenericArguments.Add (Resolve (ga)); + } + + methodReference = m; + } else { + methodReference = new MethodReference (method.Name, method.ReturnType, declaringType); + + foreach (var gp in method.GenericParameters) + methodReference.GenericParameters.Add (new GenericParameter (gp.Name, methodReference)); + + foreach (var p in method.Parameters) + methodReference.Parameters.Add (new ParameterDefinition (p.Name, p.Attributes, p.ParameterType)); + + methodReference.HasThis = method.HasThis; + } + + + return methodReference; + } + + public FieldReference Resolve (FieldReference field) + { + var declaringType = Resolve (field.DeclaringType); + + if (declaringType == field.DeclaringType) + return field; + + return new FieldReference (field.Name, field.FieldType, declaringType); + } + + public TypeReference ResolveReturnType (MethodReference method) + { + return Resolve (GenericParameterResolver.ResolveReturnTypeIfNeeded (method)); + } + + public TypeReference ResolveParameterType (MethodReference method, ParameterReference parameter) + { + return Resolve (GenericParameterResolver.ResolveParameterTypeIfNeeded (method, parameter)); + } + + public TypeReference ResolveVariableType (MethodReference method, VariableReference variable) + { + return Resolve (GenericParameterResolver.ResolveVariableTypeIfNeeded (method, variable)); + } + + public TypeReference ResolveFieldType (FieldReference field) + { + return Resolve (GenericParameterResolver.ResolveFieldTypeIfNeeded (field)); + } + + public TypeReference Resolve (TypeReference typeReference) + { + return Resolve (typeReference, true); + } + + public TypeReference Resolve (TypeReference typeReference, bool includeTypeDefinitions) + { + if (IsDummy ()) + return typeReference; + + if (_typeDefinitionContext != null && _typeDefinitionContext.GenericArguments.Contains (typeReference)) + return typeReference; + if (_methodDefinitionContext != null && _methodDefinitionContext.GenericArguments.Contains (typeReference)) + return typeReference; + + var genericParameter = typeReference as GenericParameter; + if (genericParameter != null) { + if (_typeDefinitionContext != null && _typeDefinitionContext.GenericArguments.Contains (genericParameter)) + return genericParameter; + if (_methodDefinitionContext != null && _methodDefinitionContext.GenericArguments.Contains (genericParameter)) + return genericParameter; + return ResolveGenericParameter (genericParameter); + } + + var arrayType = typeReference as ArrayType; + if (arrayType != null) + return new ArrayType (Resolve (arrayType.ElementType), arrayType.Rank); + + var pointerType = typeReference as PointerType; + if (pointerType != null) + return new PointerType (Resolve (pointerType.ElementType)); + + var byReferenceType = typeReference as ByReferenceType; + if (byReferenceType != null) + return new ByReferenceType (Resolve (byReferenceType.ElementType)); + + var pinnedType = typeReference as PinnedType; + if (pinnedType != null) + return new PinnedType (Resolve (pinnedType.ElementType)); + + var genericInstanceType = typeReference as GenericInstanceType; + if (genericInstanceType != null) { + var newGenericInstanceType = new GenericInstanceType (genericInstanceType.ElementType); + foreach (var genericArgument in genericInstanceType.GenericArguments) + newGenericInstanceType.GenericArguments.Add (Resolve (genericArgument)); + return newGenericInstanceType; + } + + var requiredModType = typeReference as RequiredModifierType; + if (requiredModType != null) + return Resolve (requiredModType.ElementType, includeTypeDefinitions); + + + if (includeTypeDefinitions) { + var typeDefinition = typeReference as TypeDefinition; + if (typeDefinition != null && typeDefinition.HasGenericParameters) { + var newGenericInstanceType = new GenericInstanceType (typeDefinition); + foreach (var gp in typeDefinition.GenericParameters) + newGenericInstanceType.GenericArguments.Add (Resolve (gp)); + return newGenericInstanceType; + } + } + + if (typeReference is TypeSpecification) + throw new NotSupportedException (string.Format ("The type {0} cannot be resolved correctly.", typeReference.FullName)); + + return typeReference; + } + + internal TypeResolver Nested (GenericInstanceMethod genericInstanceMethod) + { + return new TypeResolver (_typeDefinitionContext as GenericInstanceType, genericInstanceMethod); + } + + private TypeReference ResolveGenericParameter (GenericParameter genericParameter) + { + if (genericParameter.Owner == null) + return HandleOwnerlessInvalidILCode (genericParameter); + + var memberReference = genericParameter.Owner as MemberReference; + if (memberReference == null) + throw new NotSupportedException (); + + return genericParameter.Type == GenericParameterType.Type + ? _typeDefinitionContext.GenericArguments [genericParameter.Position] + : (_methodDefinitionContext != null ? _methodDefinitionContext.GenericArguments [genericParameter.Position] : genericParameter); + } + + private TypeReference HandleOwnerlessInvalidILCode (GenericParameter genericParameter) + { + // NOTE: If owner is null and we have a method parameter, then we'll assume that the method parameter + // is actually a type parameter, and we'll use the type parameter from the corresponding position. I think + // this assumption is valid, but if you're visiting this code then I might have been proven wrong. + if (genericParameter.Type == GenericParameterType.Method && (_typeDefinitionContext != null && genericParameter.Position < _typeDefinitionContext.GenericArguments.Count)) + return _typeDefinitionContext.GenericArguments [genericParameter.Position]; + + // NOTE: Owner cannot be null, but sometimes the Mono compiler generates invalid IL and we + // end up in this situation. + // When we do, we assume that the runtime doesn't care about the resolved type of the GenericParameter, + // thus we return a reference to System.Object. + return genericParameter.Module.TypeSystem.Object; + } + + private bool IsDummy () + { + return _typeDefinitionContext == null && _methodDefinitionContext == null; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeResolver.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeResolver.cs.meta new file mode 100644 index 0000000..9b42c4c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeResolver.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94140ae852ea8954489f238f1e59f865 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSpecification.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSpecification.cs new file mode 100644 index 0000000..4be061f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSpecification.cs @@ -0,0 +1,66 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil { + + public abstract class TypeSpecification : TypeReference { + + readonly TypeReference element_type; + + public TypeReference ElementType { + get { return element_type; } + } + + public override string Name { + get { return element_type.Name; } + set { throw new InvalidOperationException (); } + } + + public override string Namespace { + get { return element_type.Namespace; } + set { throw new InvalidOperationException (); } + } + + public override IMetadataScope Scope { + get { return element_type.Scope; } + set { throw new InvalidOperationException (); } + } + + public override ModuleDefinition Module { + get { return element_type.Module; } + } + + public override string FullName { + get { return element_type.FullName; } + } + + public override bool ContainsGenericParameter { + get { return element_type.ContainsGenericParameter; } + } + + public override MetadataType MetadataType { + get { return (MetadataType)etype; } + } + + internal TypeSpecification (TypeReference type) + : base (null, null) + { + this.element_type = type; + this.token = new MetadataToken (TokenType.TypeSpec); + } + + public override TypeReference GetElementType () + { + return element_type.GetElementType (); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSpecification.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSpecification.cs.meta new file mode 100644 index 0000000..2d6b903 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSpecification.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4c1d979e44d835a4dbcdefa35a45a07a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSystem.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSystem.cs new file mode 100644 index 0000000..686156c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSystem.cs @@ -0,0 +1,330 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Metadata; +using System; + +namespace MonoFN.Cecil { + + public abstract class TypeSystem { + + sealed class CoreTypeSystem : TypeSystem { + + public CoreTypeSystem (ModuleDefinition module) + : base (module) + { + } + + internal override TypeReference LookupType (string @namespace, string name) + { + var type = LookupTypeDefinition (@namespace, name) ?? LookupTypeForwarded (@namespace, name); + if (type != null) + return type; + + throw new NotSupportedException (); + } + + TypeReference LookupTypeDefinition (string @namespace, string name) + { + var metadata = module.MetadataSystem; + if (metadata.Types == null) + Initialize (module.Types); + + return module.Read (new Row (@namespace, name), (row, reader) => { + var types = reader.metadata.Types; + + for (int i = 0; i < types.Length; i++) { + if (types [i] == null) + types [i] = reader.GetTypeDefinition ((uint)i + 1); + + var type = types [i]; + + if (type.Name == row.Col2 && type.Namespace == row.Col1) + return type; + } + + return null; + }); + } + + TypeReference LookupTypeForwarded (string @namespace, string name) + { + if (!module.HasExportedTypes) + return null; + + var exported_types = module.ExportedTypes; + for (int i = 0; i < exported_types.Count; i++) { + var exported_type = exported_types [i]; + + if (exported_type.Name == name && exported_type.Namespace == @namespace) + return exported_type.CreateReference (); + } + + return null; + } + + static void Initialize (object obj) + { + } + } + + sealed class CommonTypeSystem : TypeSystem { + + AssemblyNameReference core_library; + + public CommonTypeSystem (ModuleDefinition module) + : base (module) + { + } + + internal override TypeReference LookupType (string @namespace, string name) + { + return CreateTypeReference (@namespace, name); + } + + public AssemblyNameReference GetCoreLibraryReference () + { + if (core_library != null) + return core_library; + + if (module.TryGetCoreLibraryReference (out core_library)) + return core_library; + + core_library = new AssemblyNameReference { + Name = Mixin.mscorlib, + Version = GetCorlibVersion (), + PublicKeyToken = new byte [] { 0xb7, 0x7a, 0x5c, 0x56, 0x19, 0x34, 0xe0, 0x89 }, + }; + + module.AssemblyReferences.Add (core_library); + + return core_library; + } + + Version GetCorlibVersion () + { + switch (module.Runtime) { + case TargetRuntime.Net_1_0: + case TargetRuntime.Net_1_1: + return new Version (1, 0, 0, 0); + case TargetRuntime.Net_2_0: + return new Version (2, 0, 0, 0); + case TargetRuntime.Net_4_0: + return new Version (4, 0, 0, 0); + default: + throw new NotSupportedException (); + } + } + + TypeReference CreateTypeReference (string @namespace, string name) + { + return new TypeReference (@namespace, name, module, GetCoreLibraryReference ()); + } + } + + readonly ModuleDefinition module; + + TypeReference type_object; + TypeReference type_void; + TypeReference type_bool; + TypeReference type_char; + TypeReference type_sbyte; + TypeReference type_byte; + TypeReference type_int16; + TypeReference type_uint16; + TypeReference type_int32; + TypeReference type_uint32; + TypeReference type_int64; + TypeReference type_uint64; + TypeReference type_single; + TypeReference type_double; + TypeReference type_intptr; + TypeReference type_uintptr; + TypeReference type_string; + TypeReference type_typedref; + + TypeSystem (ModuleDefinition module) + { + this.module = module; + } + + internal static TypeSystem CreateTypeSystem (ModuleDefinition module) + { + if (module.IsCoreLibrary ()) + return new CoreTypeSystem (module); + + return new CommonTypeSystem (module); + } + + internal abstract TypeReference LookupType (string @namespace, string name); + + TypeReference LookupSystemType (ref TypeReference reference, string name, ElementType element_type) + { + lock (module.SyncRoot) { + if (reference != null) + return reference; + var type = LookupType ("System", name); + type.etype = element_type; + return reference = type; + } + } + + TypeReference LookupSystemValueType (ref TypeReference typeRef, string name, ElementType element_type) + { + lock (module.SyncRoot) { + if (typeRef != null) + return typeRef; + var type = LookupType ("System", name); + type.etype = element_type; + type.KnownValueType (); + return typeRef = type; + } + } + + [Obsolete ("Use CoreLibrary")] + public IMetadataScope Corlib { + get { return CoreLibrary; } + } + + public IMetadataScope CoreLibrary { + get { + var common = this as CommonTypeSystem; + if (common == null) + return module; + + return common.GetCoreLibraryReference (); + } + } + + public TypeReference Object { + get { return type_object ?? (LookupSystemType (ref type_object, "Object", ElementType.Object)); } + } + + public TypeReference Void { + get { return type_void ?? (LookupSystemType (ref type_void, "Void", ElementType.Void)); } + } + + public TypeReference Boolean { + get { return type_bool ?? (LookupSystemValueType (ref type_bool, "Boolean", ElementType.Boolean)); } + } + + public TypeReference Char { + get { return type_char ?? (LookupSystemValueType (ref type_char, "Char", ElementType.Char)); } + } + + public TypeReference SByte { + get { return type_sbyte ?? (LookupSystemValueType (ref type_sbyte, "SByte", ElementType.I1)); } + } + + public TypeReference Byte { + get { return type_byte ?? (LookupSystemValueType (ref type_byte, "Byte", ElementType.U1)); } + } + + public TypeReference Int16 { + get { return type_int16 ?? (LookupSystemValueType (ref type_int16, "Int16", ElementType.I2)); } + } + + public TypeReference UInt16 { + get { return type_uint16 ?? (LookupSystemValueType (ref type_uint16, "UInt16", ElementType.U2)); } + } + + public TypeReference Int32 { + get { return type_int32 ?? (LookupSystemValueType (ref type_int32, "Int32", ElementType.I4)); } + } + + public TypeReference UInt32 { + get { return type_uint32 ?? (LookupSystemValueType (ref type_uint32, "UInt32", ElementType.U4)); } + } + + public TypeReference Int64 { + get { return type_int64 ?? (LookupSystemValueType (ref type_int64, "Int64", ElementType.I8)); } + } + + public TypeReference UInt64 { + get { return type_uint64 ?? (LookupSystemValueType (ref type_uint64, "UInt64", ElementType.U8)); } + } + + public TypeReference Single { + get { return type_single ?? (LookupSystemValueType (ref type_single, "Single", ElementType.R4)); } + } + + public TypeReference Double { + get { return type_double ?? (LookupSystemValueType (ref type_double, "Double", ElementType.R8)); } + } + + public TypeReference IntPtr { + get { return type_intptr ?? (LookupSystemValueType (ref type_intptr, "IntPtr", ElementType.I)); } + } + + public TypeReference UIntPtr { + get { return type_uintptr ?? (LookupSystemValueType (ref type_uintptr, "UIntPtr", ElementType.U)); } + } + + public TypeReference String { + get { return type_string ?? (LookupSystemType (ref type_string, "String", ElementType.String)); } + } + + public TypeReference TypedReference { + get { return type_typedref ?? (LookupSystemValueType (ref type_typedref, "TypedReference", ElementType.TypedByRef)); } + } + } + + static partial class Mixin { + + public const string mscorlib = "mscorlib"; + public const string system_runtime = "System.Runtime"; + public const string system_private_corelib = "System.Private.CoreLib"; + public const string netstandard = "netstandard"; + + public static bool TryGetCoreLibraryReference (this ModuleDefinition module, out AssemblyNameReference reference) + { + var references = module.AssemblyReferences; + + for (int i = 0; i < references.Count; i++) { + reference = references [i]; + if (IsCoreLibrary (reference)) + return true; + } + + reference = null; + return false; + + } + + public static bool IsCoreLibrary (this ModuleDefinition module) + { + if (module.Assembly == null) + return false; + + if (!IsCoreLibrary (module.Assembly.Name)) + return false; + + if (module.HasImage && module.Read (module, (m, reader) => reader.image.GetTableLength (Table.AssemblyRef) > 0)) + return false; + + return true; + } + + public static void KnownValueType (this TypeReference type) + { + if (!type.IsDefinition) + type.IsValueType = true; + } + + static bool IsCoreLibrary (AssemblyNameReference reference) + { + var name = reference.Name; + return name == mscorlib + || name == system_runtime + || name == system_private_corelib + || name == netstandard; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSystem.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSystem.cs.meta new file mode 100644 index 0000000..20fec27 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/TypeSystem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68c81a3fab6a4ee4dbfc5e83e365d1c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/VariantType.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/VariantType.cs new file mode 100644 index 0000000..9f5ed54 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/VariantType.cs @@ -0,0 +1,37 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +namespace MonoFN.Cecil { + + public enum VariantType { + None = 0, + I2 = 2, + I4 = 3, + R4 = 4, + R8 = 5, + CY = 6, + Date = 7, + BStr = 8, + Dispatch = 9, + Error = 10, + Bool = 11, + Variant = 12, + Unknown = 13, + Decimal = 14, + I1 = 16, + UI1 = 17, + UI2 = 18, + UI4 = 19, + I8 = 20, + UI8 = 21, + Int = 22, + UInt = 23 + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/VariantType.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/VariantType.cs.meta new file mode 100644 index 0000000..5bc5518 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/VariantType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b01b9a572a6975b4c806b3269b858cb1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/WindowsRuntimeProjections.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/WindowsRuntimeProjections.cs new file mode 100644 index 0000000..d505b28 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/WindowsRuntimeProjections.cs @@ -0,0 +1,959 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace MonoFN.Cecil { + + sealed class TypeDefinitionProjection { + + public readonly TypeAttributes Attributes; + public readonly string Name; + public readonly TypeDefinitionTreatment Treatment; + public readonly Collection RedirectedMethods; + public readonly Collection> RedirectedInterfaces; + + public TypeDefinitionProjection (TypeDefinition type, TypeDefinitionTreatment treatment, Collection redirectedMethods, Collection> redirectedInterfaces) + { + Attributes = type.Attributes; + Name = type.Name; + Treatment = treatment; + RedirectedMethods = redirectedMethods; + RedirectedInterfaces = redirectedInterfaces; + } + } + + sealed class TypeReferenceProjection { + + public readonly string Name; + public readonly string Namespace; + public readonly IMetadataScope Scope; + public readonly TypeReferenceTreatment Treatment; + + public TypeReferenceProjection (TypeReference type, TypeReferenceTreatment treatment) + { + Name = type.Name; + Namespace = type.Namespace; + Scope = type.Scope; + Treatment = treatment; + } + } + + sealed class MethodDefinitionProjection { + + public readonly MethodAttributes Attributes; + public readonly MethodImplAttributes ImplAttributes; + public readonly string Name; + public readonly MethodDefinitionTreatment Treatment; + + public MethodDefinitionProjection (MethodDefinition method, MethodDefinitionTreatment treatment) + { + Attributes = method.Attributes; + ImplAttributes = method.ImplAttributes; + Name = method.Name; + Treatment = treatment; + } + } + + sealed class FieldDefinitionProjection { + + public readonly FieldAttributes Attributes; + public readonly FieldDefinitionTreatment Treatment; + + public FieldDefinitionProjection (FieldDefinition field, FieldDefinitionTreatment treatment) + { + Attributes = field.Attributes; + Treatment = treatment; + } + } + + sealed class CustomAttributeValueProjection { + + public readonly AttributeTargets Targets; + public readonly CustomAttributeValueTreatment Treatment; + + public CustomAttributeValueProjection (AttributeTargets targets, CustomAttributeValueTreatment treatment) + { + Targets = targets; + Treatment = treatment; + } + } + + sealed class WindowsRuntimeProjections { + + struct ProjectionInfo { + + public readonly string WinRTNamespace; + public readonly string ClrNamespace; + public readonly string ClrName; + public readonly string ClrAssembly; + public readonly bool Attribute; + + public ProjectionInfo (string winrt_namespace, string clr_namespace, string clr_name, string clr_assembly, bool attribute = false) + { + WinRTNamespace = winrt_namespace; + ClrNamespace = clr_namespace; + ClrName = clr_name; + ClrAssembly = clr_assembly; + Attribute = attribute; + } + } + + static readonly Version version = new Version (4, 0, 0, 0); + + static readonly byte [] contract_pk_token = { + 0xB0, 0x3F, 0x5F, 0x7F, 0x11, 0xD5, 0x0A, 0x3A + }; + + static readonly byte [] contract_pk = { + 0x00, 0x24, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x06, 0x02, 0x00, 0x00, + 0x00, 0x24, 0x00, 0x00, 0x52, 0x53, 0x41, 0x31, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, + 0x07, 0xD1, 0xFA, 0x57, 0xC4, 0xAE, 0xD9, 0xF0, 0xA3, 0x2E, 0x84, 0xAA, 0x0F, 0xAE, 0xFD, 0x0D, + 0xE9, 0xE8, 0xFD, 0x6A, 0xEC, 0x8F, 0x87, 0xFB, 0x03, 0x76, 0x6C, 0x83, 0x4C, 0x99, 0x92, 0x1E, + 0xB2, 0x3B, 0xE7, 0x9A, 0xD9, 0xD5, 0xDC, 0xC1, 0xDD, 0x9A, 0xD2, 0x36, 0x13, 0x21, 0x02, 0x90, + 0x0B, 0x72, 0x3C, 0xF9, 0x80, 0x95, 0x7F, 0xC4, 0xE1, 0x77, 0x10, 0x8F, 0xC6, 0x07, 0x77, 0x4F, + 0x29, 0xE8, 0x32, 0x0E, 0x92, 0xEA, 0x05, 0xEC, 0xE4, 0xE8, 0x21, 0xC0, 0xA5, 0xEF, 0xE8, 0xF1, + 0x64, 0x5C, 0x4C, 0x0C, 0x93, 0xC1, 0xAB, 0x99, 0x28, 0x5D, 0x62, 0x2C, 0xAA, 0x65, 0x2C, 0x1D, + 0xFA, 0xD6, 0x3D, 0x74, 0x5D, 0x6F, 0x2D, 0xE5, 0xF1, 0x7E, 0x5E, 0xAF, 0x0F, 0xC4, 0x96, 0x3D, + 0x26, 0x1C, 0x8A, 0x12, 0x43, 0x65, 0x18, 0x20, 0x6D, 0xC0, 0x93, 0x34, 0x4D, 0x5A, 0xD2, 0x93 + }; + + static Dictionary projections; + + static Dictionary Projections { + get { + if (projections != null) + return projections; + + + var new_projections = new Dictionary { + { "AttributeTargets", new ProjectionInfo ("Windows.Foundation.Metadata", "System", "AttributeTargets", "System.Runtime") }, + { "AttributeUsageAttribute", new ProjectionInfo ("Windows.Foundation.Metadata", "System", "AttributeUsageAttribute", "System.Runtime", attribute: true) }, + { "Color", new ProjectionInfo ("Windows.UI", "Windows.UI", "Color", "System.Runtime.WindowsRuntime") }, + { "CornerRadius", new ProjectionInfo ("Windows.UI.Xaml", "Windows.UI.Xaml", "CornerRadius", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "DateTime", new ProjectionInfo ("Windows.Foundation", "System", "DateTimeOffset", "System.Runtime") }, + { "Duration", new ProjectionInfo ("Windows.UI.Xaml", "Windows.UI.Xaml", "Duration", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "DurationType", new ProjectionInfo ("Windows.UI.Xaml", "Windows.UI.Xaml", "DurationType", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "EventHandler`1", new ProjectionInfo ("Windows.Foundation", "System", "EventHandler`1", "System.Runtime") }, + { "EventRegistrationToken", new ProjectionInfo ("Windows.Foundation", "System.Runtime.InteropServices.WindowsRuntime", "EventRegistrationToken", "System.Runtime.InteropServices.WindowsRuntime") }, + { "GeneratorPosition", new ProjectionInfo ("Windows.UI.Xaml.Controls.Primitives", "Windows.UI.Xaml.Controls.Primitives", "GeneratorPosition", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "GridLength", new ProjectionInfo ("Windows.UI.Xaml", "Windows.UI.Xaml", "GridLength", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "GridUnitType", new ProjectionInfo ("Windows.UI.Xaml", "Windows.UI.Xaml", "GridUnitType", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "HResult", new ProjectionInfo ("Windows.Foundation", "System", "Exception", "System.Runtime") }, + { "IBindableIterable", new ProjectionInfo ("Windows.UI.Xaml.Interop", "System.Collections", "IEnumerable", "System.Runtime") }, + { "IBindableVector", new ProjectionInfo ("Windows.UI.Xaml.Interop", "System.Collections", "IList", "System.Runtime") }, + { "IClosable", new ProjectionInfo ("Windows.Foundation", "System", "IDisposable", "System.Runtime") }, + { "ICommand", new ProjectionInfo ("Windows.UI.Xaml.Input", "System.Windows.Input", "ICommand", "System.ObjectModel") }, + { "IIterable`1", new ProjectionInfo ("Windows.Foundation.Collections", "System.Collections.Generic", "IEnumerable`1", "System.Runtime") }, + { "IKeyValuePair`2", new ProjectionInfo ("Windows.Foundation.Collections", "System.Collections.Generic", "KeyValuePair`2", "System.Runtime") }, + { "IMapView`2", new ProjectionInfo ("Windows.Foundation.Collections", "System.Collections.Generic", "IReadOnlyDictionary`2", "System.Runtime") }, + { "IMap`2", new ProjectionInfo ("Windows.Foundation.Collections", "System.Collections.Generic", "IDictionary`2", "System.Runtime") }, + { "INotifyCollectionChanged", new ProjectionInfo ("Windows.UI.Xaml.Interop", "System.Collections.Specialized", "INotifyCollectionChanged", "System.ObjectModel") }, + { "INotifyPropertyChanged", new ProjectionInfo ("Windows.UI.Xaml.Data", "System.ComponentModel", "INotifyPropertyChanged", "System.ObjectModel") }, + { "IReference`1", new ProjectionInfo ("Windows.Foundation", "System", "Nullable`1", "System.Runtime") }, + { "IVectorView`1", new ProjectionInfo ("Windows.Foundation.Collections", "System.Collections.Generic", "IReadOnlyList`1", "System.Runtime") }, + { "IVector`1", new ProjectionInfo ("Windows.Foundation.Collections", "System.Collections.Generic", "IList`1", "System.Runtime") }, + { "KeyTime", new ProjectionInfo ("Windows.UI.Xaml.Media.Animation", "Windows.UI.Xaml.Media.Animation", "KeyTime", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "Matrix", new ProjectionInfo ("Windows.UI.Xaml.Media", "Windows.UI.Xaml.Media", "Matrix", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "Matrix3D", new ProjectionInfo ("Windows.UI.Xaml.Media.Media3D", "Windows.UI.Xaml.Media.Media3D", "Matrix3D", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "Matrix3x2", new ProjectionInfo ("Windows.Foundation.Numerics", "System.Numerics", "Matrix3x2", "System.Numerics.Vectors") }, + { "Matrix4x4", new ProjectionInfo ("Windows.Foundation.Numerics", "System.Numerics", "Matrix4x4", "System.Numerics.Vectors") }, + { "NotifyCollectionChangedAction", new ProjectionInfo ("Windows.UI.Xaml.Interop", "System.Collections.Specialized", "NotifyCollectionChangedAction", "System.ObjectModel") }, + { "NotifyCollectionChangedEventArgs", new ProjectionInfo ("Windows.UI.Xaml.Interop", "System.Collections.Specialized", "NotifyCollectionChangedEventArgs", "System.ObjectModel") }, + { "NotifyCollectionChangedEventHandler", new ProjectionInfo ("Windows.UI.Xaml.Interop", "System.Collections.Specialized", "NotifyCollectionChangedEventHandler", "System.ObjectModel") }, + { "Plane", new ProjectionInfo ("Windows.Foundation.Numerics", "System.Numerics", "Plane", "System.Numerics.Vectors") }, + { "Point", new ProjectionInfo ("Windows.Foundation", "Windows.Foundation", "Point", "System.Runtime.WindowsRuntime") }, + { "PropertyChangedEventArgs", new ProjectionInfo ("Windows.UI.Xaml.Data", "System.ComponentModel", "PropertyChangedEventArgs", "System.ObjectModel") }, + { "PropertyChangedEventHandler", new ProjectionInfo ("Windows.UI.Xaml.Data", "System.ComponentModel", "PropertyChangedEventHandler", "System.ObjectModel") }, + { "Quaternion", new ProjectionInfo ("Windows.Foundation.Numerics", "System.Numerics", "Quaternion", "System.Numerics.Vectors") }, + { "Rect", new ProjectionInfo ("Windows.Foundation", "Windows.Foundation", "Rect", "System.Runtime.WindowsRuntime") }, + { "RepeatBehavior", new ProjectionInfo ("Windows.UI.Xaml.Media.Animation", "Windows.UI.Xaml.Media.Animation", "RepeatBehavior", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "RepeatBehaviorType", new ProjectionInfo ("Windows.UI.Xaml.Media.Animation", "Windows.UI.Xaml.Media.Animation", "RepeatBehaviorType", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "Size", new ProjectionInfo ("Windows.Foundation", "Windows.Foundation", "Size", "System.Runtime.WindowsRuntime") }, + { "Thickness", new ProjectionInfo ("Windows.UI.Xaml", "Windows.UI.Xaml", "Thickness", "System.Runtime.WindowsRuntime.UI.Xaml") }, + { "TimeSpan", new ProjectionInfo ("Windows.Foundation", "System", "TimeSpan", "System.Runtime") }, + { "TypeName", new ProjectionInfo ("Windows.UI.Xaml.Interop", "System", "Type", "System.Runtime") }, + { "Uri", new ProjectionInfo ("Windows.Foundation", "System", "Uri", "System.Runtime") }, + { "Vector2", new ProjectionInfo ("Windows.Foundation.Numerics", "System.Numerics", "Vector2", "System.Numerics.Vectors") }, + { "Vector3", new ProjectionInfo ("Windows.Foundation.Numerics", "System.Numerics", "Vector3", "System.Numerics.Vectors") }, + { "Vector4", new ProjectionInfo ("Windows.Foundation.Numerics", "System.Numerics", "Vector4", "System.Numerics.Vectors") }, + }; + + Interlocked.CompareExchange (ref projections, new_projections, null); + return projections; + } + } + + readonly ModuleDefinition module; + Version corlib_version = new Version (255, 255, 255, 255); + AssemblyNameReference [] virtual_references; + + AssemblyNameReference [] VirtualReferences { + get { + if (virtual_references == null) { + // force module to read its assembly references. that will in turn initialize virtual_references + Mixin.Read (module.AssemblyReferences); + } + + return virtual_references; + } + } + + public WindowsRuntimeProjections (ModuleDefinition module) + { + this.module = module; + } + + public static void Project (TypeDefinition type) + { + var treatment = TypeDefinitionTreatment.None; + var metadata_kind = type.Module.MetadataKind; + Collection redirectedMethods = null; + Collection> redirectedInterfaces = null; + + if (type.IsWindowsRuntime) { + if (metadata_kind == MetadataKind.WindowsMetadata) { + treatment = GetWellKnownTypeDefinitionTreatment (type); + if (treatment != TypeDefinitionTreatment.None) { + ApplyProjection (type, new TypeDefinitionProjection (type, treatment, redirectedMethods, redirectedInterfaces)); + return; + } + + var base_type = type.BaseType; + if (base_type != null && IsAttribute (base_type)) { + treatment = TypeDefinitionTreatment.NormalAttribute; + } else { + treatment = GenerateRedirectionInformation (type, out redirectedMethods, out redirectedInterfaces); + } + } else if (metadata_kind == MetadataKind.ManagedWindowsMetadata && NeedsWindowsRuntimePrefix (type)) + treatment = TypeDefinitionTreatment.PrefixWindowsRuntimeName; + + if (treatment == TypeDefinitionTreatment.PrefixWindowsRuntimeName || treatment == TypeDefinitionTreatment.NormalType) + if (!type.IsInterface && HasAttribute (type, "Windows.UI.Xaml", "TreatAsAbstractComposableClassAttribute")) + treatment |= TypeDefinitionTreatment.Abstract; + } else if (metadata_kind == MetadataKind.ManagedWindowsMetadata && IsClrImplementationType (type)) + treatment = TypeDefinitionTreatment.UnmangleWindowsRuntimeName; + + if (treatment != TypeDefinitionTreatment.None) + ApplyProjection (type, new TypeDefinitionProjection (type, treatment, redirectedMethods, redirectedInterfaces)); + } + + static TypeDefinitionTreatment GetWellKnownTypeDefinitionTreatment (TypeDefinition type) + { + ProjectionInfo info; + if (!Projections.TryGetValue (type.Name, out info)) + return TypeDefinitionTreatment.None; + + var treatment = info.Attribute ? TypeDefinitionTreatment.RedirectToClrAttribute : TypeDefinitionTreatment.RedirectToClrType; + + if (type.Namespace == info.ClrNamespace) + return treatment; + + if (type.Namespace == info.WinRTNamespace) + return treatment | TypeDefinitionTreatment.Internal; + + return TypeDefinitionTreatment.None; + } + + private static TypeDefinitionTreatment GenerateRedirectionInformation (TypeDefinition type, out Collection redirectedMethods, out Collection> redirectedInterfaces) + { + bool implementsProjectedInterface = false; + redirectedMethods = null; + redirectedInterfaces = null; + + foreach (var implementedInterface in type.Interfaces) { + if (IsRedirectedType (implementedInterface.InterfaceType)) { + implementsProjectedInterface = true; + break; + } + } + + if (!implementsProjectedInterface) + return TypeDefinitionTreatment.NormalType; + + var allImplementedInterfaces = new HashSet (new TypeReferenceEqualityComparer ()); + redirectedMethods = new Collection (); + redirectedInterfaces = new Collection> (); + + foreach (var @interface in type.Interfaces) { + var interfaceType = @interface.InterfaceType; + + if (IsRedirectedType (interfaceType)) { + allImplementedInterfaces.Add (interfaceType); + CollectImplementedInterfaces (interfaceType, allImplementedInterfaces); + } + } + + foreach (var implementedInterface in type.Interfaces) { + var interfaceType = implementedInterface.InterfaceType; + if (IsRedirectedType (implementedInterface.InterfaceType)) { + var etype = interfaceType.GetElementType (); + var unprojectedType = new TypeReference (etype.Namespace, etype.Name, etype.Module, etype.Scope) { + DeclaringType = etype.DeclaringType, + projection = etype.projection + }; + + RemoveProjection (unprojectedType); + + var genericInstanceType = interfaceType as GenericInstanceType; + if (genericInstanceType != null) { + var genericUnprojectedType = new GenericInstanceType (unprojectedType); + foreach (var genericArgument in genericInstanceType.GenericArguments) + genericUnprojectedType.GenericArguments.Add (genericArgument); + + unprojectedType = genericUnprojectedType; + } + + var unprojectedInterface = new InterfaceImplementation (unprojectedType); + redirectedInterfaces.Add (new KeyValuePair (implementedInterface, unprojectedInterface)); + } + } + + // Interfaces don't inherit methods of the interfaces they implement + if (!type.IsInterface) { + foreach (var implementedInterface in allImplementedInterfaces) { + RedirectInterfaceMethods (implementedInterface, redirectedMethods); + } + } + + return TypeDefinitionTreatment.RedirectImplementedMethods; + } + + private static void CollectImplementedInterfaces (TypeReference type, HashSet results) + { + var typeResolver = TypeResolver.For (type); + var typeDef = type.Resolve (); + + foreach (var implementedInterface in typeDef.Interfaces) { + var interfaceType = typeResolver.Resolve (implementedInterface.InterfaceType); + results.Add (interfaceType); + CollectImplementedInterfaces (interfaceType, results); + } + } + + private static void RedirectInterfaceMethods (TypeReference interfaceType, Collection redirectedMethods) + { + var typeResolver = TypeResolver.For (interfaceType); + var typeDef = interfaceType.Resolve (); + + foreach (var method in typeDef.Methods) { + var redirectedMethod = new MethodDefinition (method.Name, MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.Final | MethodAttributes.NewSlot, typeResolver.Resolve (method.ReturnType)); + redirectedMethod.ImplAttributes = MethodImplAttributes.Runtime; + + foreach (var parameter in method.Parameters) { + redirectedMethod.Parameters.Add (new ParameterDefinition (parameter.Name, parameter.Attributes, typeResolver.Resolve (parameter.ParameterType))); + } + + redirectedMethod.Overrides.Add (typeResolver.Resolve (method)); + redirectedMethods.Add (redirectedMethod); + } + } + + private static bool IsRedirectedType (TypeReference type) + { + var typeRefProjection = type.GetElementType ().projection as TypeReferenceProjection; + return typeRefProjection != null && typeRefProjection.Treatment == TypeReferenceTreatment.UseProjectionInfo; + } + + static bool NeedsWindowsRuntimePrefix (TypeDefinition type) + { + if ((type.Attributes & (TypeAttributes.VisibilityMask | TypeAttributes.Interface)) != TypeAttributes.Public) + return false; + + var base_type = type.BaseType; + if (base_type == null || base_type.MetadataToken.TokenType != TokenType.TypeRef) + return false; + + if (base_type.Namespace == "System") + switch (base_type.Name) { + case "Attribute": + case "MulticastDelegate": + case "ValueType": + return false; + } + + return true; + } + + public static bool IsClrImplementationType (TypeDefinition type) + { + if ((type.Attributes & (TypeAttributes.VisibilityMask | TypeAttributes.SpecialName)) != TypeAttributes.SpecialName) + return false; + return type.Name.StartsWith (""); + } + + public static void ApplyProjection (TypeDefinition type, TypeDefinitionProjection projection) + { + if (projection == null) + return; + + var treatment = projection.Treatment; + + switch (treatment & TypeDefinitionTreatment.KindMask) { + case TypeDefinitionTreatment.NormalType: + type.Attributes |= TypeAttributes.WindowsRuntime | TypeAttributes.Import; + break; + + case TypeDefinitionTreatment.NormalAttribute: + type.Attributes |= TypeAttributes.WindowsRuntime | TypeAttributes.Sealed; + break; + + case TypeDefinitionTreatment.UnmangleWindowsRuntimeName: + type.Attributes = type.Attributes & ~TypeAttributes.SpecialName | TypeAttributes.Public; + type.Name = type.Name.Substring ("".Length); + break; + + case TypeDefinitionTreatment.PrefixWindowsRuntimeName: + type.Attributes = type.Attributes & ~TypeAttributes.Public | TypeAttributes.Import; + type.Name = "" + type.Name; + break; + + case TypeDefinitionTreatment.RedirectToClrType: + type.Attributes = type.Attributes & ~TypeAttributes.Public | TypeAttributes.Import; + break; + + case TypeDefinitionTreatment.RedirectToClrAttribute: + type.Attributes = type.Attributes & ~TypeAttributes.Public; + break; + + case TypeDefinitionTreatment.RedirectImplementedMethods: { + type.Attributes |= TypeAttributes.WindowsRuntime | TypeAttributes.Import; + + foreach (var redirectedInterfacePair in projection.RedirectedInterfaces) { + type.Interfaces.Add (redirectedInterfacePair.Value); + + foreach (var customAttribute in redirectedInterfacePair.Key.CustomAttributes) + redirectedInterfacePair.Value.CustomAttributes.Add (customAttribute); + + redirectedInterfacePair.Key.CustomAttributes.Clear (); + + foreach (var method in type.Methods) { + foreach (var @override in method.Overrides) { + if (TypeReferenceEqualityComparer.AreEqual (@override.DeclaringType, redirectedInterfacePair.Key.InterfaceType)) { + @override.DeclaringType = redirectedInterfacePair.Value.InterfaceType; + } + } + } + } + + foreach (var method in projection.RedirectedMethods) { + type.Methods.Add (method); + } + } + break; + } + + if ((treatment & TypeDefinitionTreatment.Abstract) != 0) + type.Attributes |= TypeAttributes.Abstract; + + if ((treatment & TypeDefinitionTreatment.Internal) != 0) + type.Attributes &= ~TypeAttributes.Public; + + type.WindowsRuntimeProjection = projection; + } + + public static TypeDefinitionProjection RemoveProjection (TypeDefinition type) + { + if (!type.IsWindowsRuntimeProjection) + return null; + + var projection = type.WindowsRuntimeProjection; + type.WindowsRuntimeProjection = null; + + type.Attributes = projection.Attributes; + type.Name = projection.Name; + + if (projection.Treatment == TypeDefinitionTreatment.RedirectImplementedMethods) { + foreach (var method in projection.RedirectedMethods) { + type.Methods.Remove (method); + } + + foreach (var redirectedInterfacePair in projection.RedirectedInterfaces) { + foreach (var method in type.Methods) { + foreach (var @override in method.Overrides) { + if (TypeReferenceEqualityComparer.AreEqual (@override.DeclaringType, redirectedInterfacePair.Value.InterfaceType)) { + @override.DeclaringType = redirectedInterfacePair.Key.InterfaceType; + } + } + } + + foreach (var customAttribute in redirectedInterfacePair.Value.CustomAttributes) + redirectedInterfacePair.Key.CustomAttributes.Add (customAttribute); + + redirectedInterfacePair.Value.CustomAttributes.Clear (); + type.Interfaces.Remove (redirectedInterfacePair.Value); + } + } + + return projection; + } + + public static void Project (TypeReference type) + { + TypeReferenceTreatment treatment; + + ProjectionInfo info; + if (Projections.TryGetValue (type.Name, out info) && info.WinRTNamespace == type.Namespace) + treatment = TypeReferenceTreatment.UseProjectionInfo; + else + treatment = GetSpecialTypeReferenceTreatment (type); + + if (treatment != TypeReferenceTreatment.None) + ApplyProjection (type, new TypeReferenceProjection (type, treatment)); + } + + static TypeReferenceTreatment GetSpecialTypeReferenceTreatment (TypeReference type) + { + if (type.Namespace == "System") { + if (type.Name == "MulticastDelegate") + return TypeReferenceTreatment.SystemDelegate; + if (type.Name == "Attribute") + return TypeReferenceTreatment.SystemAttribute; + } + + return TypeReferenceTreatment.None; + } + + static bool IsAttribute (TypeReference type) + { + if (type.MetadataToken.TokenType != TokenType.TypeRef) + return false; + return type.Name == "Attribute" && type.Namespace == "System"; + } + + static bool IsEnum (TypeReference type) + { + if (type.MetadataToken.TokenType != TokenType.TypeRef) + return false; + return type.Name == "Enum" && type.Namespace == "System"; + } + + public static void ApplyProjection (TypeReference type, TypeReferenceProjection projection) + { + if (projection == null) + return; + + switch (projection.Treatment) { + case TypeReferenceTreatment.SystemDelegate: + case TypeReferenceTreatment.SystemAttribute: + type.Scope = type.Module.Projections.GetAssemblyReference ("System.Runtime"); + break; + + case TypeReferenceTreatment.UseProjectionInfo: + var info = Projections [type.Name]; + type.Name = info.ClrName; + type.Namespace = info.ClrNamespace; + type.Scope = type.Module.Projections.GetAssemblyReference (info.ClrAssembly); + break; + } + + type.WindowsRuntimeProjection = projection; + } + + public static TypeReferenceProjection RemoveProjection (TypeReference type) + { + if (!type.IsWindowsRuntimeProjection) + return null; + + var projection = type.WindowsRuntimeProjection; + type.WindowsRuntimeProjection = null; + + type.Name = projection.Name; + type.Namespace = projection.Namespace; + type.Scope = projection.Scope; + + return projection; + } + + public static void Project (MethodDefinition method) + { + var treatment = MethodDefinitionTreatment.None; + var other = false; + var declaring_type = method.DeclaringType; + + if (declaring_type.IsWindowsRuntime) { + if (IsClrImplementationType (declaring_type)) + treatment = MethodDefinitionTreatment.None; + else if (declaring_type.IsNested) + treatment = MethodDefinitionTreatment.None; + else if (declaring_type.IsInterface) + treatment = MethodDefinitionTreatment.Runtime | MethodDefinitionTreatment.InternalCall; + else if (declaring_type.Module.MetadataKind == MetadataKind.ManagedWindowsMetadata && !method.IsPublic) + treatment = MethodDefinitionTreatment.None; + else { + other = true; + + var base_type = declaring_type.BaseType; + if (base_type != null && base_type.MetadataToken.TokenType == TokenType.TypeRef) { + switch (GetSpecialTypeReferenceTreatment (base_type)) { + case TypeReferenceTreatment.SystemDelegate: + treatment = MethodDefinitionTreatment.Runtime | MethodDefinitionTreatment.Public; + other = false; + break; + + case TypeReferenceTreatment.SystemAttribute: + treatment = MethodDefinitionTreatment.Runtime | MethodDefinitionTreatment.InternalCall; + other = false; + break; + } + } + } + } + + if (other) { + var seen_redirected = false; + var seen_non_redirected = false; + + foreach (var @override in method.Overrides) { + if (@override.MetadataToken.TokenType == TokenType.MemberRef && ImplementsRedirectedInterface (@override)) { + seen_redirected = true; + } else { + seen_non_redirected = true; + } + } + + if (seen_redirected && !seen_non_redirected) { + treatment = MethodDefinitionTreatment.Runtime | MethodDefinitionTreatment.InternalCall | MethodDefinitionTreatment.Private; + other = false; + } + } + + if (other) + treatment |= GetMethodDefinitionTreatmentFromCustomAttributes (method); + + if (treatment != MethodDefinitionTreatment.None) + ApplyProjection (method, new MethodDefinitionProjection (method, treatment)); + } + + static MethodDefinitionTreatment GetMethodDefinitionTreatmentFromCustomAttributes (MethodDefinition method) + { + var treatment = MethodDefinitionTreatment.None; + + foreach (var attribute in method.CustomAttributes) { + var type = attribute.AttributeType; + if (type.Namespace != "Windows.UI.Xaml") + continue; + if (type.Name == "TreatAsPublicMethodAttribute") + treatment |= MethodDefinitionTreatment.Public; + else if (type.Name == "TreatAsAbstractMethodAttribute") + treatment |= MethodDefinitionTreatment.Abstract; + } + + return treatment; + } + + public static void ApplyProjection (MethodDefinition method, MethodDefinitionProjection projection) + { + if (projection == null) + return; + + var treatment = projection.Treatment; + + if ((treatment & MethodDefinitionTreatment.Abstract) != 0) + method.Attributes |= MethodAttributes.Abstract; + + if ((treatment & MethodDefinitionTreatment.Private) != 0) + method.Attributes = (method.Attributes & ~MethodAttributes.MemberAccessMask) | MethodAttributes.Private; + + if ((treatment & MethodDefinitionTreatment.Public) != 0) + method.Attributes = (method.Attributes & ~MethodAttributes.MemberAccessMask) | MethodAttributes.Public; + + if ((treatment & MethodDefinitionTreatment.Runtime) != 0) + method.ImplAttributes |= MethodImplAttributes.Runtime; + + if ((treatment & MethodDefinitionTreatment.InternalCall) != 0) + method.ImplAttributes |= MethodImplAttributes.InternalCall; + + method.WindowsRuntimeProjection = projection; + } + + public static MethodDefinitionProjection RemoveProjection (MethodDefinition method) + { + if (!method.IsWindowsRuntimeProjection) + return null; + + var projection = method.WindowsRuntimeProjection; + method.WindowsRuntimeProjection = null; + + method.Attributes = projection.Attributes; + method.ImplAttributes = projection.ImplAttributes; + method.Name = projection.Name; + + return projection; + } + + public static void Project (FieldDefinition field) + { + var treatment = FieldDefinitionTreatment.None; + var declaring_type = field.DeclaringType; + + if (declaring_type.Module.MetadataKind == MetadataKind.WindowsMetadata && field.IsRuntimeSpecialName && field.Name == "value__") { + var base_type = declaring_type.BaseType; + if (base_type != null && IsEnum (base_type)) + treatment = FieldDefinitionTreatment.Public; + } + + if (treatment != FieldDefinitionTreatment.None) + ApplyProjection (field, new FieldDefinitionProjection (field, treatment)); + } + + public static void ApplyProjection (FieldDefinition field, FieldDefinitionProjection projection) + { + if (projection == null) + return; + + if (projection.Treatment == FieldDefinitionTreatment.Public) + field.Attributes = (field.Attributes & ~FieldAttributes.FieldAccessMask) | FieldAttributes.Public; + + field.WindowsRuntimeProjection = projection; + } + + public static FieldDefinitionProjection RemoveProjection (FieldDefinition field) + { + if (!field.IsWindowsRuntimeProjection) + return null; + + var projection = field.WindowsRuntimeProjection; + field.WindowsRuntimeProjection = null; + + field.Attributes = projection.Attributes; + + return projection; + } + + static bool ImplementsRedirectedInterface (MemberReference member) + { + var declaring_type = member.DeclaringType; + TypeReference type; + switch (declaring_type.MetadataToken.TokenType) { + case TokenType.TypeRef: + type = declaring_type; + break; + + case TokenType.TypeSpec: + if (!declaring_type.IsGenericInstance) + return false; + + type = ((TypeSpecification)declaring_type).ElementType; + if (type.MetadataType != MetadataType.Class || type.MetadataToken.TokenType != TokenType.TypeRef) + return false; + + break; + + default: + return false; + } + + var projection = RemoveProjection (type); + + var found = false; + + ProjectionInfo info; + if (Projections.TryGetValue (type.Name, out info) && type.Namespace == info.WinRTNamespace) { + found = true; + } + + ApplyProjection (type, projection); + + return found; + } + + + public void AddVirtualReferences (Collection references) + { + var corlib = GetCoreLibrary (references); + corlib_version = corlib.Version; + corlib.Version = version; + + if (virtual_references == null) { + var winrt_references = GetAssemblyReferences (corlib); + Interlocked.CompareExchange (ref virtual_references, winrt_references, null); + } + + foreach (var reference in virtual_references) + references.Add (reference); + } + + public void RemoveVirtualReferences (Collection references) + { + var corlib = GetCoreLibrary (references); + corlib.Version = corlib_version; + + foreach (var reference in VirtualReferences) + references.Remove (reference); + } + + static AssemblyNameReference [] GetAssemblyReferences (AssemblyNameReference corlib) + { + var system_runtime = new AssemblyNameReference ("System.Runtime", version); + var system_runtime_interopservices_windowsruntime = new AssemblyNameReference ("System.Runtime.InteropServices.WindowsRuntime", version); + var system_objectmodel = new AssemblyNameReference ("System.ObjectModel", version); + var system_runtime_windowsruntime = new AssemblyNameReference ("System.Runtime.WindowsRuntime", version); + var system_runtime_windowsruntime_ui_xaml = new AssemblyNameReference ("System.Runtime.WindowsRuntime.UI.Xaml", version); + var system_numerics_vectors = new AssemblyNameReference ("System.Numerics.Vectors", version); + + if (corlib.HasPublicKey) { + system_runtime_windowsruntime.PublicKey = + system_runtime_windowsruntime_ui_xaml.PublicKey = corlib.PublicKey; + + system_runtime.PublicKey = + system_runtime_interopservices_windowsruntime.PublicKey = + system_objectmodel.PublicKey = + system_numerics_vectors.PublicKey = contract_pk; + } else { + system_runtime_windowsruntime.PublicKeyToken = + system_runtime_windowsruntime_ui_xaml.PublicKeyToken = corlib.PublicKeyToken; + + system_runtime.PublicKeyToken = + system_runtime_interopservices_windowsruntime.PublicKeyToken = + system_objectmodel.PublicKeyToken = + system_numerics_vectors.PublicKeyToken = contract_pk_token; + } + + return new [] { + system_runtime, + system_runtime_interopservices_windowsruntime, + system_objectmodel, + system_runtime_windowsruntime, + system_runtime_windowsruntime_ui_xaml, + system_numerics_vectors, + }; + } + + static AssemblyNameReference GetCoreLibrary (Collection references) + { + foreach (var reference in references) + if (reference.Name == "mscorlib") + return reference; + + throw new BadImageFormatException ("Missing mscorlib reference in AssemblyRef table."); + } + + AssemblyNameReference GetAssemblyReference (string name) + { + foreach (var assembly in VirtualReferences) + if (assembly.Name == name) + return assembly; + + throw new Exception (); + } + + public static void Project (ICustomAttributeProvider owner, CustomAttribute attribute) + { + if (!IsWindowsAttributeUsageAttribute (owner, attribute)) + return; + + var treatment = CustomAttributeValueTreatment.None; + var type = (TypeDefinition)owner; + + if (type.Namespace == "Windows.Foundation.Metadata") { + if (type.Name == "VersionAttribute") + treatment = CustomAttributeValueTreatment.VersionAttribute; + else if (type.Name == "DeprecatedAttribute") + treatment = CustomAttributeValueTreatment.DeprecatedAttribute; + } + + if (treatment == CustomAttributeValueTreatment.None) { + var multiple = HasAttribute (type, "Windows.Foundation.Metadata", "AllowMultipleAttribute"); + treatment = multiple ? CustomAttributeValueTreatment.AllowMultiple : CustomAttributeValueTreatment.AllowSingle; + } + + if (treatment != CustomAttributeValueTreatment.None) { + var attribute_targets = (AttributeTargets)attribute.ConstructorArguments [0].Value; + ApplyProjection (attribute, new CustomAttributeValueProjection (attribute_targets, treatment)); + } + } + + static bool IsWindowsAttributeUsageAttribute (ICustomAttributeProvider owner, CustomAttribute attribute) + { + if (owner.MetadataToken.TokenType != TokenType.TypeDef) + return false; + + var constructor = attribute.Constructor; + + if (constructor.MetadataToken.TokenType != TokenType.MemberRef) + return false; + + var declaring_type = constructor.DeclaringType; + + if (declaring_type.MetadataToken.TokenType != TokenType.TypeRef) + return false; + + // declaring type is already projected + return declaring_type.Name == "AttributeUsageAttribute" && declaring_type.Namespace == /*"Windows.Foundation.Metadata"*/"System"; + } + + static bool HasAttribute (TypeDefinition type, string @namespace, string name) + { + foreach (var attribute in type.CustomAttributes) { + var attribute_type = attribute.AttributeType; + if (attribute_type.Name == name && attribute_type.Namespace == @namespace) + return true; + } + return false; + } + + public static void ApplyProjection (CustomAttribute attribute, CustomAttributeValueProjection projection) + { + if (projection == null) + return; + + bool version_or_deprecated; + bool multiple; + + switch (projection.Treatment) { + case CustomAttributeValueTreatment.AllowSingle: + version_or_deprecated = false; + multiple = false; + break; + + case CustomAttributeValueTreatment.AllowMultiple: + version_or_deprecated = false; + multiple = true; + break; + + case CustomAttributeValueTreatment.VersionAttribute: + case CustomAttributeValueTreatment.DeprecatedAttribute: + version_or_deprecated = true; + multiple = true; + break; + + default: + throw new ArgumentException (); + } + + var attribute_targets = (AttributeTargets)attribute.ConstructorArguments [0].Value; + if (version_or_deprecated) + attribute_targets |= AttributeTargets.Constructor | AttributeTargets.Property; + attribute.ConstructorArguments [0] = new CustomAttributeArgument (attribute.ConstructorArguments [0].Type, attribute_targets); + + attribute.Properties.Add (new CustomAttributeNamedArgument ("AllowMultiple", new CustomAttributeArgument (attribute.Module.TypeSystem.Boolean, multiple))); + + attribute.projection = projection; + } + + public static CustomAttributeValueProjection RemoveProjection (CustomAttribute attribute) + { + if (attribute.projection == null) + return null; + + var projection = attribute.projection; + attribute.projection = null; + + attribute.ConstructorArguments [0] = new CustomAttributeArgument (attribute.ConstructorArguments [0].Type, projection.Targets); + attribute.Properties.Clear (); + + return projection; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/WindowsRuntimeProjections.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/WindowsRuntimeProjections.cs.meta new file mode 100644 index 0000000..c747763 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Cecil/WindowsRuntimeProjections.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4816f370ee0b9f64ca793643ba5481ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic.meta new file mode 100644 index 0000000..57e75c2 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 465b9dfce90e5db47b3b735df83f25fd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/Collection.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/Collection.cs new file mode 100644 index 0000000..0c5caf2 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/Collection.cs @@ -0,0 +1,427 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil; +using System; +using System.Collections; +using System.Collections.Generic; + +namespace MonoFN.Collections.Generic { + + public class Collection : IList, IList { + + internal T [] items; + internal int size; + int version; + + public int Count { + get { return size; } + } + + public T this [int index] { + get { + if (index >= size) + throw new ArgumentOutOfRangeException (); + + return items [index]; + } + set { + CheckIndex (index); + if (index == size) + throw new ArgumentOutOfRangeException (); + + OnSet (value, index); + + items [index] = value; + } + } + + public int Capacity { + get { return items.Length; } + set { + if (value < 0 || value < size) + throw new ArgumentOutOfRangeException (); + + Resize (value); + } + } + + bool ICollection.IsReadOnly { + get { return false; } + } + + bool IList.IsFixedSize { + get { return false; } + } + + bool IList.IsReadOnly { + get { return false; } + } + + object IList.this [int index] { + get { return this [index]; } + set { + CheckIndex (index); + + try { + this [index] = (T)value; + return; + } + catch (InvalidCastException) { + } + catch (NullReferenceException) { + } + + throw new ArgumentException (); + } + } + + int ICollection.Count { + get { return Count; } + } + + bool ICollection.IsSynchronized { + get { return false; } + } + + object ICollection.SyncRoot { + get { return this; } + } + + public Collection () + { + items = Empty.Array; + } + + public Collection (int capacity) + { + if (capacity < 0) + throw new ArgumentOutOfRangeException (); + + items = capacity == 0 + ? Empty.Array + : new T [capacity]; + } + + public Collection (ICollection items) + { + if (items == null) + throw new ArgumentNullException ("items"); + + this.items = new T [items.Count]; + items.CopyTo (this.items, 0); + this.size = this.items.Length; + } + + public void Add (T item) + { + if (size == items.Length) + Grow (1); + + OnAdd (item, size); + + items [size++] = item; + version++; + } + + public bool Contains (T item) + { + return IndexOf (item) != -1; + } + + public int IndexOf (T item) + { + return Array.IndexOf (items, item, 0, size); + } + + public void Insert (int index, T item) + { + CheckIndex (index); + if (size == items.Length) + Grow (1); + + OnInsert (item, index); + + Shift (index, 1); + items [index] = item; + version++; + } + + public void RemoveAt (int index) + { + if (index < 0 || index >= size) + throw new ArgumentOutOfRangeException (); + + var item = items [index]; + + OnRemove (item, index); + + Shift (index, -1); + version++; + } + + public bool Remove (T item) + { + var index = IndexOf (item); + if (index == -1) + return false; + + OnRemove (item, index); + + Shift (index, -1); + version++; + + return true; + } + + public void Clear () + { + OnClear (); + + Array.Clear (items, 0, size); + size = 0; + version++; + } + + public void CopyTo (T [] array, int arrayIndex) + { + Array.Copy (items, 0, array, arrayIndex, size); + } + + public T [] ToArray () + { + var array = new T [size]; + Array.Copy (items, 0, array, 0, size); + return array; + } + + void CheckIndex (int index) + { + if (index < 0 || index > size) + throw new ArgumentOutOfRangeException (); + } + + void Shift (int start, int delta) + { + if (delta < 0) + start -= delta; + + if (start < size) + Array.Copy (items, start, items, start + delta, size - start); + + size += delta; + + if (delta < 0) + Array.Clear (items, size, -delta); + } + + protected virtual void OnAdd (T item, int index) + { + } + + protected virtual void OnInsert (T item, int index) + { + } + + protected virtual void OnSet (T item, int index) + { + } + + protected virtual void OnRemove (T item, int index) + { + } + + protected virtual void OnClear () + { + } + + internal virtual void Grow (int desired) + { + int new_size = size + desired; + if (new_size <= items.Length) + return; + + const int default_capacity = 4; + + new_size = System.Math.Max ( + System.Math.Max (items.Length * 2, default_capacity), + new_size); + + Resize (new_size); + } + + protected void Resize (int new_size) + { + if (new_size == size) + return; + if (new_size < size) + throw new ArgumentOutOfRangeException (); + + items = items.Resize (new_size); + } + + int IList.Add (object value) + { + try { + Add ((T)value); + return size - 1; + } + catch (InvalidCastException) { + } + catch (NullReferenceException) { + } + + throw new ArgumentException (); + } + + void IList.Clear () + { + Clear (); + } + + bool IList.Contains (object value) + { + return ((IList)this).IndexOf (value) > -1; + } + + int IList.IndexOf (object value) + { + try { + return IndexOf ((T)value); + } + catch (InvalidCastException) { + } + catch (NullReferenceException) { + } + + return -1; + } + + void IList.Insert (int index, object value) + { + CheckIndex (index); + + try { + Insert (index, (T)value); + return; + } + catch (InvalidCastException) { + } + catch (NullReferenceException) { + } + + throw new ArgumentException (); + } + + void IList.Remove (object value) + { + try { + Remove ((T)value); + } + catch (InvalidCastException) { + } + catch (NullReferenceException) { + } + } + + void IList.RemoveAt (int index) + { + RemoveAt (index); + } + + void ICollection.CopyTo (Array array, int index) + { + Array.Copy (items, 0, array, index, size); + } + + public Enumerator GetEnumerator () + { + return new Enumerator (this); + } + + IEnumerator IEnumerable.GetEnumerator () + { + return new Enumerator (this); + } + + IEnumerator IEnumerable.GetEnumerator () + { + return new Enumerator (this); + } + + public struct Enumerator : IEnumerator, IDisposable { + + Collection collection; + T current; + + int next; + readonly int version; + + public T Current { + get { return current; } + } + + object IEnumerator.Current { + get { + CheckState (); + + if (next <= 0) + throw new InvalidOperationException (); + + return current; + } + } + + internal Enumerator (Collection collection) + : this () + { + this.collection = collection; + this.version = collection.version; + } + + public bool MoveNext () + { + CheckState (); + + if (next < 0) + return false; + + if (next < collection.size) { + current = collection.items [next++]; + return true; + } + + next = -1; + return false; + } + + public void Reset () + { + CheckState (); + + next = 0; + } + + void CheckState () + { + if (collection == null) + throw new ObjectDisposedException (GetType ().FullName); + + if (version != collection.version) + throw new InvalidOperationException (); + } + + public void Dispose () + { + collection = null; + } + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/Collection.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/Collection.cs.meta new file mode 100644 index 0000000..01bd872 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/Collection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d1f0d8a176addda42a579d710c12a7ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/ReadOnlyCollection.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/ReadOnlyCollection.cs new file mode 100644 index 0000000..736f1c0 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/ReadOnlyCollection.cs @@ -0,0 +1,101 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Threading; + +namespace MonoFN.Collections.Generic { + + public sealed class ReadOnlyCollection : Collection, ICollection, IList { + + static ReadOnlyCollection empty; + + public static ReadOnlyCollection Empty { + get { + if (empty != null) + return empty; + + Interlocked.CompareExchange (ref empty, new ReadOnlyCollection (), null); + return empty; + } + } + + bool ICollection.IsReadOnly { + get { return true; } + } + + bool IList.IsFixedSize { + get { return true; } + } + + bool IList.IsReadOnly { + get { return true; } + } + + ReadOnlyCollection () + { + } + + public ReadOnlyCollection (T [] array) + { + if (array == null) + throw new ArgumentNullException (); + + Initialize (array, array.Length); + } + + public ReadOnlyCollection (Collection collection) + { + if (collection == null) + throw new ArgumentNullException (); + + Initialize (collection.items, collection.size); + } + + void Initialize (T [] items, int size) + { + this.items = new T [size]; + Array.Copy (items, 0, this.items, 0, size); + this.size = size; + } + + internal override void Grow (int desired) + { + throw new InvalidOperationException (); + } + + protected override void OnAdd (T item, int index) + { + throw new InvalidOperationException (); + } + + protected override void OnClear () + { + throw new InvalidOperationException (); + } + + protected override void OnInsert (T item, int index) + { + throw new InvalidOperationException (); + } + + protected override void OnRemove (T item, int index) + { + throw new InvalidOperationException (); + } + + protected override void OnSet (T item, int index) + { + throw new InvalidOperationException (); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/ReadOnlyCollection.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/ReadOnlyCollection.cs.meta new file mode 100644 index 0000000..a89c654 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Collections.Generic/ReadOnlyCollection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d94cb0938831f1349b60e63292a04b67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography.meta new file mode 100644 index 0000000..dd61b11 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 300d5aad29f8cf04c8a1a3f0dfa3e014 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoConvert.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoConvert.cs new file mode 100644 index 0000000..c6eacee --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoConvert.cs @@ -0,0 +1,290 @@ +// +// CryptoConvert.cs - Crypto Convertion Routines +// +// Author: +// Sebastien Pouliot +// +// (C) 2003 Motus Technologies Inc. (http://www.motus.com) +// Copyright (C) 2004-2006 Novell Inc. (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Security.Cryptography; + +namespace MonoFN.Security.Cryptography { + + static class CryptoConvert { + + static private int ToInt32LE (byte [] bytes, int offset) + { + return (bytes [offset + 3] << 24) | (bytes [offset + 2] << 16) | (bytes [offset + 1] << 8) | bytes [offset]; + } + + static private uint ToUInt32LE (byte [] bytes, int offset) + { + return (uint)((bytes [offset + 3] << 24) | (bytes [offset + 2] << 16) | (bytes [offset + 1] << 8) | bytes [offset]); + } + + static private byte [] GetBytesLE (int val) + { + return new byte [] { + (byte) (val & 0xff), + (byte) ((val >> 8) & 0xff), + (byte) ((val >> 16) & 0xff), + (byte) ((val >> 24) & 0xff) + }; + } + + static private byte [] Trim (byte [] array) + { + for (int i = 0; i < array.Length; i++) { + if (array [i] != 0x00) { + byte [] result = new byte [array.Length - i]; + Buffer.BlockCopy (array, i, result, 0, result.Length); + return result; + } + } + return null; + } + + static RSA FromCapiPrivateKeyBlob (byte [] blob, int offset) + { + RSAParameters rsap = new RSAParameters (); + try { + if ((blob [offset] != 0x07) || // PRIVATEKEYBLOB (0x07) + (blob [offset + 1] != 0x02) || // Version (0x02) + (blob [offset + 2] != 0x00) || // Reserved (word) + (blob [offset + 3] != 0x00) || + (ToUInt32LE (blob, offset + 8) != 0x32415352)) // DWORD magic = RSA2 + throw new CryptographicException ("Invalid blob header"); + + // ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...) + // int algId = ToInt32LE (blob, offset+4); + + // DWORD bitlen + int bitLen = ToInt32LE (blob, offset + 12); + + // DWORD public exponent + byte [] exp = new byte [4]; + Buffer.BlockCopy (blob, offset + 16, exp, 0, 4); + Array.Reverse (exp); + rsap.Exponent = Trim (exp); + + int pos = offset + 20; + // BYTE modulus[rsapubkey.bitlen/8]; + int byteLen = (bitLen >> 3); + rsap.Modulus = new byte [byteLen]; + Buffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen); + Array.Reverse (rsap.Modulus); + pos += byteLen; + + // BYTE prime1[rsapubkey.bitlen/16]; + int byteHalfLen = (byteLen >> 1); + rsap.P = new byte [byteHalfLen]; + Buffer.BlockCopy (blob, pos, rsap.P, 0, byteHalfLen); + Array.Reverse (rsap.P); + pos += byteHalfLen; + + // BYTE prime2[rsapubkey.bitlen/16]; + rsap.Q = new byte [byteHalfLen]; + Buffer.BlockCopy (blob, pos, rsap.Q, 0, byteHalfLen); + Array.Reverse (rsap.Q); + pos += byteHalfLen; + + // BYTE exponent1[rsapubkey.bitlen/16]; + rsap.DP = new byte [byteHalfLen]; + Buffer.BlockCopy (blob, pos, rsap.DP, 0, byteHalfLen); + Array.Reverse (rsap.DP); + pos += byteHalfLen; + + // BYTE exponent2[rsapubkey.bitlen/16]; + rsap.DQ = new byte [byteHalfLen]; + Buffer.BlockCopy (blob, pos, rsap.DQ, 0, byteHalfLen); + Array.Reverse (rsap.DQ); + pos += byteHalfLen; + + // BYTE coefficient[rsapubkey.bitlen/16]; + rsap.InverseQ = new byte [byteHalfLen]; + Buffer.BlockCopy (blob, pos, rsap.InverseQ, 0, byteHalfLen); + Array.Reverse (rsap.InverseQ); + pos += byteHalfLen; + + // ok, this is hackish but CryptoAPI support it so... + // note: only works because CRT is used by default + // http://bugzilla.ximian.com/show_bug.cgi?id=57941 + rsap.D = new byte [byteLen]; // must be allocated + if (pos + byteLen + offset <= blob.Length) { + // BYTE privateExponent[rsapubkey.bitlen/8]; + Buffer.BlockCopy (blob, pos, rsap.D, 0, byteLen); + Array.Reverse (rsap.D); + } + } + catch (Exception e) { + throw new CryptographicException ("Invalid blob.", e); + } + + RSA rsa = null; + try { + rsa = RSA.Create (); + rsa.ImportParameters (rsap); + } + catch (CryptographicException) { + // this may cause problem when this code is run under + // the SYSTEM identity on Windows (e.g. ASP.NET). See + // http://bugzilla.ximian.com/show_bug.cgi?id=77559 + bool throws = false; + try { + CspParameters csp = new CspParameters (); + csp.Flags = CspProviderFlags.UseMachineKeyStore; + rsa = new RSACryptoServiceProvider (csp); + rsa.ImportParameters (rsap); + } + catch { + throws = true; + } + + if (throws) { + // rethrow original, not the latter, exception if this fails + throw; + } + } + return rsa; + } + + static RSA FromCapiPublicKeyBlob (byte [] blob, int offset) + { + try { + if ((blob [offset] != 0x06) || // PUBLICKEYBLOB (0x06) + (blob [offset + 1] != 0x02) || // Version (0x02) + (blob [offset + 2] != 0x00) || // Reserved (word) + (blob [offset + 3] != 0x00) || + (ToUInt32LE (blob, offset + 8) != 0x31415352)) // DWORD magic = RSA1 + throw new CryptographicException ("Invalid blob header"); + + // ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...) + // int algId = ToInt32LE (blob, offset+4); + + // DWORD bitlen + int bitLen = ToInt32LE (blob, offset + 12); + + // DWORD public exponent + RSAParameters rsap = new RSAParameters (); + rsap.Exponent = new byte [3]; + rsap.Exponent [0] = blob [offset + 18]; + rsap.Exponent [1] = blob [offset + 17]; + rsap.Exponent [2] = blob [offset + 16]; + + int pos = offset + 20; + // BYTE modulus[rsapubkey.bitlen/8]; + int byteLen = (bitLen >> 3); + rsap.Modulus = new byte [byteLen]; + Buffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen); + Array.Reverse (rsap.Modulus); + + RSA rsa = null; + try { + rsa = RSA.Create (); + rsa.ImportParameters (rsap); + } + catch (CryptographicException) { + // this may cause problem when this code is run under + // the SYSTEM identity on Windows (e.g. ASP.NET). See + // http://bugzilla.ximian.com/show_bug.cgi?id=77559 + CspParameters csp = new CspParameters (); + csp.Flags = CspProviderFlags.UseMachineKeyStore; + rsa = new RSACryptoServiceProvider (csp); + rsa.ImportParameters (rsap); + } + return rsa; + } + catch (Exception e) { + throw new CryptographicException ("Invalid blob.", e); + } + } + + // PRIVATEKEYBLOB + // PUBLICKEYBLOB + static public RSA FromCapiKeyBlob (byte [] blob) + { + return FromCapiKeyBlob (blob, 0); + } + + static public RSA FromCapiKeyBlob (byte [] blob, int offset) + { + if (blob == null) + throw new ArgumentNullException ("blob"); + if (offset >= blob.Length) + throw new ArgumentException ("blob is too small."); + + switch (blob [offset]) { + case 0x00: + // this could be a public key inside an header + // like "sn -e" would produce + if (blob [offset + 12] == 0x06) { + return FromCapiPublicKeyBlob (blob, offset + 12); + } + break; + case 0x06: + return FromCapiPublicKeyBlob (blob, offset); + case 0x07: + return FromCapiPrivateKeyBlob (blob, offset); + } + throw new CryptographicException ("Unknown blob format."); + } + + static public byte [] ToCapiPublicKeyBlob (RSA rsa) + { + RSAParameters p = rsa.ExportParameters (false); + int keyLength = p.Modulus.Length; // in bytes + byte [] blob = new byte [20 + keyLength]; + + blob [0] = 0x06; // Type - PUBLICKEYBLOB (0x06) + blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02) + // [2], [3] // RESERVED - Always 0 + blob [5] = 0x24; // ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN) + blob [8] = 0x52; // Magic - RSA1 (ASCII in hex) + blob [9] = 0x53; + blob [10] = 0x41; + blob [11] = 0x31; + + byte [] bitlen = GetBytesLE (keyLength << 3); + blob [12] = bitlen [0]; // bitlen + blob [13] = bitlen [1]; + blob [14] = bitlen [2]; + blob [15] = bitlen [3]; + + // public exponent (DWORD) + int pos = 16; + int n = p.Exponent.Length; + while (n > 0) + blob [pos++] = p.Exponent [--n]; + // modulus + pos = 20; + byte [] part = p.Modulus; + int len = part.Length; + Array.Reverse (part, 0, len); + Buffer.BlockCopy (part, 0, blob, pos, len); + pos += len; + return blob; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoConvert.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoConvert.cs.meta new file mode 100644 index 0000000..ba086fa --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoConvert.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 40b945bb6ba518c4b8ce54b5e54a06b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoService.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoService.cs new file mode 100644 index 0000000..5582b17 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoService.cs @@ -0,0 +1,202 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.PE; +using MonoFN.Security.Cryptography; +using System; +using System.IO; +using System.Reflection; +using System.Runtime.Serialization; +using System.Security.Cryptography; + +namespace MonoFN.Cecil { + + // Most of this code has been adapted + // from Jeroen Frijters' fantastic work + // in IKVM.Reflection.Emit. Thanks! + + static class CryptoService { + + public static byte [] GetPublicKey (WriterParameters parameters) + { + using (var rsa = parameters.CreateRSA ()) { + var cspBlob = CryptoConvert.ToCapiPublicKeyBlob (rsa); + var publicKey = new byte [12 + cspBlob.Length]; + Buffer.BlockCopy (cspBlob, 0, publicKey, 12, cspBlob.Length); + // The first 12 bytes are documented at: + // http://msdn.microsoft.com/library/en-us/cprefadd/html/grfungethashfromfile.asp + // ALG_ID - Signature + publicKey [1] = 36; + // ALG_ID - Hash + publicKey [4] = 4; + publicKey [5] = 128; + // Length of Public Key (in bytes) + publicKey [8] = (byte)(cspBlob.Length >> 0); + publicKey [9] = (byte)(cspBlob.Length >> 8); + publicKey [10] = (byte)(cspBlob.Length >> 16); + publicKey [11] = (byte)(cspBlob.Length >> 24); + return publicKey; + } + } + + public static void StrongName (Stream stream, ImageWriter writer, WriterParameters parameters) + { + int strong_name_pointer; + + var strong_name = CreateStrongName (parameters, HashStream (stream, writer, out strong_name_pointer)); + PatchStrongName (stream, strong_name_pointer, strong_name); + } + + static void PatchStrongName (Stream stream, int strong_name_pointer, byte [] strong_name) + { + stream.Seek (strong_name_pointer, SeekOrigin.Begin); + stream.Write (strong_name, 0, strong_name.Length); + } + + static byte [] CreateStrongName (WriterParameters parameters, byte [] hash) + { + const string hash_algo = "SHA1"; + + using (var rsa = parameters.CreateRSA ()) { + var formatter = new RSAPKCS1SignatureFormatter (rsa); + formatter.SetHashAlgorithm (hash_algo); + + byte [] signature = formatter.CreateSignature (hash); + Array.Reverse (signature); + + return signature; + } + } + + static byte [] HashStream (Stream stream, ImageWriter writer, out int strong_name_pointer) + { + const int buffer_size = 8192; + + var text = writer.text; + var header_size = (int)writer.GetHeaderSize (); + var text_section_pointer = (int)text.PointerToRawData; + var strong_name_directory = writer.GetStrongNameSignatureDirectory (); + + if (strong_name_directory.Size == 0) + throw new InvalidOperationException (); + + strong_name_pointer = (int)(text_section_pointer + + (strong_name_directory.VirtualAddress - text.VirtualAddress)); + var strong_name_length = (int)strong_name_directory.Size; + + var sha1 = new SHA1Managed (); + var buffer = new byte [buffer_size]; + using (var crypto_stream = new CryptoStream (Stream.Null, sha1, CryptoStreamMode.Write)) { + stream.Seek (0, SeekOrigin.Begin); + CopyStreamChunk (stream, crypto_stream, buffer, header_size); + + stream.Seek (text_section_pointer, SeekOrigin.Begin); + CopyStreamChunk (stream, crypto_stream, buffer, (int)strong_name_pointer - text_section_pointer); + + stream.Seek (strong_name_length, SeekOrigin.Current); + CopyStreamChunk (stream, crypto_stream, buffer, (int)(stream.Length - (strong_name_pointer + strong_name_length))); + } + + return sha1.Hash; + } + + static void CopyStreamChunk (Stream stream, Stream dest_stream, byte [] buffer, int length) + { + while (length > 0) { + int read = stream.Read (buffer, 0, System.Math.Min (buffer.Length, length)); + dest_stream.Write (buffer, 0, read); + length -= read; + } + } + + public static byte [] ComputeHash (string file) + { + if (!File.Exists (file)) + return Empty.Array; + + using (var stream = new FileStream (file, FileMode.Open, FileAccess.Read, FileShare.Read)) + return ComputeHash (stream); + } + + public static byte [] ComputeHash (Stream stream) + { + const int buffer_size = 8192; + + var sha1 = new SHA1Managed (); + var buffer = new byte [buffer_size]; + + using (var crypto_stream = new CryptoStream (Stream.Null, sha1, CryptoStreamMode.Write)) + CopyStreamChunk (stream, crypto_stream, buffer, (int)stream.Length); + + return sha1.Hash; + } + + public static byte [] ComputeHash (params ByteBuffer [] buffers) + { + var sha1 = new SHA1Managed (); + + using (var crypto_stream = new CryptoStream (Stream.Null, sha1, CryptoStreamMode.Write)) { + for (int i = 0; i < buffers.Length; i++) { + crypto_stream.Write (buffers [i].buffer, 0, buffers [i].length); + } + } + + return sha1.Hash; + } + + public static Guid ComputeGuid (byte [] hash) + { + // From corefx/src/System.Reflection.Metadata/src/System/Reflection/Metadata/BlobContentId.cs + var guid = new byte [16]; + Buffer.BlockCopy (hash, 0, guid, 0, 16); + + // modify the guid data so it decodes to the form of a "random" guid ala rfc4122 + guid [7] = (byte)((guid [7] & 0x0f) | (4 << 4)); + guid [8] = (byte)((guid [8] & 0x3f) | (2 << 6)); + + return new Guid (guid); + } + } + + static partial class Mixin { + + public static RSA CreateRSA (this WriterParameters writer_parameters) + { + byte [] key; + string key_container; + + if (writer_parameters.StrongNameKeyBlob != null) + return CryptoConvert.FromCapiKeyBlob (writer_parameters.StrongNameKeyBlob); + + if (writer_parameters.StrongNameKeyContainer != null) + key_container = writer_parameters.StrongNameKeyContainer; + else if (!TryGetKeyContainer (writer_parameters.StrongNameKeyPair, out key, out key_container)) + return CryptoConvert.FromCapiKeyBlob (key); + + var parameters = new CspParameters { + Flags = CspProviderFlags.UseMachineKeyStore, + KeyContainerName = key_container, + KeyNumber = 2, + }; + + return new RSACryptoServiceProvider (parameters); + } + + static bool TryGetKeyContainer (ISerializable key_pair, out byte [] key, out string key_container) + { + var info = new SerializationInfo (typeof (StrongNameKeyPair), new FormatterConverter ()); + key_pair.GetObjectData (info, new StreamingContext ()); + + key = (byte [])info.GetValue ("_keyPairArray", typeof (byte [])); + key_container = info.GetString ("_keyPairContainer"); + return key_container != null; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoService.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoService.cs.meta new file mode 100644 index 0000000..13f5dd0 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.Security.Cryptography/CryptoService.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c49085888b0afc047af3a03b536acdc2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.meta new file mode 100644 index 0000000..7cfba3f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54d61064c2612804c9547e313fb726f0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Disposable.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Disposable.cs new file mode 100644 index 0000000..37c3e93 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Disposable.cs @@ -0,0 +1,45 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN { + + static class Disposable { + + public static Disposable Owned (T value) where T : class, IDisposable + { + return new Disposable (value, owned: true); + } + + public static Disposable NotOwned (T value) where T : class, IDisposable + { + return new Disposable (value, owned: false); + } + } + + struct Disposable : IDisposable where T : class, IDisposable { + + internal readonly T value; + readonly bool owned; + + public Disposable (T value, bool owned) + { + this.value = value; + this.owned = owned; + } + + public void Dispose () + { + if (value != null && owned) + value.Dispose (); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Disposable.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Disposable.cs.meta new file mode 100644 index 0000000..03c0571 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Disposable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1aa8d86dc5c9323419e8b535d582fccf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Empty.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Empty.cs new file mode 100644 index 0000000..63a91e3 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Empty.cs @@ -0,0 +1,62 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Collections.Generic; +using System; + +namespace MonoFN { + + static class Empty { + + public static readonly T [] Array = new T [0]; + } + + class ArgumentNullOrEmptyException : ArgumentException { + + public ArgumentNullOrEmptyException (string paramName) + : base ("Argument null or empty", paramName) + { + } + } +} + +namespace MonoFN.Cecil { + + static partial class Mixin { + + public static bool IsNullOrEmpty (this T [] self) + { + return self == null || self.Length == 0; + } + + public static bool IsNullOrEmpty (this Collection self) + { + return self == null || self.size == 0; + } + + public static T [] Resize (this T [] self, int length) + { + Array.Resize (ref self, length); + return self; + } + + public static T [] Add (this T [] self, T item) + { + if (self == null) { + self = new [] { item }; + return self; + } + + self = self.Resize (self.Length + 1); + self [self.Length - 1] = item; + return self; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Empty.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Empty.cs.meta new file mode 100644 index 0000000..76bd34a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/Empty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4662c38d1a951c24b89aeae3390acd39 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/MergeSort.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/MergeSort.cs new file mode 100644 index 0000000..4fde695 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/MergeSort.cs @@ -0,0 +1,66 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; +using System.Collections.Generic; + +namespace MonoFN { + + class MergeSort { + private readonly T [] elements; + private readonly T [] buffer; + private readonly IComparer comparer; + + private MergeSort (T [] elements, IComparer comparer) + { + this.elements = elements; + this.buffer = new T [elements.Length]; + Array.Copy (this.elements, this.buffer, elements.Length); + this.comparer = comparer; + } + + public static void Sort (T [] source, IComparer comparer) + { + Sort (source, 0, source.Length, comparer); + } + + public static void Sort (T [] source, int start, int length, IComparer comparer) + { + new MergeSort (source, comparer).Sort (start, length); + } + + private void Sort (int start, int length) + { + TopDownSplitMerge (this.buffer, this.elements, start, length); + } + + private void TopDownSplitMerge (T [] a, T [] b, int start, int end) + { + if (end - start < 2) + return; + + int middle = (end + start) / 2; + TopDownSplitMerge (b, a, start, middle); + TopDownSplitMerge (b, a, middle, end); + TopDownMerge (a, b, start, middle, end); + } + + private void TopDownMerge (T [] a, T [] b, int start, int middle, int end) + { + for (int i = start, j = middle, k = start; k < end; k++) { + if (i < middle && (j >= end || comparer.Compare (a [i], a [j]) <= 0)) { + b [k] = a [i++]; + } else { + b [k] = a [j++]; + } + } + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/MergeSort.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/MergeSort.cs.meta new file mode 100644 index 0000000..5e6a613 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/Mono/MergeSort.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c35ecf3bff670b4c8b367ed632eee37 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/MonoFN.Cecil.asmdef b/Assets/FishNet/CodeGenerating/cecil-0.11.4/MonoFN.Cecil.asmdef new file mode 100644 index 0000000..c52c300 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/MonoFN.Cecil.asmdef @@ -0,0 +1,15 @@ +{ + "name": "FishNet.Codegen.Cecil", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": true, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/MonoFN.Cecil.asmdef.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/MonoFN.Cecil.asmdef.meta new file mode 100644 index 0000000..b5ca406 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/MonoFN.Cecil.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 23311a592bb0c5640b641143d87bf5b7 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/ProjectInfo.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/ProjectInfo.cs new file mode 100644 index 0000000..2bfa196 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/ProjectInfo.cs @@ -0,0 +1,21 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil; +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyProduct (Consts.AssemblyName)] +[assembly: AssemblyCopyright ("Copyright © 2008 - 2018 Jb Evain")] + +[assembly: ComVisible (false)] + +[assembly: AssemblyVersion ("0.11.4.0")] +[assembly: AssemblyFileVersion ("0.11.4.0")] +[assembly: AssemblyInformationalVersion ("0.11.4.0")] diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/ProjectInfo.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/ProjectInfo.cs.meta new file mode 100644 index 0000000..8fac323 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/ProjectInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 468fd5ab13cb01b4381e9c667167b2e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/README.md b/Assets/FishNet/CodeGenerating/cecil-0.11.4/README.md new file mode 100644 index 0000000..c052e4c --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/README.md @@ -0,0 +1,17 @@ +Cecil +===== + +Mono.Cecil is a library to generate and inspect programs and libraries in the ECMA CIL form. + +To put it simply, you can use Cecil to: + +* Analyze .NET binaries using a simple and powerful object model, without having to load assemblies to use Reflection. +* Modify .NET binaries, add new metadata structures and alter the IL code. + +Cecil has been around since 2004 and is [widely used](https://github.com/jbevain/cecil/wiki/Users) in the .NET community. If you're using Cecil, or depend on a framework, project, or product using it, please consider [sponsoring Cecil](https://github.com/sponsors/jbevain/). + +Read about the Cecil development on the [development log](http://cecil.pe). + +To discuss Cecil, the best place is the [mono-cecil](https://groups.google.com/group/mono-cecil) Google Group. + +Cecil is a project under the benevolent umbrella of the [.NET Foundation](http://www.dotnetfoundation.org/). diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/README.md.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/README.md.meta new file mode 100644 index 0000000..28851a6 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3bca5ad696a6f8e47b4651fa04b2cd96 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/cecil.snk b/Assets/FishNet/CodeGenerating/cecil-0.11.4/cecil.snk new file mode 100644 index 0000000..c0380d1 Binary files /dev/null and b/Assets/FishNet/CodeGenerating/cecil-0.11.4/cecil.snk differ diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/cecil.snk.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/cecil.snk.meta new file mode 100644 index 0000000..1ad02ba --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/cecil.snk.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 71693fd731252cb4a9bd4d8abf7846c0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks.meta new file mode 100644 index 0000000..aaa0b72 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8723713565b9be445bb695a476bc77c6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks.meta new file mode 100644 index 0000000..9ea055b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4929a85ce2b13ee4799e6f2a768bd5e9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/AssemblyInfo.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/AssemblyInfo.cs new file mode 100644 index 0000000..4c82583 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/AssemblyInfo.cs @@ -0,0 +1,15 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +//[assembly: AssemblyTitle ("MonoFN.Cecil.Rocks")] + +[assembly: CLSCompliant (false)] diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/AssemblyInfo.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/AssemblyInfo.cs.meta new file mode 100644 index 0000000..a9fbe70 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/AssemblyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f9ceb0221cb78b247b676d0ea5d57fc8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/DocCommentId.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/DocCommentId.cs new file mode 100644 index 0000000..783dbde --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/DocCommentId.cs @@ -0,0 +1,261 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; +using System.Collections.Generic; +using System.Text; + +namespace MonoFN.Cecil.Rocks { + + public class DocCommentId { + StringBuilder id; + + DocCommentId () + { + id = new StringBuilder (); + } + + void WriteField (FieldDefinition field) + { + WriteDefinition ('F', field); + } + + void WriteEvent (EventDefinition @event) + { + WriteDefinition ('E', @event); + } + + void WriteType (TypeDefinition type) + { + id.Append ('T').Append (':'); + WriteTypeFullName (type); + } + + void WriteMethod (MethodDefinition method) + { + WriteDefinition ('M', method); + + if (method.HasGenericParameters) { + id.Append ('`').Append ('`'); + id.Append (method.GenericParameters.Count); + } + + if (method.HasParameters) + WriteParameters (method.Parameters); + + if (IsConversionOperator (method)) + WriteReturnType (method); + } + + static bool IsConversionOperator (MethodDefinition self) + { + if (self == null) + throw new ArgumentNullException ("self"); + + return self.IsSpecialName + && (self.Name == "op_Explicit" || self.Name == "op_Implicit"); + } + + void WriteReturnType (MethodDefinition method) + { + id.Append ('~'); + WriteTypeSignature (method.ReturnType); + } + + void WriteProperty (PropertyDefinition property) + { + WriteDefinition ('P', property); + + if (property.HasParameters) + WriteParameters (property.Parameters); + } + + void WriteParameters (IList parameters) + { + id.Append ('('); + WriteList (parameters, p => WriteTypeSignature (p.ParameterType)); + id.Append (')'); + } + + void WriteTypeSignature (TypeReference type) + { + switch (type.MetadataType) { + case MetadataType.Array: + WriteArrayTypeSignature ((ArrayType)type); + break; + case MetadataType.ByReference: + WriteTypeSignature (((ByReferenceType)type).ElementType); + id.Append ('@'); + break; + case MetadataType.FunctionPointer: + WriteFunctionPointerTypeSignature ((FunctionPointerType)type); + break; + case MetadataType.GenericInstance: + WriteGenericInstanceTypeSignature ((GenericInstanceType)type); + break; + case MetadataType.Var: + id.Append ('`'); + id.Append (((GenericParameter)type).Position); + break; + case MetadataType.MVar: + id.Append ('`').Append ('`'); + id.Append (((GenericParameter)type).Position); + break; + case MetadataType.OptionalModifier: + WriteModiferTypeSignature ((OptionalModifierType)type, '!'); + break; + case MetadataType.RequiredModifier: + WriteModiferTypeSignature ((RequiredModifierType)type, '|'); + break; + case MetadataType.Pointer: + WriteTypeSignature (((PointerType)type).ElementType); + id.Append ('*'); + break; + default: + WriteTypeFullName (type); + break; + } + } + + void WriteGenericInstanceTypeSignature (GenericInstanceType type) + { + if (type.ElementType.IsTypeSpecification ()) + throw new NotSupportedException (); + + WriteTypeFullName (type.ElementType, stripGenericArity: true); + id.Append ('{'); + WriteList (type.GenericArguments, WriteTypeSignature); + id.Append ('}'); + } + + void WriteList (IList list, Action action) + { + for (int i = 0; i < list.Count; i++) { + if (i > 0) + id.Append (','); + + action (list [i]); + } + } + + void WriteModiferTypeSignature (IModifierType type, char id) + { + WriteTypeSignature (type.ElementType); + this.id.Append (id); + WriteTypeSignature (type.ModifierType); + } + + void WriteFunctionPointerTypeSignature (FunctionPointerType type) + { + id.Append ("=FUNC:"); + WriteTypeSignature (type.ReturnType); + + if (type.HasParameters) + WriteParameters (type.Parameters); + } + + void WriteArrayTypeSignature (ArrayType type) + { + WriteTypeSignature (type.ElementType); + + if (type.IsVector) { + id.Append ("[]"); + return; + } + + id.Append ("["); + + WriteList (type.Dimensions, dimension => { + if (dimension.LowerBound.HasValue) + id.Append (dimension.LowerBound.Value); + + id.Append (':'); + + if (dimension.UpperBound.HasValue) + id.Append (dimension.UpperBound.Value - (dimension.LowerBound.GetValueOrDefault () + 1)); + }); + + id.Append ("]"); + } + + void WriteDefinition (char id, IMemberDefinition member) + { + this.id.Append (id) + .Append (':'); + + WriteTypeFullName (member.DeclaringType); + this.id.Append ('.'); + WriteItemName (member.Name); + } + + void WriteTypeFullName (TypeReference type, bool stripGenericArity = false) + { + if (type.DeclaringType != null) { + WriteTypeFullName (type.DeclaringType); + id.Append ('.'); + } + + if (!string.IsNullOrEmpty (type.Namespace)) { + id.Append (type.Namespace); + id.Append ('.'); + } + + var name = type.Name; + + if (stripGenericArity) { + var index = name.LastIndexOf ('`'); + if (index > 0) + name = name.Substring (0, index); + } + + id.Append (name); + } + + void WriteItemName (string name) + { + id.Append (name.Replace ('.', '#').Replace ('<', '{').Replace ('>', '}')); + } + + public override string ToString () + { + return id.ToString (); + } + + public static string GetDocCommentId (IMemberDefinition member) + { + if (member == null) + throw new ArgumentNullException ("member"); + + var documentId = new DocCommentId (); + + switch (member.MetadataToken.TokenType) { + case TokenType.Field: + documentId.WriteField ((FieldDefinition)member); + break; + case TokenType.Method: + documentId.WriteMethod ((MethodDefinition)member); + break; + case TokenType.TypeDef: + documentId.WriteType ((TypeDefinition)member); + break; + case TokenType.Event: + documentId.WriteEvent ((EventDefinition)member); + break; + case TokenType.Property: + documentId.WriteProperty ((PropertyDefinition)member); + break; + default: + throw new NotSupportedException (member.FullName); + } + + return documentId.ToString (); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/DocCommentId.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/DocCommentId.cs.meta new file mode 100644 index 0000000..7cc833e --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/DocCommentId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 370e40931a1b9cf478e08e66fd2a9eac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/Functional.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/Functional.cs new file mode 100644 index 0000000..90c24ed --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/Functional.cs @@ -0,0 +1,41 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; +using System.Collections.Generic; + +namespace MonoFN.Cecil.Rocks { + + static class Functional { + + public static System.Func Y (System.Func, System.Func> f) + { + System.Func g = null; + g = f (a => g (a)); + return g; + } + + public static IEnumerable Prepend (this IEnumerable source, TSource element) + { + if (source == null) + throw new ArgumentNullException ("source"); + + return PrependIterator (source, element); + } + + static IEnumerable PrependIterator (IEnumerable source, TSource element) + { + yield return element; + + foreach (var item in source) + yield return item; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/Functional.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/Functional.cs.meta new file mode 100644 index 0000000..15f593e --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/Functional.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b481a942e0bdf8649b6b5b20db207190 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ILParser.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ILParser.cs new file mode 100644 index 0000000..9e814a6 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ILParser.cs @@ -0,0 +1,228 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Cil; +using MonoFN.Collections.Generic; +using System; + +namespace MonoFN.Cecil.Rocks { + +#if UNITY_EDITOR + public +#endif + interface IILVisitor { + void OnInlineNone (OpCode opcode); + void OnInlineSByte (OpCode opcode, sbyte value); + void OnInlineByte (OpCode opcode, byte value); + void OnInlineInt32 (OpCode opcode, int value); + void OnInlineInt64 (OpCode opcode, long value); + void OnInlineSingle (OpCode opcode, float value); + void OnInlineDouble (OpCode opcode, double value); + void OnInlineString (OpCode opcode, string value); + void OnInlineBranch (OpCode opcode, int offset); + void OnInlineSwitch (OpCode opcode, int [] offsets); + void OnInlineVariable (OpCode opcode, VariableDefinition variable); + void OnInlineArgument (OpCode opcode, ParameterDefinition parameter); + void OnInlineSignature (OpCode opcode, CallSite callSite); + void OnInlineType (OpCode opcode, TypeReference type); + void OnInlineField (OpCode opcode, FieldReference field); + void OnInlineMethod (OpCode opcode, MethodReference method); + } + +#if UNITY_EDITOR + public +#endif + static class ILParser { + + class ParseContext { + public CodeReader Code { get; set; } + public int Position { get; set; } + public MetadataReader Metadata { get; set; } + public Collection Variables { get; set; } + public IILVisitor Visitor { get; set; } + } + + public static void Parse (MethodDefinition method, IILVisitor visitor) + { + if (method == null) + throw new ArgumentNullException ("method"); + if (visitor == null) + throw new ArgumentNullException ("visitor"); + if (!method.HasBody || !method.HasImage) + throw new ArgumentException (); + + method.Module.Read (method, (m, _) => { + ParseMethod (m, visitor); + return true; + }); + } + + static void ParseMethod (MethodDefinition method, IILVisitor visitor) + { + var context = CreateContext (method, visitor); + var code = context.Code; + + var flags = code.ReadByte (); + + switch (flags & 0x3) { + case 0x2: // tiny + int code_size = flags >> 2; + ParseCode (code_size, context); + break; + case 0x3: // fat + code.Advance (-1); + ParseFatMethod (context); + break; + default: + throw new NotSupportedException (); + } + + code.MoveBackTo (context.Position); + } + + static ParseContext CreateContext (MethodDefinition method, IILVisitor visitor) + { + var code = method.Module.Read (method, (_, reader) => reader.code); + var position = code.MoveTo (method); + + return new ParseContext { + Code = code, + Position = position, + Metadata = code.reader, + Visitor = visitor, + }; + } + + static void ParseFatMethod (ParseContext context) + { + var code = context.Code; + + code.Advance (4); + var code_size = code.ReadInt32 (); + var local_var_token = code.ReadToken (); + + if (local_var_token != MetadataToken.Zero) + context.Variables = code.ReadVariables (local_var_token); + + ParseCode (code_size, context); + } + + static void ParseCode (int code_size, ParseContext context) + { + var code = context.Code; + var metadata = context.Metadata; + var visitor = context.Visitor; + + var start = code.Position; + var end = start + code_size; + + while (code.Position < end) { + var il_opcode = code.ReadByte (); + var opcode = il_opcode != 0xfe + ? OpCodes.OneByteOpCode [il_opcode] + : OpCodes.TwoBytesOpCode [code.ReadByte ()]; + + switch (opcode.OperandType) { + case OperandType.InlineNone: + visitor.OnInlineNone (opcode); + break; + case OperandType.InlineSwitch: + var length = code.ReadInt32 (); + var branches = new int [length]; + for (int i = 0; i < length; i++) + branches [i] = code.ReadInt32 (); + visitor.OnInlineSwitch (opcode, branches); + break; + case OperandType.ShortInlineBrTarget: + visitor.OnInlineBranch (opcode, code.ReadSByte ()); + break; + case OperandType.InlineBrTarget: + visitor.OnInlineBranch (opcode, code.ReadInt32 ()); + break; + case OperandType.ShortInlineI: + if (opcode == OpCodes.Ldc_I4_S) + visitor.OnInlineSByte (opcode, code.ReadSByte ()); + else + visitor.OnInlineByte (opcode, code.ReadByte ()); + break; + case OperandType.InlineI: + visitor.OnInlineInt32 (opcode, code.ReadInt32 ()); + break; + case OperandType.InlineI8: + visitor.OnInlineInt64 (opcode, code.ReadInt64 ()); + break; + case OperandType.ShortInlineR: + visitor.OnInlineSingle (opcode, code.ReadSingle ()); + break; + case OperandType.InlineR: + visitor.OnInlineDouble (opcode, code.ReadDouble ()); + break; + case OperandType.InlineSig: + visitor.OnInlineSignature (opcode, code.GetCallSite (code.ReadToken ())); + break; + case OperandType.InlineString: + visitor.OnInlineString (opcode, code.GetString (code.ReadToken ())); + break; + case OperandType.ShortInlineArg: + visitor.OnInlineArgument (opcode, code.GetParameter (code.ReadByte ())); + break; + case OperandType.InlineArg: + visitor.OnInlineArgument (opcode, code.GetParameter (code.ReadInt16 ())); + break; + case OperandType.ShortInlineVar: + visitor.OnInlineVariable (opcode, GetVariable (context, code.ReadByte ())); + break; + case OperandType.InlineVar: + visitor.OnInlineVariable (opcode, GetVariable (context, code.ReadInt16 ())); + break; + case OperandType.InlineTok: + case OperandType.InlineField: + case OperandType.InlineMethod: + case OperandType.InlineType: + var member = metadata.LookupToken (code.ReadToken ()); + switch (member.MetadataToken.TokenType) { + case TokenType.TypeDef: + case TokenType.TypeRef: + case TokenType.TypeSpec: + visitor.OnInlineType (opcode, (TypeReference)member); + break; + case TokenType.Method: + case TokenType.MethodSpec: + visitor.OnInlineMethod (opcode, (MethodReference)member); + break; + case TokenType.Field: + visitor.OnInlineField (opcode, (FieldReference)member); + break; + case TokenType.MemberRef: + var field_ref = member as FieldReference; + if (field_ref != null) { + visitor.OnInlineField (opcode, field_ref); + break; + } + + var method_ref = member as MethodReference; + if (method_ref != null) { + visitor.OnInlineMethod (opcode, method_ref); + break; + } + + throw new InvalidOperationException (); + } + break; + } + } + } + + static VariableDefinition GetVariable (ParseContext context, int index) + { + return context.Variables [index]; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ILParser.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ILParser.cs.meta new file mode 100644 index 0000000..65cbdbe --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ILParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2916628c81c279046adb746612d6067b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodBodyRocks.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodBodyRocks.cs new file mode 100644 index 0000000..feaabbf --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodBodyRocks.cs @@ -0,0 +1,411 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using MonoFN.Cecil.Cil; +using System; + +namespace MonoFN.Cecil.Rocks { + +#if UNITY_EDITOR + public +#endif + static class MethodBodyRocks { + + public static void SimplifyMacros (this MethodBody self) + { + if (self == null) + throw new ArgumentNullException ("self"); + + foreach (var instruction in self.Instructions) { + if (instruction.OpCode.OpCodeType != OpCodeType.Macro) + continue; + + switch (instruction.OpCode.Code) { + case Code.Ldarg_0: + ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (0)); + break; + case Code.Ldarg_1: + ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (1)); + break; + case Code.Ldarg_2: + ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (2)); + break; + case Code.Ldarg_3: + ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (3)); + break; + case Code.Ldloc_0: + ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [0]); + break; + case Code.Ldloc_1: + ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [1]); + break; + case Code.Ldloc_2: + ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [2]); + break; + case Code.Ldloc_3: + ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [3]); + break; + case Code.Stloc_0: + ExpandMacro (instruction, OpCodes.Stloc, self.Variables [0]); + break; + case Code.Stloc_1: + ExpandMacro (instruction, OpCodes.Stloc, self.Variables [1]); + break; + case Code.Stloc_2: + ExpandMacro (instruction, OpCodes.Stloc, self.Variables [2]); + break; + case Code.Stloc_3: + ExpandMacro (instruction, OpCodes.Stloc, self.Variables [3]); + break; + case Code.Ldarg_S: + instruction.OpCode = OpCodes.Ldarg; + break; + case Code.Ldarga_S: + instruction.OpCode = OpCodes.Ldarga; + break; + case Code.Starg_S: + instruction.OpCode = OpCodes.Starg; + break; + case Code.Ldloc_S: + instruction.OpCode = OpCodes.Ldloc; + break; + case Code.Ldloca_S: + instruction.OpCode = OpCodes.Ldloca; + break; + case Code.Stloc_S: + instruction.OpCode = OpCodes.Stloc; + break; + case Code.Ldc_I4_M1: + ExpandMacro (instruction, OpCodes.Ldc_I4, -1); + break; + case Code.Ldc_I4_0: + ExpandMacro (instruction, OpCodes.Ldc_I4, 0); + break; + case Code.Ldc_I4_1: + ExpandMacro (instruction, OpCodes.Ldc_I4, 1); + break; + case Code.Ldc_I4_2: + ExpandMacro (instruction, OpCodes.Ldc_I4, 2); + break; + case Code.Ldc_I4_3: + ExpandMacro (instruction, OpCodes.Ldc_I4, 3); + break; + case Code.Ldc_I4_4: + ExpandMacro (instruction, OpCodes.Ldc_I4, 4); + break; + case Code.Ldc_I4_5: + ExpandMacro (instruction, OpCodes.Ldc_I4, 5); + break; + case Code.Ldc_I4_6: + ExpandMacro (instruction, OpCodes.Ldc_I4, 6); + break; + case Code.Ldc_I4_7: + ExpandMacro (instruction, OpCodes.Ldc_I4, 7); + break; + case Code.Ldc_I4_8: + ExpandMacro (instruction, OpCodes.Ldc_I4, 8); + break; + case Code.Ldc_I4_S: + ExpandMacro (instruction, OpCodes.Ldc_I4, (int)(sbyte)instruction.Operand); + break; + case Code.Br_S: + instruction.OpCode = OpCodes.Br; + break; + case Code.Brfalse_S: + instruction.OpCode = OpCodes.Brfalse; + break; + case Code.Brtrue_S: + instruction.OpCode = OpCodes.Brtrue; + break; + case Code.Beq_S: + instruction.OpCode = OpCodes.Beq; + break; + case Code.Bge_S: + instruction.OpCode = OpCodes.Bge; + break; + case Code.Bgt_S: + instruction.OpCode = OpCodes.Bgt; + break; + case Code.Ble_S: + instruction.OpCode = OpCodes.Ble; + break; + case Code.Blt_S: + instruction.OpCode = OpCodes.Blt; + break; + case Code.Bne_Un_S: + instruction.OpCode = OpCodes.Bne_Un; + break; + case Code.Bge_Un_S: + instruction.OpCode = OpCodes.Bge_Un; + break; + case Code.Bgt_Un_S: + instruction.OpCode = OpCodes.Bgt_Un; + break; + case Code.Ble_Un_S: + instruction.OpCode = OpCodes.Ble_Un; + break; + case Code.Blt_Un_S: + instruction.OpCode = OpCodes.Blt_Un; + break; + case Code.Leave_S: + instruction.OpCode = OpCodes.Leave; + break; + } + } + } + + static void ExpandMacro (Instruction instruction, OpCode opcode, object operand) + { + instruction.OpCode = opcode; + instruction.Operand = operand; + } + + static void MakeMacro (Instruction instruction, OpCode opcode) + { + instruction.OpCode = opcode; + instruction.Operand = null; + } + + public static void Optimize (this MethodBody self) + { + if (self == null) + throw new ArgumentNullException ("self"); + + OptimizeLongs (self); + OptimizeMacros (self); + } + + static void OptimizeLongs (this MethodBody self) + { + for (var i = 0; i < self.Instructions.Count; i++) { + var instruction = self.Instructions [i]; + if (instruction.OpCode.Code != Code.Ldc_I8) + continue; + var l = (long)instruction.Operand; + if (l >= int.MaxValue || l <= int.MinValue) + continue; + ExpandMacro (instruction, OpCodes.Ldc_I4, (int)l); + self.Instructions.Insert (++i, Instruction.Create (OpCodes.Conv_I8)); + } + } + + public static void OptimizeMacros (this MethodBody self) + { + if (self == null) + throw new ArgumentNullException ("self"); + + var method = self.Method; + + foreach (var instruction in self.Instructions) { + int index; + switch (instruction.OpCode.Code) { + case Code.Ldarg: + index = ((ParameterDefinition)instruction.Operand).Index; + if (index == -1 && instruction.Operand == self.ThisParameter) + index = 0; + else if (method.HasThis) + index++; + + switch (index) { + case 0: + MakeMacro (instruction, OpCodes.Ldarg_0); + break; + case 1: + MakeMacro (instruction, OpCodes.Ldarg_1); + break; + case 2: + MakeMacro (instruction, OpCodes.Ldarg_2); + break; + case 3: + MakeMacro (instruction, OpCodes.Ldarg_3); + break; + default: + if (index < 256) + ExpandMacro (instruction, OpCodes.Ldarg_S, instruction.Operand); + break; + } + break; + case Code.Ldloc: + index = ((VariableDefinition)instruction.Operand).Index; + switch (index) { + case 0: + MakeMacro (instruction, OpCodes.Ldloc_0); + break; + case 1: + MakeMacro (instruction, OpCodes.Ldloc_1); + break; + case 2: + MakeMacro (instruction, OpCodes.Ldloc_2); + break; + case 3: + MakeMacro (instruction, OpCodes.Ldloc_3); + break; + default: + if (index < 256) + ExpandMacro (instruction, OpCodes.Ldloc_S, instruction.Operand); + break; + } + break; + case Code.Stloc: + index = ((VariableDefinition)instruction.Operand).Index; + switch (index) { + case 0: + MakeMacro (instruction, OpCodes.Stloc_0); + break; + case 1: + MakeMacro (instruction, OpCodes.Stloc_1); + break; + case 2: + MakeMacro (instruction, OpCodes.Stloc_2); + break; + case 3: + MakeMacro (instruction, OpCodes.Stloc_3); + break; + default: + if (index < 256) + ExpandMacro (instruction, OpCodes.Stloc_S, instruction.Operand); + break; + } + break; + case Code.Ldarga: + index = ((ParameterDefinition)instruction.Operand).Index; + if (index == -1 && instruction.Operand == self.ThisParameter) + index = 0; + else if (method.HasThis) + index++; + if (index < 256) + ExpandMacro (instruction, OpCodes.Ldarga_S, instruction.Operand); + break; + case Code.Ldloca: + if (((VariableDefinition)instruction.Operand).Index < 256) + ExpandMacro (instruction, OpCodes.Ldloca_S, instruction.Operand); + break; + case Code.Ldc_I4: + int i = (int)instruction.Operand; + switch (i) { + case -1: + MakeMacro (instruction, OpCodes.Ldc_I4_M1); + break; + case 0: + MakeMacro (instruction, OpCodes.Ldc_I4_0); + break; + case 1: + MakeMacro (instruction, OpCodes.Ldc_I4_1); + break; + case 2: + MakeMacro (instruction, OpCodes.Ldc_I4_2); + break; + case 3: + MakeMacro (instruction, OpCodes.Ldc_I4_3); + break; + case 4: + MakeMacro (instruction, OpCodes.Ldc_I4_4); + break; + case 5: + MakeMacro (instruction, OpCodes.Ldc_I4_5); + break; + case 6: + MakeMacro (instruction, OpCodes.Ldc_I4_6); + break; + case 7: + MakeMacro (instruction, OpCodes.Ldc_I4_7); + break; + case 8: + MakeMacro (instruction, OpCodes.Ldc_I4_8); + break; + default: + if (i >= -128 && i < 128) + ExpandMacro (instruction, OpCodes.Ldc_I4_S, (sbyte)i); + break; + } + break; + } + } + + OptimizeBranches (self); + } + + static void OptimizeBranches (MethodBody body) + { + ComputeOffsets (body); + + foreach (var instruction in body.Instructions) { + if (instruction.OpCode.OperandType != OperandType.InlineBrTarget) + continue; + + if (OptimizeBranch (instruction)) + ComputeOffsets (body); + } + } + + static bool OptimizeBranch (Instruction instruction) + { + var offset = ((Instruction)instruction.Operand).Offset - (instruction.Offset + instruction.OpCode.Size + 4); + if (!(offset >= -128 && offset <= 127)) + return false; + + switch (instruction.OpCode.Code) { + case Code.Br: + instruction.OpCode = OpCodes.Br_S; + break; + case Code.Brfalse: + instruction.OpCode = OpCodes.Brfalse_S; + break; + case Code.Brtrue: + instruction.OpCode = OpCodes.Brtrue_S; + break; + case Code.Beq: + instruction.OpCode = OpCodes.Beq_S; + break; + case Code.Bge: + instruction.OpCode = OpCodes.Bge_S; + break; + case Code.Bgt: + instruction.OpCode = OpCodes.Bgt_S; + break; + case Code.Ble: + instruction.OpCode = OpCodes.Ble_S; + break; + case Code.Blt: + instruction.OpCode = OpCodes.Blt_S; + break; + case Code.Bne_Un: + instruction.OpCode = OpCodes.Bne_Un_S; + break; + case Code.Bge_Un: + instruction.OpCode = OpCodes.Bge_Un_S; + break; + case Code.Bgt_Un: + instruction.OpCode = OpCodes.Bgt_Un_S; + break; + case Code.Ble_Un: + instruction.OpCode = OpCodes.Ble_Un_S; + break; + case Code.Blt_Un: + instruction.OpCode = OpCodes.Blt_Un_S; + break; + case Code.Leave: + instruction.OpCode = OpCodes.Leave_S; + break; + } + + return true; + } + + static void ComputeOffsets (MethodBody body) + { + var offset = 0; + foreach (var instruction in body.Instructions) { + instruction.Offset = offset; + offset += instruction.GetSize (); + } + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodBodyRocks.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodBodyRocks.cs.meta new file mode 100644 index 0000000..3067d55 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodBodyRocks.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c47d4756ed8120429bad0887cff0366 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodDefinitionRocks.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodDefinitionRocks.cs new file mode 100644 index 0000000..040f795 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodDefinitionRocks.cs @@ -0,0 +1,72 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil.Rocks { + +#if UNITY_EDITOR + public +#endif + static class MethodDefinitionRocks { + + public static MethodDefinition GetBaseMethod (this MethodDefinition self) + { + if (self == null) + throw new ArgumentNullException ("self"); + if (!self.IsVirtual) + return self; + if (self.IsNewSlot) + return self; + + var base_type = ResolveBaseType (self.DeclaringType); + while (base_type != null) { + var @base = GetMatchingMethod (base_type, self); + if (@base != null) + return @base; + + base_type = ResolveBaseType (base_type); + } + + return self; + } + + public static MethodDefinition GetOriginalBaseMethod (this MethodDefinition self) + { + if (self == null) + throw new ArgumentNullException ("self"); + + while (true) { + var @base = self.GetBaseMethod (); + if (@base == self) + return self; + + self = @base; + } + } + + static TypeDefinition ResolveBaseType (TypeDefinition type) + { + if (type == null) + return null; + + var base_type = type.BaseType; + if (base_type == null) + return null; + + return base_type.Resolve (); + } + + static MethodDefinition GetMatchingMethod (TypeDefinition type, MethodDefinition method) + { + return MetadataResolver.GetMethod (type.Methods, method); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodDefinitionRocks.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodDefinitionRocks.cs.meta new file mode 100644 index 0000000..af399f1 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/MethodDefinitionRocks.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7a5d7596633ddb043b9785a7fa7bfa6f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ModuleDefinitionRocks.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ModuleDefinitionRocks.cs new file mode 100644 index 0000000..7eeab2b --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ModuleDefinitionRocks.cs @@ -0,0 +1,32 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace MonoFN.Cecil.Rocks { + +#if UNITY_EDITOR + public +#endif + static class ModuleDefinitionRocks { + + public static IEnumerable GetAllTypes (this ModuleDefinition self) + { + if (self == null) + throw new ArgumentNullException ("self"); + + // it was fun to write, but we need a somewhat less convoluted implementation + return self.Types.SelectMany ( + Functional.Y> (f => type => type.NestedTypes.SelectMany (f).Prepend (type))); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ModuleDefinitionRocks.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ModuleDefinitionRocks.cs.meta new file mode 100644 index 0000000..682485f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ModuleDefinitionRocks.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d90334a1cd085c047b9b8eddaa65cf09 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ParameterReferenceRocks.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ParameterReferenceRocks.cs new file mode 100644 index 0000000..30bbb70 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ParameterReferenceRocks.cs @@ -0,0 +1,11 @@ + +namespace MonoFN.Cecil.Rocks { + + public static class ParameterReferenceRocks { + + public static int GetSequence (this ParameterReference self) + { + return self.Index + 1; + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ParameterReferenceRocks.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ParameterReferenceRocks.cs.meta new file mode 100644 index 0000000..30bde11 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/ParameterReferenceRocks.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d276fe9256961b847b51a9bfc735384b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/SecurityDeclarationRocks.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/SecurityDeclarationRocks.cs new file mode 100644 index 0000000..bf22572 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/SecurityDeclarationRocks.cs @@ -0,0 +1,157 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +#if !NET_CORE + +using System; +using System.Security; +using SSP = System.Security.Permissions; + +namespace MonoFN.Cecil.Rocks { + +#if UNITY_EDITOR + public +#endif + static class SecurityDeclarationRocks { + + public static PermissionSet ToPermissionSet (this SecurityDeclaration self) + { + if (self == null) + throw new ArgumentNullException ("self"); + + PermissionSet set; + if (TryProcessPermissionSetAttribute (self, out set)) + return set; + + return CreatePermissionSet (self); + } + + static bool TryProcessPermissionSetAttribute (SecurityDeclaration declaration, out PermissionSet set) + { + set = null; + + if (!declaration.HasSecurityAttributes && declaration.SecurityAttributes.Count != 1) + return false; + + var security_attribute = declaration.SecurityAttributes [0]; + if (!security_attribute.AttributeType.IsTypeOf ("System.Security.Permissions", "PermissionSetAttribute")) + return false; + + var attribute = new SSP.PermissionSetAttribute ((SSP.SecurityAction)declaration.Action); + + var named_argument = security_attribute.Properties [0]; + string value = (string)named_argument.Argument.Value; + switch (named_argument.Name) { + case "XML": + attribute.XML = value; + break; + case "Name": + attribute.Name = value; + break; + default: + throw new NotImplementedException (named_argument.Name); + } + + set = attribute.CreatePermissionSet (); + return true; + } + + static PermissionSet CreatePermissionSet (SecurityDeclaration declaration) + { + var set = new PermissionSet (SSP.PermissionState.None); + + foreach (var attribute in declaration.SecurityAttributes) { + var permission = CreatePermission (declaration, attribute); + set.AddPermission (permission); + } + + return set; + } + + static IPermission CreatePermission (SecurityDeclaration declaration, SecurityAttribute attribute) + { + var attribute_type = Type.GetType (attribute.AttributeType.FullName); + if (attribute_type == null) + throw new ArgumentException ("attribute"); + + var security_attribute = CreateSecurityAttribute (attribute_type, declaration); + if (security_attribute == null) + throw new InvalidOperationException (); + + CompleteSecurityAttribute (security_attribute, attribute); + + return security_attribute.CreatePermission (); + } + + static void CompleteSecurityAttribute (SSP.SecurityAttribute security_attribute, SecurityAttribute attribute) + { + if (attribute.HasFields) + CompleteSecurityAttributeFields (security_attribute, attribute); + + if (attribute.HasProperties) + CompleteSecurityAttributeProperties (security_attribute, attribute); + } + + static void CompleteSecurityAttributeFields (SSP.SecurityAttribute security_attribute, SecurityAttribute attribute) + { + var type = security_attribute.GetType (); + + foreach (var named_argument in attribute.Fields) + type.GetField (named_argument.Name).SetValue (security_attribute, named_argument.Argument.Value); + } + + static void CompleteSecurityAttributeProperties (SSP.SecurityAttribute security_attribute, SecurityAttribute attribute) + { + var type = security_attribute.GetType (); + + foreach (var named_argument in attribute.Properties) + type.GetProperty (named_argument.Name).SetValue (security_attribute, named_argument.Argument.Value, null); + } + + static SSP.SecurityAttribute CreateSecurityAttribute (Type attribute_type, SecurityDeclaration declaration) + { + SSP.SecurityAttribute security_attribute; + try { + security_attribute = (SSP.SecurityAttribute)Activator.CreateInstance ( + attribute_type, new object [] { (SSP.SecurityAction)declaration.Action }); + } + catch (MissingMethodException) { + security_attribute = (SSP.SecurityAttribute)Activator.CreateInstance (attribute_type, new object [0]); + } + + return security_attribute; + } + + public static SecurityDeclaration ToSecurityDeclaration (this PermissionSet self, SecurityAction action, ModuleDefinition module) + { + if (self == null) + throw new ArgumentNullException ("self"); + if (module == null) + throw new ArgumentNullException ("module"); + + var declaration = new SecurityDeclaration (action); + + var attribute = new SecurityAttribute ( + module.TypeSystem.LookupType ("System.Security.Permissions", "PermissionSetAttribute")); + + attribute.Properties.Add ( + new CustomAttributeNamedArgument ( + "XML", + new CustomAttributeArgument ( + module.TypeSystem.String, self.ToXml ().ToString ()))); + + declaration.SecurityAttributes.Add (attribute); + + return declaration; + } + } +} + +#endif diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/SecurityDeclarationRocks.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/SecurityDeclarationRocks.cs.meta new file mode 100644 index 0000000..c659e1a --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/SecurityDeclarationRocks.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9d89d937b712004089aafb3a1391907 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeDefinitionRocks.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeDefinitionRocks.cs new file mode 100644 index 0000000..7b7d78f --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeDefinitionRocks.cs @@ -0,0 +1,65 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace MonoFN.Cecil.Rocks { + +#if UNITY_EDITOR + public +#endif + static class TypeDefinitionRocks { + + public static IEnumerable GetConstructors (this TypeDefinition self) + { + if (self == null) + throw new ArgumentNullException ("self"); + + if (!self.HasMethods) + return Empty.Array; + + return self.Methods.Where (method => method.IsConstructor); + } + + public static MethodDefinition GetStaticConstructor (this TypeDefinition self) + { + if (self == null) + throw new ArgumentNullException ("self"); + + if (!self.HasMethods) + return null; + + return self.GetConstructors ().FirstOrDefault (ctor => ctor.IsStatic); + } + + public static IEnumerable GetMethods (this TypeDefinition self) + { + if (self == null) + throw new ArgumentNullException ("self"); + + if (!self.HasMethods) + return Empty.Array; + + return self.Methods.Where (method => !method.IsConstructor); + } + + public static TypeReference GetEnumUnderlyingType (this TypeDefinition self) + { + if (self == null) + throw new ArgumentNullException ("self"); + if (!self.IsEnum) + throw new ArgumentException (); + + return Mixin.GetEnumUnderlyingType (self); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeDefinitionRocks.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeDefinitionRocks.cs.meta new file mode 100644 index 0000000..620eacd --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeDefinitionRocks.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b4d5393ac3307a84ca5babfbdcad9eea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeReferenceRocks.cs b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeReferenceRocks.cs new file mode 100644 index 0000000..1fdd284 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeReferenceRocks.cs @@ -0,0 +1,87 @@ +// +// Author: +// Jb Evain (jbevain@gmail.com) +// +// Copyright (c) 2008 - 2015 Jb Evain +// Copyright (c) 2008 - 2011 Novell, Inc. +// +// Licensed under the MIT/X11 license. +// + +using System; + +namespace MonoFN.Cecil.Rocks { + +#if UNITY_EDITOR + public +#endif + static class TypeReferenceRocks { + + public static ArrayType MakeArrayType (this TypeReference self) + { + return new ArrayType (self); + } + + public static ArrayType MakeArrayType (this TypeReference self, int rank) + { + if (rank == 0) + throw new ArgumentOutOfRangeException ("rank"); + + var array = new ArrayType (self); + + for (int i = 1; i < rank; i++) + array.Dimensions.Add (new ArrayDimension ()); + + return array; + } + + public static PointerType MakePointerType (this TypeReference self) + { + return new PointerType (self); + } + + public static ByReferenceType MakeByReferenceType (this TypeReference self) + { + return new ByReferenceType (self); + } + + public static OptionalModifierType MakeOptionalModifierType (this TypeReference self, TypeReference modifierType) + { + return new OptionalModifierType (modifierType, self); + } + + public static RequiredModifierType MakeRequiredModifierType (this TypeReference self, TypeReference modifierType) + { + return new RequiredModifierType (modifierType, self); + } + + public static GenericInstanceType MakeGenericInstanceType (this TypeReference self, params TypeReference [] arguments) + { + if (self == null) + throw new ArgumentNullException ("self"); + if (arguments == null) + throw new ArgumentNullException ("arguments"); + if (arguments.Length == 0) + throw new ArgumentException (); + if (self.GenericParameters.Count != arguments.Length) + throw new ArgumentException (); + + var instance = new GenericInstanceType (self, arguments.Length); + + foreach (var argument in arguments) + instance.GenericArguments.Add (argument); + + return instance; + } + + public static PinnedType MakePinnedType (this TypeReference self) + { + return new PinnedType (self); + } + + public static SentinelType MakeSentinelType (this TypeReference self) + { + return new SentinelType (self); + } + } +} diff --git a/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeReferenceRocks.cs.meta b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeReferenceRocks.cs.meta new file mode 100644 index 0000000..0239366 --- /dev/null +++ b/Assets/FishNet/CodeGenerating/cecil-0.11.4/rocks/Mono.Cecil.Rocks/TypeReferenceRocks.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 25d089a650c8e0f45a6f9086aaf0004a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/DOCUMENTATION.txt b/Assets/FishNet/DOCUMENTATION.txt new file mode 100644 index 0000000..8318532 --- /dev/null +++ b/Assets/FishNet/DOCUMENTATION.txt @@ -0,0 +1,3 @@ +Please view our online documentation for the most up to date information: https://fish-networking.gitbook.io/docs/ + +Support is available on our discord. Please contact FirstGearGames#0001 @ https://discord.gg/Ta9HgDh4Hj \ No newline at end of file diff --git a/Assets/FishNet/DOCUMENTATION.txt.meta b/Assets/FishNet/DOCUMENTATION.txt.meta new file mode 100644 index 0000000..65996b4 --- /dev/null +++ b/Assets/FishNet/DOCUMENTATION.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b8eb79f9866e25342b4565ac8c981645 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos.meta b/Assets/FishNet/Demos.meta new file mode 100644 index 0000000..e17a8d8 --- /dev/null +++ b/Assets/FishNet/Demos.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d066166ea67f71429de1af8cf635915 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Authenticator.meta b/Assets/FishNet/Demos/Authenticator.meta new file mode 100644 index 0000000..a4e42c3 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ecbf3577da9f5be4fa280507f592d747 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Authenticator/Prefabs.meta b/Assets/FishNet/Demos/Authenticator/Prefabs.meta new file mode 100644 index 0000000..e5950b0 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 29d7fd53a109938428ece2660c6bbf25 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Authenticator/Prefabs/_Authenticator_Prefabs.asset b/Assets/FishNet/Demos/Authenticator/Prefabs/_Authenticator_Prefabs.asset new file mode 100644 index 0000000..3dc3623 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Prefabs/_Authenticator_Prefabs.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4489d77032a81ef42b0067acf2737d4d, type: 3} + m_Name: _Authenticator_Prefabs + m_EditorClassIdentifier: + _prefabs: [] diff --git a/Assets/FishNet/Demos/Authenticator/Prefabs/_Authenticator_Prefabs.asset.meta b/Assets/FishNet/Demos/Authenticator/Prefabs/_Authenticator_Prefabs.asset.meta new file mode 100644 index 0000000..f9f89f3 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Prefabs/_Authenticator_Prefabs.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab6a9000f5ff83f45b6761c2a3be018d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Authenticator/Scenes.meta b/Assets/FishNet/Demos/Authenticator/Scenes.meta new file mode 100644 index 0000000..5c1296b --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 92540a55e648a2448bb430e825f01bc4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Authenticator/Scenes/Authenticator.unity b/Assets/FishNet/Demos/Authenticator/Scenes/Authenticator.unity new file mode 100644 index 0000000..bbf17a2 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Scenes/Authenticator.unity @@ -0,0 +1,383 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &279669268 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 279669271} + - component: {fileID: 279669270} + - component: {fileID: 279669269} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &279669269 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 279669268} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &279669270 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 279669268} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &279669271 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 279669268} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1689326519 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_Pivot.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058994, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: _autoStartType + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058995, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_Name + value: NetworkHudCanvas + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 0570b6f7f713dc44a90463654bbcd8d0, type: 3} +--- !u!114 &1759771918 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491481971} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 226e4eaf2fa685f48bdc3dfaa87c1453, type: 3} + m_Name: + m_EditorClassIdentifier: + _allowHostAuthentication: 0 + _password: HelloWorld +--- !u!4 &7443408886491481969 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491481971} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7443408886491481970 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491481971} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2c95dfde7d73b54dbbdc23155d35d36, type: 3} + m_Name: + m_EditorClassIdentifier: + _refreshDefaultPrefabs: 0 + _runInBackground: 1 + _dontDestroyOnLoad: 1 + _objectPool: {fileID: 0} + _persistence: 0 + _logging: {fileID: 0} + _spawnablePrefabs: {fileID: 11400000, guid: ab6a9000f5ff83f45b6761c2a3be018d, type: 2} +--- !u!1 &7443408886491481971 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7443408886491481969} + - component: {fileID: 7443408886491481970} + - component: {fileID: 1759771918} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 diff --git a/Assets/FishNet/Demos/Authenticator/Scenes/Authenticator.unity.meta b/Assets/FishNet/Demos/Authenticator/Scenes/Authenticator.unity.meta new file mode 100644 index 0000000..13af204 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Scenes/Authenticator.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0bc02b628363de5499d5e7c00bd63b1b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Authenticator/Scripts.meta b/Assets/FishNet/Demos/Authenticator/Scripts.meta new file mode 100644 index 0000000..2c6fbb0 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0cb111b6bede3a1478c9b179a609d822 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Authenticator/Scripts/Broadcasts.cs b/Assets/FishNet/Demos/Authenticator/Scripts/Broadcasts.cs new file mode 100644 index 0000000..9991b66 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Scripts/Broadcasts.cs @@ -0,0 +1,21 @@ + +using FishNet.Broadcast; + +namespace FishNet.Example.Authenticating +{ + public struct HostPasswordBroadcast : IBroadcast + { + public string Password; + } + + public struct PasswordBroadcast : IBroadcast + { + public string Password; + } + + public struct ResponseBroadcast : IBroadcast + { + public bool Passed; + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/Authenticator/Scripts/Broadcasts.cs.meta b/Assets/FishNet/Demos/Authenticator/Scripts/Broadcasts.cs.meta new file mode 100644 index 0000000..c2d9e65 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Scripts/Broadcasts.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d26bb0c99070e9b49bc8632dc0b68214 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Authenticator/Scripts/HostAuthenticator.cs b/Assets/FishNet/Demos/Authenticator/Scripts/HostAuthenticator.cs new file mode 100644 index 0000000..36fb0f8 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Scripts/HostAuthenticator.cs @@ -0,0 +1,152 @@ +using FishNet.Connection; +using FishNet.Example.Authenticating; +using FishNet.Managing; +using FishNet.Transporting; +using System; +using System.Security.Cryptography; +using System.Text; +using UnityEngine; + +namespace FishNet.Authenticating +{ + + /// + /// This authenticator is an example of how to let host bypass the authentication process. + /// When checking to authenticate on the client side call AuthenticateAsHost, and if returned true skip normal authentication. + /// + public abstract class HostAuthenticator : Authenticator + { + #region Serialized. + /// + /// True to enable use of AuthenticateAsHost. + /// + [Tooltip("True to enable use of AuthenticateAsHost.")] + [SerializeField] + private bool _allowHostAuthentication; + /// + /// Sets if to allow host authentication. + /// + /// + public void SetAllowHostAuthentication(bool value) => _allowHostAuthentication = value; + /// + /// Returns if AllowHostAuthentication is enabled. + /// + /// + public bool GetAllowHostAuthentication() => _allowHostAuthentication; + #endregion + + #region Private. + /// + /// A random hash which only exist if the server is started. + /// + private static string _hostHash = string.Empty; + #endregion + + /// + /// Initializes this script for use. + /// + /// + public override void InitializeOnce(NetworkManager networkManager) + { + base.InitializeOnce(networkManager); + //Listen for connection state of local server to set hash. + base.NetworkManager.ServerManager.OnServerConnectionState += ServerManager_OnServerConnectionState; + //Listen for broadcast from client. Be sure to set requireAuthentication to false. + base.NetworkManager.ServerManager.RegisterBroadcast(OnHostPasswordBroadcast, false); + } + + /// + /// Called after the local server connection state changes. + /// + private void ServerManager_OnServerConnectionState(ServerConnectionStateArgs obj) + { + int length = (obj.ConnectionState == LocalConnectionState.Started) ? 25 : 0; + SetHostHash(length); + } + + /// + /// Received on server when a client sends the password broadcast message. + /// + /// Connection sending broadcast. + /// + private void OnHostPasswordBroadcast(NetworkConnection conn, HostPasswordBroadcast hpb, Channel channel) + { + //Not accepting host authentications. This could be an attack. + if (!_allowHostAuthentication) + { + conn.Disconnect(true); + return; + } + /* If client is already authenticated this could be an attack. Connections + * are removed when a client disconnects so there is no reason they should + * already be considered authenticated. */ + if (conn.IsAuthenticated) + { + conn.Disconnect(true); + return; + } + + bool correctPassword = (hpb.Password == _hostHash); + OnHostAuthenticationResult(conn, correctPassword); + } + + /// + /// Called after handling a host authentication result. + /// + /// Connection authenticating. + /// True if authentication passed. + protected abstract void OnHostAuthenticationResult(NetworkConnection conn, bool authenticated); + + /// + /// Sets a host hash of length. + /// + /// https://stackoverflow.com/questions/32932679/using-rngcryptoserviceprovider-to-generate-random-string + private void SetHostHash(int length) + { + if (length <= 0) + { + _hostHash = string.Empty; + } + else + { + const string charPool = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()"; + StringBuilder result = new StringBuilder(); + using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider()) + { + byte[] uintBuffer = new byte[sizeof(uint)]; + while (length-- > 0) + { + rng.GetBytes(uintBuffer); + uint num = BitConverter.ToUInt32(uintBuffer, 0); + result.Append(charPool[(int)(num % (uint)charPool.Length)]); + } + } + + _hostHash = result.ToString(); + } + } + + /// + /// Returns true if authentication was sent as host. + /// + /// + protected bool AuthenticateAsHost() + { + if (!_allowHostAuthentication) + return false; + if (_hostHash == string.Empty) + return false; + + HostPasswordBroadcast hpb = new HostPasswordBroadcast() + { + Password = _hostHash, + }; + + base.NetworkManager.ClientManager.Broadcast(hpb); + return true; + } + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/Authenticator/Scripts/HostAuthenticator.cs.meta b/Assets/FishNet/Demos/Authenticator/Scripts/HostAuthenticator.cs.meta new file mode 100644 index 0000000..d26ea1d --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Scripts/HostAuthenticator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c7497d751bb68f444b4343e3edc28e39 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Authenticator/Scripts/PasswordAuthenticator.cs b/Assets/FishNet/Demos/Authenticator/Scripts/PasswordAuthenticator.cs new file mode 100644 index 0000000..07c7a41 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Scripts/PasswordAuthenticator.cs @@ -0,0 +1,132 @@ +using FishNet.Authenticating; +using FishNet.Connection; +using FishNet.Managing; +using FishNet.Managing.Logging; +using FishNet.Transporting; +using System; +using UnityEngine; + +namespace FishNet.Example.Authenticating +{ + /// + /// This is an example of a password authenticator. + /// Never send passwords without encryption. + /// + public class PasswordAuthenticator : HostAuthenticator + { + #region Public. + /// + /// Called when authenticator has concluded a result for a connection. Boolean is true if authentication passed, false if failed. + /// Server listens for this event automatically. + /// + public override event Action OnAuthenticationResult; + #endregion + + #region Serialized. + /// + /// Password to authenticate. + /// + [Tooltip("Password to authenticate.")] + [SerializeField] + private string _password = "HelloWorld"; + #endregion + + public override void InitializeOnce(NetworkManager networkManager) + { + base.InitializeOnce(networkManager); + + //Listen for connection state change as client. + base.NetworkManager.ClientManager.OnClientConnectionState += ClientManager_OnClientConnectionState; + //Listen for broadcast from client. Be sure to set requireAuthentication to false. + base.NetworkManager.ServerManager.RegisterBroadcast(OnPasswordBroadcast, false); + //Listen to response from server. + base.NetworkManager.ClientManager.RegisterBroadcast(OnResponseBroadcast); + } + + /// + /// Called when a connection state changes for the local client. + /// + private void ClientManager_OnClientConnectionState(ClientConnectionStateArgs args) + { + /* If anything but the started state then exit early. + * Only try to authenticate on started state. The server + * doesn't have to send an authentication request before client + * can authenticate, that is entirely optional and up to you. In this + * example the client tries to authenticate soon as they connect. */ + if (args.ConnectionState != LocalConnectionState.Started) + return; + //Authentication was sent as host, no need to authenticate normally. + if (AuthenticateAsHost()) + return; + + PasswordBroadcast pb = new PasswordBroadcast() + { + Password = _password + }; + + base.NetworkManager.ClientManager.Broadcast(pb); + } + + + /// + /// Received on server when a client sends the password broadcast message. + /// + /// Connection sending broadcast. + /// + private void OnPasswordBroadcast(NetworkConnection conn, PasswordBroadcast pb, Channel channel) + { + /* If client is already authenticated this could be an attack. Connections + * are removed when a client disconnects so there is no reason they should + * already be considered authenticated. */ + if (conn.IsAuthenticated) + { + conn.Disconnect(true); + return; + } + + bool correctPassword = (pb.Password == _password); + SendAuthenticationResponse(conn, correctPassword); + /* Invoke result. This is handled internally to complete the connection or kick client. + * It's important to call this after sending the broadcast so that the broadcast + * makes it out to the client before the kick. */ + OnAuthenticationResult?.Invoke(conn, correctPassword); + } + + /// + /// Received on client after server sends an authentication response. + /// + /// + private void OnResponseBroadcast(ResponseBroadcast rb, Channel channel) + { + string result = (rb.Passed) ? "Authentication complete." : "Authenitcation failed."; + NetworkManager.Log(result); + } + + /// + /// Sends an authentication result to a connection. + /// + private void SendAuthenticationResponse(NetworkConnection conn, bool authenticated) + { + /* Tell client if they authenticated or not. This is + * entirely optional but does demonstrate that you can send + * broadcasts to client on pass or fail. */ + ResponseBroadcast rb = new ResponseBroadcast() + { + Passed = authenticated + }; + base.NetworkManager.ServerManager.Broadcast(conn, rb, false); + } + /// + /// Called after handling a host authentication result. + /// + /// Connection authenticating. + /// True if authentication passed. + protected override void OnHostAuthenticationResult(NetworkConnection conn, bool authenticated) + { + SendAuthenticationResponse(conn, authenticated); + OnAuthenticationResult?.Invoke(conn, authenticated); + } + } + + +} diff --git a/Assets/FishNet/Demos/Authenticator/Scripts/PasswordAuthenticator.cs.meta b/Assets/FishNet/Demos/Authenticator/Scripts/PasswordAuthenticator.cs.meta new file mode 100644 index 0000000..135ee06 --- /dev/null +++ b/Assets/FishNet/Demos/Authenticator/Scripts/PasswordAuthenticator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 226e4eaf2fa685f48bdc3dfaa87c1453 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback.meta b/Assets/FishNet/Demos/ColliderRollback.meta new file mode 100644 index 0000000..c97f882 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b4a241a573ddd2841a4f3eb890a36bf2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Audio.meta b/Assets/FishNet/Demos/ColliderRollback/Audio.meta new file mode 100644 index 0000000..e2ae81e --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Audio.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 055912d614133a949a9ea99034287d3f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Audio/Glock.wav b/Assets/FishNet/Demos/ColliderRollback/Audio/Glock.wav new file mode 100644 index 0000000..e603e10 Binary files /dev/null and b/Assets/FishNet/Demos/ColliderRollback/Audio/Glock.wav differ diff --git a/Assets/FishNet/Demos/ColliderRollback/Audio/Glock.wav.meta b/Assets/FishNet/Demos/ColliderRollback/Audio/Glock.wav.meta new file mode 100644 index 0000000..5bf941a --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Audio/Glock.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 0330762d2b3c8d641bfe11ad89b7e196 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/ColliderRollback Demo README.txt b/Assets/FishNet/Demos/ColliderRollback/ColliderRollback Demo README.txt new file mode 100644 index 0000000..5b9252d --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/ColliderRollback Demo README.txt @@ -0,0 +1,10 @@ +THIS DEMO REQUIRES FISH-NETWORKING PRO + +- Start two editors or builds. +- Press play on each. +- Run one as server, and the other as client. + +Red shows where the object was rolled back to on the server. +Green shows where the object actually was on server. + +Rollback indicators in demo will not be correct when firing as clientHost. diff --git a/Assets/FishNet/Demos/ColliderRollback/ColliderRollback Demo README.txt.meta b/Assets/FishNet/Demos/ColliderRollback/ColliderRollback Demo README.txt.meta new file mode 100644 index 0000000..16c2629 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/ColliderRollback Demo README.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 683b83b178f491a479b732df31da7ade +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials.meta b/Assets/FishNet/Demos/ColliderRollback/Materials.meta new file mode 100644 index 0000000..4fc3385 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2105bcd81068f6244a97aeccbe8818d8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Ground.mat b/Assets/FishNet/Demos/ColliderRollback/Materials/Ground.mat new file mode 100644 index 0000000..4a86cd7 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Ground.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Ground + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.30265415, g: 0.31132078, b: 0.08664116, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Ground.mat.meta b/Assets/FishNet/Demos/ColliderRollback/Materials/Ground.mat.meta new file mode 100644 index 0000000..b990db0 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Ground.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d329b71ccd856144ab8753e70f69e4e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Particles.meta b/Assets/FishNet/Demos/ColliderRollback/Materials/Particles.meta new file mode 100644 index 0000000..adf5f44 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Particles.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bdb28f0aecd0e4f43ba84d12dc7a9e0f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Particles/Circle Additive.mat b/Assets/FishNet/Demos/ColliderRollback/Materials/Particles/Circle Additive.mat new file mode 100644 index 0000000..81ede44 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Particles/Circle Additive.mat @@ -0,0 +1,29 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Circle Additive + m_Shader: {fileID: 10720, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 5 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTex: + m_Texture: {fileID: 2800000, guid: 155f67fd8750f8e4e83c8efb1731f3a0, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _InvFade: 1 + m_Colors: + - _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Particles/Circle Additive.mat.meta b/Assets/FishNet/Demos/ColliderRollback/Materials/Particles/Circle Additive.mat.meta new file mode 100644 index 0000000..f8509fa --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Particles/Circle Additive.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4bf10d94145fd6c4187c18de0af92e43 +timeCreated: 1448288937 +licenseType: Store +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization.meta b/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization.meta new file mode 100644 index 0000000..747c393 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5ad1202d40533db4fba20e21a57fec29 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ClientPosition.mat b/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ClientPosition.mat new file mode 100644 index 0000000..f357f74 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ClientPosition.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ClientPosition + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0, g: 1, b: 0.034508944, a: 0.49019608} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ClientPosition.mat.meta b/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ClientPosition.mat.meta new file mode 100644 index 0000000..31d05a0 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ClientPosition.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 997fc4a5ccc62814697fc91eb139e535 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ServerPosition.mat b/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ServerPosition.mat new file mode 100644 index 0000000..e0e5fc3 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ServerPosition.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ServerPosition + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 1, g: 0.05869128, b: 0, a: 0.49019608} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ServerPosition.mat.meta b/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ServerPosition.mat.meta new file mode 100644 index 0000000..885b8f9 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Rollback Visualization/ServerPosition.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 14cdcc3d5d8692d469297ede7ced7ab8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Target.mat b/Assets/FishNet/Demos/ColliderRollback/Materials/Target.mat new file mode 100644 index 0000000..a70f6f8 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Target.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Target + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Target.mat.meta b/Assets/FishNet/Demos/ColliderRollback/Materials/Target.mat.meta new file mode 100644 index 0000000..a8e6fc1 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Target.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4c62c607906e6e1499102239be9499be +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Wall.mat b/Assets/FishNet/Demos/ColliderRollback/Materials/Wall.mat new file mode 100644 index 0000000..4f0049f --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Wall.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Wall + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.4339623, g: 0.4339623, b: 0.4339623, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/ColliderRollback/Materials/Wall.mat.meta b/Assets/FishNet/Demos/ColliderRollback/Materials/Wall.mat.meta new file mode 100644 index 0000000..04169ce --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Materials/Wall.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 14d23cd2d8240244baa6026ca98df0bf +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Models.meta b/Assets/FishNet/Demos/ColliderRollback/Models.meta new file mode 100644 index 0000000..b295ce4 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2fb6eaa3dd222634591fa7ebc5245eda +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons.meta b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons.meta new file mode 100644 index 0000000..e8de409 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 499043ab5c8e7ce4d9f83dddbe4c9bfa +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Glock.obj b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Glock.obj new file mode 100644 index 0000000..a77e37d --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Glock.obj @@ -0,0 +1,949 @@ +# Alias OBJ Model File +# Exported from SketchUp, (c) 2000-2012 Trimble Navigation Limited +# File units = meters + +mtllib pistol.mtl + +g Mesh1 Group2 Group1 Model + +usemtl Gray4 +v 0.0045 0.018 0.0225 +vt 0 22.0472 +vn 1 0 -0 +v 0.0045 0.0102 0.0225 +vt 0 16.9291 +v 0.0045 0.0102 -0.0189 +vt 27.1654 16.9291 +v 0.0045 0.018 -0.0189 +vt 27.1654 22.0472 +f 1/1/1 2/2/1 3/3/1 4/4/1 + +v -0.0045 0.018 0.0225 +vn 0 0 1 +v -0.0045 0.0102 0.0225 +v -0.0039 0.0102 0.0225 +vt 0.393701 16.9291 +v -0.0039 0.0174 0.0225 +vt 0.393701 21.6535 +v 0.0039 0.0174 0.0225 +vt 5.51181 21.6535 +v 0.0039 0.0102 0.0225 +vt 5.51181 16.9291 +vt 5.90551 16.9291 +vt 5.90551 22.0472 +f 5/1/2 6/2/2 7/5/2 8/6/2 9/7/2 10/8/2 2/9/2 1/10/2 + +v -0.0045 0.018 -0.0075 +vt -19.685 22.0472 +vn -1 0 -0 +v -0.0045 0.018 -0.0189 +vt -27.1654 22.0472 +v -0.0045 0.0102 -0.0189 +vt -27.1654 16.9291 +v -0.0045 0.018 0.0003 +vt -14.5669 22.0472 +v -0.0045 0.015 0.0003 +vt -14.5669 20.0787 +v -0.0045 0.015 -0.0075 +vt -19.685 20.0787 +f 11/11/3 12/12/3 13/13/3 6/2/3 5/1/3 14/14/3 15/15/3 16/16/3 + +vt 0 27.1654 +vn 0 1 -0 +vt 0 19.685 +v 0.0015 0.018 -0.0075 +vt 3.93701 19.685 +v 0.0015 0.018 0.0003 +vt 3.93701 14.5669 +vt 0 14.5669 +vt 0 0 +vt 5.90551 0 +vt 5.90551 27.1654 +f 12/17/4 11/18/4 17/19/4 18/20/4 14/21/4 5/22/4 1/23/4 4/24/4 + +v 0.0015 0.0174 -0.0075 +vt 3.93701 21.6535 +vt 3.93701 22.0472 +vt 0 20.0787 +v -0.0039 0.015 -0.0075 +vt 0.393701 20.0787 +v -0.0039 0.0174 -0.0075 +f 19/25/2 17/26/2 11/1/2 16/27/2 20/28/2 21/6/2 + +vt -19.685 21.6535 +v 0.0015 0.0174 0.0003 +vt -14.5669 21.6535 +f 18/14/3 17/11/3 19/29/3 22/30/3 + +v 0.0039 0.0174 -0.0189 +vt -5.51181 27.1654 +vn 0 -1 -0 +v 0.0039 0.0174 0.0219 +vt -5.51181 0.393701 +v -0.0039 0.0174 0.0219 +vt -0.393701 0.393701 +v -0.0039 0.0174 0.0003 +vt -0.393701 14.5669 +vt -3.93701 14.5669 +vt -3.93701 19.685 +vt -0.393701 19.685 +v -0.0039 0.0174 -0.0189 +vt -0.393701 27.1654 +f 23/31/5 24/32/5 25/33/5 26/34/5 22/35/5 19/36/5 21/37/5 27/38/5 + +vt -0.393701 21.6535 +vn -1 -8.44909e-032 -5.30817e-016 +vt -27.1654 21.6535 +v 0.0039 0.0102 -0.0189 +v 0.0039 0.0102 0.0219 +vt -0.393701 16.9291 +f 24/39/6 23/40/6 28/13/6 29/41/6 + +vt -5.90551 16.9291 +vn 0 0 -1 +vt -5.51181 16.9291 +vt -5.51181 21.6535 +v -0.0039 0.0102 -0.0189 +vt -5.90551 22.0472 +f 3/42/7 28/43/7 23/44/7 27/39/7 30/41/7 13/2/7 12/1/7 4/45/7 + +vt -5.90551 27.1654 +vt -5.90551 0 +vt -5.51181 0 +f 29/32/5 28/31/5 3/46/5 2/47/5 10/48/5 + +vt 0 21.6535 +f 10/2/3 9/49/3 24/39/3 29/41/3 + +vt -0.393701 0 +f 9/48/5 8/50/5 25/33/5 24/32/5 + +v -0.0039 0.0102 0.0219 +f 8/49/1 7/2/1 31/5/1 25/6/1 + +f 30/38/5 31/33/5 7/50/5 6/22/5 13/17/5 + +vt 14.5669 21.6535 +vn 1 -9.10486e-016 -4.47514e-016 +vt 27.1654 21.6535 +vt 19.685 21.6535 +vt 19.685 20.0787 +v -0.0039 0.015 0.0003 +vt 14.5669 20.0787 +f 26/51/8 25/6/8 31/5/8 30/3/8 27/52/8 21/53/8 20/54/8 32/55/8 + +vt 0.393701 14.5669 +vt 0.393701 19.685 +f 16/18/4 15/21/4 32/56/4 20/57/4 + +vt -3.93701 21.6535 +vt -0.393701 20.0787 +vt -3.93701 22.0472 +f 22/58/7 26/39/7 32/59/7 15/27/7 14/1/7 18/60/7 + +g Mesh2 Group3 Group1 Model + +usemtl Gray6 +v -0.0039 -0.0156 -0.0225 +vt -0.393701 29.5276 +v 0.0039 -0.0156 -0.0225 +vt -5.51181 29.5276 +v 0.0039 -0.0156 -0.0105 +v -0.0039 -0.0156 -0.0105 +f 33/61/5 34/62/5 35/44/5 36/39/5 + +v 0.0045 -0.0156 -0.0231 +vt 5.90551 29.9213 +vt 0.393701 29.5276 +vt 5.51181 29.5276 +f 37/63/4 33/64/4 34/65/4 + +v -0.0045 -0.0156 -0.0231 +vt 0 29.9213 +f 38/66/4 33/64/4 37/63/4 + +v -0.0045 -0.0156 -0.0099 +vt 1.42109e-014 21.2598 +f 33/64/4 38/66/4 39/67/4 + +vt -21.2598 -1.02483e-058 +vn -1 -2.08756e-045 1.64071e-015 +vt -29.9213 -1.02483e-058 +v -0.0045 -0.018 -0.0231 +vt -29.9213 -1.5748 +v -0.0045 -0.018 -0.0099 +vt -21.2598 -1.5748 +f 39/68/9 38/69/9 40/70/9 41/71/9 + +v 0.0045 -0.018 -0.0231 +vt -5.90551 -1.5748 +vt 0 -1.5748 +f 38/22/7 37/47/7 42/72/7 40/73/7 + +vt 29.9213 1.23281e-044 +vn 1 -2.08756e-045 -1.64071e-015 +v 0.0045 -0.0156 -0.0099 +vt 21.2598 1.23281e-044 +v 0.0045 -0.018 -0.0099 +vt 21.2598 -1.5748 +vt 29.9213 -1.5748 +f 37/74/10 43/75/10 44/76/10 42/77/10 + +vt 5.90551 21.2598 +f 35/7/4 43/78/4 37/63/4 + +f 36/6/4 43/78/4 35/7/4 + +f 36/6/4 39/67/4 43/78/4 + +f 39/67/4 36/6/4 33/64/4 + +v -0.0039 0.0072 0.0219 +vt -0.393701 14.9606 +vn -1 -6.29366e-016 1.52472e-016 +v -0.0039 0.0174 0.0219 +v -0.0039 0.0174 -0.0195 +vt -27.5591 21.6535 +v -0.0039 0.0072 -0.0195 +vt -27.5591 14.9606 +v -0.0039 0.0072 -0.0165 +vt -25.5906 14.9606 +vt -29.5276 -2.47782e-016 +vt -21.6535 -2.47782e-016 +v -0.0039 0.0072 -0.0045 +vt -17.7165 14.9606 +f 45/79/11 46/39/11 47/80/11 48/81/11 49/82/11 33/83/11 36/84/11 50/85/11 + +vt 0.393701 14.9606 +v -0.00289778 0.0130235 0.0219 +vt 1.05133 18.7819 +f 45/86/2 51/87/2 46/6/2 + +v -0.00259808 0.0123 0.0219 +vt 1.24798 18.3071 +f 51/87/2 45/86/2 52/88/2 + +v -0.00212132 0.0116787 0.0219 +vt 1.56081 17.8994 +f 52/88/2 45/86/2 53/89/2 + +v -0.0015 0.0112019 0.0219 +vt 1.9685 17.5866 +f 53/89/2 45/86/2 54/90/2 + +v -0.000776457 0.0109022 0.0219 +vt 2.44327 17.3899 +f 54/90/2 45/86/2 55/91/2 + +v -9.86988e-018 0.0108 0.0219 +vt 2.95276 17.3228 +f 55/91/2 45/86/2 56/92/2 + +v 0.000776457 0.0109022 0.0219 +vt 3.46224 17.3899 +f 45/86/2 57/93/2 56/92/2 + +v 0.0015 0.0112019 0.0219 +vt 3.93701 17.5866 +f 45/86/2 58/94/2 57/93/2 + +v 0.0039 0.0072 0.0219 +vt 5.51181 14.9606 +f 59/95/2 58/94/2 45/86/2 + +v 0.00212132 0.0116787 0.0219 +vt 4.3447 17.8994 +f 58/94/2 59/95/2 60/96/2 + +v 0.00259808 0.0123 0.0219 +vt 4.65753 18.3071 +f 60/96/2 59/95/2 61/97/2 + +v 0.00289778 0.0130235 0.0219 +vt 4.85418 18.7819 +f 61/97/2 59/95/2 62/98/2 + +v 0.0039 0.0174 0.0219 +f 62/98/2 59/95/2 63/7/2 + +v 0.0039 0.0174 -0.0195 +vt 27.5591 21.6535 +vn 1 -1.5843e-016 1.83988e-016 +v 0.0039 0.0072 -0.0045 +vt 17.7165 14.9606 +vt 21.6535 8.73238e-016 +vt 29.5276 8.73238e-016 +v 0.0039 0.0072 -0.0165 +vt 25.5906 14.9606 +v 0.0039 0.0072 -0.0195 +vt 27.5591 14.9606 +f 64/99/12 63/6/12 59/86/12 65/100/12 35/101/12 34/102/12 66/103/12 67/104/12 + +vt 0.393701 27.5591 +vt 0.393701 0.393701 +vt 5.51181 0.393701 +vt 5.51181 27.5591 +f 47/105/4 46/106/4 63/107/4 64/108/4 + +v -9.86988e-018 0.0168 0.0219 +vt 2.95276 21.2598 +f 46/6/2 68/109/2 63/7/2 + +v -0.000776457 0.0166978 0.0219 +vt 2.44327 21.1928 +f 46/6/2 69/110/2 68/109/2 + +v -0.0015 0.0163981 0.0219 +vt 1.9685 20.9961 +f 46/6/2 70/111/2 69/110/2 + +v -0.00212132 0.0159213 0.0219 +vt 1.56081 20.6833 +f 46/6/2 71/112/2 70/111/2 + +v -0.00259808 0.0153 0.0219 +vt 1.24798 20.2756 +f 46/6/2 72/113/2 71/112/2 + +v -0.00289778 0.0145765 0.0219 +vt 1.05133 19.8008 +f 46/6/2 73/114/2 72/113/2 + +v -0.003 0.0138 0.0219 +vt 0.984252 19.2913 +f 46/6/2 74/115/2 73/114/2 + +f 46/6/2 51/87/2 74/115/2 + +usemtl Gray4 +v -0.003 0.0138 0.0231 +vt 0.393701 18.9978 +vt -0.393701 18.9978 +vt -0.393701 18.4839 +vn -0.965926 -0.258819 -0 +v -0.00289778 0.0130235 0.0231 +vt 0.393701 18.4839 +f 75/116/3 74/117/3 51/118/13 76/119/13 + +v -0.00289778 0.0145765 0.0231 +vt 0.393701 19.7687 +vn -0.965926 0.258819 -0 +vt -0.393701 19.7687 +vt -0.393701 19.2548 +vt 0.393701 19.2548 +f 77/120/14 73/121/14 74/122/3 75/123/3 + +v -0.00259808 0.0153 0.0231 +vt 0.393701 19.2098 +vn -0.866025 0.5 -0 +vt -0.393701 19.2098 +vt -0.393701 18.6959 +vt 0.393701 18.6959 +f 78/124/15 72/125/15 73/126/14 77/127/14 + +v -0.00212132 0.0159213 0.0231 +vt 0.393701 17.3593 +vn -0.707107 0.707107 -0 +vt -0.393701 17.3593 +vt -0.393701 16.8454 +vt 0.393701 16.8454 +f 79/128/16 71/129/16 72/130/15 78/131/15 + +v -0.0015 0.0163981 0.0231 +vt 0.393701 14.3433 +vn -0.5 0.866025 -0 +vt -0.393701 14.3433 +vt -0.393701 13.8295 +vt 0.393701 13.8295 +f 80/132/17 70/133/17 71/134/16 79/135/16 + +v -0.000776457 0.0166978 0.0231 +vt 0.393701 10.3674 +vn -0.258819 0.965926 -0 +vt -0.393701 10.3674 +vt -0.393701 9.85353 +vt 0.393701 9.85353 +f 81/136/18 69/137/18 70/138/17 80/139/17 + +v -9.86988e-018 0.0168 0.0231 +vt 0.393701 5.70246 +vt -0.393701 5.70246 +vt -0.393701 5.18858 +vt 0.393701 5.18858 +f 82/140/4 68/141/4 69/142/18 81/143/18 + +v 0.000776457 0.0166978 0.0231 +vt -0.393701 -0.666411 +vn 0.258819 0.965926 -0 +v 0.000776457 0.0166978 0.0219 +vt 0.393701 -0.666411 +vt 0.393701 -0.152528 +vt -0.393701 -0.152528 +f 83/144/19 84/145/19 68/146/4 82/147/4 + +v 0.0015 0.0163981 0.0231 +vt -0.393701 4.39754 +vn 0.5 0.866025 -0 +v 0.0015 0.0163981 0.0219 +vt 0.393701 4.39754 +vt 0.393701 4.91143 +vt -0.393701 4.91143 +f 85/148/20 86/149/20 84/150/19 83/151/19 + +v 0.00212132 0.0159213 0.0231 +vt -0.393701 9.1443 +vn 0.707107 0.707107 -0 +v 0.00212132 0.0159213 0.0219 +vt 0.393701 9.1443 +vt 0.393701 9.65819 +vt -0.393701 9.65819 +f 87/152/21 88/153/21 86/154/20 85/155/20 + +v 0.00259808 0.0153 0.0231 +vt -0.393701 13.2504 +vn 0.866025 0.5 -0 +v 0.00259808 0.0153 0.0219 +vt 0.393701 13.2504 +vt 0.393701 13.7643 +vt -0.393701 13.7643 +f 89/156/22 90/157/22 88/158/21 87/159/21 + +v 0.00289778 0.0145765 0.0231 +vt -0.393701 16.436 +vn 0.965926 0.258819 -0 +v 0.00289778 0.0145765 0.0219 +vt 0.393701 16.436 +vt 0.393701 16.9498 +vt -0.393701 16.9498 +f 91/160/23 92/161/23 90/162/22 89/163/22 + +v 0.003 0.0138 0.0231 +vn 1 -4.75916e-016 -0 +v 0.003 0.0138 0.0219 +f 93/118/24 94/119/24 92/116/23 91/117/23 + +v 0.00289778 0.0130235 0.0231 +vn 0.965926 -0.258819 -0 +f 95/122/25 62/123/25 94/120/24 93/121/24 + +v 0.00259808 0.0123 0.0231 +vn 0.866025 -0.5 -0 +f 96/126/26 61/127/26 62/124/25 95/125/25 + +v 0.00212132 0.0116787 0.0231 +vn 0.707107 -0.707107 -0 +f 97/130/27 60/131/27 61/128/26 96/129/26 + +v 0.0015 0.0112019 0.0231 +vn 0.5 -0.866025 -0 +f 98/134/28 58/135/28 60/132/27 97/133/27 + +v 0.000776457 0.0109022 0.0231 +vn 0.258819 -0.965926 -0 +f 99/138/29 57/139/29 58/136/28 98/137/28 + +v -9.86988e-018 0.0108 0.0231 +f 100/142/5 56/143/5 57/140/29 99/141/29 + +v -0.000776457 0.0109022 0.0231 +vn -0.258819 -0.965926 -0 +f 101/146/30 55/147/30 56/144/5 100/145/5 + +v -0.0015 0.0112019 0.0231 +vn -0.5 -0.866025 -0 +f 102/150/31 54/151/31 55/148/30 101/149/30 + +v -0.00212132 0.0116787 0.0231 +vn -0.707107 -0.707107 -0 +f 103/154/32 53/155/32 54/152/31 102/153/31 + +v -0.00259808 0.0123 0.0231 +vn -0.866025 -0.5 -0 +f 104/158/33 52/159/33 53/156/32 103/157/32 + +f 76/162/13 51/163/13 52/160/33 104/161/33 + +v -0.00206741 0.0126064 0.0231 +vt 1.59619 18.5081 +f 104/88/2 105/164/2 76/87/2 + +v -0.00168803 0.012112 0.0231 +vt 1.84512 18.1837 +f 104/88/2 106/165/2 105/164/2 + +v -0.00119362 0.0117326 0.0231 +vt 2.16954 17.9348 +f 104/88/2 107/166/2 106/165/2 + +f 103/89/2 107/166/2 104/88/2 + +v -0.000617862 0.0114941 0.0231 +vt 2.54733 17.7783 +f 103/89/2 108/167/2 107/166/2 + +v -9.86988e-018 0.0114128 0.0231 +vt 2.95276 17.7249 +f 103/89/2 109/168/2 108/167/2 + +f 103/89/2 98/94/2 109/168/2 + +f 102/90/2 98/94/2 103/89/2 + +f 101/91/2 98/94/2 102/90/2 + +f 101/91/2 99/93/2 98/94/2 + +f 99/93/2 101/91/2 100/92/2 + +f 97/96/2 109/168/2 98/94/2 + +v 0.000617862 0.0114941 0.0231 +vt 3.35818 17.7783 +f 109/168/2 97/96/2 110/169/2 + +v 0.00119362 0.0117326 0.0231 +vt 3.73597 17.9348 +f 110/169/2 97/96/2 111/170/2 + +f 111/170/2 97/96/2 96/97/2 + +v 0.00168803 0.012112 0.0231 +vt 4.06039 18.1837 +f 111/170/2 96/97/2 112/171/2 + +v 0.00206741 0.0126064 0.0231 +vt 4.30932 18.5081 +f 112/171/2 96/97/2 113/172/2 + +f 113/172/2 96/97/2 95/98/2 + +v 0.00230589 0.0131821 0.0231 +vt 4.46581 18.8859 +f 113/172/2 95/98/2 114/173/2 + +vt 4.92126 19.2913 +f 114/173/2 95/98/2 93/174/2 + +v 0.00238724 0.0138 0.0231 +vt 4.51918 19.2913 +f 114/173/2 93/174/2 115/175/2 + +vt 4.85418 19.8008 +f 115/175/2 93/174/2 91/176/2 + +v 0.00230589 0.0144179 0.0231 +vt 4.46581 19.6968 +f 115/175/2 91/176/2 116/177/2 + +v 0.00206741 0.0149936 0.0231 +vt 4.30932 20.0746 +f 116/177/2 91/176/2 117/178/2 + +vt 4.65753 20.2756 +f 117/178/2 91/176/2 89/179/2 + +v 0.00168803 0.015488 0.0231 +vt 4.06039 20.399 +f 117/178/2 89/179/2 118/180/2 + +vt 4.3447 20.6833 +f 118/180/2 89/179/2 87/181/2 + +v 0.00119362 0.0158674 0.0231 +vt 3.73597 20.6479 +f 118/180/2 87/181/2 119/182/2 + +v 0.000617862 0.0161059 0.0231 +vt 3.35818 20.8044 +f 119/182/2 87/181/2 120/183/2 + +vt 3.93701 20.9961 +f 120/183/2 87/181/2 85/184/2 + +v -9.86988e-018 0.0161872 0.0231 +vt 2.95276 20.8578 +f 120/183/2 85/184/2 121/185/2 + +f 121/185/2 85/184/2 80/111/2 + +f 80/111/2 85/184/2 81/110/2 + +vt 3.46224 21.1928 +f 81/110/2 85/184/2 83/186/2 + +f 81/110/2 83/186/2 82/109/2 + +v -0.000617862 0.0161059 0.0231 +vt 2.54733 20.8044 +f 80/111/2 122/187/2 121/185/2 + +f 79/112/2 122/187/2 80/111/2 + +v -0.00119362 0.0158674 0.0231 +vt 2.16954 20.6479 +f 79/112/2 123/188/2 122/187/2 + +v -0.00168803 0.015488 0.0231 +vt 1.84512 20.399 +f 79/112/2 124/189/2 123/188/2 + +f 78/113/2 124/189/2 79/112/2 + +v -0.00206741 0.0149936 0.0231 +vt 1.59619 20.0746 +f 78/113/2 125/190/2 124/189/2 + +f 77/114/2 125/190/2 78/113/2 + +v -0.00230589 0.0144179 0.0231 +vt 1.4397 19.6968 +f 77/114/2 126/191/2 125/190/2 + +f 75/115/2 126/191/2 77/114/2 + +v -0.00238724 0.0138 0.0231 +vt 1.38633 19.2913 +f 75/115/2 127/192/2 126/191/2 + +v -0.00230589 0.0131821 0.0231 +vt 1.4397 18.8859 +f 75/115/2 128/193/2 127/192/2 + +f 76/87/2 128/193/2 75/115/2 + +f 76/87/2 105/164/2 128/193/2 + +v -0.00206741 0.0126064 0.0219 +vt 0.393701 16.4884 +v -0.00230589 0.0131821 0.0219 +vt 0.393701 16.8974 +vt -0.393701 16.8974 +vt -0.393701 16.4884 +f 129/194/22 130/195/23 128/196/23 105/197/22 + +usemtl Gray8 +v -0.00206741 0.0149936 0.0219 +v -0.00230589 0.0144179 0.0219 +v -0.00238724 0.0138 0.0219 +v -0.00168803 0.012112 0.0219 +v -0.00119362 0.0117326 0.0219 +v -0.000617862 0.0114941 0.0219 +v -9.86988e-018 0.0114128 0.0219 +v 0.000617862 0.0114941 0.0219 +v 0.00119362 0.0117326 0.0219 +v 0.00168803 0.012112 0.0219 +v 0.00206741 0.0126064 0.0219 +v 0.00230589 0.0131821 0.0219 +v 0.00238724 0.0138 0.0219 +v 0.00230589 0.0144179 0.0219 +v 0.00206741 0.0149936 0.0219 +v 0.00168803 0.015488 0.0219 +v 0.00119362 0.0158674 0.0219 +v 0.000617862 0.0161059 0.0219 +v -9.86988e-018 0.0161872 0.0219 +v -0.000617862 0.0161059 0.0219 +v -0.00119362 0.0158674 0.0219 +v -0.00168803 0.015488 0.0219 +f 131/190/2 132/191/2 133/192/2 130/193/2 129/164/2 134/165/2 135/166/2 136/167/2 137/168/2 138/169/2 139/170/2 140/171/2 141/172/2 142/173/2 143/175/2 144/177/2 145/178/2 146/180/2 147/182/2 148/183/2 149/185/2 150/187/2 151/188/2 152/189/2 + +usemtl Gray4 +vt 0.393701 18.7484 +vt 0.393701 19.1573 +vt -0.393701 19.1573 +vt -0.393701 18.7484 +f 132/198/25 131/199/26 125/200/26 126/201/25 + +vt 0.393701 16.8979 +vt 0.393701 17.3068 +vt -0.393701 17.3068 +vt -0.393701 16.8979 +f 131/202/26 152/203/27 124/204/27 125/205/26 + +vt 0.393701 13.8819 +vt 0.393701 14.2909 +vt -0.393701 14.2909 +vt -0.393701 13.8819 +f 152/206/27 151/207/28 123/208/28 124/209/27 + +vt 0.393701 9.90601 +vt 0.393701 10.3149 +vt -0.393701 10.3149 +vt -0.393701 9.90601 +f 151/210/28 150/211/29 122/212/29 123/213/28 + +vt 0.393701 5.24106 +vt 0.393701 5.64998 +vt -0.393701 5.64998 +vt -0.393701 5.24106 +f 150/214/29 149/215/5 121/216/5 122/217/29 + +vt -0.393701 -0.20501 +vt -0.393701 -0.613929 +vt 0.393701 -0.613929 +vt 0.393701 -0.20501 +f 149/218/5 148/219/30 120/220/30 121/221/5 + +vt -0.393701 4.85894 +vt -0.393701 4.45003 +vt 0.393701 4.45003 +vt 0.393701 4.85894 +f 148/222/30 147/223/31 119/224/31 120/225/30 + +vt -0.393701 9.6057 +vt -0.393701 9.19678 +vt 0.393701 9.19678 +vt 0.393701 9.6057 +f 147/226/31 146/227/32 118/228/32 119/229/31 + +vt -0.393701 13.7118 +vt -0.393701 13.3029 +vt 0.393701 13.3029 +vt 0.393701 13.7118 +f 146/230/32 145/231/33 117/232/33 118/233/32 + +f 145/196/33 144/197/13 116/194/13 117/195/33 + +vt -0.393701 18.9453 +vt -0.393701 18.5364 +vn -1 1.1338e-015 -0 +vt 0.393701 18.5364 +vt 0.393701 18.9453 +f 144/234/13 143/235/34 115/236/34 116/237/13 + +vt -0.393701 19.7162 +vt -0.393701 19.3073 +vt 0.393701 19.3073 +vt 0.393701 19.7162 +f 143/238/34 142/239/14 114/240/14 115/241/34 + +f 142/200/14 141/201/15 113/198/15 114/199/14 + +f 141/204/15 140/205/16 112/202/16 113/203/15 + +f 140/208/16 139/209/17 111/206/17 112/207/16 + +f 139/212/17 138/213/18 110/210/18 111/211/17 + +f 138/216/18 137/217/4 109/214/4 110/215/18 + +f 137/220/4 136/221/19 108/218/19 109/219/4 + +f 136/224/19 135/225/20 107/222/20 108/223/19 + +f 135/228/20 134/229/21 106/226/21 107/227/20 + +f 134/232/21 129/233/22 105/230/22 106/231/21 + +vn 1 -5.87897e-016 -0 +f 133/240/35 132/241/25 126/238/25 127/239/35 + +f 130/236/23 133/237/35 127/234/35 128/235/23 + +usemtl Gray6 +f 62/98/2 63/7/2 94/174/2 + +f 94/174/2 63/7/2 92/176/2 + +f 92/176/2 63/7/2 90/179/2 + +f 90/179/2 63/7/2 88/181/2 + +f 88/181/2 63/7/2 86/184/2 + +f 86/184/2 63/7/2 84/186/2 + +f 84/186/2 63/7/2 68/109/2 + +v 0.0015 0.0162 -0.0195 +vt -3.93701 20.8661 +f 64/44/7 153/242/7 47/39/7 + +v 0.0015 0.012 -0.0195 +vt -3.93701 18.1102 +f 64/44/7 154/243/7 153/242/7 + +vt -5.51181 14.9606 +f 67/244/7 154/243/7 64/44/7 + +v -0.0015 0.012 -0.0195 +vt -1.9685 18.1102 +f 154/243/7 67/244/7 155/245/7 + +f 48/79/7 155/245/7 67/244/7 + +f 155/245/7 48/79/7 47/39/7 + +v -0.0015 0.0162 -0.0195 +vt -1.9685 20.8661 +f 155/245/7 47/39/7 156/246/7 + +f 156/246/7 47/39/7 153/242/7 + +usemtl Gray4 +v -0.0015 0.0162 -0.0213 +vt 1.9685 28.7402 +vt 1.9685 27.5591 +vt 3.93701 27.5591 +v 0.0015 0.0162 -0.0213 +vt 3.93701 28.7402 +f 157/247/4 156/248/4 153/249/4 158/250/4 + +vt -27.5591 20.8661 +vt -28.7402 20.8661 +v -0.0015 0.0138 -0.0213 +vt -28.7402 19.2913 +vt -27.5591 18.1102 +f 156/251/3 157/252/3 159/253/3 155/254/3 + +vt -1.9685 19.2913 +v 0.0015 0.0138 -0.0213 +vt -3.93701 19.2913 +f 159/255/7 157/246/7 158/242/7 160/256/7 + +vt 27.5591 18.1102 +vt 28.7402 19.2913 +vt 28.7402 20.8661 +vt 27.5591 20.8661 +f 154/257/1 160/258/1 158/259/1 153/260/1 + +vt -1.9685 32.2931 +vn 0 -0.707107 -0.707107 +vt -1.9685 33.9634 +vt -3.93701 33.9634 +vt -3.93701 32.2931 +f 155/261/36 159/262/36 160/263/36 154/264/36 + +usemtl Gray6 +f 155/245/7 156/246/7 153/242/7 154/243/7 + +usemtl Gray4 +vt -5.51181 25.5906 +vt -0.393701 25.5906 +vt -0.393701 27.5591 +vt -5.51181 27.5591 +f 66/265/5 49/266/5 48/267/5 67/268/5 + +usemtl Gray6 +vt -5.51181 -7.51457 +vn 0 0.254493 -0.967075 +vt -0.393701 -7.51457 +vt -0.393701 7.95542 +vt -5.51181 7.95542 +f 34/269/37 33/270/37 49/271/37 66/272/37 + +v 0.0024 0.0072 0.00335799 +vt -4.52756 12.5604 +vt -5.51181 17.7165 +f 59/32/5 161/273/5 65/274/5 + +v -0.0024 0.0072 0.00335799 +vt -1.37795 12.5604 +f 59/32/5 162/275/5 161/273/5 + +f 45/33/5 162/275/5 59/32/5 + +vt -0.393701 17.7165 +f 162/275/5 45/33/5 50/276/5 + +v -0.0024 0.0072 0.00155799 +vt -1.37795 13.7415 +f 162/275/5 50/276/5 163/277/5 + +f 65/274/5 163/277/5 50/276/5 + +v 0.0024 0.0072 0.00155799 +vt -4.52756 13.7415 +f 163/277/5 65/274/5 164/278/5 + +f 164/278/5 65/274/5 161/273/5 + +usemtl Gray4 +vt 13.7415 14.9606 +vt 12.5604 14.9606 +v 0.0024 -2.81997e-017 0.00335799 +vt 12.5604 10.2362 +v 0.0024 -2.81997e-017 -0.00639474 +vt 18.9598 10.2362 +v 0.0024 0.0018 -0.00592105 +vt 18.649 11.4173 +v 0.0024 0.0018 0.00155799 +vt 13.7415 11.4173 +f 164/279/1 161/280/1 165/281/1 166/282/1 167/283/1 168/284/1 + +vt 4.52756 14.9606 +vt 1.37795 14.9606 +v -0.0024 -2.81997e-017 0.00335799 +vt 1.37795 10.2362 +vt 4.52756 10.2362 +f 161/285/2 162/286/2 169/287/2 165/288/2 + +vt -12.5604 14.9606 +vt -13.7415 14.9606 +v -0.0024 0.0018 0.00155799 +vt -13.7415 11.4173 +v -0.0024 0.0018 -0.00592105 +vt -18.649 11.4173 +v -0.0024 -2.81997e-017 -0.00639474 +vt -18.9598 10.2362 +vt -12.5604 10.2362 +f 162/289/3 163/290/3 170/291/3 171/292/3 172/293/3 169/294/3 + +vt -4.52756 14.9606 +vt -4.52756 11.4173 +vt -1.37795 11.4173 +vt -1.37795 14.9606 +f 164/295/7 168/296/7 170/297/7 163/298/7 + +vt 1.37795 13.7415 +vt 4.52756 13.7415 +vt 4.52756 18.649 +vt 1.37795 18.649 +f 170/299/4 168/300/4 167/301/4 171/302/4 + +usemtl Gray6 +vt 1.37795 6.29536 +vn 0 -0.254493 0.967075 +vt 1.37795 5.07405 +vt 4.52756 5.07405 +vt 4.52756 6.29536 +f 171/303/38 172/304/38 166/305/38 167/306/38 + +vt 0.393701 9.9593 +vn -1.49111e-029 -0.254493 0.967075 +f 50/307/39 172/304/39 171/303/39 + +vt 0.393701 -5.51068 +f 36/308/39 172/304/39 50/307/39 + +f 172/304/39 36/308/39 166/305/39 + +vt 5.51181 -5.51068 +f 35/309/39 166/305/39 36/308/39 + +vt 5.51181 9.9593 +f 166/305/39 35/309/39 65/310/39 + +f 166/305/39 65/310/39 167/306/39 + +f 167/306/39 65/310/39 171/303/39 + +f 50/307/39 171/303/39 65/310/39 + +usemtl Gray4 +vt -1.37795 18.9598 +vt -4.52756 18.9598 +f 169/275/5 172/311/5 166/312/5 165/273/5 + +usemtl Gray6 +f 37/63/4 34/65/4 35/7/4 + +vt 1.42109e-014 0 +vt 1.42109e-014 -1.5748 +vt 5.90551 -1.5748 +f 43/23/2 39/313/2 41/314/2 44/315/2 + +vt -5.90551 21.2598 +vt -1.42109e-014 21.2598 +vt -5.90551 29.9213 +f 44/316/5 41/317/5 40/66/5 42/318/5 + diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Glock.obj.meta b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Glock.obj.meta new file mode 100644 index 0000000..d72c278 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Glock.obj.meta @@ -0,0 +1,81 @@ +fileFormatVersion: 2 +guid: c1232b0a1b78ddf44bd877453fb7a84c +timeCreated: 1449962051 +licenseType: Free +ModelImporter: + serializedVersion: 18 + fileIDToRecycleName: + 100000: Mesh1_Group2_Group1_Model + 100002: Mesh2_Group3_Group1_Model + 100004: //RootNode + 400000: Mesh1_Group2_Group1_Model + 400002: Mesh2_Group3_Group1_Model + 400004: //RootNode + 2300000: Mesh1_Group2_Group1_Model + 2300002: Mesh2_Group3_Group1_Model + 3300000: Mesh1_Group2_Group1_Model + 3300002: Mesh2_Group3_Group1_Model + 4300000: Mesh1_Group2_Group1_Model + 4300002: Mesh2_Group3_Group1_Model + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + optimizeGameObjects: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + animationCompression: 1 + animationRotationError: .5 + animationPositionError: .5 + animationScaleError: .5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + importBlendShapes: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + splitTangentsAcrossUV: 1 + normalImportMode: 0 + tangentImportMode: 1 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + human: [] + skeleton: [] + armTwist: .5 + foreArmTwist: .5 + upperLegTwist: .5 + legTwist: .5 + armStretch: .0500000007 + legStretch: .0500000007 + feetSpacing: 0 + rootMotionBoneName: + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials.meta b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials.meta new file mode 100644 index 0000000..ef9997c --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 67d3f94386c0b71468666520386ce0b9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray4.mat b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray4.mat new file mode 100644 index 0000000..3a7dfc2 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray4.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Gray4 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.666667, g: 0.666667, b: 0.666667, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray4.mat.meta b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray4.mat.meta new file mode 100644 index 0000000..25b5e54 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray4.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 36f616b823d57714b97b12b9319c9db9 +timeCreated: 1449962048 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray6.mat b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray6.mat new file mode 100644 index 0000000..f665910 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray6.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Gray6 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.376471, g: 0.376471, b: 0.376471, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray6.mat.meta b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray6.mat.meta new file mode 100644 index 0000000..348a8cb --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray6.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1aa329960fc39aa4490b3a9e7e965fa8 +timeCreated: 1449962047 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray8.mat b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray8.mat new file mode 100644 index 0000000..17d9da4 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray8.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Gray8 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION + m_LightmapFlags: 1 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.266667, g: 0.266667, b: 0.266667, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray8.mat.meta b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray8.mat.meta new file mode 100644 index 0000000..8836f8f --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Gray8.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e86c377702aa20748ac223d70f899dc1 +timeCreated: 1449962047 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh1_Group2_Group1_ModelMat.mat b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh1_Group2_Group1_ModelMat.mat new file mode 100644 index 0000000..4513902 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh1_Group2_Group1_ModelMat.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Mesh1_Group2_Group1_ModelMat + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh1_Group2_Group1_ModelMat.mat.meta b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh1_Group2_Group1_ModelMat.mat.meta new file mode 100644 index 0000000..14bbc73 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh1_Group2_Group1_ModelMat.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 15a077ea89f165e44938d08352278a6d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh2_Group3_Group1_ModelMat.mat b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh2_Group3_Group1_ModelMat.mat new file mode 100644 index 0000000..de3ae88 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh2_Group3_Group1_ModelMat.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Mesh2_Group3_Group1_ModelMat + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh2_Group3_Group1_ModelMat.mat.meta b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh2_Group3_Group1_ModelMat.mat.meta new file mode 100644 index 0000000..03bc876 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Models/Weapons/Materials/Mesh2_Group3_Group1_ModelMat.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ef0c6639b7aef1d44b199f31c51a272a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs.meta b/Assets/FishNet/Demos/ColliderRollback/Prefabs.meta new file mode 100644 index 0000000..0498666 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d55bbb2250d24b94785e2ee08c45c5f4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Particles.meta b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Particles.meta new file mode 100644 index 0000000..5c5d821 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Particles.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d8fc0da1e1391e8409064c221f02358b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Particles/Pistol Muzzle Flash.prefab b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Particles/Pistol Muzzle Flash.prefab new file mode 100644 index 0000000..4f00e27 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Particles/Pistol Muzzle Flash.prefab @@ -0,0 +1,4787 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &39148481766341303 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 39148481765988663} + - component: {fileID: 2223111389534518433} + m_Layer: 0 + m_Name: Pistol Muzzle Flash + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &39148481765988663 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 39148481766341303} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 5894040643203631104} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2223111389534518433 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 39148481766341303} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3f244f524a030c6459722c6594b1e9bd, type: 3} + m_Name: + m_EditorClassIdentifier: + _delay: 1 +--- !u!1 &5894040643203631119 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5894040643203631104} + - component: {fileID: 5894040643203631106} + - component: {fileID: 5894040643203631105} + m_Layer: 0 + m_Name: Top + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5894040643203631104 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5894040643203631119} + m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.3, y: 1.3, z: 1.3} + m_Children: [] + m_Father: {fileID: 39148481765988663} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} +--- !u!199 &5894040643203631106 +ParticleSystemRenderer: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5894040643203631119} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 4294967295 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4bf10d94145fd6c4187c18de0af92e43, type: 2} + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_RenderMode: 1 + m_SortMode: 0 + m_MinParticleSize: 0 + m_MaxParticleSize: 0.5 + m_CameraVelocityScale: 0 + m_VelocityScale: 1 + m_LengthScale: 1 + m_SortingFudge: 0 + m_NormalDirection: 1 + m_ShadowBias: 0 + m_RenderAlignment: 1 + m_Pivot: {x: 0, y: 0, z: 0} + m_Flip: {x: 0, y: 0, z: 0} + m_UseCustomVertexStreams: 0 + m_EnableGPUInstancing: 0 + m_ApplyActiveColorSpace: 0 + m_AllowRoll: 1 + m_VertexStreams: 0001030405 + m_Mesh: {fileID: 0} + m_Mesh1: {fileID: 0} + m_Mesh2: {fileID: 0} + m_Mesh3: {fileID: 0} + m_MaskInteraction: 0 +--- !u!198 &5894040643203631105 +ParticleSystem: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5894040643203631119} + serializedVersion: 6 + lengthInSec: 1 + simulationSpeed: 1 + stopAction: 0 + cullingMode: 3 + ringBufferMode: 0 + ringBufferLoopRange: {x: 0, y: 1} + looping: 0 + prewarm: 0 + playOnAwake: 1 + useUnscaledTime: 0 + autoRandomSeed: 1 + useRigidbodyForVelocity: 1 + startDelay: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + moveWithTransform: 0 + moveWithCustomTransform: {fileID: 0} + scalingMode: 0 + randomSeed: 0 + InitialModule: + serializedVersion: 3 + enabled: 1 + startLifetime: + serializedVersion: 2 + minMaxState: 3 + scalar: 0.2 + minScalar: 0.1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + startSpeed: + serializedVersion: 2 + minMaxState: 3 + scalar: 0.06 + minScalar: 0.03 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.41666666 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + startColor: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + startSize: + serializedVersion: 2 + minMaxState: 3 + scalar: 0.035 + minScalar: 0.015 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.39999998 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + startSizeY: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSizeZ: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotationX: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotationY: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotation: + serializedVersion: 2 + minMaxState: 3 + scalar: 6.283185 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + randomizeRotationDirection: 0 + maxNumParticles: 1000 + size3D: 0 + rotation3D: 0 + gravityModifier: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + ShapeModule: + serializedVersion: 6 + enabled: 1 + type: 4 + angle: 30 + length: 5 + boxThickness: {x: 0, y: 0, z: 0} + radiusThickness: 1 + donutRadius: 0.2 + m_Position: {x: 0, y: 0, z: 0} + m_Rotation: {x: 0, y: 0, z: 0} + m_Scale: {x: 1, y: 1, z: 1} + placementMode: 0 + m_MeshMaterialIndex: 0 + m_MeshNormalOffset: 0 + m_MeshSpawn: + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Mesh: {fileID: 0} + m_MeshRenderer: {fileID: 0} + m_SkinnedMeshRenderer: {fileID: 0} + m_Sprite: {fileID: 0} + m_SpriteRenderer: {fileID: 0} + m_UseMeshMaterialIndex: 0 + m_UseMeshColors: 1 + alignToDirection: 0 + m_Texture: {fileID: 0} + m_TextureClipChannel: 3 + m_TextureClipThreshold: 0 + m_TextureUVChannel: 0 + m_TextureColorAffectsParticles: 1 + m_TextureAlphaAffectsParticles: 1 + m_TextureBilinearFiltering: 0 + randomDirectionAmount: 0 + sphericalDirectionAmount: 0 + randomPositionAmount: 0 + radius: + value: 0.01 + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + arc: + value: 360 + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + EmissionModule: + enabled: 1 + serializedVersion: 4 + rateOverTime: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 10 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + rateOverDistance: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_BurstCount: 1 + m_Bursts: + - serializedVersion: 2 + time: 0 + countCurve: + serializedVersion: 2 + minMaxState: 3 + scalar: 7 + minScalar: 5 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + cycleCount: 1 + repeatInterval: 0.01 + probability: 1 + SizeModule: + enabled: 1 + curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1.4 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 2 + outSlope: 2 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 0 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + RotationModule: + enabled: 1 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curve: + serializedVersion: 2 + minMaxState: 2 + scalar: 6.283185 + minScalar: 0.7853982 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0.4065934 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: -0.49450547 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + ColorModule: + enabled: 1 + gradient: + serializedVersion: 2 + minMaxState: 1 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 0.9137255, b: 0.5529412, a: 1} + key1: {r: 1, g: 0.27058825, b: 0, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0.2901961} + key4: {r: 0, g: 0, b: 0, a: 0.5019608} + key5: {r: 0, g: 0, b: 0, a: 1} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 41636 + atime2: 65084 + atime3: 34695 + atime4: 37201 + atime5: 47417 + atime6: 65535 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 3 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + UVModule: + serializedVersion: 2 + enabled: 0 + mode: 0 + timeMode: 0 + fps: 30 + frameOverTime: + serializedVersion: 2 + minMaxState: 1 + scalar: 0.9999 + minScalar: 0.9999 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startFrame: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + speedRange: {x: 0, y: 1} + tilesX: 1 + tilesY: 1 + animationType: 0 + rowIndex: 0 + cycles: 1 + uvChannelMask: -1 + rowMode: 1 + sprites: + - sprite: {fileID: 0} + flipU: 0 + flipV: 0 + VelocityModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalX: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalY: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetX: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetY: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + radial: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + speedModifier: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + inWorldSpace: 0 + InheritVelocityModule: + enabled: 0 + m_Mode: 0 + m_Curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + ForceModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + inWorldSpace: 0 + randomizePerFrame: 0 + ExternalForcesModule: + serializedVersion: 2 + enabled: 0 + multiplierCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + influenceFilter: 0 + influenceMask: + serializedVersion: 2 + m_Bits: 4294967295 + influenceList: [] + ClampVelocityModule: + enabled: 1 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + magnitude: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.8 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxis: 0 + inWorldSpace: 0 + multiplyDragByParticleSize: 1 + multiplyDragByParticleVelocity: 1 + dampen: 0.08 + drag: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + NoiseModule: + enabled: 0 + strength: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + strengthY: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + strengthZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + frequency: 0.5 + damping: 1 + octaves: 1 + octaveMultiplier: 0.5 + octaveScale: 2 + quality: 2 + scrollSpeed: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remap: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapY: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapZ: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapEnabled: 0 + positionAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + rotationAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + sizeAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + SizeBySpeedModule: + enabled: 0 + curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + range: {x: 0, y: 1} + separateAxes: 0 + RotationBySpeedModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.7853982 + minScalar: 0.7853982 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + range: {x: 0, y: 1} + ColorBySpeedModule: + enabled: 0 + gradient: + serializedVersion: 2 + minMaxState: 1 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + range: {x: 0, y: 1} + CollisionModule: + enabled: 0 + serializedVersion: 3 + type: 0 + collisionMode: 0 + colliderForce: 0 + multiplyColliderForceByParticleSize: 0 + multiplyColliderForceByParticleSpeed: 0 + multiplyColliderForceByCollisionAngle: 1 + plane0: {fileID: 0} + plane1: {fileID: 0} + plane2: {fileID: 0} + plane3: {fileID: 0} + plane4: {fileID: 0} + plane5: {fileID: 0} + m_Dampen: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Bounce: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_EnergyLossOnCollision: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minKillSpeed: 0 + maxKillSpeed: 10000 + radiusScale: 1 + collidesWith: + serializedVersion: 2 + m_Bits: 4294967295 + maxCollisionShapes: 256 + quality: 0 + voxelSize: 0.5 + collisionMessages: 0 + collidesWithDynamic: 1 + interiorCollisions: 1 + TriggerModule: + enabled: 0 + collisionShape0: {fileID: 0} + collisionShape1: {fileID: 0} + collisionShape2: {fileID: 0} + collisionShape3: {fileID: 0} + collisionShape4: {fileID: 0} + collisionShape5: {fileID: 0} + inside: 1 + outside: 0 + enter: 0 + exit: 0 + radiusScale: 1 + SubModule: + serializedVersion: 2 + enabled: 0 + subEmitters: + - serializedVersion: 3 + emitter: {fileID: 0} + type: 0 + properties: 0 + emitProbability: 1 + LightsModule: + enabled: 0 + ratio: 0 + light: {fileID: 0} + randomDistribution: 1 + color: 1 + range: 1 + intensity: 1 + rangeCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + intensityCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + maxLights: 20 + TrailModule: + enabled: 0 + mode: 0 + ratio: 1 + lifetime: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minVertexDistance: 0.2 + textureMode: 0 + ribbonCount: 1 + shadowBias: 0.5 + worldSpace: 0 + dieWithParticles: 1 + sizeAffectsWidth: 1 + sizeAffectsLifetime: 0 + inheritParticleColor: 1 + generateLightingData: 0 + splitSubEmitterRibbons: 0 + attachRibbonsToTransform: 0 + colorOverLifetime: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + widthOverTrail: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorOverTrail: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + CustomDataModule: + enabled: 0 + mode0: 0 + vectorComponentCount0: 4 + color0: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + colorLabel0: Color + vector0_0: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_0: X + vector0_1: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_1: Y + vector0_2: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_2: Z + vector0_3: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_3: W + mode1: 0 + vectorComponentCount1: 4 + color1: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + colorLabel1: Color + vector1_0: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_0: X + vector1_1: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_1: Y + vector1_2: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_2: Z + vector1_3: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_3: W diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Particles/Pistol Muzzle Flash.prefab.meta b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Particles/Pistol Muzzle Flash.prefab.meta new file mode 100644 index 0000000..3e01ad5 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Particles/Pistol Muzzle Flash.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4385a793e032d634bb912f84a23d6db1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Player.prefab b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Player.prefab new file mode 100644 index 0000000..3c59936 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Player.prefab @@ -0,0 +1,163 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4117607941181585914 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4117607941181585915} + - component: {fileID: 8475222101369129519} + - component: {fileID: 2759061792589502182} + - component: {fileID: 1348621277} + - component: {fileID: 1348621278} + - component: {fileID: 5081159371976248031} + m_Layer: 2 + m_Name: Player + m_TagString: Player + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4117607941181585915 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4117607941181585914} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 2, z: -2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8475222101369129519 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4117607941181585914} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 27 + k__BackingField: 0 + _scenePathHash: 0 + k__BackingField: 0 + k__BackingField: 7473726319608011331 + AdaptiveInterpolationValue: 4 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 2759061792589502182} + - {fileID: 1348621277} + - {fileID: 1348621278} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 0} + LocalScale: {x: 0, y: 0, z: 0} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &2759061792589502182 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4117607941181585914} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9d3558aad46c24549bea48d0e3938264, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 8475222101369129519} + _networkObjectCache: {fileID: 8475222101369129519} + _hitboxLayer: + serializedVersion: 2 + m_Bits: 32 + _audio: {fileID: 8300000, guid: 0330762d2b3c8d641bfe11ad89b7e196, type: 3} + _muzzleFlashPrefab: {fileID: 39148481766341303, guid: 4385a793e032d634bb912f84a23d6db1, + type: 3} +--- !u!114 &1348621277 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4117607941181585914} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e6d656f377f37164d8d7431aa4e43cdb, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 1 + _addedNetworkObject: {fileID: 8475222101369129519} + _networkObjectCache: {fileID: 8475222101369129519} +--- !u!114 &1348621278 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4117607941181585914} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c718ab30626bbd648952910f74780a06, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 2 + _addedNetworkObject: {fileID: 8475222101369129519} + _networkObjectCache: {fileID: 8475222101369129519} + _moveRate: 3 +--- !u!143 &5081159371976248031 +CharacterController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4117607941181585914} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Height: 1.85 + m_Radius: 0.5 + m_SlopeLimit: 45 + m_StepOffset: 0.3 + m_SkinWidth: 0.08 + m_MinMoveDistance: 0.001 + m_Center: {x: 0, y: 0.925, z: 0} diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Player.prefab.meta b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Player.prefab.meta new file mode 100644 index 0000000..7ab5d43 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Player.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8cf33e8e99a9b0c4c8f29ff725650de6 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization.meta b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization.meta new file mode 100644 index 0000000..b27609c --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0f2b8542dea4ed449a71c582716ed888 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ClientPosition.prefab b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ClientPosition.prefab new file mode 100644 index 0000000..9bf45ae --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ClientPosition.prefab @@ -0,0 +1,95 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5088285619167334560 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5088285619167334572} + - component: {fileID: 5088285619167334563} + - component: {fileID: 5088285619167334562} + - component: {fileID: 7203670863068453979} + m_Layer: 0 + m_Name: ClientPosition + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5088285619167334572 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5088285619167334560} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.04, y: 1.37, z: -3.993} + m_LocalScale: {x: 1, y: 1.85, z: 0.1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &5088285619167334563 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5088285619167334560} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5088285619167334562 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5088285619167334560} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 997fc4a5ccc62814697fc91eb139e535, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!114 &7203670863068453979 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5088285619167334560} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3f244f524a030c6459722c6594b1e9bd, type: 3} + m_Name: + m_EditorClassIdentifier: + _delay: 3 diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ClientPosition.prefab.meta b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ClientPosition.prefab.meta new file mode 100644 index 0000000..397a502 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ClientPosition.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ad8f5b5504b971d42886f4f6fd087d90 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ServerPosition.prefab b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ServerPosition.prefab new file mode 100644 index 0000000..4d95c5a --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ServerPosition.prefab @@ -0,0 +1,95 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7134941405922954312 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2532797443735268486} + - component: {fileID: 5847025287746828581} + - component: {fileID: 2682424605327152458} + - component: {fileID: 6822465367542887163} + m_Layer: 0 + m_Name: ServerPosition + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2532797443735268486 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7134941405922954312} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 3.85, y: 1.37, z: -3.993} + m_LocalScale: {x: 1, y: 1.85, z: 0.1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &5847025287746828581 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7134941405922954312} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2682424605327152458 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7134941405922954312} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 14cdcc3d5d8692d469297ede7ced7ab8, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!114 &6822465367542887163 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7134941405922954312} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3f244f524a030c6459722c6594b1e9bd, type: 3} + m_Name: + m_EditorClassIdentifier: + _delay: 3 diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ServerPosition.prefab.meta b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ServerPosition.prefab.meta new file mode 100644 index 0000000..083d871 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/ServerPosition.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 85cfddb33a414594490116dc8e2a91f4 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/TextCanvas.prefab b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/TextCanvas.prefab new file mode 100644 index 0000000..e3b3a19 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/TextCanvas.prefab @@ -0,0 +1,282 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4295747174325081366 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8244491120346562302} + - component: {fileID: 5312765372148467592} + - component: {fileID: 2637820444415577480} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8244491120346562302 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4295747174325081366} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 6334056160868253460} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5312765372148467592 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4295747174325081366} + m_CullTransparentMesh: 0 +--- !u!114 &2637820444415577480 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4295747174325081366} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 14 + m_MaxSize: 36 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: +--- !u!1 &6334056159345675329 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6334056159345675354} + - component: {fileID: 6334056159345675333} + - component: {fileID: 6334056159345675332} + - component: {fileID: 6334056159345675335} + - component: {fileID: 6334056159345675334} + - component: {fileID: 1319350220} + m_Layer: 5 + m_Name: TextCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6334056159345675354 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6334056159345675329} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 6334056160868253460} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &6334056159345675333 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6334056159345675329} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &6334056159345675332 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6334056159345675329} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &6334056159345675335 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6334056159345675329} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &6334056159345675334 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6334056159345675329} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0dc71af4e9bb144195230171a19cca9, type: 3} + m_Name: + m_EditorClassIdentifier: + _text: {fileID: 2637820444415577480} +--- !u!114 &1319350220 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6334056159345675329} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3f244f524a030c6459722c6594b1e9bd, type: 3} + m_Name: + m_EditorClassIdentifier: + _delay: 3 +--- !u!1 &6334056160868253463 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6334056160868253460} + - component: {fileID: 6334056160868253482} + - component: {fileID: 6334056160868253461} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6334056160868253460 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6334056160868253463} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 8244491120346562302} + m_Father: {fileID: 6334056159345675354} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -30.1} + m_SizeDelta: {x: 0, y: 60.16568} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6334056160868253482 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6334056160868253463} + m_CullTransparentMesh: 0 +--- !u!114 &6334056160868253461 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6334056160868253463} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 0.49019608} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/TextCanvas.prefab.meta b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/TextCanvas.prefab.meta new file mode 100644 index 0000000..1684291 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/Rollback Visualization/TextCanvas.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a7bbd13c7452746409efbaeae6a0d8e3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/_ColliderRollback_Prefabs.asset b/Assets/FishNet/Demos/ColliderRollback/Prefabs/_ColliderRollback_Prefabs.asset new file mode 100644 index 0000000..d2dffc6 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/_ColliderRollback_Prefabs.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4489d77032a81ef42b0067acf2737d4d, type: 3} + m_Name: _ColliderRollback_Prefabs + m_EditorClassIdentifier: + _prefabs: + - {fileID: 8475222101369129519, guid: 8cf33e8e99a9b0c4c8f29ff725650de6, type: 3} diff --git a/Assets/FishNet/Demos/ColliderRollback/Prefabs/_ColliderRollback_Prefabs.asset.meta b/Assets/FishNet/Demos/ColliderRollback/Prefabs/_ColliderRollback_Prefabs.asset.meta new file mode 100644 index 0000000..538d408 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Prefabs/_ColliderRollback_Prefabs.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d9693011b7416444aa06cafe900e23c0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scenes.meta b/Assets/FishNet/Demos/ColliderRollback/Scenes.meta new file mode 100644 index 0000000..99cbb3b --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 79a89eaf9d5b7364e9a9f0e6ae485f84 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scenes/ColliderRollbackDemo.unity b/Assets/FishNet/Demos/ColliderRollback/Scenes/ColliderRollbackDemo.unity new file mode 100644 index 0000000..5db26c4 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scenes/ColliderRollbackDemo.unity @@ -0,0 +1,2865 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44664782, g: 0.49649352, b: 0.57486135, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 1382340864} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &78153333 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 78153335} + - component: {fileID: 78153334} + m_Layer: 0 + m_Name: HeadHitbox + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &78153334 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 78153333} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!4 &78153335 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 78153333} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1289693644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &110068715 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 110068720} + - component: {fileID: 110068719} + - component: {fileID: 110068718} + - component: {fileID: 110068716} + - component: {fileID: 110068721} + m_Layer: 0 + m_Name: EnemySetup + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!114 &110068716 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 110068715} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01a271dd97d875347b0cea860df29a9d, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 110068721} + _networkObjectCache: {fileID: 110068721} + _boundingBox: 0 + _physicsType: 1 + _boundingBoxSize: {x: 3, y: 3, z: 3} + _colliderParents: + - {fileID: 1625859525} + - {fileID: 78153333} +--- !u!23 &110068718 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 110068715} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4c62c607906e6e1499102239be9499be, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &110068719 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 110068715} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &110068720 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 110068715} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -4.45, y: 1.5, z: 7.95} + m_LocalScale: {x: 1, y: 1.85, z: 0.1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1625859526} + - {fileID: 1289693644} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &110068721 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 110068715} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 110068716} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -4.45, y: 1.5, z: 7.95} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 1, y: 1.85, z: 0.1} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _teleportThreshold: 1 + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 1588699107 + k__BackingField: 6823410710706878447 + k__BackingField: 0 +--- !u!1 &293940165 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 293940166} + - component: {fileID: 293940169} + - component: {fileID: 293940168} + - component: {fileID: 293940167} + m_Layer: 0 + m_Name: BackWall + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &293940166 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 293940165} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3, z: -12} + m_LocalScale: {x: 25, y: 5, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1760695700} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &293940167 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 293940165} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &293940168 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 293940165} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &293940169 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 293940165} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &315136619 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 315136621} + - component: {fileID: 315136620} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &315136620 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 315136619} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.90961653, b: 0.745283, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 2 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &315136621 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 315136619} + m_LocalRotation: {x: 0.29130033, y: -0.654909, z: 0.30399895, w: 0.62755316} + m_LocalPosition: {x: -5.9194202, y: 8.696499, z: 15.588365} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1845740120} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 49.800003, y: -92.44401, z: 0} +--- !u!1 &333123234 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 333123235} + - component: {fileID: 333123238} + - component: {fileID: 333123237} + - component: {fileID: 333123236} + m_Layer: 0 + m_Name: FrontWall + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &333123235 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 333123234} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3, z: 12} + m_LocalScale: {x: 25, y: 5, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1760695700} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &333123236 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 333123234} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &333123237 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 333123234} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 14d23cd2d8240244baa6026ca98df0bf, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &333123238 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 333123234} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &374579912 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 374579917} + - component: {fileID: 374579916} + - component: {fileID: 374579915} + - component: {fileID: 374579922} + - component: {fileID: 374579919} + - component: {fileID: 374579913} + - component: {fileID: 374579921} + - component: {fileID: 374579914} + m_Layer: 0 + m_Name: MovingEnemyDemo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &374579913 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 374579912} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 088014ab71fc022458b82ed8c9792b1b, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 1 + _addedNetworkObject: {fileID: 374579922} + _networkObjectCache: {fileID: 374579922} + MoveRate: 3 + MoveDistance: 5 +--- !u!114 &374579914 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 374579912} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 3 + _addedNetworkObject: {fileID: 374579922} + _networkObjectCache: {fileID: 374579922} + _componentConfiguration: 0 + _synchronizeParent: 0 + _packing: + Position: 1 + Rotation: 1 + Scale: 0 + _interpolation: 2 + _extrapolation: 0 + _enableTeleport: 0 + _teleportThreshold: 1 + _scaleThreshold: 1 + _clientAuthoritative: 0 + _sendToOwner: 0 + _enableNetworkLod: 1 + _interval: 1 + _synchronizePosition: 1 + _positionSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeRotation: 1 + _rotationSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeScale: 1 + _scaleSnapping: + X: 0 + Y: 0 + Z: 0 +--- !u!23 &374579915 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 374579912} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4c62c607906e6e1499102239be9499be, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &374579916 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 374579912} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &374579917 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 374579912} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.5, z: 8} + m_LocalScale: {x: 1, y: 2, z: 0.1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2042333235} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &374579919 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 374579912} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6c5d5c9fcdb14704d9c64b18dc05a809, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 374579922} + _networkObjectCache: {fileID: 374579922} + _originalPrefab: {fileID: 5088285619167334560, guid: ad8f5b5504b971d42886f4f6fd087d90, + type: 3} + _rollbackPrefab: {fileID: 7134941405922954312, guid: 85cfddb33a414594490116dc8e2a91f4, + type: 3} + _textCanvasPrefab: {fileID: 6334056159345675334, guid: a7bbd13c7452746409efbaeae6a0d8e3, + type: 3} +--- !u!114 &374579921 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 374579912} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01a271dd97d875347b0cea860df29a9d, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 2 + _addedNetworkObject: {fileID: 374579922} + _networkObjectCache: {fileID: 374579922} + _boundingBox: 0 + _physicsType: 1 + _boundingBoxSize: {x: 3, y: 3, z: 3} + _colliderParents: + - {fileID: 2042333234} +--- !u!114 &374579922 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 374579912} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 374579919} + - {fileID: 374579913} + - {fileID: 374579921} + - {fileID: 374579914} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 0} + LocalScale: {x: 0, y: 0, z: 0} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _teleportThreshold: 1 + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 1588699107 + k__BackingField: 6823410710584987682 + k__BackingField: 0 +--- !u!1 &485115532 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 485115533} + m_Layer: 0 + m_Name: Muzzle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &485115533 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 485115532} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.014, z: 0.0242} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5670937365706158997} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &557728923 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 557728924} + - component: {fileID: 557728926} + - component: {fileID: 557728925} + m_Layer: 0 + m_Name: Displays + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &557728924 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 557728923} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1016939666208092860} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &557728925 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 557728923} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8bc8f0363ddc75946a958043c5e49a83, type: 3} + m_Name: + m_EditorClassIdentifier: + _color: {r: 0, g: 0, b: 0, a: 1} + _placement: 3 + _showOutgoing: 1 + _showIncoming: 1 +--- !u!114 &557728926 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 557728923} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f9b6b565cd9533c4ebc18003f0fc18a2, type: 3} + m_Name: + m_EditorClassIdentifier: + _color: {r: 0, g: 0, b: 0, a: 1} + _placement: 2 + _hideTickRate: 1 +--- !u!1 &1136385240 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1136385243} + - component: {fileID: 1136385244} + - component: {fileID: 1136385242} + - component: {fileID: 1136385241} + m_Layer: 0 + m_Name: Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1136385241 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1136385240} + m_Enabled: 1 +--- !u!20 &1136385242 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1136385240} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.63492346, g: 0.70660126, b: 0.8207547, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 1 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1136385243 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1136385240} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 2, z: -2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5670937365706158997} + m_Father: {fileID: 1845740120} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1136385244 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1136385240} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe0209d73083bf744ba4925f8cad7144, type: 3} + m_Name: + m_EditorClassIdentifier: + MuzzleFlash: {fileID: 485115533} +--- !u!1 &1289693643 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1289693644} + - component: {fileID: 1289693646} + - component: {fileID: 1289693645} + m_Layer: 0 + m_Name: Head + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1289693644 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1289693643} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.672, z: 0} + m_LocalScale: {x: 0.35, y: 0.35, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 78153335} + m_Father: {fileID: 110068720} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1289693645 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1289693643} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4c62c607906e6e1499102239be9499be, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1289693646 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1289693643} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!850595691 &1382340864 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Settings.lighting + serializedVersion: 4 + m_GIWorkflowMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 1 + m_LightmapMaxSize: 1024 + m_BakeResolution: 40 + m_Padding: 2 + m_LightmapCompression: 3 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 256 + m_FinalGatherFiltering: 1 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRMinBounces: 2 + m_PVREnvironmentMIS: 0 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_PVRTiledBaking: 0 +--- !u!1 &1469142509 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1469142510} + - component: {fileID: 1469142513} + - component: {fileID: 1469142512} + - component: {fileID: 1469142511} + m_Layer: 0 + m_Name: LeftWall + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1469142510 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1469142509} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -12, y: 3, z: 0} + m_LocalScale: {x: 1, y: 5, z: 25} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1760695700} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1469142511 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1469142509} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1469142512 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1469142509} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1469142513 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1469142509} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1499550446 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1499550447} + - component: {fileID: 1499550450} + - component: {fileID: 1499550449} + - component: {fileID: 1499550448} + m_Layer: 0 + m_Name: Floor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1499550447 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1499550446} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 25, y: 1, z: 25} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1760695700} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1499550448 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1499550446} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1499550449 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1499550446} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 3d329b71ccd856144ab8753e70f69e4e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1499550450 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1499550446} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1508050967 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1508050968} + - component: {fileID: 1508050970} + - component: {fileID: 1508050969} + m_Layer: 5 + m_Name: Crosshairs (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1508050968 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1508050967} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1885986765} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 130, y: 130} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1508050969 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1508050967} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: dd2a76027478bf540b7194d78248edf8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1508050970 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1508050967} + m_CullTransparentMesh: 0 +--- !u!1 &1625859525 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1625859526} + - component: {fileID: 1625859527} + m_Layer: 0 + m_Name: BodyHitbox + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1625859526 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1625859525} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 110068720} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1625859527 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1625859525} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &1670963065 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1670963066} + - component: {fileID: 1670963069} + - component: {fileID: 1670963068} + - component: {fileID: 1670963067} + m_Layer: 0 + m_Name: RightWall + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1670963066 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1670963065} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 12, y: 3, z: 0} + m_LocalScale: {x: 1, y: 5, z: 25} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1760695700} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1670963067 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1670963065} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1670963068 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1670963065} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1670963069 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1670963065} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1697504689 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1697504690} + - component: {fileID: 1697504692} + - component: {fileID: 1697504691} + m_Layer: 5 + m_Name: Crosshairs + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1697504690 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1697504689} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1885986765} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1697504691 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1697504689} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: dd2a76027478bf540b7194d78248edf8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1697504692 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1697504689} + m_CullTransparentMesh: 0 +--- !u!1 &1760695699 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1760695700} + m_Layer: 0 + m_Name: WallsAndFloor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1760695700 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1760695699} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1499550447} + - {fileID: 333123235} + - {fileID: 293940166} + - {fileID: 1469142510} + - {fileID: 1670963066} + m_Father: {fileID: 1845740120} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1845740119 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1845740120} + m_Layer: 0 + m_Name: Scene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1845740120 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1845740119} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1136385243} + - {fileID: 1898334455} + - {fileID: 1885986765} + - {fileID: 315136621} + - {fileID: 1760695700} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1885986761 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1885986765} + - component: {fileID: 1885986764} + - component: {fileID: 1885986763} + - component: {fileID: 1885986762} + m_Layer: 5 + m_Name: CrosshairsCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1885986762 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1885986761} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1885986763 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1885986761} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &1885986764 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1885986761} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &1885986765 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1885986761} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1508050968} + - {fileID: 1697504690} + m_Father: {fileID: 1845740120} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &1898334452 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1898334455} + - component: {fileID: 1898334454} + - component: {fileID: 1898334453} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1898334453 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1898334452} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &1898334454 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1898334452} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &1898334455 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1898334452} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -1.3194205, y: 1.8064992, z: 15.788364} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1845740120} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2042333234 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2042333235} + - component: {fileID: 2042333236} + m_Layer: 5 + m_Name: Hitbox + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2042333235 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2042333234} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 374579917} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &2042333236 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2042333234} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!224 &950570838981703716 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3164981797884060106} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6172005702412834340} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1016939666208092849 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1016939666208092862} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 211a9f6ec51ddc14f908f5acc0cd0423, type: 3} + m_Name: + m_EditorClassIdentifier: + _playerPrefab: {fileID: 8475222101369129519, guid: 8cf33e8e99a9b0c4c8f29ff725650de6, + type: 3} + _addToDefaultScene: 1 + Spawns: [] +--- !u!4 &1016939666208092860 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1016939666208092862} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6172005702803148417} + - {fileID: 557728924} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1016939666208092862 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1016939666208092860} + - component: {fileID: 1016939666208092863} + - component: {fileID: 1016939666208092849} + - component: {fileID: 1016939666208092864} + - component: {fileID: 1016939666208092865} + - component: {fileID: 1016939666208092866} + - component: {fileID: 1016939666208092867} + - component: {fileID: 1016939666208092868} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1016939666208092863 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1016939666208092862} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2c95dfde7d73b54dbbdc23155d35d36, type: 3} + m_Name: + m_EditorClassIdentifier: + _refreshDefaultPrefabs: 1 + _runInBackground: 1 + _dontDestroyOnLoad: 1 + _objectPool: {fileID: 0} + _persistence: 0 + _logging: {fileID: 0} + _spawnablePrefabs: {fileID: 11400000, guid: d9693011b7416444aa06cafe900e23c0, type: 2} +--- !u!114 &1016939666208092864 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1016939666208092862} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b185516acd802904383e2a5f1a666750, type: 3} + m_Name: + m_EditorClassIdentifier: + _boundingBoxLayer: + serializedVersion: 2 + m_Bits: 0 + _maximumRollbackTime: 1 + Interpolation: 2 +--- !u!114 &1016939666208092865 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1016939666208092862} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3fdaae44044276a49a52229c1597e33b, type: 3} + m_Name: + m_EditorClassIdentifier: + _updateOrder: 0 + _timingType: 0 + _allowTickDropping: 0 + _maximumFrameTicks: 2 + _tickRate: 50 + _pingInterval: 1 + _physicsMode: 1 +--- !u!114 &1016939666208092866 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1016939666208092862} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6f48f002b825cbd45a19bd96d90f9edb, type: 3} + m_Name: + m_EditorClassIdentifier: + _unreliableMTU: 1023 + _ipv4BindAddress: + _ipv6BindAddress: + _port: 7770 + _maximumClients: 4095 + _clientAddress: localhost + _timeout: 15 +--- !u!114 &1016939666208092867 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1016939666208092862} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 756c28cd3141c4140ae776188ee26729, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkTraffic: + _updateInteval: 1 + _updateClient: 1 + _updateServer: 1 +--- !u!114 &1016939666208092868 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1016939666208092862} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 34e4a322dca349547989b14021da4e23, type: 3} + m_Name: + m_EditorClassIdentifier: + Transport: {fileID: 1016939666208092866} + _intermediateLayer: {fileID: 0} + _latencySimulator: + _enabled: 0 + _simulateHost: 1 + _latency: 40 + _outOfOrder: 0 + _packetLoss: 0 +--- !u!224 &1695578100518147014 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5420949849147866324} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6172005702262170532} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &3164981797884060106 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 950570838981703716} + - component: {fileID: 3424640392724440141} + - component: {fileID: 6798532730535708727} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &3424640392724440141 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3164981797884060106} + m_CullTransparentMesh: 0 +--- !u!222 &3805187687340116174 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5420949849147866324} + m_CullTransparentMesh: 0 +--- !u!1 &5420949849147866324 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1695578100518147014} + - component: {fileID: 3805187687340116174} + - component: {fileID: 8832568358278173757} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &5670937365703733617 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5670937365705666481} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1aa329960fc39aa4490b3a9e7e965fa8, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!23 &5670937365703733619 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5670937365705666483} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e86c377702aa20748ac223d70f899dc1, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &5670937365704864689 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5670937365705666481} + m_Mesh: {fileID: 4300000, guid: c1232b0a1b78ddf44bd877453fb7a84c, type: 3} +--- !u!33 &5670937365704864691 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5670937365705666483} + m_Mesh: {fileID: 4300002, guid: c1232b0a1b78ddf44bd877453fb7a84c, type: 3} +--- !u!1 &5670937365705666481 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5670937365706158993} + - component: {fileID: 5670937365704864689} + - component: {fileID: 5670937365703733617} + m_Layer: 0 + m_Name: Mesh1_Group2_Group1_Model + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &5670937365705666483 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5670937365706158995} + - component: {fileID: 5670937365704864691} + - component: {fileID: 5670937365703733619} + m_Layer: 0 + m_Name: Mesh2_Group3_Group1_Model + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &5670937365705666485 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5670937365706158997} + m_Layer: 0 + m_Name: Glock + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5670937365706158993 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5670937365705666481} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5670937365706158997} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &5670937365706158995 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5670937365705666483} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5670937365706158997} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &5670937365706158997 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5670937365705666485} + m_LocalRotation: {x: 0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.25, y: -0.25, z: 0.55} + m_LocalScale: {x: 5, y: 5, z: 6} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5670937365706158993} + - {fileID: 5670937365706158995} + - {fileID: 485115533} + m_Father: {fileID: 1136385243} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!224 &6172005702262170532 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702262170535} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1695578100518147014} + m_Father: {fileID: 6172005702803148417} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -96} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!114 &6172005702262170533 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702262170535} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 6172005702262170538} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 6172005702803148445} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Client + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &6172005702262170535 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6172005702262170532} + - component: {fileID: 6172005702262170539} + - component: {fileID: 6172005702262170538} + - component: {fileID: 6172005702262170533} + m_Layer: 5 + m_Name: Client + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &6172005702262170538 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702262170535} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2d50394614f8feb4eb0567fb7618d84d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &6172005702262170539 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702262170535} + m_CullTransparentMesh: 0 +--- !u!224 &6172005702412834340 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702412834343} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 950570838981703716} + m_Father: {fileID: 6172005702803148417} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -16} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!114 &6172005702412834341 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702412834343} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 6172005702412834346} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 6172005702803148445} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Server + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &6172005702412834343 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6172005702412834340} + - component: {fileID: 6172005702412834347} + - component: {fileID: 6172005702412834346} + - component: {fileID: 6172005702412834341} + m_Layer: 5 + m_Name: Server + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &6172005702412834346 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702412834343} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1b187e63031bf7849b249c8212440c3b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &6172005702412834347 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702412834343} + m_CullTransparentMesh: 0 +--- !u!223 &6172005702803148416 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702803148444} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &6172005702803148417 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702803148444} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6172005702412834340} + - {fileID: 6172005702262170532} + m_Father: {fileID: 1016939666208092860} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &6172005702803148418 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702803148444} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &6172005702803148419 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702803148444} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!1 &6172005702803148444 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6172005702803148417} + - component: {fileID: 6172005702803148445} + - component: {fileID: 6172005702803148416} + - component: {fileID: 6172005702803148419} + - component: {fileID: 6172005702803148418} + m_Layer: 5 + m_Name: NetworkHudCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &6172005702803148445 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6172005702803148444} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d3606bfdac5a4743890fc1a5ecd8f24, type: 3} + m_Name: + m_EditorClassIdentifier: + _autoStartType: 0 + _stoppedColor: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + _changingColor: {r: 0.78431374, g: 0.6862745, b: 0, a: 1} + _startedColor: {r: 0, g: 0.5882353, b: 0.64705884, a: 1} + _serverIndicator: {fileID: 6798532730535708727} + _clientIndicator: {fileID: 8832568358278173757} +--- !u!114 &6798532730535708727 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3164981797884060106} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &8832568358278173757 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5420949849147866324} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 diff --git a/Assets/FishNet/Demos/ColliderRollback/Scenes/ColliderRollbackDemo.unity.meta b/Assets/FishNet/Demos/ColliderRollback/Scenes/ColliderRollbackDemo.unity.meta new file mode 100644 index 0000000..b078b79 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scenes/ColliderRollbackDemo.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9e30e3df1ec43184daee875457d49364 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts.meta b/Assets/FishNet/Demos/ColliderRollback/Scripts.meta new file mode 100644 index 0000000..4ed8dd8 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: af8606f905937fc419c0dfcad970cd1d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/DestroyAfterDelay.cs b/Assets/FishNet/Demos/ColliderRollback/Scripts/DestroyAfterDelay.cs new file mode 100644 index 0000000..7a5f284 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/DestroyAfterDelay.cs @@ -0,0 +1,17 @@ +using UnityEngine; + +namespace FishNet.Example.ColliderRollbacks +{ + public class DestroyAfterDelay : MonoBehaviour + { + [SerializeField] + private float _delay = 1f; + + private void Awake() + { + Destroy(gameObject, _delay); + } + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/DestroyAfterDelay.cs.meta b/Assets/FishNet/Demos/ColliderRollback/Scripts/DestroyAfterDelay.cs.meta new file mode 100644 index 0000000..d1e6335 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/DestroyAfterDelay.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f244f524a030c6459722c6594b1e9bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Player.meta b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player.meta new file mode 100644 index 0000000..4c32959 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7a9331e21bfaa0a4aaac4ffe7d8d644c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Aim.cs b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Aim.cs new file mode 100644 index 0000000..c020b49 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Aim.cs @@ -0,0 +1,67 @@ +using FishNet.Object; +using UnityEngine; + + +namespace FishNet.Example.ColliderRollbacks +{ + + /// + /// DEMO. CODE IS NOT OPTIMIZED. + /// Aims the camera. + /// + public class Aim : NetworkBehaviour + { + + public PlayerCamera PlayerCamera { get; private set; } + private readonly Vector3 _offset = new Vector3(0f, 1.65f, 0f); + + public override void OnStartClient() + { + if (base.IsOwner) + PlayerCamera = Camera.main.transform.GetComponent(); + } + + private void Update() + { + if (!base.IsOwner || PlayerCamera == null) + return; + + Cursor.lockState = CursorLockMode.Locked; + Cursor.visible = false; + MoveAim(); + MoveCamera(); + } + + /// + /// Aims camera. + /// + private void MoveAim() + { + float speed = 2f; + //Yaw. + transform.Rotate(new Vector3(0f, Input.GetAxis("Mouse X") * speed, 0f)); + //Pitch. + float pitch = PlayerCamera.transform.eulerAngles.x - (Input.GetAxis("Mouse Y") * speed); + /* If not signed on X then make it + * signed for easy clamping. */ + if (pitch > 180f) + pitch -= 360f; + pitch = Mathf.Clamp(pitch, -89f, 89f); + + PlayerCamera.transform.eulerAngles = new Vector3(pitch, transform.eulerAngles.y, transform.eulerAngles.z); + } + + /// + /// Moves camera. + /// + private void MoveCamera() + { + PlayerCamera.transform.position = transform.position + _offset; + PlayerCamera.transform.rotation = Quaternion.Euler(PlayerCamera.transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z); + } + + } + + + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Aim.cs.meta b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Aim.cs.meta new file mode 100644 index 0000000..1c42d93 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Aim.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e6d656f377f37164d8d7431aa4e43cdb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Fire.cs b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Fire.cs new file mode 100644 index 0000000..6fcb21e --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Fire.cs @@ -0,0 +1,22 @@ +using FishNet.Component.ColliderRollback; +using FishNet.Managing.Timing; +using FishNet.Object; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + + +namespace FishNet.Example.ColliderRollbacks +{ + + /// + /// DEMO. CODE IS NOT OPTIMIZED. + /// Fires at objects. + /// + public class Fire : NetworkBehaviour + { + + + } +} + diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Fire.cs.meta b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Fire.cs.meta new file mode 100644 index 0000000..beca062 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/Fire.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9d3558aad46c24549bea48d0e3938264 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerCamera.cs b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerCamera.cs new file mode 100644 index 0000000..53772b5 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerCamera.cs @@ -0,0 +1,19 @@ +using UnityEngine; + +namespace FishNet.Example.ColliderRollbacks +{ + + /// + /// DEMO. CODE IS NOT OPTIMIZED. + /// Doesn't do much... + /// + public class PlayerCamera : MonoBehaviour + { + /// + /// MuzzleFlash on the weapon. + /// + public Transform MuzzleFlash; + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerCamera.cs.meta b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerCamera.cs.meta new file mode 100644 index 0000000..defc480 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerCamera.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fe0209d73083bf744ba4925f8cad7144 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerMotor.cs b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerMotor.cs new file mode 100644 index 0000000..6339734 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerMotor.cs @@ -0,0 +1,50 @@ +using FishNet.Object; +using UnityEngine; + + +namespace FishNet.Example.ColliderRollbacks +{ + + + /// + /// DEMO. CODE IS NOT OPTIMIZED. + /// Moves the player around. + /// + public class PlayerMotor : NetworkBehaviour + { + [SerializeField] + private float _moveRate = 3f; + + private CharacterController _characterController; + + public override void OnStartClient() + { + if (base.IsOwner) + _characterController = GetComponent(); + } + + + private void Update() + { + if (base.IsOwner) + { + Move(); + } + } + + private void Move() + { + if (_characterController == null) + return; + + Vector3 gravity = new Vector3(0f, -10f, 0f); + Vector3 inputs = transform.TransformDirection( + new Vector3(Input.GetAxisRaw("Horizontal"), 0f, Input.GetAxisRaw("Vertical")) + ); + + _characterController.Move((gravity + inputs) * _moveRate * Time.deltaTime); + } + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerMotor.cs.meta b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerMotor.cs.meta new file mode 100644 index 0000000..69f0be6 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Player/PlayerMotor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c718ab30626bbd648952910f74780a06 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization.meta b/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization.meta new file mode 100644 index 0000000..b7151b8 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9b80990f4a80a944c9394e21c9c2187c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/RollbackVisualizer.cs b/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/RollbackVisualizer.cs new file mode 100644 index 0000000..0cbc82e --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/RollbackVisualizer.cs @@ -0,0 +1,65 @@ +using FishNet.Connection; +using FishNet.Object; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + + +namespace FishNet.Example.ColliderRollbacks +{ + /// + /// DEMO. CODE IS NOT OPTIMIZED. + /// Shows where an object was when client hit it, and where it was after server rolled it back. + /// + + public class RollbackVisualizer : NetworkBehaviour + { + [SerializeField] + private GameObject _originalPrefab; + [SerializeField] + private GameObject _rollbackPrefab; + [SerializeField] + private TextCanvas _textCanvasPrefab; + + /// + /// Shows difference between where object was when client shot it, and where it was after rollback. + /// + /// + /// + [Server] + public void ShowDifference(NetworkObject clientObject, Vector3 original, Vector3 rolledBack) + { + TargetShowDifference(clientObject.Owner, original, rolledBack); + } + + + [TargetRpc] + private void TargetShowDifference(NetworkConnection conn, Vector3 original, Vector3 rollback) + { + Instantiate(_originalPrefab, original, transform.rotation); + Instantiate(_rollbackPrefab, rollback, transform.rotation); + + float difference = Vector3.Distance(original, rollback); + if (difference <= 0.00001f) + difference = 0f; + + _differences.Add(difference); + if (_differences.Count > 20) + _differences.RemoveAt(0); + float averageDifference = (_differences.Sum() / _differences.Count); + + string accuracyText = (base.IsServerStarted) ? + $"Accuracy will not show properly when as clientHost.{Environment.NewLine}Use a separate client and server for testing." + : $"Difference {difference.ToString("0.000")}m. Average difference {averageDifference.ToString("0.000")}m."; + + TextCanvas tc = Instantiate(_textCanvasPrefab); + tc.SetText(accuracyText); + Debug.Log(accuracyText); + } + + private List _differences = new List(); + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/RollbackVisualizer.cs.meta b/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/RollbackVisualizer.cs.meta new file mode 100644 index 0000000..ebcdaea --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/RollbackVisualizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c5d5c9fcdb14704d9c64b18dc05a809 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/TextCanvas.cs b/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/TextCanvas.cs new file mode 100644 index 0000000..1260f90 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/TextCanvas.cs @@ -0,0 +1,29 @@ +using UnityEngine; +using UnityEngine.UI; + +namespace FishNet.Example.ColliderRollbacks +{ + public class TextCanvas : MonoBehaviour + { + [SerializeField] + private Text _text; + + private static TextCanvas _instance; + + private void Awake() + { + if (_instance != null) + Destroy(_instance.gameObject); + + _instance = this; + } + + public void SetText(string text) + { + _text.text = text; + } + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/TextCanvas.cs.meta b/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/TextCanvas.cs.meta new file mode 100644 index 0000000..9927865 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Rollback Visualization/TextCanvas.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d0dc71af4e9bb144195230171a19cca9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Strafe.cs b/Assets/FishNet/Demos/ColliderRollback/Scripts/Strafe.cs new file mode 100644 index 0000000..a33bcc4 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Strafe.cs @@ -0,0 +1,35 @@ +using FishNet.Object; +using UnityEngine; + + +namespace FishNet.Example.ColliderRollbacks +{ + + public class Strafe : NetworkBehaviour + { + public float MoveRate = 2f; + public float MoveDistance = 3f; + + private bool _movingRight = true; + private float _startX; + public override void OnStartServer() + { + + _startX = transform.position.x; + } + + private void Update() + { + if (base.IsServerStarted) + { + float x = (_movingRight) ? _startX + MoveDistance : _startX - MoveDistance; + Vector3 goal = new Vector3(x, transform.position.y, transform.position.z); + transform.position = Vector3.MoveTowards(transform.position, goal, MoveRate * Time.deltaTime); + if (transform.position == goal) + _movingRight = !_movingRight; + } + } + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/ColliderRollback/Scripts/Strafe.cs.meta b/Assets/FishNet/Demos/ColliderRollback/Scripts/Strafe.cs.meta new file mode 100644 index 0000000..dbe3171 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Scripts/Strafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 088014ab71fc022458b82ed8c9792b1b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Textures.meta b/Assets/FishNet/Demos/ColliderRollback/Textures.meta new file mode 100644 index 0000000..3655e19 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7782cde83489d9a4ca40e344c67aa02a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Textures/Crosshair.png b/Assets/FishNet/Demos/ColliderRollback/Textures/Crosshair.png new file mode 100644 index 0000000..c15bd33 Binary files /dev/null and b/Assets/FishNet/Demos/ColliderRollback/Textures/Crosshair.png differ diff --git a/Assets/FishNet/Demos/ColliderRollback/Textures/Crosshair.png.meta b/Assets/FishNet/Demos/ColliderRollback/Textures/Crosshair.png.meta new file mode 100644 index 0000000..b00ba24 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Textures/Crosshair.png.meta @@ -0,0 +1,104 @@ +fileFormatVersion: 2 +guid: dd2a76027478bf540b7194d78248edf8 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Textures/Particles.meta b/Assets/FishNet/Demos/ColliderRollback/Textures/Particles.meta new file mode 100644 index 0000000..ebf063e --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Textures/Particles.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eb2e86322ed960149a79e8ed8199b52b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/ColliderRollback/Textures/Particles/circle.png b/Assets/FishNet/Demos/ColliderRollback/Textures/Particles/circle.png new file mode 100644 index 0000000..db571f5 Binary files /dev/null and b/Assets/FishNet/Demos/ColliderRollback/Textures/Particles/circle.png differ diff --git a/Assets/FishNet/Demos/ColliderRollback/Textures/Particles/circle.png.meta b/Assets/FishNet/Demos/ColliderRollback/Textures/Particles/circle.png.meta new file mode 100644 index 0000000..bfd1ee8 --- /dev/null +++ b/Assets/FishNet/Demos/ColliderRollback/Textures/Particles/circle.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 155f67fd8750f8e4e83c8efb1731f3a0 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 7 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/CustomSyncType.meta b/Assets/FishNet/Demos/CustomSyncType.meta new file mode 100644 index 0000000..e706033 --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6860196879fb52a408948f34a9ad992a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/CustomSyncType/Component State Sync.meta b/Assets/FishNet/Demos/CustomSyncType/Component State Sync.meta new file mode 100644 index 0000000..45ec865 --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Component State Sync.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ae35102a88f9145439386a0fcf0a72e5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/CustomSyncType/Component State Sync/AMonoScript.cs b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/AMonoScript.cs new file mode 100644 index 0000000..8a62bed --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/AMonoScript.cs @@ -0,0 +1,17 @@ +using UnityEngine; + +namespace FishNet.Example.ComponentStateSync +{ + + + public class AMonoScript : MonoBehaviour + { + + private void Start() + { + //Start is here to show enabled toggle within inspector. + } + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/CustomSyncType/Component State Sync/AMonoScript.cs.meta b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/AMonoScript.cs.meta new file mode 100644 index 0000000..703535d --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/AMonoScript.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5821b28e5b90ef44b4910a640482c15 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentStateSync.cs b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentStateSync.cs new file mode 100644 index 0000000..56abff4 --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentStateSync.cs @@ -0,0 +1,154 @@ +using FishNet.Documenting; +using FishNet.Object.Synchronizing; +using FishNet.Object.Synchronizing.Internal; +using FishNet.Serializing; +using System.Runtime.CompilerServices; +using FishNet.Managing; +using UnityEngine; + +namespace FishNet.Example.ComponentStateSync +{ + + + /// + /// It's very important to exclude this from codegen. + /// However, whichever value you are synchronizing must not be excluded. This is why the value is outside the StructySync class. + /// + public class ComponentStateSync : SyncBase, ICustomSync where T : MonoBehaviour + { + #region Public. + /// + /// Gets or Sets the enabled state for Component. + /// + public bool Enabled + { + get => (Component == null) ? false : GetState(); + set => SetState(value); + } + /// + /// Component to state sync. + /// + public T Component { get; private set; } + /// + /// Delegate signature for when the component changes. + /// + public delegate void StateChanged(T component, bool prevState, bool nextState, bool asServer); + /// + /// Called when the component state changes. + /// + public event StateChanged OnChange; + #endregion + + /// + /// Initializes this StateSync with a component. + /// + /// + public void Initialize(T component) + { + Component = component; + } + + /// + /// Sets the enabled state for Component. + /// + /// + private void SetState(bool enabled) + { + if (base.NetworkManager == null) + return; + + if (Component == null) + base.NetworkManager.LogError($"State cannot be changed as Initialize has not been called with a valid component."); + + //If hasn't changed then ignore. + bool prev = GetState(); + if (enabled == prev) + return; + + //Set to new value and add operation. + Component.enabled = enabled; + AddOperation(Component, prev, enabled); + } + + /// + /// Gets the enabled state for Component. + /// + /// + private bool GetState() + { + return Component.enabled; + } + + /// + /// Adds an operation to synchronize. + /// + private void AddOperation(T component, bool prev, bool next) + { + if (!base.IsInitialized) + return; + + if (base.NetworkManager != null && !base.NetworkBehaviour.IsServerStarted) + { + NetworkManager.LogWarning($"Cannot complete operation as server when server is not active."); + return; + } + + base.Dirty(); + + //Data can currently only be set from server, so this is always asServer. + bool asServer = true; + OnChange?.Invoke(component, prev, next, asServer); + } + /// + /// Writes all changed values. + /// + ///True to set the next time data may sync. + internal protected override void WriteDelta(PooledWriter writer, bool resetSyncTick = true) + { + base.WriteDelta(writer, resetSyncTick); + writer.WriteBoolean(Component.enabled); + } + + /// + /// Writes all values. + /// + internal protected override void WriteFull(PooledWriter writer) + { + /* Always write full for this custom sync type. + * It would be difficult to know if the + * state has changed given it's a boolean, and + * may or may not be true/false after pooling is added. */ + WriteDelta(writer, false); + } + + /// + /// Reads and sets the current values for server or client. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [APIExclude] + internal protected override void Read(PooledReader reader, bool asServer) + { + bool nextValue = reader.ReadBoolean(); + if (base.NetworkManager == null) + return; + + bool prevValue = GetState(); + + /* When !asServer don't make changes if server is running. + * This is because changes would have already been made on + * the server side and doing so again would result in duplicates + * and potentially overwrite data not yet sent. */ + bool asClientAndHost = (!asServer && base.NetworkManager.IsServerStarted); + if (!asClientAndHost) + Component.enabled = nextValue; + + OnChange?.Invoke(Component, prevValue, nextValue, asServer); + } + + /// + /// Return the serialized type. + /// + /// + public object GetSerializedType() => null; + } +} diff --git a/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentStateSync.cs.meta b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentStateSync.cs.meta new file mode 100644 index 0000000..7ba490b --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentStateSync.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ce7cdae4a8f3d914fa9141b4bd760faa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentSyncStateBehaviour.cs b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentSyncStateBehaviour.cs new file mode 100644 index 0000000..904fcd6 --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentSyncStateBehaviour.cs @@ -0,0 +1,53 @@ +using FishNet.Object; +using FishNet.Object.Synchronizing; +using FishNet.Serializing; +using UnityEngine; + +namespace FishNet.Example.ComponentStateSync +{ + public static class AMSSerializer + { + public static void WriteAMS(this Writer w, AMonoScript value) + { + } + public static AMonoScript ReadAMS(this Reader r) + { + return default; + } + } + public class ComponentSyncStateBehaviour : NetworkBehaviour + { + /// + /// Using my custom SyncType for Structy. + /// + + private readonly ComponentStateSync _syncScript = new ComponentStateSync(); + + private void Awake() + { + AMonoScript ams = GetComponent(); + //Initialize with the component of your choice. + _syncScript.Initialize(ams); + //Optionally listen for changes. + _syncScript.OnChange += _syncScript_OnChange; + } + + /// + /// Called when enabled state changes for SyncScript. + /// + private void _syncScript_OnChange(AMonoScript component, bool prevState, bool nextState, bool asServer) + { + Debug.Log($"Change received on {component.GetType().Name}. New value is {nextState}. Received asServer {asServer}."); + } + + private void Update() + { + //Every so often flip the state of the component. + if (base.IsServerStarted && Time.frameCount % 200 == 0) + _syncScript.Enabled = !_syncScript.Enabled; + } + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentSyncStateBehaviour.cs.meta b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentSyncStateBehaviour.cs.meta new file mode 100644 index 0000000..eba67fc --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Component State Sync/ComponentSyncStateBehaviour.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a7327b94eff9c7d4aa876aa54ca6b439 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync.meta b/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync.meta new file mode 100644 index 0000000..358c36f --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 158d38828d286af468fbdb3b594ad9bc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructSyncBehaviour.cs b/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructSyncBehaviour.cs new file mode 100644 index 0000000..fe74fdb --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructSyncBehaviour.cs @@ -0,0 +1,41 @@ +using FishNet.Object; +using FishNet.Object.Synchronizing; +using UnityEngine; + +namespace FishNet.Example.CustomSyncObject +{ + + public class StructSyncBehaviour : NetworkBehaviour + { + /// + /// Using my custom SyncType for Structy. + /// + + private readonly StructySync _structy = new StructySync(); + + private void Awake() + { + //Listen for change events. + _structy.OnChange += _structy_OnChange; + } + + private void _structy_OnChange(StructySync.CustomOperation op, Structy oldItem, Structy newItem, bool asServer) + { + Debug.Log("Changed " + op.ToString() + ", " + newItem.Age + ", " + asServer); + } + + private void Update() + { + //Every so often increase the age property on structy using StructySync, my custom sync type. + if (base.IsServerStarted && Time.frameCount % 200 == 0) + { + //Increase the age and set that values have changed. + _structy.Value.Age += 1; + _structy.ValuesChanged(); + } + } + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructSyncBehaviour.cs.meta b/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructSyncBehaviour.cs.meta new file mode 100644 index 0000000..fc5e85e --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructSyncBehaviour.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c2cc7cbbeb4170642ac60367303222ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructySync.cs b/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructySync.cs new file mode 100644 index 0000000..0701021 --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructySync.cs @@ -0,0 +1,257 @@ +using FishNet.Managing; +using FishNet.Documenting; +using FishNet.Object.Synchronizing; +using FishNet.Object.Synchronizing.Internal; +using FishNet.Serializing; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace FishNet.Example.CustomSyncObject +{ + /// + /// This is the data type I want to create a custom SyncType for. + /// + public struct Structy + { + public string Name; + public ushort Age; + + public Structy(string name, ushort age) + { + Name = name; + Age = age; + } + } + + /// + /// It's very important to exclude this from codegen. + /// However, whichever value you are synchronizing must not be excluded. This is why the value is outside the StructySync class. + /// + public class StructySync : SyncBase, ICustomSync + { + #region Types. + /// + /// Information about how the struct has changed. + /// You could send the entire struct on every change + /// but this is an example of how you might send individual changed + /// fields. + /// + private struct ChangeData + { + internal CustomOperation Operation; + internal Structy Data; + + public ChangeData(CustomOperation operation, Structy data) + { + Operation = operation; + Data = data; + } + } + /// + /// Types of changes. This is related to ChangedData + /// where you can specify what has changed. + /// + public enum CustomOperation : byte + { + Full = 0, + Name = 1, + Age = 2 + } + #endregion + + #region Public. + /// + /// Delegate signature for when Structy changes. + /// + /// + /// + /// + public delegate void CustomChanged(CustomOperation op, Structy oldItem, Structy newItem, bool asServer); + /// + /// Called when the Structy changes. + /// + public event CustomChanged OnChange; + /// + /// Current value of Structy. + /// + public Structy Value = new Structy(); + #endregion + + #region Private. + /// + /// Initial value when initialized. Used to reset this sync type. + /// + private Structy _initialValue; + /// + /// Changed data which will be sent next tick. + /// + private readonly List _changed = new List(); + /// + /// True if values have changed since initialization. + /// + private bool _valuesChanged; + /// + /// Last value after dirty call. + /// + private Structy _lastDirtied = new Structy(); + #endregion + + protected override void Initialized() + { + base.Initialized(); + _initialValue = Value; + } + + /// + /// Adds an operation and invokes locally. + /// + /// + /// + /// + /// + private void AddOperation(CustomOperation operation, Structy prev, Structy next) + { + if (!base.IsInitialized) + return; + + if (base.NetworkManager != null && !base.NetworkBehaviour.IsServerStarted) + { + base.NetworkManager.LogWarning($"Cannot complete operation as server when server is not active."); + return; + } + + /* Set as changed even if cannot dirty. + * Dirty is only set when there are observers, + * but even if there are not observers + * values must be marked as changed so when + * there are observers, new values are sent. */ + _valuesChanged = true; + base.Dirty(); + + //Data can currently only be set from server, so this is always asServer. + bool asServer = true; + //Add to changed. + ChangeData cd = new ChangeData(operation, next); + _changed.Add(cd); + OnChange?.Invoke(operation, prev, next, asServer); + } + + /// + /// Writes all changed values. + /// + /// + ///True to set the next time data may sync. + internal protected override void WriteDelta(PooledWriter writer, bool resetSyncTick = true) + { + base.WriteDelta(writer, resetSyncTick); + writer.WriteInt32(_changed.Count); + + for (int i = 0; i < _changed.Count; i++) + { + ChangeData change = _changed[i]; + writer.WriteByte((byte)change.Operation); + + //Clear does not need to write anymore data so it is not included in checks. + if (change.Operation == CustomOperation.Age) + { + writer.WriteUInt16(change.Data.Age); + } + else if (change.Operation == CustomOperation.Name) + { + writer.WriteString(change.Data.Name); + } + } + + _changed.Clear(); + } + + /// + /// Writes all values if not initial values. + /// + /// + internal protected override void WriteFull(PooledWriter writer) + { + if (!_valuesChanged) + return; + + base.WriteHeader(writer, false); + //Write one change. + writer.WriteInt32(1); + //Write if changed is from the server, so always use the server _value. + writer.WriteByte((byte)CustomOperation.Full); + //Write value. + writer.Write(Value); + } + + /// + /// Reads and sets the current values for server or client. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [APIExclude] + internal protected override void Read(PooledReader reader, bool asServer) + { + /* When !asServer don't make changes if server is running. + * This is because changes would have already been made on + * the server side and doing so again would result in duplicates + * and potentially overwrite data not yet sent. */ + bool asClientAndHost = (!asServer && base.NetworkManager.IsServerStarted); + + int changes = reader.ReadInt32(); + for (int i = 0; i < changes; i++) + { + CustomOperation operation = (CustomOperation)reader.ReadByte(); + Structy prev = Value; + Structy next = prev; + + //Full. + if (operation == CustomOperation.Full) + next = reader.Read(); + //Name. + else if (operation == CustomOperation.Name) + next.Name = reader.ReadString(); + //Age + else if (operation == CustomOperation.Age) + next.Age = reader.ReadUInt16(); + + OnChange?.Invoke(operation, prev, next, asServer); + + if (!asClientAndHost) + Value = next; + } + + } + + /// + /// Checks Value for changes and sends them to clients. + /// + public void ValuesChanged() + { + Structy prev = _lastDirtied; + Structy current = Value; + + if (prev.Name != current.Name) + AddOperation(CustomOperation.Name, prev, current); + if (prev.Age != current.Age) + AddOperation(CustomOperation.Age, prev, current); + + _lastDirtied = Value; + } + + /// + /// Resets to initialized values. + /// + internal protected override void ResetState(bool asServer) + { + base.ResetState(asServer); + _changed.Clear(); + Value = _initialValue; + _valuesChanged = false; + } + + /// + /// Return the serialized type. + /// + /// + public object GetSerializedType() => typeof(Structy); + } +} diff --git a/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructySync.cs.meta b/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructySync.cs.meta new file mode 100644 index 0000000..68e9a15 --- /dev/null +++ b/Assets/FishNet/Demos/CustomSyncType/Custom Struct Sync/StructySync.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4c0a84e32efc60f4aa471e3a42cf2e0b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/FishNet.Demos.asmdef b/Assets/FishNet/Demos/FishNet.Demos.asmdef new file mode 100644 index 0000000..fcf46f0 --- /dev/null +++ b/Assets/FishNet/Demos/FishNet.Demos.asmdef @@ -0,0 +1,17 @@ +{ + "name": "FishNet.Demos", + "rootNamespace": "", + "references": [ + "GUID:7c88a4a7926ee5145ad2dfa06f454c67", + "GUID:1d82bdf40e2465b44b34adf79595e74c" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/FishNet.Demos.asmdef.meta b/Assets/FishNet/Demos/FishNet.Demos.asmdef.meta new file mode 100644 index 0000000..56eb043 --- /dev/null +++ b/Assets/FishNet/Demos/FishNet.Demos.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0bb35fc3181999548a4abea731e00e89 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid.meta b/Assets/FishNet/Demos/HashGrid.meta new file mode 100644 index 0000000..bed0572 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 02c5cb48c15b7f445b5f7947b3caab23 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/HashGrid Demo README.txt b/Assets/FishNet/Demos/HashGrid/HashGrid Demo README.txt new file mode 100644 index 0000000..ae9bcc3 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/HashGrid Demo README.txt @@ -0,0 +1,5 @@ +- Open scene. +- Press Play. + +Demo only works on clientHost. Real usage works with separate client and server, and clientHost. +Scene view can be used to see objects appear and disappear as the player object moves betwen grid spots. \ No newline at end of file diff --git a/Assets/FishNet/Demos/HashGrid/HashGrid Demo README.txt.meta b/Assets/FishNet/Demos/HashGrid/HashGrid Demo README.txt.meta new file mode 100644 index 0000000..979a0e7 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/HashGrid Demo README.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4193a544613faaf4a8dd0a4a215523f3 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/Prefabs.meta b/Assets/FishNet/Demos/HashGrid/Prefabs.meta new file mode 100644 index 0000000..3bf7b0f --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 77d19422e209c5843b939e6dcd6b4971 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Moving.prefab b/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Moving.prefab new file mode 100644 index 0000000..78b57b7 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Moving.prefab @@ -0,0 +1,217 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2758258074630985 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2058948186138587895} + - component: {fileID: 2529588038898116402} + m_Layer: 0 + m_Name: Sprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2058948186138587895 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2758258074630985} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4512293259955182957} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2529588038898116402 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2758258074630985} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} + m_Color: {r: 1, g: 0.6277604, b: 0, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 2.9, y: 2.22} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &4512293259955182959 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4512293259955182957} + - component: {fileID: 4512293259955182956} + - component: {fileID: 4670340455971777434} + - component: {fileID: 3019520109258855553} + m_Layer: 0 + m_Name: HashGrid_Moving + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4512293259955182957 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 3, y: 3, z: 3} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2058948186138587895} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4512293259955182956 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 4670340455971777434} + - {fileID: 3019520109258855553} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 0} + LocalScale: {x: 0, y: 0, z: 0} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 0 + k__BackingField: 0 + k__BackingField: 11406911356865610645 +--- !u!114 &4670340455971777434 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 10f399a5388d3b3459b7a8476ae13e6a, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 4512293259955182956} + _networkObjectCache: {fileID: 4512293259955182956} + _renderer: {fileID: 2529588038898116402} +--- !u!114 &3019520109258855553 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 1 + _addedNetworkObject: {fileID: 4512293259955182956} + _networkObjectCache: {fileID: 4512293259955182956} + _componentConfiguration: 0 + _synchronizeParent: 0 + _packing: + Position: 1 + Rotation: 1 + Scale: 0 + _interpolation: 2 + _extrapolation: 2 + _enableTeleport: 1 + _teleportThreshold: 0.5 + _scaleThreshold: 1 + _clientAuthoritative: 1 + _sendToOwner: 1 + _enableNetworkLod: 1 + _interval: 1 + _synchronizePosition: 1 + _positionSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeRotation: 1 + _rotationSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeScale: 1 + _scaleSnapping: + X: 0 + Y: 0 + Z: 0 diff --git a/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Moving.prefab.meta b/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Moving.prefab.meta new file mode 100644 index 0000000..fac69cc --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Moving.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 44611030e61220d42ab7c37ba3c0ea92 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Static.prefab b/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Static.prefab new file mode 100644 index 0000000..1d0ae5d --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Static.prefab @@ -0,0 +1,167 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2758258074630985 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2058948186138587895} + - component: {fileID: 2529588038898116402} + m_Layer: 0 + m_Name: Sprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967295 + m_IsActive: 1 +--- !u!4 &2058948186138587895 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2758258074630985} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4512293259955182957} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2529588038898116402 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2758258074630985} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} + m_Color: {r: 1, g: 0.20549601, b: 0, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 2.9, y: 2.22} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &4512293259955182959 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4512293259955182957} + - component: {fileID: 4512293259955182956} + m_Layer: 0 + m_Name: HashGrid_Static + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967295 + m_IsActive: 1 +--- !u!4 &4512293259955182957 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2058948186138587895} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4512293259955182956 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 0 + k__BackingField: 0 + k__BackingField: 17472515426990886281 + _sceneNetworkObjects: [] + k__BackingField: 0 + _enablePrediction: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 0 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 0} + LocalScale: {x: 0, y: 0, z: 0} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 diff --git a/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Static.prefab.meta b/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Static.prefab.meta new file mode 100644 index 0000000..6a98c0e --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Prefabs/HashGrid_Static.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0d6d0f48b03b17f49a6340103cd9b9d0 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/Prefabs/_HashGrid_Prefabs.asset b/Assets/FishNet/Demos/HashGrid/Prefabs/_HashGrid_Prefabs.asset new file mode 100644 index 0000000..fe4ef1d --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Prefabs/_HashGrid_Prefabs.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4489d77032a81ef42b0067acf2737d4d, type: 3} + m_Name: _HashGrid_Prefabs + m_EditorClassIdentifier: + _prefabs: + - {fileID: 4512293259955182956, guid: 44611030e61220d42ab7c37ba3c0ea92, type: 3} + - {fileID: 4512293259955182956, guid: 0d6d0f48b03b17f49a6340103cd9b9d0, type: 3} diff --git a/Assets/FishNet/Demos/HashGrid/Prefabs/_HashGrid_Prefabs.asset.meta b/Assets/FishNet/Demos/HashGrid/Prefabs/_HashGrid_Prefabs.asset.meta new file mode 100644 index 0000000..8531564 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Prefabs/_HashGrid_Prefabs.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2863463f6933f3f439a639f883f642f6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/Scenes.meta b/Assets/FishNet/Demos/HashGrid/Scenes.meta new file mode 100644 index 0000000..a80ec58 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1f1bf5e92afde20428b1ccf93f8648a0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/Scenes/HashGrid_Demo.unity b/Assets/FishNet/Demos/HashGrid/Scenes/HashGrid_Demo.unity new file mode 100644 index 0000000..4077e5b --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Scenes/HashGrid_Demo.unity @@ -0,0 +1,1115 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &51369845 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 51369846} + - component: {fileID: 51369847} + m_Layer: 0 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &51369846 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 51369845} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 5} + m_LocalScale: {x: 50, y: 50, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 442045875} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &51369847 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 51369845} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 89cc97401eb588a408315f5fa0148929, type: 3} + m_Color: {r: 0.06933072, g: 0.11994747, b: 0.3584906, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.16, y: 0.16} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &370472796 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3fdaae44044276a49a52229c1597e33b, type: 3} + m_Name: + m_EditorClassIdentifier: + _updateOrder: 0 + _timingType: 0 + _allowTickDropping: 0 + _maximumFrameTicks: 2 + _tickRate: 30 + _pingInterval: 15 + _physicsMode: 0 +--- !u!1 &442045874 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 442045875} + - component: {fileID: 442045876} + - component: {fileID: 442045877} + - component: {fileID: 442045878} + m_Layer: 0 + m_Name: --GridSpawner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &442045875 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 442045874} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 51369846} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &442045876 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 442045874} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 442045877} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 1, y: 1, z: 1} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1046374546 + k__BackingField: 4494144455973923660 + k__BackingField: 0 +--- !u!114 &442045877 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 442045874} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f70001444cb8ef49bef71f3b6e3a925, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 442045876} + _networkObjectCache: {fileID: 442045876} + _staticPrefab: {fileID: 4512293259955182956, guid: 0d6d0f48b03b17f49a6340103cd9b9d0, + type: 3} + _movingPrefab: {fileID: 4512293259955182956, guid: 44611030e61220d42ab7c37ba3c0ea92, + type: 3} + _movingCount: 100 + _spacing: 2 +--- !u!114 &442045878 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 442045874} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c71fd7f855ec523429999fc4e14a1928, type: 3} + m_Name: + m_EditorClassIdentifier: + _overrideType: 3 + _updateHostVisibility: 1 + _observerConditions: [] +--- !u!1 &585532990 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 585532993} + - component: {fileID: 585532992} + m_Layer: 0 + m_Name: Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!20 &585532992 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 585532990} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 2.75 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &585532993 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 585532990} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1776591436 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d331f979d46e8e4a9fc90070c596d44, type: 3} + m_Name: + m_EditorClassIdentifier: + _enableNetworkLod: 0 + _levelOfDetailDistances: + - 5 + - 10 + - 15 + - 30 + - 50 + - 70 + - 90 + - 100 + _updateHostVisibility: 1 + _defaultConditions: + - {fileID: 11400000, guid: cc503f7541ebd424c94541e6a767efee, type: 2} +--- !u!114 &1424052073952814568 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714076101889} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &2480283714076101889 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9139860295505404435} + - component: {fileID: 6745855428728600859} + - component: {fileID: 1424052073952814568} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &3965864432884103650 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256728133663} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4393252310954709616 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310954709618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252310954709631} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252311495835464} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Client + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!224 &4393252310954709617 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310954709618} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 9139860295505404435} + m_Father: {fileID: 4393252311495835476} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -96} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!1 &4393252310954709618 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252310954709617} + - component: {fileID: 4393252310954709630} + - component: {fileID: 4393252310954709631} + - component: {fileID: 4393252310954709616} + m_Layer: 5 + m_Name: Client + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &4393252310954709630 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310954709618} + m_CullTransparentMesh: 0 +--- !u!114 &4393252310954709631 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310954709618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2d50394614f8feb4eb0567fb7618d84d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4393252311105513456 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311105513458} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252311105513471} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252311495835464} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Server + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!224 &4393252311105513457 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311105513458} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7233259200116312561} + m_Father: {fileID: 4393252311495835476} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -16} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!1 &4393252311105513458 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311105513457} + - component: {fileID: 4393252311105513470} + - component: {fileID: 4393252311105513471} + - component: {fileID: 4393252311105513456} + m_Layer: 5 + m_Name: Server + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &4393252311105513470 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311105513458} + m_CullTransparentMesh: 0 +--- !u!114 &4393252311105513471 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311105513458} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1b187e63031bf7849b249c8212440c3b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4393252311495835464 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311495835465} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d3606bfdac5a4743890fc1a5ecd8f24, type: 3} + m_Name: + m_EditorClassIdentifier: + _autoStartType: 0 + _stoppedColor: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + _changingColor: {r: 0.78431374, g: 0.6862745, b: 0, a: 1} + _startedColor: {r: 0, g: 0.5882353, b: 0.64705884, a: 1} + _serverIndicator: {fileID: 3965864432884103650} + _clientIndicator: {fileID: 1424052073952814568} +--- !u!1 &4393252311495835465 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311495835476} + - component: {fileID: 4393252311495835464} + - component: {fileID: 4393252311495835477} + - component: {fileID: 4393252311495835478} + - component: {fileID: 4393252311495835479} + m_Layer: 5 + m_Name: NetworkHudCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4393252311495835476 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311495835465} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4393252311105513457} + - {fileID: 4393252310954709617} + m_Father: {fileID: 7443408886575219561} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &4393252311495835477 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311495835465} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &4393252311495835478 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311495835465} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!114 &4393252311495835479 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311495835465} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!1 &4808982256728133663 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7233259200116312561} + - component: {fileID: 5104387649625413016} + - component: {fileID: 3965864432884103650} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &5104387649625413016 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256728133663} + m_CullTransparentMesh: 0 +--- !u!222 &6745855428728600859 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714076101889} + m_CullTransparentMesh: 0 +--- !u!224 &7233259200116312561 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256728133663} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4393252311105513457} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &7443408886575219556 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 211a9f6ec51ddc14f908f5acc0cd0423, type: 3} + m_Name: + m_EditorClassIdentifier: + _playerPrefab: {fileID: 4512293259955182956, guid: 44611030e61220d42ab7c37ba3c0ea92, + type: 3} + _addToDefaultScene: 1 + Spawns: [] +--- !u!4 &7443408886575219561 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4393252311495835476} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7443408886575219562 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2c95dfde7d73b54dbbdc23155d35d36, type: 3} + m_Name: + m_EditorClassIdentifier: + _refreshDefaultPrefabs: 1 + _runInBackground: 1 + _dontDestroyOnLoad: 1 + _objectPool: {fileID: 0} + _persistence: 0 + _logging: {fileID: 0} + _spawnablePrefabs: {fileID: 11400000, guid: 2863463f6933f3f439a639f883f642f6, type: 2} +--- !u!1 &7443408886575219563 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7443408886575219561} + - component: {fileID: 7443408886575219562} + - component: {fileID: 7443408886575219556} + - component: {fileID: 370472796} + - component: {fileID: 7443408886575219565} + - component: {fileID: 7443408886575219564} + - component: {fileID: 1776591436} + - component: {fileID: 7443408886575219566} + - component: {fileID: 7443408886575219567} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &7443408886575219564 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 756c28cd3141c4140ae776188ee26729, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkTraffic: + _updateInteval: 1 + _updateClient: 0 + _updateServer: 1 +--- !u!114 &7443408886575219565 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8bc8f0363ddc75946a958043c5e49a83, type: 3} + m_Name: + m_EditorClassIdentifier: + _color: {r: 1, g: 1, b: 1, a: 1} + _placement: 2 + _showOutgoing: 1 + _showIncoming: 1 +--- !u!114 &7443408886575219566 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0a9fc3aafb02eb74fb571c300f846bf2, type: 3} + m_Name: + m_EditorClassIdentifier: + _gridAxes: 0 + _accuracy: 10 +--- !u!114 &7443408886575219567 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6f48f002b825cbd45a19bd96d90f9edb, type: 3} + m_Name: + m_EditorClassIdentifier: + _dontRoute: 0 + _unreliableMtu: 1023 + _ipv4BindAddress: + _enableIpv6: 1 + _ipv6BindAddress: + _port: 30681 + _maximumClients: 4095 + _clientAddress: 4d3a4e3f1ace.pr.edgegap.net +--- !u!224 &9139860295505404435 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714076101889} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4393252310954709617} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/FishNet/Demos/HashGrid/Scenes/HashGrid_Demo.unity.meta b/Assets/FishNet/Demos/HashGrid/Scenes/HashGrid_Demo.unity.meta new file mode 100644 index 0000000..4c2b628 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Scenes/HashGrid_Demo.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 99947f0521cb96a4087d4496b8761a23 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/Scripts.meta b/Assets/FishNet/Demos/HashGrid/Scripts.meta new file mode 100644 index 0000000..5b137ee --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c8112cf1a9acc7f47946446bdc61e7a7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/Scripts/GridSpawner.cs b/Assets/FishNet/Demos/HashGrid/Scripts/GridSpawner.cs new file mode 100644 index 0000000..d3caec5 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Scripts/GridSpawner.cs @@ -0,0 +1,43 @@ +using FishNet.Object; +using UnityEngine; + + +namespace FishNet.Demo.HashGrid +{ + + public class GridSpawner : NetworkBehaviour + { + [SerializeField] + private NetworkObject _staticPrefab; + [SerializeField] + private NetworkObject _movingPrefab; + [SerializeField] + private int _movingCount = 100; + [SerializeField] + private byte _spacing = 2; + + private float _range => MoveRandomly.Range; + + public override void OnStartServer() + { + + + for (int x = (int)(_range * -1); x < _range; x+= _spacing) + { + for (int y = (int)(_range * -1); y < _range; y++) + { + NetworkObject n = Instantiate(_staticPrefab, new Vector3(x, y, transform.position.z), Quaternion.identity); + base.Spawn(n); + } + } + + for (int i = 0; i < _movingCount; i++) + { + NetworkObject n = Instantiate(_movingPrefab, transform.position, transform.rotation); + base.Spawn(n); + } + } + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/HashGrid/Scripts/GridSpawner.cs.meta b/Assets/FishNet/Demos/HashGrid/Scripts/GridSpawner.cs.meta new file mode 100644 index 0000000..164df6b --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Scripts/GridSpawner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5f70001444cb8ef49bef71f3b6e3a925 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/Scripts/MoveRandomly.cs b/Assets/FishNet/Demos/HashGrid/Scripts/MoveRandomly.cs new file mode 100644 index 0000000..a3cffa4 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Scripts/MoveRandomly.cs @@ -0,0 +1,75 @@ +using FishNet.Object; +using UnityEngine; + +namespace FishNet.Demo.HashGrid +{ + + public class MoveRandomly : NetworkBehaviour + { + //Colors green for client. + [SerializeField] + private Renderer _renderer; + + //How quickly to move over 1s. + private float _moveRate = 0.5f; + //Maximum range for new position. + public const float Range = 25f; + //Position to move towards. + private Vector3 _goal; + //Position at spawn. + private Vector3 _start; + + private void Update() + { + if (!base.IsOwner && !base.IsServerStarted) + return; + + transform.position = Vector3.MoveTowards(transform.position, _goal, (_moveRate * Time.deltaTime)); + if (transform.position == _goal) + RandomizeGoal(); + } + + public override void OnStartNetwork() + { + _start = transform.position; + + if (base.Owner.IsLocalClient) + { + _renderer.material.color = Color.green; + _moveRate *= 3f; + transform.position -= new Vector3(0f, 0f, 1f); + Camera c = Camera.main; + c.transform.SetParent(transform); + c.transform.localPosition = new Vector3(0f, 0f, -5f); + } + else + { + _renderer.material.color = Color.gray; + transform.position = (_start + RandomInsideRange()); + } + + RandomizeGoal(); + } + + public override void OnStopNetwork() + { + Camera c = Camera.main; + if (c != null && base.Owner.IsLocalClient) + c.transform.SetParent(null); + } + + private void RandomizeGoal() + { + _goal = _start + RandomInsideRange(); + } + + private Vector3 RandomInsideRange() + { + Vector3 goal = (Random.insideUnitSphere * Range); + goal.z = transform.position.z; + return goal; + } + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/HashGrid/Scripts/MoveRandomly.cs.meta b/Assets/FishNet/Demos/HashGrid/Scripts/MoveRandomly.cs.meta new file mode 100644 index 0000000..3321685 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Scripts/MoveRandomly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 10f399a5388d3b3459b7a8476ae13e6a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/Textures.meta b/Assets/FishNet/Demos/HashGrid/Textures.meta new file mode 100644 index 0000000..c2e0d05 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2632d5734cb07bb419c6b6aa4e4b245d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/HashGrid/Textures/1x1 Pixel.png b/Assets/FishNet/Demos/HashGrid/Textures/1x1 Pixel.png new file mode 100644 index 0000000..4927ef6 Binary files /dev/null and b/Assets/FishNet/Demos/HashGrid/Textures/1x1 Pixel.png differ diff --git a/Assets/FishNet/Demos/HashGrid/Textures/1x1 Pixel.png.meta b/Assets/FishNet/Demos/HashGrid/Textures/1x1 Pixel.png.meta new file mode 100644 index 0000000..8eef734 --- /dev/null +++ b/Assets/FishNet/Demos/HashGrid/Textures/1x1 Pixel.png.meta @@ -0,0 +1,104 @@ +fileFormatVersion: 2 +guid: 89cc97401eb588a408315f5fa0148929 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 1 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/IntermediateLayer.meta b/Assets/FishNet/Demos/IntermediateLayer.meta new file mode 100644 index 0000000..46c84ea --- /dev/null +++ b/Assets/FishNet/Demos/IntermediateLayer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea07d809d9bc44b4ba4025cb56b199b3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/IntermediateLayer/Prefabs.meta b/Assets/FishNet/Demos/IntermediateLayer/Prefabs.meta new file mode 100644 index 0000000..b2a92e2 --- /dev/null +++ b/Assets/FishNet/Demos/IntermediateLayer/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 90949fa81eb0c194080a75b84fa699d9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/IntermediateLayer/Prefabs/_IntermediateLayer_Prefabs.asset b/Assets/FishNet/Demos/IntermediateLayer/Prefabs/_IntermediateLayer_Prefabs.asset new file mode 100644 index 0000000..9d00963 --- /dev/null +++ b/Assets/FishNet/Demos/IntermediateLayer/Prefabs/_IntermediateLayer_Prefabs.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4489d77032a81ef42b0067acf2737d4d, type: 3} + m_Name: _IntermediateLayer_Prefabs + m_EditorClassIdentifier: + _prefabs: [] diff --git a/Assets/FishNet/Demos/IntermediateLayer/Prefabs/_IntermediateLayer_Prefabs.asset.meta b/Assets/FishNet/Demos/IntermediateLayer/Prefabs/_IntermediateLayer_Prefabs.asset.meta new file mode 100644 index 0000000..5529107 --- /dev/null +++ b/Assets/FishNet/Demos/IntermediateLayer/Prefabs/_IntermediateLayer_Prefabs.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dcdf15fc89edd2546baf8ff544470626 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/IntermediateLayer/Scenes.meta b/Assets/FishNet/Demos/IntermediateLayer/Scenes.meta new file mode 100644 index 0000000..fda9e58 --- /dev/null +++ b/Assets/FishNet/Demos/IntermediateLayer/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1eaf920277ad1b043b6175001766791c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/IntermediateLayer/Scenes/IntermediateLayer.unity b/Assets/FishNet/Demos/IntermediateLayer/Scenes/IntermediateLayer.unity new file mode 100644 index 0000000..6b17bba --- /dev/null +++ b/Assets/FishNet/Demos/IntermediateLayer/Scenes/IntermediateLayer.unity @@ -0,0 +1,791 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!224 &1007221594027449775 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5856558383919887037} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5754166031317642701} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!4 &1468556956860775637 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1468556956860775639} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5754166031850356968} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1468556956860775638 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1468556956860775639} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2c95dfde7d73b54dbbdc23155d35d36, type: 3} + m_Name: + m_EditorClassIdentifier: + _refreshDefaultPrefabs: 0 + _runInBackground: 1 + _dontDestroyOnLoad: 1 + _objectPool: {fileID: 0} + _persistence: 0 + _logging: {fileID: 0} + _spawnablePrefabs: {fileID: 11400000, guid: 68e79e63a16f2c74e81f070bd36822b8, type: 2} +--- !u!1 &1468556956860775639 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1468556956860775637} + - component: {fileID: 1468556956860775638} + - component: {fileID: 1468556956860775641} + - component: {fileID: 1468556956860775642} + - component: {fileID: 1468556956860775643} + - component: {fileID: 1468556956860775644} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1468556956860775641 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1468556956860775639} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 34e4a322dca349547989b14021da4e23, type: 3} + m_Name: + m_EditorClassIdentifier: + Transport: {fileID: 0} + _intermediateLayer: {fileID: 1468556956860775642} + _latencySimulator: + _enabled: 0 + _simulateHost: 1 + _latency: 0 + _outOfOrder: 0 + _packetLoss: 0 +--- !u!114 &1468556956860775642 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1468556956860775639} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 10c18bbe05944364d9295f5ee411a95f, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &1468556956860775643 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1468556956860775639} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d0962ead4b02a34aae248fccce671ce, type: 3} + m_Name: + m_EditorClassIdentifier: + WriteSceneObjectDetails: 0 + ObserverRpcLinks: 1 + TargetRpcLinks: 1 + ReplicateRpcLinks: 1 + ReconcileRpcLinks: 1 + ServerRpcLinks: 1 +--- !u!114 &1468556956860775644 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1468556956860775639} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3fdaae44044276a49a52229c1597e33b, type: 3} + m_Name: + m_EditorClassIdentifier: + _updateOrder: 0 + _timingType: 0 + _allowTickDropping: 0 + _maximumFrameTicks: 2 + _tickRate: 5 + _pingInterval: 1 + _physicsMode: 0 +--- !u!224 &1678895830352950861 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3571917272714833827} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5754166031736870989} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3365042086831326887 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5856558383919887037} + m_CullTransparentMesh: 0 +--- !u!1 &3571917272714833827 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1678895830352950861} + - component: {fileID: 3889840908291566116} + - component: {fileID: 4910195209183790686} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &3889840908291566116 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3571917272714833827} + m_CullTransparentMesh: 0 +--- !u!114 &4910195209183790686 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3571917272714833827} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &5754166031317642690 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031317642702} + m_CullTransparentMesh: 0 +--- !u!114 &5754166031317642691 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031317642702} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2d50394614f8feb4eb0567fb7618d84d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &5754166031317642700 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031317642702} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 5754166031317642691} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 5754166031850356980} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Client + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!224 &5754166031317642701 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031317642702} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1007221594027449775} + m_Father: {fileID: 5754166031850356968} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -96} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!1 &5754166031317642702 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5754166031317642701} + - component: {fileID: 5754166031317642690} + - component: {fileID: 5754166031317642691} + - component: {fileID: 5754166031317642700} + m_Layer: 5 + m_Name: Client + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &5754166031736870978 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031736870990} + m_CullTransparentMesh: 0 +--- !u!114 &5754166031736870979 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031736870990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1b187e63031bf7849b249c8212440c3b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &5754166031736870988 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031736870990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 5754166031736870979} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 5754166031850356980} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Server + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!224 &5754166031736870989 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031736870990} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1678895830352950861} + m_Father: {fileID: 5754166031850356968} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -16} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!1 &5754166031736870990 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5754166031736870989} + - component: {fileID: 5754166031736870978} + - component: {fileID: 5754166031736870979} + - component: {fileID: 5754166031736870988} + m_Layer: 5 + m_Name: Server + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5754166031850356968 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031850356981} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5754166031736870989} + - {fileID: 5754166031317642701} + m_Father: {fileID: 1468556956860775637} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &5754166031850356969 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031850356981} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &5754166031850356970 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031850356981} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!114 &5754166031850356971 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031850356981} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &5754166031850356980 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5754166031850356981} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d3606bfdac5a4743890fc1a5ecd8f24, type: 3} + m_Name: + m_EditorClassIdentifier: + _autoStartType: 1 + _stoppedColor: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + _changingColor: {r: 0.78431374, g: 0.6862745, b: 0, a: 1} + _startedColor: {r: 0, g: 0.5882353, b: 0.64705884, a: 1} + _serverIndicator: {fileID: 4910195209183790686} + _clientIndicator: {fileID: 6984572743191468628} +--- !u!1 &5754166031850356981 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5754166031850356968} + - component: {fileID: 5754166031850356980} + - component: {fileID: 5754166031850356969} + - component: {fileID: 5754166031850356970} + - component: {fileID: 5754166031850356971} + m_Layer: 5 + m_Name: NetworkHudCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &5856558383919887037 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1007221594027449775} + - component: {fileID: 3365042086831326887} + - component: {fileID: 6984572743191468628} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &6984572743191468628 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5856558383919887037} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 diff --git a/Assets/FishNet/Demos/IntermediateLayer/Scenes/IntermediateLayer.unity.meta b/Assets/FishNet/Demos/IntermediateLayer/Scenes/IntermediateLayer.unity.meta new file mode 100644 index 0000000..a29f1a7 --- /dev/null +++ b/Assets/FishNet/Demos/IntermediateLayer/Scenes/IntermediateLayer.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fa009a2a1952c0647ae5cf75a5fd4c05 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/IntermediateLayer/Scripts.meta b/Assets/FishNet/Demos/IntermediateLayer/Scripts.meta new file mode 100644 index 0000000..af18117 --- /dev/null +++ b/Assets/FishNet/Demos/IntermediateLayer/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a91fd8f80ac0aee48bf00ae0d84167c4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/IntermediateLayer/Scripts/IntermediateLayerCipher.cs b/Assets/FishNet/Demos/IntermediateLayer/Scripts/IntermediateLayerCipher.cs new file mode 100644 index 0000000..2933047 --- /dev/null +++ b/Assets/FishNet/Demos/IntermediateLayer/Scripts/IntermediateLayerCipher.cs @@ -0,0 +1,60 @@ +using FishNet.Managing.Transporting; +using System; + +namespace FishNet.Example.IntermediateLayers +{ + /* Below is an example of creating a basic Caesar Cipher. + * Bytes are modified by a set value of CIPHER_KEY, and then + * the original src ArraySegment is returned. + * + * It's very important to only iterate the bytes provided + * as the segment. For example, if the ArraySegment contains + * 1000 bytes but the Offset is 3 and Count is 5 then you should + * only iterate bytes on index 3, 4, 5, 6, 7. The code below + * shows one way of properly doing so. + * + * If you are to change the byte array reference, size, or segment + * count be sure to return a new ArraySegment with the new values. + * For example, if your Offset was 0 and count was 10 but after + * encrypting data the Offset was still 0 and count 15 you would + * return new ArraySegment(theArray, 0, 15); */ + public class IntermediateLayerCipher : IntermediateLayer + { + private const byte CIPHER_KEY = 5; + //Decipher incoming data. + public override ArraySegment HandleIncoming(ArraySegment src, bool fromServer) + { + byte[] arr = src.Array; + int length = src.Count; + int offset = src.Offset; + + for (int i = src.Offset; i < (offset + length); i++) + { + short next = (short)(arr[i] - CIPHER_KEY); + if (next < 0) + next += 256; + arr[i] = (byte)next; + } + + return src; + } + //Cipher outgoing data. + public override ArraySegment HandleOutgoing(ArraySegment src, bool toServer) + { + byte[] arr = src.Array; + int length = src.Count; + int offset = src.Offset; + + for (int i = offset; i < (offset + length); i++) + { + short next = (short)(arr[i] + CIPHER_KEY); + if (next > byte.MaxValue) + next -= 256; + arr[i] = (byte)next; + } + + return src; + } + + } +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/IntermediateLayer/Scripts/IntermediateLayerCipher.cs.meta b/Assets/FishNet/Demos/IntermediateLayer/Scripts/IntermediateLayerCipher.cs.meta new file mode 100644 index 0000000..427848c --- /dev/null +++ b/Assets/FishNet/Demos/IntermediateLayer/Scripts/IntermediateLayerCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 10c18bbe05944364d9295f5ee411a95f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD.meta b/Assets/FishNet/Demos/Network LOD.meta new file mode 100644 index 0000000..6bcf5d1 --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 01b17d2e9e8e92c468aa520552226c3d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Materials.meta b/Assets/FishNet/Demos/Network LOD/Materials.meta new file mode 100644 index 0000000..0253e3f --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eac3bb4d33654b949b68cda7cd1209b2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Materials/Player.mat b/Assets/FishNet/Demos/Network LOD/Materials/Player.mat new file mode 100644 index 0000000..3f4e43e --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Materials/Player.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Player + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.44982982, g: 0.8207547, b: 0.2748754, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/Network LOD/Materials/Player.mat.meta b/Assets/FishNet/Demos/Network LOD/Materials/Player.mat.meta new file mode 100644 index 0000000..2452502 --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Materials/Player.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 143d8fe5f64b27d44a592f57d7949e1c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Network LOD Demo README.txt b/Assets/FishNet/Demos/Network LOD/Network LOD Demo README.txt new file mode 100644 index 0000000..caba11a --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Network LOD Demo README.txt @@ -0,0 +1,10 @@ +THIS DEMO REQUIRES FISH-NETWORKING PRO + +- Enable LOD inside the Fish-Networking > Developer menu. +- Open scene. +- Select LOD Tester in scene and slide LOD Level. +- Press Play. + +Can be tested as clientHost, or server and client separate. +LOD Level cannot be changed at runtime. +A level of 1 is the same as not using LOD. \ No newline at end of file diff --git a/Assets/FishNet/Demos/Network LOD/Network LOD Demo README.txt.meta b/Assets/FishNet/Demos/Network LOD/Network LOD Demo README.txt.meta new file mode 100644 index 0000000..839dcc1 --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Network LOD Demo README.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c373771d26a3af04a84bd1afd5aabfe8 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Prefabs.meta b/Assets/FishNet/Demos/Network LOD/Prefabs.meta new file mode 100644 index 0000000..52db18f --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3060a1729644a5a489574203c0653563 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Prefabs/LODObjectPrefab.prefab b/Assets/FishNet/Demos/Network LOD/Prefabs/LODObjectPrefab.prefab new file mode 100644 index 0000000..ee7ec2f --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Prefabs/LODObjectPrefab.prefab @@ -0,0 +1,211 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4512293259955182959 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4512293259955182957} + - component: {fileID: 4512293259955182956} + - component: {fileID: 6667641716399555817} + - component: {fileID: -5271135124957689192} + m_Layer: 0 + m_Name: LODObjectPrefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4512293259955182957 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2745247498903379289} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4512293259955182956 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 26 + k__BackingField: 0 + _scenePathHash: 0 + k__BackingField: 0 + k__BackingField: 1985539020153172578 + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 6667641716399555817} + - {fileID: -5271135124957689192} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 1, y: 1, z: 1} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &6667641716399555817 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9880e85651efd71469092ce519317f7b, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 4512293259955182956} + _networkObjectCache: {fileID: 4512293259955182956} + _renderer: {fileID: 0} + _updateRotation: 1 +--- !u!114 &-5271135124957689192 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 1 + _addedNetworkObject: {fileID: 4512293259955182956} + _networkObjectCache: {fileID: 4512293259955182956} + _componentConfiguration: 0 + _synchronizeParent: 0 + _packing: + Position: 1 + Rotation: 1 + Scale: 0 + _interpolation: 2 + _extrapolation: 2 + _enableTeleport: 0 + _teleportThreshold: 1 + _scaleThreshold: 1 + _clientAuthoritative: 1 + _sendToOwner: 1 + _enableNetworkLod: 1 + _interval: 1 + _synchronizePosition: 1 + _positionSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeRotation: 1 + _rotationSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeScale: 1 + _scaleSnapping: + X: 0 + Y: 0 + Z: 0 +--- !u!1 &5839577311109879042 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2745247498903379289} + - component: {fileID: 3127415364279584095} + - component: {fileID: 5921142425762840611} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2745247498903379289 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5839577311109879042} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4512293259955182957} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3127415364279584095 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5839577311109879042} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5921142425762840611 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5839577311109879042} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 diff --git a/Assets/FishNet/Demos/Network LOD/Prefabs/LODObjectPrefab.prefab.meta b/Assets/FishNet/Demos/Network LOD/Prefabs/LODObjectPrefab.prefab.meta new file mode 100644 index 0000000..6358294 --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Prefabs/LODObjectPrefab.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f32d4c19de900e64cb73cedcb8ba6f70 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Prefabs/PlayerPrefab.prefab b/Assets/FishNet/Demos/Network LOD/Prefabs/PlayerPrefab.prefab new file mode 100644 index 0000000..cfb950b --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Prefabs/PlayerPrefab.prefab @@ -0,0 +1,211 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4512293259955182959 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4512293259955182957} + - component: {fileID: 4512293259955182956} + - component: {fileID: 6667641716399555817} + - component: {fileID: -5271135124957689192} + m_Layer: 0 + m_Name: PlayerPrefab + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4512293259955182957 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2745247498903379289} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4512293259955182956 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 6 + k__BackingField: 0 + _scenePathHash: 2359702710 + k__BackingField: 0 + k__BackingField: 7585316040777855176 + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 6667641716399555817} + - {fileID: -5271135124957689192} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 1, y: 1, z: 1} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &6667641716399555817 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9880e85651efd71469092ce519317f7b, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 4512293259955182956} + _networkObjectCache: {fileID: 4512293259955182956} + _renderer: {fileID: 0} + _updateRotation: 1 +--- !u!114 &-5271135124957689192 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4512293259955182959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 1 + _addedNetworkObject: {fileID: 4512293259955182956} + _networkObjectCache: {fileID: 4512293259955182956} + _componentConfiguration: 0 + _synchronizeParent: 0 + _packing: + Position: 1 + Rotation: 1 + Scale: 0 + _interpolation: 2 + _extrapolation: 2 + _enableTeleport: 0 + _teleportThreshold: 1 + _scaleThreshold: 1 + _clientAuthoritative: 1 + _sendToOwner: 1 + _enableNetworkLod: 1 + _interval: 1 + _synchronizePosition: 1 + _positionSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeRotation: 1 + _rotationSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeScale: 1 + _scaleSnapping: + X: 0 + Y: 0 + Z: 0 +--- !u!1 &5839577311109879042 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2745247498903379289} + - component: {fileID: 3127415364279584095} + - component: {fileID: 5921142425762840611} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2745247498903379289 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5839577311109879042} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4512293259955182957} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3127415364279584095 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5839577311109879042} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5921142425762840611 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5839577311109879042} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 143d8fe5f64b27d44a592f57d7949e1c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 diff --git a/Assets/FishNet/Demos/Network LOD/Prefabs/PlayerPrefab.prefab.meta b/Assets/FishNet/Demos/Network LOD/Prefabs/PlayerPrefab.prefab.meta new file mode 100644 index 0000000..de7ba26 --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Prefabs/PlayerPrefab.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 300370bdf7819da41937e0beac65b32c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Prefabs/_Network LOD_Prefabs.asset b/Assets/FishNet/Demos/Network LOD/Prefabs/_Network LOD_Prefabs.asset new file mode 100644 index 0000000..cacc73d --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Prefabs/_Network LOD_Prefabs.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4489d77032a81ef42b0067acf2737d4d, type: 3} + m_Name: _Network LOD_Prefabs + m_EditorClassIdentifier: + _prefabs: + - {fileID: 4512293259955182956, guid: 300370bdf7819da41937e0beac65b32c, type: 3} + - {fileID: 4512293259955182956, guid: f32d4c19de900e64cb73cedcb8ba6f70, type: 3} diff --git a/Assets/FishNet/Demos/Network LOD/Prefabs/_Network LOD_Prefabs.asset.meta b/Assets/FishNet/Demos/Network LOD/Prefabs/_Network LOD_Prefabs.asset.meta new file mode 100644 index 0000000..a559414 --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Prefabs/_Network LOD_Prefabs.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0078a285cda09f349b2668a721a53212 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Scenes.meta b/Assets/FishNet/Demos/Network LOD/Scenes.meta new file mode 100644 index 0000000..dfcee44 --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c4bb86f41e1c4a84585e1ebef18ea9a7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Scenes/NetworkLOD_Demo.unity b/Assets/FishNet/Demos/Network LOD/Scenes/NetworkLOD_Demo.unity new file mode 100644 index 0000000..ea1640f --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Scenes/NetworkLOD_Demo.unity @@ -0,0 +1,1120 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!114 &370472796 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3fdaae44044276a49a52229c1597e33b, type: 3} + m_Name: + m_EditorClassIdentifier: + _updateOrder: 0 + _timingType: 0 + _allowTickDropping: 0 + _maximumFrameTicks: 2 + _tickRate: 30 + _pingInterval: 15 + _physicsMode: 0 +--- !u!1 &442045874 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 442045875} + - component: {fileID: 442045876} + - component: {fileID: 442045877} + m_Layer: 0 + m_Name: --LOD Tester + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &442045875 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 442045874} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1453871496} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &442045876 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 442045874} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 442045877} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 1, y: 1, z: 1} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _teleportThreshold: 1 + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 2359702710 + k__BackingField: 10134845970961547977 + k__BackingField: 0 +--- !u!114 &442045877 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 442045874} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3e21cdbd259430f4ea77e1f3a6c88fc4, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 442045876} + _networkObjectCache: {fileID: 442045876} + _prefab: {fileID: 4512293259955182956, guid: f32d4c19de900e64cb73cedcb8ba6f70, type: 3} + _observerManager: {fileID: 1776591436} + _lodLevel: 8 + _count: 500 + _xyRange: 15 + _zRange: 100 +--- !u!1 &584355000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 584355002} + - component: {fileID: 584355001} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &584355001 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 584355000} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &584355002 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 584355000} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &585532990 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 585532993} + - component: {fileID: 585532992} + - component: {fileID: 585532991} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &585532991 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 585532990} + m_Enabled: 1 +--- !u!20 &585532992 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 585532990} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &585532993 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 585532990} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1453871495 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1453871496} + m_Layer: 0 + m_Name: GameObject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1453871496 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1453871495} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -20} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 442045875} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1776591436 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d331f979d46e8e4a9fc90070c596d44, type: 3} + m_Name: + m_EditorClassIdentifier: + _enableNetworkLod: 1 + _levelOfDetailDistances: + - 5 + - 10 + - 15 + - 30 + - 50 + - 70 + - 90 + - 100 + _updateHostVisibility: 1 + _defaultConditions: + - {fileID: 11400000, guid: 2033f54fd2794464bae08fa5a55c8996, type: 2} +--- !u!114 &1424052073952814568 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714076101889} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &2480283714076101889 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9139860295505404435} + - component: {fileID: 6745855428728600859} + - component: {fileID: 1424052073952814568} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &3965864432884103650 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256728133663} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4393252310954709616 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310954709618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252310954709631} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252311495835464} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Client + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!224 &4393252310954709617 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310954709618} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 9139860295505404435} + m_Father: {fileID: 4393252311495835476} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -96} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!1 &4393252310954709618 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252310954709617} + - component: {fileID: 4393252310954709630} + - component: {fileID: 4393252310954709631} + - component: {fileID: 4393252310954709616} + m_Layer: 5 + m_Name: Client + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &4393252310954709630 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310954709618} + m_CullTransparentMesh: 0 +--- !u!114 &4393252310954709631 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310954709618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2d50394614f8feb4eb0567fb7618d84d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4393252311105513456 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311105513458} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252311105513471} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252311495835464} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Server + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!224 &4393252311105513457 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311105513458} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7233259200116312561} + m_Father: {fileID: 4393252311495835476} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -16} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!1 &4393252311105513458 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311105513457} + - component: {fileID: 4393252311105513470} + - component: {fileID: 4393252311105513471} + - component: {fileID: 4393252311105513456} + m_Layer: 5 + m_Name: Server + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &4393252311105513470 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311105513458} + m_CullTransparentMesh: 0 +--- !u!114 &4393252311105513471 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311105513458} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1b187e63031bf7849b249c8212440c3b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4393252311495835464 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311495835465} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d3606bfdac5a4743890fc1a5ecd8f24, type: 3} + m_Name: + m_EditorClassIdentifier: + _autoStartType: 1 + _stoppedColor: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + _changingColor: {r: 0.78431374, g: 0.6862745, b: 0, a: 1} + _startedColor: {r: 0, g: 0.5882353, b: 0.64705884, a: 1} + _serverIndicator: {fileID: 3965864432884103650} + _clientIndicator: {fileID: 1424052073952814568} +--- !u!1 &4393252311495835465 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311495835476} + - component: {fileID: 4393252311495835464} + - component: {fileID: 4393252311495835477} + - component: {fileID: 4393252311495835478} + - component: {fileID: 4393252311495835479} + m_Layer: 5 + m_Name: NetworkHudCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4393252311495835476 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311495835465} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4393252311105513457} + - {fileID: 4393252310954709617} + m_Father: {fileID: 7443408886575219561} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &4393252311495835477 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311495835465} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &4393252311495835478 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311495835465} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!114 &4393252311495835479 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311495835465} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!1 &4808982256728133663 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7233259200116312561} + - component: {fileID: 5104387649625413016} + - component: {fileID: 3965864432884103650} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &5104387649625413016 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256728133663} + m_CullTransparentMesh: 0 +--- !u!222 &6745855428728600859 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714076101889} + m_CullTransparentMesh: 0 +--- !u!224 &7233259200116312561 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256728133663} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4393252311105513457} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &7443408886575219556 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 211a9f6ec51ddc14f908f5acc0cd0423, type: 3} + m_Name: + m_EditorClassIdentifier: + _playerPrefab: {fileID: 4512293259955182956, guid: 300370bdf7819da41937e0beac65b32c, + type: 3} + _addToDefaultScene: 1 + Spawns: [] +--- !u!4 &7443408886575219561 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4393252311495835476} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7443408886575219562 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2c95dfde7d73b54dbbdc23155d35d36, type: 3} + m_Name: + m_EditorClassIdentifier: + _refreshDefaultPrefabs: 1 + _runInBackground: 1 + _dontDestroyOnLoad: 1 + _objectPool: {fileID: 0} + _persistence: 0 + _logging: {fileID: 0} + _spawnablePrefabs: {fileID: 11400000, guid: 0078a285cda09f349b2668a721a53212, type: 2} +--- !u!1 &7443408886575219563 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7443408886575219561} + - component: {fileID: 7443408886575219562} + - component: {fileID: 7443408886575219556} + - component: {fileID: 370472796} + - component: {fileID: 7443408886575219565} + - component: {fileID: 7443408886575219564} + - component: {fileID: 1776591436} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &7443408886575219564 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 756c28cd3141c4140ae776188ee26729, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkTraffic: + _updateInteval: 1 + _updateClient: 0 + _updateServer: 1 +--- !u!114 &7443408886575219565 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886575219563} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8bc8f0363ddc75946a958043c5e49a83, type: 3} + m_Name: + m_EditorClassIdentifier: + _color: {r: 1, g: 1, b: 1, a: 1} + _placement: 2 + _showOutgoing: 1 + _showIncoming: 1 +--- !u!224 &9139860295505404435 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714076101889} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4393252310954709617} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/FishNet/Demos/Network LOD/Scenes/NetworkLOD_Demo.unity.meta b/Assets/FishNet/Demos/Network LOD/Scenes/NetworkLOD_Demo.unity.meta new file mode 100644 index 0000000..d5f8856 --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Scenes/NetworkLOD_Demo.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 961b96636e4c7644584dc8dfd0d0aad6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Scripts.meta b/Assets/FishNet/Demos/Network LOD/Scripts.meta new file mode 100644 index 0000000..98fc423 --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9f8d1e8e1482b84468258a26a4887d07 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Scripts/MoveRandomly.cs b/Assets/FishNet/Demos/Network LOD/Scripts/MoveRandomly.cs new file mode 100644 index 0000000..5ac86cb --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Scripts/MoveRandomly.cs @@ -0,0 +1,80 @@ +using FishNet.Object; +using UnityEngine; + +namespace FishNet.Demo.NetworkLod +{ + + public class MoveRandomly : NetworkBehaviour + { + + //Colors green for client. + [SerializeField] + private Renderer _renderer; + [SerializeField] + private bool _updateRotation; + + //Time to move to new position. + private const float _moveRate = 3f; + //Maximum range for new position. + private const float _range = 10f; + //Position to move towards. + private Vector3 _goalPosition; + //Rotation to move towards. + private Quaternion _goalRotation; + //Position at spawn. + private Vector3 _startPosition; + + + + private void Update() + { + //Client should not move these. + if (base.IsClientOnlyStarted) + return; + //Server shouldn't move client one. + if (base.Owner.IsValid) + return; + + transform.position = Vector3.MoveTowards(transform.position, _goalPosition, _moveRate * Time.deltaTime); + if (_updateRotation) + transform.rotation = Quaternion.RotateTowards(transform.rotation, _goalRotation, 15f * Time.deltaTime); + if (transform.position == _goalPosition) + RandomizeGoal(); + } + + public override void OnStartNetwork() + { + _startPosition = transform.position; + RandomizeGoal(); + + if (_renderer != null && base.Owner.IsActive) + _renderer.material.color = Color.green; + + if (!base.Owner.IsValid) + gameObject.name = "LOD " + base.ObjectId; + else + gameObject.name = "Owned " + base.ObjectId; + } + + private void RandomizeGoal() + { + _goalPosition = _startPosition + (Random.insideUnitSphere * _range); + + if (_updateRotation) + { + bool rotate = (Random.Range(0f, 1f) <= 0.33f); + if (rotate) + { + Vector3 euler = Random.insideUnitSphere * 180f; + _goalRotation = Quaternion.Euler(euler); + } + else + { + _goalRotation = transform.rotation; + } + } + } + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/Network LOD/Scripts/MoveRandomly.cs.meta b/Assets/FishNet/Demos/Network LOD/Scripts/MoveRandomly.cs.meta new file mode 100644 index 0000000..bd16c3d --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Scripts/MoveRandomly.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9880e85651efd71469092ce519317f7b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Network LOD/Scripts/NetworkLodTester.cs b/Assets/FishNet/Demos/Network LOD/Scripts/NetworkLodTester.cs new file mode 100644 index 0000000..86812d6 --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Scripts/NetworkLodTester.cs @@ -0,0 +1,74 @@ +using FishNet.Managing.Observing; +using FishNet.Object; +using System.Collections.Generic; +using UnityEngine; + + +namespace FishNet.Demo.NetworkLod +{ + + public class NetworkLodTester : NetworkBehaviour + { + [Header("General")] + [SerializeField] + private NetworkObject _prefab; + [SerializeField] + private ObserverManager _observerManager; + [Range(1, 8)] + [SerializeField] + private byte _lodLevel = 8; + + [Header("Spawning")] + [SerializeField] + private int _count = 500; + [SerializeField] + private float _xyRange = 15f; + [SerializeField] + private float _zRange = 100f; + + private void Awake() + { + //Check for pro...this will stay false if not on a pro package. + bool isPro = false; + + if (!isPro) + { + Debug.LogError($"Network Level of Detail demo requires Fish-Networking Pro to work."); + DestroyImmediate(this); + return; + } + + List distances = _observerManager.GetLevelOfDetailDistances(); + while (distances.Count > _lodLevel) + distances.RemoveAt(distances.Count - 1); + } + + public override void OnStartServer() + { + //Spawn objects going down the range to make it easier to debug. + float xySpacing = (_xyRange / _count); + float zSpacing = (_zRange / _count); + float x = 0f; + float y = 0f; + float z = 0f; + + for (int i = 0; i < _count; i++) + { + //Z cannot be flipped. + float nextZ = z; + + x += xySpacing; + y += xySpacing; + z += zSpacing; + float nextX = 0; + float nextY = 0; + Vector3 position = new Vector3(nextX, nextY, nextZ); + NetworkObject obj = Instantiate(_prefab, position, Quaternion.identity); + base.Spawn(obj); + } + } + + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/Network LOD/Scripts/NetworkLodTester.cs.meta b/Assets/FishNet/Demos/Network LOD/Scripts/NetworkLodTester.cs.meta new file mode 100644 index 0000000..b83bb07 --- /dev/null +++ b/Assets/FishNet/Demos/Network LOD/Scripts/NetworkLodTester.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e21cdbd259430f4ea77e1f3a6c88fc4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2.meta b/Assets/FishNet/Demos/Prediction 2.meta new file mode 100644 index 0000000..93248ba --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7e04426ec3811c4439a20fc6f21abb62 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController.meta b/Assets/FishNet/Demos/Prediction 2/CharacterController.meta new file mode 100644 index 0000000..efba932 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: accc5b93ebf3b0040baaec2298c7d394 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController/Materials.meta b/Assets/FishNet/Demos/Prediction 2/CharacterController/Materials.meta new file mode 100644 index 0000000..945b291 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bdae6fa333d2d94449c27856e21d936a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController/Materials/BlueMat.mat b/Assets/FishNet/Demos/Prediction 2/CharacterController/Materials/BlueMat.mat new file mode 100644 index 0000000..f0d6684 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController/Materials/BlueMat.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BlueMat + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0, g: 0.363446, b: 0.5471698, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController/Materials/BlueMat.mat.meta b/Assets/FishNet/Demos/Prediction 2/CharacterController/Materials/BlueMat.mat.meta new file mode 100644 index 0000000..39a6c0a --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController/Materials/BlueMat.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a2ca0973c8f8a4846bb7f3894c3bc5cf +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController/PredictionV2_CC.unity b/Assets/FishNet/Demos/Prediction 2/CharacterController/PredictionV2_CC.unity new file mode 100644 index 0000000..ba2ebbe --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController/PredictionV2_CC.unity @@ -0,0 +1,2001 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!114 &192429404 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3fdaae44044276a49a52229c1597e33b, type: 3} + m_Name: + m_EditorClassIdentifier: + _updateOrder: 0 + _timingType: 0 + _allowTickDropping: 0 + _maximumFrameTicks: 2 + _tickRate: 20 + _pingInterval: 1 + _physicsMode: 1 +--- !u!114 &192429405 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6f48f002b825cbd45a19bd96d90f9edb, type: 3} + m_Name: + m_EditorClassIdentifier: + _unreliableMTU: 1023 + _ipv4BindAddress: + _ipv6BindAddress: + _port: 7770 + _maximumClients: 5000 + _clientAddress: localhost + _timeout: 15 +--- !u!114 &192429406 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f9b6b565cd9533c4ebc18003f0fc18a2, type: 3} + m_Name: + m_EditorClassIdentifier: + _color: {r: 1, g: 1, b: 1, a: 1} + _placement: 1 + _hideTickRate: 1 +--- !u!114 &192429407 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 34e4a322dca349547989b14021da4e23, type: 3} + m_Name: + m_EditorClassIdentifier: + Transport: {fileID: 192429405} + _intermediateLayer: {fileID: 0} + _latencySimulator: + _enabled: 0 + _simulateHost: 1 + _latency: 70 + _outOfOrder: 0 + _packetLoss: 0 +--- !u!114 &192429408 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 68828c85278210948b9d50a8db3aab74, type: 3} + m_Name: + m_EditorClassIdentifier: + _authenticator: {fileID: 0} + _remoteClientTimeout: 0 + _remoteClientTimeoutDuration: 60 + _syncTypeRate: 0.1 + SpawnPacking: + Position: 0 + Rotation: 2 + Scale: 2 + _changeFrameRate: 1 + _frameRate: 100 + _shareIds: 1 + _startOnHeadless: 1 + _limitClientMTU: 1 +--- !u!114 &192429409 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e08bb003fce297d4086cf8cba5aa459a, type: 3} + m_Name: + m_EditorClassIdentifier: + _queuedInputs: 1 + _dropExcessiveReplicates: 1 + _maximumServerReplicates: 15 + _maximumConsumeCount: 4 + _redundancyCount: 2 + _allowPredictedSpawning: 0 + _reservedObjectIds: 15 +--- !u!114 &192429410 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aca43cf6f20e77c4f8fcc078fd85081f, type: 3} + m_Name: + m_EditorClassIdentifier: + _remoteServerTimeout: 2 + _remoteServerTimeoutDuration: 60 + _changeFrameRate: 1 + _frameRate: 100 +--- !u!1 &212039606 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 212039607} + - component: {fileID: 212039608} + m_Layer: 0 + m_Name: View + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &212039607 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 212039606} + m_LocalRotation: {x: 0.37959778, y: -0.5981522, z: 0.3830318, w: 0.5927952} + m_LocalPosition: {x: 10.585218, y: 24.346329, z: 20.032343} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 40, y: -90, z: 0} +--- !u!114 &212039608 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 212039606} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 10.585218, y: 24.346329, z: 20.032343} + Rotation: {x: 0.37959778, y: -0.5981522, z: 0.3830318, w: 0.5927952} + LocalScale: {x: 1, y: 1, z: 1} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 2478811136 + k__BackingField: 10646412763218034985 + k__BackingField: 0 +--- !u!1 &555580081 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 555580085} + - component: {fileID: 555580084} + - component: {fileID: 555580083} + - component: {fileID: 555580082} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &555580082 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 555580081} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &555580083 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 555580081} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a2ca0973c8f8a4846bb7f3894c3bc5cf, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &555580084 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 555580081} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &555580085 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 555580081} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -9.16, y: -3.4, z: 13.1} + m_LocalScale: {x: 15, y: 15, z: 15} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &587483120 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 587483126} + - component: {fileID: 587483125} + - component: {fileID: 587483124} + - component: {fileID: 587483123} + - component: {fileID: 587483122} + - component: {fileID: 587483121} + m_Layer: 0 + m_Name: OfflineCapsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!54 &587483121 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &587483122 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b749f90d4c9961c4991179db1130fa4d, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!136 &587483123 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &587483124 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &587483125 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &587483126 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 6.0329375, y: 0.01036527, z: 8.858636} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &872683029 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 872683031} + - component: {fileID: 872683030} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &872683030 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 872683029} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &872683031 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 872683029} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &967467089 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 967467090} + - component: {fileID: 967467093} + - component: {fileID: 967467092} + - component: {fileID: 967467091} + m_Layer: 0 + m_Name: Wall + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &967467090 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 967467089} + m_LocalRotation: {x: 0, y: 0.82565534, z: 0, w: 0.56417483} + m_LocalPosition: {x: 8.24, y: -0.08, z: 15.86} + m_LocalScale: {x: 1, y: 5, z: 5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 111.31, z: 0} +--- !u!65 &967467091 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 967467089} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &967467092 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 967467089} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a2ca0973c8f8a4846bb7f3894c3bc5cf, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &967467093 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 967467089} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1112005912 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1112005916} + - component: {fileID: 1112005915} + - component: {fileID: 1112005914} + - component: {fileID: 1112005913} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1112005913 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1112005912} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1112005914 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1112005912} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0bb31cf72dfcef449a1a4a5aab857f63, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1112005915 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1112005912} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1112005916 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1112005912} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -2, z: 0} + m_LocalScale: {x: 100, y: 1, z: 100} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1256183191 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1256183192} + - component: {fileID: 1256183195} + - component: {fileID: 1256183194} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1256183192 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1256183191} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1560902884} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1256183194 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1256183191} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1256183195 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1256183191} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1470934487 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1470934491} + - component: {fileID: 1470934490} + - component: {fileID: 1470934489} + - component: {fileID: 1470934488} + m_Layer: 0 + m_Name: Wall + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1470934488 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1470934487} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1470934489 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1470934487} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a2ca0973c8f8a4846bb7f3894c3bc5cf, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1470934490 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1470934487} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1470934491 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1470934487} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 12.11, y: -0.08, z: 0} + m_LocalScale: {x: 1, y: 5, z: 20} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1560902877 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1560902884} + - component: {fileID: 1560902881} + - component: {fileID: 1560902878} + - component: {fileID: 1560902880} + - component: {fileID: 1560902879} + m_Layer: 0 + m_Name: OnlineSphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!54 &1560902878 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1560902877} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 1 +--- !u!114 &1560902879 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1560902877} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 402926ef33e0a894d9fec352693988ac, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 1560902880} + _networkObjectCache: {fileID: 1560902880} +--- !u!114 &1560902880 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1560902877} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 1560902879} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 0} + LocalScale: {x: 0, y: 0, z: 0} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 2478811136 + k__BackingField: 10646412763343888858 + k__BackingField: 0 +--- !u!135 &1560902881 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1560902877} + m_Material: {fileID: 13400000, guid: 2315b89c915a21c40982b5867ff7d343, type: 2} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!4 &1560902884 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1560902877} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.1, y: 0, z: 5.430528} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1256183192} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1726381377 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d331f979d46e8e4a9fc90070c596d44, type: 3} + m_Name: + m_EditorClassIdentifier: + _enableNetworkLod: 0 + _levelOfDetailDistances: [] + _updateHostVisibility: 1 + _defaultConditions: + - {fileID: 11400000, guid: 2033f54fd2794464bae08fa5a55c8996, type: 2} +--- !u!1 &1784594014 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1784594015} + m_Layer: 0 + m_Name: Level + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1784594015 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1784594014} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1112005916} + - {fileID: 1470934491} + - {fileID: 555580085} + - {fileID: 1852016427} + - {fileID: 872683031} + - {fileID: 967467090} + - {fileID: 1883869627} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1852016424 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1852016427} + - component: {fileID: 1852016426} + - component: {fileID: 1852016425} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1852016425 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1852016424} + m_Enabled: 1 +--- !u!20 &1852016426 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1852016424} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1852016427 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1852016424} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1883869626 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1883869627} + - component: {fileID: 1883869630} + - component: {fileID: 1883869629} + - component: {fileID: 1883869628} + m_Layer: 0 + m_Name: Cube (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1883869627 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1883869626} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -48.62, y: -0.08, z: 0} + m_LocalScale: {x: 1, y: 5, z: 20} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1883869628 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1883869626} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1883869629 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1883869626} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 6273444b68d517449aadb36abebaf561, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1883869630 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1883869626} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &1424052073902602981 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714093027852} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &2480283714093027852 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9139860295689780510} + - component: {fileID: 6745855428745291286} + - component: {fileID: 1424052073902602981} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &3965864432699664111 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256744730386} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4393252310837120370 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310837120383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2d50394614f8feb4eb0567fb7618d84d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &4393252310837120371 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310837120383} + m_CullTransparentMesh: 0 +--- !u!224 &4393252310837120380 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310837120383} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 9139860295689780510} + m_Father: {fileID: 4393252311378272345} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -96} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!114 &4393252310837120381 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310837120383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252310837120370} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252311378272325} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Client + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &4393252310837120383 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252310837120380} + - component: {fileID: 4393252310837120371} + - component: {fileID: 4393252310837120370} + - component: {fileID: 4393252310837120381} + m_Layer: 5 + m_Name: Client + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &4393252311222810866 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311222810879} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1b187e63031bf7849b249c8212440c3b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &4393252311222810867 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311222810879} + m_CullTransparentMesh: 0 +--- !u!224 &4393252311222810876 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311222810879} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7233259200132978428} + m_Father: {fileID: 4393252311378272345} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -16} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!114 &4393252311222810877 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311222810879} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252311222810866} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252311378272325} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Server + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &4393252311222810879 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311222810876} + - component: {fileID: 4393252311222810867} + - component: {fileID: 4393252311222810866} + - component: {fileID: 4393252311222810877} + m_Layer: 5 + m_Name: Server + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &4393252311378272324 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311378272345} + - component: {fileID: 4393252311378272325} + - component: {fileID: 4393252311378272344} + - component: {fileID: 4393252311378272347} + - component: {fileID: 4393252311378272346} + m_Layer: 5 + m_Name: NetworkHudCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &4393252311378272325 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311378272324} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d3606bfdac5a4743890fc1a5ecd8f24, type: 3} + m_Name: + m_EditorClassIdentifier: + _autoStartType: 2 + _stoppedColor: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + _changingColor: {r: 0.78431374, g: 0.6862745, b: 0, a: 1} + _startedColor: {r: 0, g: 0.5882353, b: 0.64705884, a: 1} + _serverIndicator: {fileID: 3965864432699664111} + _clientIndicator: {fileID: 1424052073902602981} +--- !u!223 &4393252311378272344 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311378272324} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &4393252311378272345 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311378272324} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4393252311222810876} + - {fileID: 4393252310837120380} + m_Father: {fileID: 7443408886491487332} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &4393252311378272346 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311378272324} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &4393252311378272347 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311378272324} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!1 &4808982256744730386 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7233259200132978428} + - component: {fileID: 5104387649508117141} + - component: {fileID: 3965864432699664111} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &5104387649508117141 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256744730386} + m_CullTransparentMesh: 0 +--- !u!222 &6745855428745291286 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714093027852} + m_CullTransparentMesh: 0 +--- !u!224 &7233259200132978428 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256744730386} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4393252311222810876} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!4 &7443408886491487332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4393252311378272345} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7443408886491487334 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7443408886491487332} + - component: {fileID: 7443408886491487335} + - component: {fileID: 1726381377} + - component: {fileID: 7443408886491487337} + - component: {fileID: 192429409} + - component: {fileID: 192429404} + - component: {fileID: 192429405} + - component: {fileID: 192429406} + - component: {fileID: 192429407} + - component: {fileID: 192429408} + - component: {fileID: 192429410} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &7443408886491487335 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2c95dfde7d73b54dbbdc23155d35d36, type: 3} + m_Name: + m_EditorClassIdentifier: + _refreshDefaultPrefabs: 1 + _runInBackground: 1 + _dontDestroyOnLoad: 1 + _objectPool: {fileID: 0} + _persistence: 0 + _logging: {fileID: 0} + _spawnablePrefabs: {fileID: 11400000, guid: 3a54436bdb916194f99da0d17231e617, type: 2} +--- !u!114 &7443408886491487337 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 211a9f6ec51ddc14f908f5acc0cd0423, type: 3} + m_Name: + m_EditorClassIdentifier: + _playerPrefab: {fileID: 201277550, guid: 5b712878ecece354ba4ffb026c0a221c, type: 3} + _addToDefaultScene: 1 + Spawns: [] +--- !u!224 &9139860295689780510 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714093027852} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4393252310837120380} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController/PredictionV2_CC.unity.meta b/Assets/FishNet/Demos/Prediction 2/CharacterController/PredictionV2_CC.unity.meta new file mode 100644 index 0000000..9aeb488 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController/PredictionV2_CC.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 941f6f8cbac7e9d418ffc6f22ee9359f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController/Prefabs.meta b/Assets/FishNet/Demos/Prediction 2/CharacterController/Prefabs.meta new file mode 100644 index 0000000..e0abc32 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 50d54accc2af0c746b0729b097981b93 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController/Prefabs/CharacterControllerPrediction.prefab b/Assets/FishNet/Demos/Prediction 2/CharacterController/Prefabs/CharacterControllerPrediction.prefab new file mode 100644 index 0000000..6a5bb9b --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController/Prefabs/CharacterControllerPrediction.prefab @@ -0,0 +1,202 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &303449598114786579 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 303449598114786577} + - component: {fileID: -2060332294883903109} + - component: {fileID: 201277550} + - component: {fileID: 4148834954576211901} + m_Layer: 0 + m_Name: CharacterControllerPrediction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &303449598114786577 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598114786579} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -4.80351, y: 0.18147132, z: 5.430528} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6952090537135875148} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &-2060332294883903109 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598114786579} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 53a6d84aa5d214e48a7308646e5d20da, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 201277550} + _networkObjectCache: {fileID: 201277550} +--- !u!114 &201277550 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598114786579} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: -2060332294883903109} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -4.80351, y: 0.18147132, z: 5.430528} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 1, y: 1, z: 1} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + k__BackingField: 3 + k__BackingField: 0 + _scenePathHash: 0 + k__BackingField: 0 + k__BackingField: 15176741689908595000 +--- !u!143 &4148834954576211901 +CharacterController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598114786579} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Height: 2 + m_Radius: 0.5 + m_SlopeLimit: 45 + m_StepOffset: 0.3 + m_SkinWidth: 0.08 + m_MinMoveDistance: 0.001 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &5873068582516782542 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6952090537135875148} + - component: {fileID: 6605329024375725182} + - component: {fileID: 9006911641345807741} + - component: {fileID: 4946798872430241371} + m_Layer: 0 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6952090537135875148 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5873068582516782542} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.01, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 303449598114786577} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &6605329024375725182 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5873068582516782542} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &9006911641345807741 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5873068582516782542} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &4946798872430241371 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5873068582516782542} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController/Prefabs/CharacterControllerPrediction.prefab.meta b/Assets/FishNet/Demos/Prediction 2/CharacterController/Prefabs/CharacterControllerPrediction.prefab.meta new file mode 100644 index 0000000..3ae3ba7 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController/Prefabs/CharacterControllerPrediction.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5b712878ecece354ba4ffb026c0a221c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController/Scripts.meta b/Assets/FishNet/Demos/Prediction 2/CharacterController/Scripts.meta new file mode 100644 index 0000000..6ddee3b --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eaf414b899169f04bb4b0d65424a40bf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController/Scripts/CharacterControllerPredictionV2.cs b/Assets/FishNet/Demos/Prediction 2/CharacterController/Scripts/CharacterControllerPredictionV2.cs new file mode 100644 index 0000000..5677cc0 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController/Scripts/CharacterControllerPredictionV2.cs @@ -0,0 +1,152 @@ +using FishNet; +using FishNet.Object; +using FishNet.Object.Prediction; +using FishNet.Transporting; +using System.Collections.Generic; +using UnityEngine; +using static FishNet.PredictionV2.CharacterControllerPredictionV2; + +namespace FishNet.PredictionV2 +{ + + public class CharacterControllerPredictionV2 : NetworkBehaviour + { +#if !PREDICTION_1 + + + public struct MoveData : IReplicateData + { + public uint SentTick; + public bool Jump; + public float Horizontal; + public float Vertical; + public MoveData(bool jump, float horizontal, float vertical, uint sentTick) + { + Jump = jump; + Horizontal = horizontal; + Vertical = vertical; + SentTick = sentTick; + _tick = 0; + } + + private uint _tick; + public void Dispose() { } + public uint GetTick() => _tick; + public void SetTick(uint value) => _tick = value; + } + + public struct ReconcileData : IReconcileData + { + public Vector3 Position; + public float VerticalVelocity; + public ReconcileData(Vector3 position, float verticalVelocity) + { + Position = position; + VerticalVelocity = verticalVelocity; + _tick = 0; + } + + private uint _tick; + public void Dispose() { } + public uint GetTick() => _tick; + public void SetTick(uint value) => _tick = value; + } + + [SerializeField] + private float _jumpForce = 15f; + [SerializeField] + private float _moveRate = 4f; + + private CharacterController _characterController; + private bool _jump; + private float _verticalVelocity; + + private void Update() + { + if (base.IsOwner) + { + if (Input.GetKeyDown(KeyCode.Space)) + _jump = true; + } + } + + public override void OnStartNetwork() + { + _characterController = GetComponent(); + base.TimeManager.OnTick += TimeManager_OnTick; + } + + public override void OnStopNetwork() + { + base.TimeManager.OnTick -= TimeManager_OnTick; + } + + + private void TimeManager_OnTick() + { + Move(BuildMoveData()); + /* The base.IsServer check is not required but does save a little + * performance by not building the reconcileData if not server. */ + CreateReconcile(); + } + + public override void CreateReconcile() + { + if (base.IsServerStarted) + { + ReconcileData rd = new ReconcileData(transform.position, _verticalVelocity); + Reconciliation(rd); + } + } + private MoveData BuildMoveData() + { + if (!base.IsOwner) + return default; + + float horizontal = Input.GetAxisRaw("Horizontal"); + float vertical = Input.GetAxisRaw("Vertical"); + + MoveData md; + if (horizontal != 0 || vertical != 0) + md = new MoveData(_jump, horizontal, vertical, base.TimeManager.LocalTick); + else + md = new MoveData(_jump, horizontal, vertical, 0); + _jump = false; + + return md; + } + + + [Replicate] + private void Move(MoveData md, ReplicateState state = ReplicateState.Invalid, Channel channel = Channel.Unreliable) + { + if (state == ReplicateState.CurrentFuture) + return; + + if (md.Jump) + _verticalVelocity = _jumpForce; + + float delta = (float)base.TimeManager.TickDelta; + _verticalVelocity += (Physics.gravity.y * delta); + if (_verticalVelocity < -20f) + _verticalVelocity = -20f; + + + Vector3 forces = new Vector3(md.Horizontal, _verticalVelocity, md.Vertical) * _moveRate; + _characterController.Move(forces * delta); + + + } + + [Reconcile] + private void Reconciliation(ReconcileData rd, Channel channel = Channel.Unreliable) + { + transform.position = rd.Position; + _verticalVelocity = rd.VerticalVelocity; + + } + +#endif + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/Prediction 2/CharacterController/Scripts/CharacterControllerPredictionV2.cs.meta b/Assets/FishNet/Demos/Prediction 2/CharacterController/Scripts/CharacterControllerPredictionV2.cs.meta new file mode 100644 index 0000000..347ec1f --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/CharacterController/Scripts/CharacterControllerPredictionV2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 53a6d84aa5d214e48a7308646e5d20da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/README Prediction V Examples.txt b/Assets/FishNet/Demos/Prediction 2/README Prediction V Examples.txt new file mode 100644 index 0000000..a2dbccd --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/README Prediction V Examples.txt @@ -0,0 +1,5 @@ +Prediction V2 is a work in progress and so are the examples. + +The Rigidbody example may not smooth properly. + +The CharacterController example is expected to work. \ No newline at end of file diff --git a/Assets/FishNet/Demos/Prediction 2/README Prediction V Examples.txt.meta b/Assets/FishNet/Demos/Prediction 2/README Prediction V Examples.txt.meta new file mode 100644 index 0000000..6fdc8cc --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/README Prediction V Examples.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 43f99d5241a617843a16537c3229c093 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/Rigidbody.meta b/Assets/FishNet/Demos/Prediction 2/Rigidbody.meta new file mode 100644 index 0000000..9a1671a --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/Rigidbody.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1603123a7ba837c4892564f087decd80 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/Rigidbody/PredictionV2_RB.unity b/Assets/FishNet/Demos/Prediction 2/Rigidbody/PredictionV2_RB.unity new file mode 100644 index 0000000..9500251 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/Rigidbody/PredictionV2_RB.unity @@ -0,0 +1,2063 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!114 &192429404 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3fdaae44044276a49a52229c1597e33b, type: 3} + m_Name: + m_EditorClassIdentifier: + _updateOrder: 0 + _timingType: 0 + _allowTickDropping: 0 + _maximumFrameTicks: 2 + _tickRate: 10 + _pingInterval: 1 + _physicsMode: 1 +--- !u!114 &192429405 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6f48f002b825cbd45a19bd96d90f9edb, type: 3} + m_Name: + m_EditorClassIdentifier: + _dontRoute: 0 + _unreliableMtu: 1023 + _ipv4BindAddress: + _enableIpv6: 1 + _ipv6BindAddress: + _port: 7770 + _maximumClients: 5000 + _clientAddress: localhost +--- !u!114 &192429406 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f9b6b565cd9533c4ebc18003f0fc18a2, type: 3} + m_Name: + m_EditorClassIdentifier: + _color: {r: 1, g: 1, b: 1, a: 1} + _placement: 1 + _hideTickRate: 1 +--- !u!114 &192429407 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 34e4a322dca349547989b14021da4e23, type: 3} + m_Name: + m_EditorClassIdentifier: + Transport: {fileID: 192429405} + _intermediateLayer: {fileID: 0} + _latencySimulator: + _enabled: 0 + _simulateHost: 1 + _latency: 5 + _outOfOrder: 0 + _packetLoss: 0 +--- !u!114 &192429408 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 68828c85278210948b9d50a8db3aab74, type: 3} + m_Name: + m_EditorClassIdentifier: + _authenticator: {fileID: 0} + _remoteClientTimeout: 2 + _remoteClientTimeoutDuration: 60 + _syncTypeRate: 0.1 + SpawnPacking: + Position: 0 + Rotation: 2 + Scale: 2 + _changeFrameRate: 1 + _frameRate: 100 + _shareIds: 1 + _startOnHeadless: 1 +--- !u!114 &192429409 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e08bb003fce297d4086cf8cba5aa459a, type: 3} + m_Name: + m_EditorClassIdentifier: + _queuedInputs: 0 + _dropExcessiveReplicates: 1 + _maximumServerReplicates: 15 + _redundancyCount: 2 + _allowPredictedSpawning: 0 + _reservedObjectIds: 15 +--- !u!114 &192429410 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: aca43cf6f20e77c4f8fcc078fd85081f, type: 3} + m_Name: + m_EditorClassIdentifier: + _remoteServerTimeout: 2 + _remoteServerTimeoutDuration: 60 + _changeFrameRate: 1 + _frameRate: 100 +--- !u!1 &212039606 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 212039607} + - component: {fileID: 212039608} + m_Layer: 0 + m_Name: View + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &212039607 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 212039606} + m_LocalRotation: {x: 0.37959778, y: -0.5981522, z: 0.3830318, w: 0.5927952} + m_LocalPosition: {x: 10.585218, y: 24.346329, z: 20.032343} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 40, y: -90, z: 0} +--- !u!114 &212039608 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 212039606} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 10.585218, y: 24.346329, z: 20.032343} + Rotation: {x: 0.37959778, y: -0.5981522, z: 0.3830318, w: 0.5927952} + LocalScale: {x: 1, y: 1, z: 1} + _isNetworked: 1 + _isSpawnable: 0 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _teleportThreshold: 1 + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1828152806 + k__BackingField: 7851856517478923898 + k__BackingField: 0 +--- !u!1 &555580081 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 555580085} + - component: {fileID: 555580084} + - component: {fileID: 555580083} + - component: {fileID: 555580082} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &555580082 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 555580081} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &555580083 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 555580081} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 6273444b68d517449aadb36abebaf561, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &555580084 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 555580081} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &555580085 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 555580081} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -9.16, y: -3.4, z: 26.49} + m_LocalScale: {x: 15, y: 15, z: 15} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &587483120 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 587483126} + - component: {fileID: 587483125} + - component: {fileID: 587483124} + - component: {fileID: 587483123} + - component: {fileID: 587483122} + - component: {fileID: 587483121} + m_Layer: 0 + m_Name: OfflineCapsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!54 &587483121 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!114 &587483122 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b749f90d4c9961c4991179db1130fa4d, type: 3} + m_Name: + m_EditorClassIdentifier: + _rigidbodyType: 0 + _getInChildren: 0 +--- !u!136 &587483123 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &587483124 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &587483125 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &587483126 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 587483120} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 6.0329375, y: 0.01036527, z: 8.858636} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &872683029 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 872683031} + - component: {fileID: 872683030} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &872683030 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 872683029} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &872683031 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 872683029} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &967467089 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 967467090} + - component: {fileID: 967467093} + - component: {fileID: 967467092} + - component: {fileID: 967467091} + m_Layer: 0 + m_Name: Wall + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &967467090 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 967467089} + m_LocalRotation: {x: 0, y: 0.82565534, z: 0, w: 0.56417483} + m_LocalPosition: {x: 8.24, y: -0.08, z: 15.86} + m_LocalScale: {x: 1, y: 5, z: 5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 111.31, z: 0} +--- !u!65 &967467091 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 967467089} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 2, y: 2, z: 2} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &967467092 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 967467089} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 6273444b68d517449aadb36abebaf561, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &967467093 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 967467089} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1112005912 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1112005916} + - component: {fileID: 1112005915} + - component: {fileID: 1112005914} + - component: {fileID: 1112005913} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1112005913 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1112005912} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 2, y: 1, z: 2} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1112005914 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1112005912} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 0bb31cf72dfcef449a1a4a5aab857f63, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1112005915 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1112005912} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1112005916 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1112005912} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -2, z: 0} + m_LocalScale: {x: 100, y: 1, z: 100} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1256183191 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1256183192} + - component: {fileID: 1256183195} + - component: {fileID: 1256183194} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1256183192 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1256183191} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1560902884} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1256183194 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1256183191} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1256183195 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1256183191} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1470934487 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1470934491} + - component: {fileID: 1470934490} + - component: {fileID: 1470934489} + - component: {fileID: 1470934488} + m_Layer: 0 + m_Name: Wall + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1470934488 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1470934487} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 2, y: 2, z: 2} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1470934489 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1470934487} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 6273444b68d517449aadb36abebaf561, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1470934490 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1470934487} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1470934491 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1470934487} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 12.11, y: -0.08, z: 0} + m_LocalScale: {x: 1, y: 5, z: 20} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1560902877 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1560902884} + - component: {fileID: 1560902881} + - component: {fileID: 1560902878} + - component: {fileID: 1560902880} + - component: {fileID: 1560902879} + m_Layer: 0 + m_Name: OnlineSphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!54 &1560902878 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1560902877} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 1 +--- !u!114 &1560902879 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1560902877} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 402926ef33e0a894d9fec352693988ac, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 1560902880} + _networkObjectCache: {fileID: 1560902880} +--- !u!114 &1560902880 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1560902877} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 1560902879} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 0} + LocalScale: {x: 0, y: 0, z: 0} + _isNetworked: 1 + _isSpawnable: 0 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _teleportThreshold: 1 + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 1828152806 + k__BackingField: 7851856515000995197 + k__BackingField: 0 +--- !u!135 &1560902881 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1560902877} + m_Material: {fileID: 13400000, guid: 2315b89c915a21c40982b5867ff7d343, type: 2} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!4 &1560902884 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1560902877} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.1, y: 0, z: 5.430528} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1256183192} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1726381377 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d331f979d46e8e4a9fc90070c596d44, type: 3} + m_Name: + m_EditorClassIdentifier: + _enableNetworkLod: 0 + _levelOfDetailDistances: [] + _updateHostVisibility: 1 + _defaultConditions: + - {fileID: 11400000, guid: 2033f54fd2794464bae08fa5a55c8996, type: 2} +--- !u!1 &1784594014 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1784594015} + m_Layer: 0 + m_Name: Level + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1784594015 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1784594014} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1112005916} + - {fileID: 1470934491} + - {fileID: 555580085} + - {fileID: 1852016427} + - {fileID: 872683031} + - {fileID: 967467090} + - {fileID: 1883869627} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1852016424 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1852016427} + - component: {fileID: 1852016426} + - component: {fileID: 1852016425} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1852016425 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1852016424} + m_Enabled: 1 +--- !u!20 &1852016426 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1852016424} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1852016427 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1852016424} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1883869626 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1883869627} + - component: {fileID: 1883869630} + - component: {fileID: 1883869629} + - component: {fileID: 1883869628} + m_Layer: 0 + m_Name: Cube (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1883869627 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1883869626} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -48.62, y: -0.08, z: 0} + m_LocalScale: {x: 1, y: 5, z: 20} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1784594015} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1883869628 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1883869626} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 2, y: 2, z: 2} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1883869629 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1883869626} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 6273444b68d517449aadb36abebaf561, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1883869630 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1883869626} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &1424052073902602981 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714093027852} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1001 &1712874950459209376 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1712874951232431508, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_Name + value: Sphere_A + objectReference: {fileID: 0} + - target: {fileID: 1712874951232431512, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 1712874951232431512, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_LocalPosition.x + value: 10.983304 + objectReference: {fileID: 0} + - target: {fileID: 1712874951232431512, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_LocalPosition.y + value: -0.99999994 + objectReference: {fileID: 0} + - target: {fileID: 1712874951232431512, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_LocalPosition.z + value: 11.61 + objectReference: {fileID: 0} + - target: {fileID: 1712874951232431512, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_LocalRotation.w + value: -0.40963268 + objectReference: {fileID: 0} + - target: {fileID: 1712874951232431512, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1712874951232431512, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1712874951232431512, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_LocalRotation.z + value: 0.9122505 + objectReference: {fileID: 0} + - target: {fileID: 1712874951232431512, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1712874951232431512, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1712874951232431512, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9108174227488385262, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: _scenePathHash + value: 1828152806 + objectReference: {fileID: 0} + - target: {fileID: 9108174227488385262, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} + propertyPath: k__BackingField + value: 7851856514066328649 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: bcf416aedafd2ea4d9ed2cd8469dbf56, type: 3} +--- !u!1 &2480283714093027852 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9139860295689780510} + - component: {fileID: 6745855428745291286} + - component: {fileID: 1424052073902602981} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &3965864432699664111 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256744730386} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4393252310837120370 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310837120383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2d50394614f8feb4eb0567fb7618d84d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &4393252310837120371 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310837120383} + m_CullTransparentMesh: 0 +--- !u!224 &4393252310837120380 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310837120383} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 9139860295689780510} + m_Father: {fileID: 4393252311378272345} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -96} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!114 &4393252310837120381 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310837120383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252310837120370} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252311378272325} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Client + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &4393252310837120383 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252310837120380} + - component: {fileID: 4393252310837120371} + - component: {fileID: 4393252310837120370} + - component: {fileID: 4393252310837120381} + m_Layer: 5 + m_Name: Client + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &4393252311222810866 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311222810879} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1b187e63031bf7849b249c8212440c3b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &4393252311222810867 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311222810879} + m_CullTransparentMesh: 0 +--- !u!224 &4393252311222810876 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311222810879} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7233259200132978428} + m_Father: {fileID: 4393252311378272345} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -16} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!114 &4393252311222810877 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311222810879} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252311222810866} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252311378272325} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Server + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &4393252311222810879 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311222810876} + - component: {fileID: 4393252311222810867} + - component: {fileID: 4393252311222810866} + - component: {fileID: 4393252311222810877} + m_Layer: 5 + m_Name: Server + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &4393252311378272324 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311378272345} + - component: {fileID: 4393252311378272325} + - component: {fileID: 4393252311378272344} + - component: {fileID: 4393252311378272347} + - component: {fileID: 4393252311378272346} + m_Layer: 5 + m_Name: NetworkHudCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &4393252311378272325 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311378272324} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d3606bfdac5a4743890fc1a5ecd8f24, type: 3} + m_Name: + m_EditorClassIdentifier: + _autoStartType: 1 + _stoppedColor: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + _changingColor: {r: 0.78431374, g: 0.6862745, b: 0, a: 1} + _startedColor: {r: 0, g: 0.5882353, b: 0.64705884, a: 1} + _serverIndicator: {fileID: 3965864432699664111} + _clientIndicator: {fileID: 1424052073902602981} +--- !u!223 &4393252311378272344 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311378272324} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &4393252311378272345 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311378272324} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4393252311222810876} + - {fileID: 4393252310837120380} + m_Father: {fileID: 7443408886491487332} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &4393252311378272346 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311378272324} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &4393252311378272347 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311378272324} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!1 &4808982256744730386 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7233259200132978428} + - component: {fileID: 5104387649508117141} + - component: {fileID: 3965864432699664111} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &5104387649508117141 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256744730386} + m_CullTransparentMesh: 0 +--- !u!222 &6745855428745291286 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714093027852} + m_CullTransparentMesh: 0 +--- !u!224 &7233259200132978428 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256744730386} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4393252311222810876} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!4 &7443408886491487332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4393252311378272345} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7443408886491487334 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7443408886491487332} + - component: {fileID: 7443408886491487335} + - component: {fileID: 1726381377} + - component: {fileID: 7443408886491487337} + - component: {fileID: 192429404} + - component: {fileID: 192429405} + - component: {fileID: 192429406} + - component: {fileID: 192429407} + - component: {fileID: 192429408} + - component: {fileID: 192429409} + - component: {fileID: 192429410} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &7443408886491487335 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2c95dfde7d73b54dbbdc23155d35d36, type: 3} + m_Name: + m_EditorClassIdentifier: + _refreshDefaultPrefabs: 1 + _runInBackground: 1 + _dontDestroyOnLoad: 1 + _objectPool: {fileID: 0} + _persistence: 0 + _logging: {fileID: 0} + _spawnablePrefabs: {fileID: 11400000, guid: 68e79e63a16f2c74e81f070bd36822b8, type: 2} +--- !u!114 &7443408886491487337 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408886491487334} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 211a9f6ec51ddc14f908f5acc0cd0423, type: 3} + m_Name: + m_EditorClassIdentifier: + _playerPrefab: {fileID: 201277550, guid: 8ef354bfc16ca8a459074c3fa9b6727e, type: 3} + _addToDefaultScene: 1 + Spawns: [] +--- !u!224 &9139860295689780510 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714093027852} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4393252310837120380} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/FishNet/Demos/Prediction 2/Rigidbody/PredictionV2_RB.unity.meta b/Assets/FishNet/Demos/Prediction 2/Rigidbody/PredictionV2_RB.unity.meta new file mode 100644 index 0000000..c11f8c5 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/Rigidbody/PredictionV2_RB.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7f31e665d963214449f27dc0ad466dfb +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/Rigidbody/Prefabs.meta b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Prefabs.meta new file mode 100644 index 0000000..d875209 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c147d08de81079a4c8f17246c4e49dc5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/Rigidbody/Prefabs/RigidbodyPrediction.prefab b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Prefabs/RigidbodyPrediction.prefab new file mode 100644 index 0000000..9724be0 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Prefabs/RigidbodyPrediction.prefab @@ -0,0 +1,451 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &303449597948771942 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 303449597948771941} + - component: {fileID: 303449597948771939} + - component: {fileID: 303449597948771940} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &303449597948771941 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449597948771942} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.5, y: 0.25, z: 0.25} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 303449599178274091} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} +--- !u!33 &303449597948771939 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449597948771942} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &303449597948771940 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449597948771942} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &303449598114786579 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 303449598114786577} + - component: {fileID: 4875864441162262683} + - component: {fileID: 303449598114786578} + - component: {fileID: 201277550} + - component: {fileID: 201277549} + m_Layer: 0 + m_Name: RigidbodyPrediction + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &303449598114786577 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598114786579} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -4.80351, y: 0.18147132, z: 5.430528} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 303449599178274091} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4875864441162262683 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598114786579} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1e66bfd8c92aad24e8526e7d3aae8b34, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 201277550} + _networkObjectCache: {fileID: 201277550} +--- !u!135 &303449598114786578 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598114786579} + m_Material: {fileID: 13400000, guid: b31539408c1f95d4281bb4484bb6b78e, type: 2} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &201277550 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598114786579} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 4875864441162262683} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -4.80351, y: 0.18147132, z: 5.430528} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 1, y: 1, z: 1} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + k__BackingField: 21 + k__BackingField: 0 + _scenePathHash: 0 + k__BackingField: 0 + k__BackingField: 12616697518120799840 +--- !u!54 &201277549 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598114786579} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 112 + m_CollisionDetection: 1 +--- !u!1 &303449598207636365 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 303449598207636364} + - component: {fileID: 303449598207636362} + - component: {fileID: 303449598207636363} + m_Layer: 0 + m_Name: Cube (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &303449598207636364 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598207636365} + m_LocalRotation: {x: 0.5, y: 0.5, z: 0.5, w: 0.5} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.5, y: 0.25, z: 0.25} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 303449599178274091} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 90, z: 90} +--- !u!33 &303449598207636362 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598207636365} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &303449598207636363 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598207636365} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &303449598691742042 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 303449598691742041} + - component: {fileID: 303449598691742039} + - component: {fileID: 303449598691742040} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &303449598691742041 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598691742042} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.5, y: 0.25, z: 0.25} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 303449599178274091} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &303449598691742039 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598691742042} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &303449598691742040 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449598691742042} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &303449599178274092 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 303449599178274091} + - component: {fileID: 303449599178274088} + - component: {fileID: 303449599178274089} + m_Layer: 0 + m_Name: Sphere (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &303449599178274091 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449599178274092} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 303449598691742041} + - {fileID: 303449597948771941} + - {fileID: 303449598207636364} + m_Father: {fileID: 303449598114786577} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &303449599178274088 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449599178274092} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &303449599178274089 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 303449599178274092} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} diff --git a/Assets/FishNet/Demos/Prediction 2/Rigidbody/Prefabs/RigidbodyPrediction.prefab.meta b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Prefabs/RigidbodyPrediction.prefab.meta new file mode 100644 index 0000000..9e75a80 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Prefabs/RigidbodyPrediction.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8ef354bfc16ca8a459074c3fa9b6727e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/Rigidbody/Scripts.meta b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Scripts.meta new file mode 100644 index 0000000..3207c14 --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bf02fdf4a8ce43c489e5b5d8e65cb87d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prediction 2/Rigidbody/Scripts/RigidbodyPredictionV2.cs b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Scripts/RigidbodyPredictionV2.cs new file mode 100644 index 0000000..9e7442d --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Scripts/RigidbodyPredictionV2.cs @@ -0,0 +1,211 @@ +using FishNet.Object; +using FishNet.Object.Prediction; +using FishNet.Transporting; +using UnityEngine; + +/* +* +* See TransformPrediction.cs for more detailed notes. +* +*/ + +namespace FishNet.PredictionV2 +{ + /* THIS CLASS IS CURRENTLY USED FOR TESTING AND IS NOT CONSIDERED + * AN EXAMPLE TO FOLLOW. */ + /* THIS CLASS IS CURRENTLY USED FOR TESTING AND IS NOT CONSIDERED + * AN EXAMPLE TO FOLLOW. */ + /* THIS CLASS IS CURRENTLY USED FOR TESTING AND IS NOT CONSIDERED + * AN EXAMPLE TO FOLLOW. */ + /* THIS CLASS IS CURRENTLY USED FOR TESTING AND IS NOT CONSIDERED + * AN EXAMPLE TO FOLLOW. */ + + public class RigidbodyPredictionV2 : NetworkBehaviour + { +#if !PREDICTION_1 + + public struct MoveData : IReplicateData + { + public bool Jump; + public float Horizontal; + public float Vertical; + public Vector3 OtherImpulseForces; + public MoveData(bool jump, float horizontal, float vertical, Vector3 otherImpulseForces) + { + Jump = jump; + Horizontal = horizontal; + Vertical = vertical; + OtherImpulseForces = otherImpulseForces; + _tick = 0; + } + + private uint _tick; + public void Dispose() { } + public uint GetTick() => _tick; + public void SetTick(uint value) => _tick = value; + } + + public struct ReconcileData : IReconcileData + { + public Vector3 Position; + public Quaternion Rotation; + public Vector3 Velocity; + public Vector3 AngularVelocity; + public ReconcileData(Vector3 position, Quaternion rotation, Vector3 velocity, Vector3 angularVelocity) + { + Position = position; + Rotation = rotation; + Velocity = velocity; + AngularVelocity = angularVelocity; + _tick = 0; + } + + private uint _tick; + public void Dispose() { } + public uint GetTick() => _tick; + public void SetTick(uint value) => _tick = value; + } + + //[SerializeField] + //private float _jumpForce = 15f; + [SerializeField] + private float _moveRate = 15f; + + public Rigidbody Rigidbody { get; private set; } + private bool _jump; + + private void Update() + { + if (base.IsOwner) + { + if (Input.GetKeyDown(KeyCode.Space)) + _jump = true; + } + } + + public override void OnStartNetwork() + { + Rigidbody = GetComponent(); + base.TimeManager.OnTick += TimeManager_OnTick; + base.TimeManager.OnPostTick += TimeManager_OnPostTick; + } + + public override void OnStopNetwork() + { + + base.TimeManager.OnTick -= TimeManager_OnTick; + base.TimeManager.OnPostTick -= TimeManager_OnPostTick; + } + + + private void TimeManager_OnTick() + { + Move(BuildMoveData()); + } + + private void TimeManager_OnPostTick() + { + CreateReconcile(); + } + + private MoveData BuildMoveData() + { + if (!IsOwner && Owner.IsValid) + return default; + + float horizontal = Input.GetAxisRaw("Horizontal"); + float vertical = Input.GetAxisRaw("Vertical"); + //MoveData md = new MoveData(_jump, horizontal, vertical, (SpringForces + RocketForces)); + MoveData md = new MoveData(_jump, horizontal, vertical, Vector3.zero); + + //SpringForces = Vector3.zero; + //RocketForces = Vector3.zero; + + _jump = false; + + return md; + } + + public uint LastMdTick; + + [Replicate] + private void Move(MoveData md, ReplicateState state = ReplicateState.Invalid, Channel channel = Channel.Unreliable) + { + LastMdTick = md.GetTick(); + //if (base.IsOwner) + // Debug.Log(PredictionManager.ClientReplayTick + " > " + md.GetTick()); + //if (state == ReplicateState.Future) + //{ + // /* Reduce velocity slightly. This will be slightly less accurate if + // * the object continues to move in the same direction but can drastically + // * reduce jarring visuals if the object changes path rather than predicted(future) + // * forward. */ + // _rigidbody.velocity *= 0.65f; + // _rigidbody.angularVelocity *= 0.65f; + // return; + //} + + //Vector3 forces = new Vector3(md.Horizontal, 0f, md.Vertical) * _moveRate; + //Rigidbody.AddForce(forces); + + //if (md.Jump) + // Rigidbody.AddForce(new Vector3(0f, _jumpForce, 0f), ForceMode.Impulse); + ////Add gravity to make the object fall faster. + //Rigidbody.AddForce(Physics.gravity * 3f); + + Vector3 forces = new Vector3(md.Horizontal, 0f, md.Vertical) * _moveRate; + //PRB.AddForce(forces); + forces += Physics.gravity * 3f; + //if (md.Jump) + // PRB.AddForce(new Vector3(0f, _jumpForce, 0f), ForceMode.Impulse); + ////Add gravity to make the object fall faster. + //PRB.AddForce(forces); + + + //if (IsOwner) + //{ + // if (state.IsReplayed()) + // Debug.Log($"{md.GetTick()} -> {transform.position.x} -> {Rigidbody.velocity.x}"); + // else + // Debug.LogWarning($"{md.GetTick()} -> {transform.position.x} -> {Rigidbody.velocity.x}"); + //} + + //if ((!base.IsServerStarted && base.IsOwner) || (base.IsServerStarted && !base.IsOwner)) + // Debug.LogWarning($"Frame {Time.frameCount}. State {state}, Horizontal {md.Horizontal}. MdTick {md.GetTick()}, PosX {transform.position.x.ToString("0.##")}. VelX {Rigidbody.velocity.x.ToString("0.###")}."); + } + + public override void CreateReconcile() + { + /* The base.IsServer check is not required but does save a little + * performance by not building the reconcileData if not server. */ + if (IsServerStarted) + { + ReconcileData rd = new ReconcileData(transform.position, transform.rotation, Rigidbody.velocity, Rigidbody.angularVelocity); + //if (!base.IsOwner) + // Debug.LogError($"Frame {Time.frameCount}. Reconcile, MdTick {LastMdTick}, PosX {transform.position.x.ToString("0.##")}. VelX {Rigidbody.velocity.x.ToString("0.###")}."); + Reconciliation(rd); + } + } + + [Reconcile] + private void Reconciliation(ReconcileData rd, Channel channel = Channel.Unreliable) + { + transform.position = rd.Position; + transform.rotation = rd.Rotation; + Rigidbody.velocity = rd.Velocity; + Rigidbody.angularVelocity = rd.AngularVelocity; + + //if (PrintForClient()) + //{ + // Debug.LogError($"Frame {Time.frameCount}. Reconcile, MdTick {rd.GetTick()}, PosX {transform.position.x.ToString("0.##")}. VelX {Rigidbody.velocity.x.ToString("0.###")}. RdPosX " + + // $"{rd.Position.x.ToString("0.##")}. RdVelX {Rigidbody.velocity.x.ToString("0.###")}"); + //} + + } + + private bool PrintForClient() => ((!base.IsServerStarted && base.IsOwner) || (base.IsServerStarted && !base.IsOwner)); + +#endif + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/Prediction 2/Rigidbody/Scripts/RigidbodyPredictionV2.cs.meta b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Scripts/RigidbodyPredictionV2.cs.meta new file mode 100644 index 0000000..f0b87be --- /dev/null +++ b/Assets/FishNet/Demos/Prediction 2/Rigidbody/Scripts/RigidbodyPredictionV2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e66bfd8c92aad24e8526e7d3aae8b34 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prefabs.meta b/Assets/FishNet/Demos/Prefabs.meta new file mode 100644 index 0000000..c54301c --- /dev/null +++ b/Assets/FishNet/Demos/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05b745a985085ca4aa6cd3ef0b947167 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prefabs/NetworkHudCanvas.prefab b/Assets/FishNet/Demos/Prefabs/NetworkHudCanvas.prefab new file mode 100644 index 0000000..a0288e4 --- /dev/null +++ b/Assets/FishNet/Demos/Prefabs/NetworkHudCanvas.prefab @@ -0,0 +1,529 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2480283714602906875 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9139860296052841449} + - component: {fileID: 6745855428185604321} + - component: {fileID: 1424052073409502226} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &9139860296052841449 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714602906875} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4393252311501663115} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6745855428185604321 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714602906875} + m_CullTransparentMesh: 0 +--- !u!114 &1424052073409502226 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714602906875} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &4393252310969058995 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252310969058990} + - component: {fileID: 4393252310969058994} + - component: {fileID: 4393252310969058991} + - component: {fileID: 4393252310969058988} + - component: {fileID: 4393252310969058989} + m_Layer: 5 + m_Name: NetworkHudCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4393252310969058990 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310969058995} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 4393252311652982283} + - {fileID: 4393252311501663115} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &4393252310969058994 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310969058995} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d3606bfdac5a4743890fc1a5ecd8f24, type: 3} + m_Name: + m_EditorClassIdentifier: + AutoStart: 0 + _stoppedColor: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + _changingColor: {r: 0.78431374, g: 0.6862745, b: 0, a: 1} + _startedColor: {r: 0, g: 0.5882353, b: 0.64705884, a: 1} + _serverIndicator: {fileID: 3965864433427628056} + _clientIndicator: {fileID: 1424052073409502226} +--- !u!223 &4393252310969058991 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310969058995} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &4393252310969058988 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310969058995} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &4393252310969058989 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252310969058995} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!1 &4393252311501663112 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311501663115} + - component: {fileID: 4393252311501663108} + - component: {fileID: 4393252311501663109} + - component: {fileID: 4393252311501663114} + m_Layer: 5 + m_Name: Client + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4393252311501663115 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311501663112} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 9139860296052841449} + m_Father: {fileID: 4393252310969058990} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -96} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!222 &4393252311501663108 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311501663112} + m_CullTransparentMesh: 0 +--- !u!114 &4393252311501663109 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311501663112} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2d50394614f8feb4eb0567fb7618d84d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4393252311501663114 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311501663112} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252311501663109} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252310969058994} + m_MethodName: OnClick_Client + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &4393252311652982280 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311652982283} + - component: {fileID: 4393252311652982276} + - component: {fileID: 4393252311652982277} + - component: {fileID: 4393252311652982282} + m_Layer: 5 + m_Name: Server + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4393252311652982283 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311652982280} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7233259200663826443} + m_Father: {fileID: 4393252310969058990} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -16} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!222 &4393252311652982276 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311652982280} + m_CullTransparentMesh: 0 +--- !u!114 &4393252311652982277 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311652982280} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1b187e63031bf7849b249c8212440c3b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4393252311652982282 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311652982280} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252311652982277} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252310969058994} + m_MethodName: OnClick_Server + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &4808982256197118437 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7233259200663826443} + - component: {fileID: 5104387649082666082} + - component: {fileID: 3965864433427628056} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7233259200663826443 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256197118437} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4393252311652982283} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5104387649082666082 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256197118437} + m_CullTransparentMesh: 0 +--- !u!114 &3965864433427628056 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256197118437} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 diff --git a/Assets/FishNet/Demos/Prefabs/NetworkHudCanvas.prefab.meta b/Assets/FishNet/Demos/Prefabs/NetworkHudCanvas.prefab.meta new file mode 100644 index 0000000..c4281bb --- /dev/null +++ b/Assets/FishNet/Demos/Prefabs/NetworkHudCanvas.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0570b6f7f713dc44a90463654bbcd8d0 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Prefabs/NetworkManager.prefab b/Assets/FishNet/Demos/Prefabs/NetworkManager.prefab new file mode 100644 index 0000000..fce3e55 --- /dev/null +++ b/Assets/FishNet/Demos/Prefabs/NetworkManager.prefab @@ -0,0 +1,208 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7443408887813606051 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7443408887813606049} + - component: {fileID: 7443408887813606050} + - component: {fileID: 934570884} + - component: {fileID: 7443408887813606060} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7443408887813606049 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887813606051} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4393252310584637084} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7443408887813606050 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887813606051} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2c95dfde7d73b54dbbdc23155d35d36, type: 3} + m_Name: + m_EditorClassIdentifier: + _logging: {fileID: 0} + _spawnablePrefabs: {fileID: 11400000, guid: ec64eb18c93ab344892891f33edbf82a, type: 2} + _refreshDefaultPrefabs: 0 + _runInBackground: 1 + _dontDestroyOnLoad: 1 + _persistence: 0 +--- !u!114 &934570884 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887813606051} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d331f979d46e8e4a9fc90070c596d44, type: 3} + m_Name: + m_EditorClassIdentifier: + _defaultConditions: + - {fileID: 11400000, guid: 2033f54fd2794464bae08fa5a55c8996, type: 2} +--- !u!114 &7443408887813606060 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887813606051} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 211a9f6ec51ddc14f908f5acc0cd0423, type: 3} + m_Name: + m_EditorClassIdentifier: + _playerPrefab: {fileID: 0} + _addToDefaultScene: 1 + Spawns: [] +--- !u!1001 &2130063410 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 7443408887813606049} + m_Modifications: + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_Pivot.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4393252310969058995, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + propertyPath: m_Name + value: NetworkHudCanvas + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 0570b6f7f713dc44a90463654bbcd8d0, type: 3} +--- !u!224 &4393252310584637084 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 4393252310969058990, guid: 0570b6f7f713dc44a90463654bbcd8d0, + type: 3} + m_PrefabInstance: {fileID: 2130063410} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/FishNet/Demos/Prefabs/NetworkManager.prefab.meta b/Assets/FishNet/Demos/Prefabs/NetworkManager.prefab.meta new file mode 100644 index 0000000..ae648e6 --- /dev/null +++ b/Assets/FishNet/Demos/Prefabs/NetworkManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0b650fca685f2eb41a86538aa883e4c1 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples).meta b/Assets/FishNet/Demos/SceneManager (Old Examples).meta new file mode 100644 index 0000000..62518d4 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples).meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20e6b1dc6b2c2aa41a7bab869daa1ce5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials.meta new file mode 100644 index 0000000..9fde7aa --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5985db0dc6b663146adf62e089060cc6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Black.mat b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Black.mat new file mode 100644 index 0000000..99f4278 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Black.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Black + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0.177 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0, g: 0, b: 0, a: 0.39215687} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Black.mat.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Black.mat.meta new file mode 100644 index 0000000..b7dfa60 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Black.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e7517d1496ae784f94a2307a88e2bb5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Blue.mat b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Blue.mat new file mode 100644 index 0000000..cd9821d --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Blue.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blue + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0, g: 0.6867471, b: 1, a: 0.39215687} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Blue.mat.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Blue.mat.meta new file mode 100644 index 0000000..abdab7d --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Blue.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d0a99caade0a68842b2274726d1bc7c3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Green.mat b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Green.mat new file mode 100644 index 0000000..04c1cf8 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Green.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Green + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0, g: 1, b: 0.030314445, a: 0.39215687} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Green.mat.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Green.mat.meta new file mode 100644 index 0000000..92fd8a6 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Green.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e0dd7b8c357813f4ba3ae9b60783a6cd +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Red.mat b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Red.mat new file mode 100644 index 0000000..19a839c --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Red.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Red + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 1, g: 0.018451946, b: 0, a: 0.39215687} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Red.mat.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Red.mat.meta new file mode 100644 index 0000000..7dd93d4 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Materials/Red.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a35bce0c956282a42a90a04b25492fb6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs.meta new file mode 100644 index 0000000..2a9b0a0 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5da04b10582d51f42a06a7be2bffd814 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/Player.prefab b/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/Player.prefab new file mode 100644 index 0000000..10dda46 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/Player.prefab @@ -0,0 +1,358 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1659630665519808908 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2767813079423793104} + - component: {fileID: 2155251397865338026} + - component: {fileID: 6670251115109007609} + m_Layer: 2 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2767813079423793104 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1659630665519808908} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.893, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5090726670223187106} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &2155251397865338026 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1659630665519808908} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6670251115109007609 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1659630665519808908} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &5090726669533971462 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5090726669533971481} + - component: {fileID: 5090726669533971480} + - component: {fileID: 5090726669533971463} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &5090726669533971481 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5090726669533971462} + m_LocalRotation: {x: 0.04100376, y: 0, z: 0, w: 0.99915904} + m_LocalPosition: {x: 0, y: 1.56, z: -4.5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5090726670223187106} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 4.7, y: 0, z: 0} +--- !u!20 &5090726669533971480 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5090726669533971462} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &5090726669533971463 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5090726669533971462} + m_Enabled: 1 +--- !u!1 &5090726670223187118 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5090726670223187106} + - component: {fileID: 5090726670223187108} + - component: {fileID: 3514369712614123748} + - component: {fileID: 474764807019926078} + - component: {fileID: 611616139817875448} + - component: {fileID: 6420552185407096997} + - component: {fileID: 6654616088585099699} + m_Layer: 0 + m_Name: Player + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5090726670223187106 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5090726670223187118} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 6, y: -2, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5090726669533971481} + - {fileID: 2767813079423793104} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5090726670223187108 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5090726670223187118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26e4f626a9ca9704f9befe7673a8dd15, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 611616139817875448} + _networkObjectCache: {fileID: 611616139817875448} + _camera: {fileID: 5090726669533971462} + _moveRate: 4 + _clientAuth: 1 +--- !u!54 &3514369712614123748 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5090726670223187118} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &474764807019926078 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5090726670223187118} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 1 + m_Direction: 1 + m_Center: {x: 0, y: 1, z: 0} +--- !u!114 &611616139817875448 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5090726670223187118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 5090726670223187108} + - {fileID: 6654616088585099699} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 0} + LocalScale: {x: 0, y: 0, z: 0} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _teleportThreshold: 1 + k__BackingField: 12 + k__BackingField: 0 + _scenePathHash: 0 + k__BackingField: 0 + k__BackingField: 12334122808499987737 +--- !u!114 &6420552185407096997 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5090726670223187118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c71fd7f855ec523429999fc4e14a1928, type: 3} + m_Name: + m_EditorClassIdentifier: + _overrideType: 3 + _updateHostVisibility: 1 + _observerConditions: [] +--- !u!114 &6654616088585099699 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5090726670223187118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 1 + _addedNetworkObject: {fileID: 611616139817875448} + _networkObjectCache: {fileID: 611616139817875448} + _componentConfiguration: 0 + _synchronizeParent: 0 + _packing: + Position: 1 + Rotation: 1 + Scale: 0 + _interpolation: 2 + _extrapolation: 2 + _enableTeleport: 0 + _teleportThreshold: 1 + _scaleThreshold: 1 + _clientAuthoritative: 1 + _sendToOwner: 1 + _enableNetworkLod: 1 + _interval: 1 + _synchronizePosition: 1 + _positionSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeRotation: 1 + _rotationSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeScale: 1 + _scaleSnapping: + X: 0 + Y: 0 + Z: 0 diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/Player.prefab.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/Player.prefab.meta new file mode 100644 index 0000000..a7f29b6 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/Player.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bf5f023b4017a5e41a9815ec5745df3d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/_SceneManager_Old_Prefabs.asset b/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/_SceneManager_Old_Prefabs.asset new file mode 100644 index 0000000..98b2c12 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/_SceneManager_Old_Prefabs.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4489d77032a81ef42b0067acf2737d4d, type: 3} + m_Name: _SceneManager_Old_Prefabs + m_EditorClassIdentifier: + _prefabs: + - {fileID: 611616139817875448, guid: bf5f023b4017a5e41a9815ec5745df3d, type: 3} diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/_SceneManager_Old_Prefabs.asset.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/_SceneManager_Old_Prefabs.asset.meta new file mode 100644 index 0000000..cbcaf6c --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Prefabs/_SceneManager_Old_Prefabs.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b1b4d193fc9b1bb41a92600a22b3d34e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes.meta new file mode 100644 index 0000000..44c5a86 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2523bec4bc0c4b54898b5ad26591d08c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive.meta new file mode 100644 index 0000000..3ef5016 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ee2b2b6fe8d82c3448ade70b9e30300b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveConnection.unity b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveConnection.unity new file mode 100644 index 0000000..e15983d --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveConnection.unity @@ -0,0 +1,268 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &76845508 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 76845512} + - component: {fileID: 76845511} + - component: {fileID: 76845510} + - component: {fileID: 76845509} + - component: {fileID: 76845514} + - component: {fileID: 76845513} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &76845509 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &76845510 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &76845511 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &76845512 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -5, y: -4.4, z: 6.2} + m_LocalScale: {x: 4, y: 4, z: 4} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &76845513 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 3284346746 + k__BackingField: 14106161864781660253 + k__BackingField: 0 + _sceneNetworkObjects: + - {fileID: 76845513} + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -5, y: -4.4, z: 6.2} + Rotation: {x: -0, y: -0, z: -0, w: 1} + LocalScale: {x: 4, y: 4, z: 4} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &76845514 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c71fd7f855ec523429999fc4e14a1928, type: 3} + m_Name: + m_EditorClassIdentifier: + _overrideType: 3 + _updateHostVisibility: 1 + _observerConditions: + - {fileID: 11400000, guid: 2033f54fd2794464bae08fa5a55c8996, type: 2} diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveConnection.unity.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveConnection.unity.meta new file mode 100644 index 0000000..807c4f4 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveConnection.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cc489be8bb6ae444283f394c5e5fa8e2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveGlobal.unity b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveGlobal.unity new file mode 100644 index 0000000..85d0f6f --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveGlobal.unity @@ -0,0 +1,264 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1950515027 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1950515031} + - component: {fileID: 1950515030} + - component: {fileID: 1950515029} + - component: {fileID: 1950515028} + - component: {fileID: 1950515033} + - component: {fileID: 1950515032} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1950515028 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1950515029 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1950515030 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1950515031 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 5, y: 0, z: 10} + m_LocalScale: {x: 4, y: 4, z: 4} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1950515032 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: -1 + _scenePathHash: 2384367787 + k__BackingField: 10240781668764572782 + _sceneNetworkObjects: + - {fileID: 1950515032} + k__BackingField: 0 + k__BackingField: 0 + _networkBehaviours: + - {fileID: 1950515033} + k__BackingField: {fileID: 0} + k__BackingField: [] + _isNetworked: 1 + _isGlobal: 0 + _disableOnDespawn: 0 +--- !u!114 &1950515033 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c71fd7f855ec523429999fc4e14a1928, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 1950515032} + _networkObjectCache: {fileID: 1950515032} + _overrideType: 3 + _setHostVisibility: 1 + _observerConditions: + - {fileID: 11400000, guid: 2033f54fd2794464bae08fa5a55c8996, type: 2} diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveGlobal.unity.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveGlobal.unity.meta new file mode 100644 index 0000000..36036b2 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveGlobal.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c43835f124dc68747a2091c4b8c42f80 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveMain.unity b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveMain.unity new file mode 100644 index 0000000..5d6d49d --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveMain.unity @@ -0,0 +1,1282 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 705507994} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &705507993 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 705507995} + - component: {fileID: 705507994} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &705507994 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705507993} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 1 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &705507995 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705507993} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: -2.2843354, y: 60.72741, z: -2.9938574} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1155569020} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &825925881 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 825925885} + - component: {fileID: 825925886} + - component: {fileID: 825925887} + - component: {fileID: 825925884} + - component: {fileID: 825925883} + - component: {fileID: 825925882} + m_Layer: 0 + m_Name: Connection + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &825925882 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825925881} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &825925883 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825925881} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: d0a99caade0a68842b2274726d1bc7c3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &825925884 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825925881} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &825925885 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825925881} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -4.7799997, y: -3, z: 10} + m_LocalScale: {x: 15, y: 15, z: 15} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &825925886 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825925881} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fa23b6e6f9b08d74885e3707aa0d9bc7, type: 3} + m_Name: + m_EditorClassIdentifier: + _moveObject: 0 + _moveAllObjects: 0 + _replaceOption: 2 + _scenes: + - AdditiveConnection + _connectionOnly: 1 + _automaticallyUnload: 1 + _onTriggerEnter: 1 +--- !u!114 &825925887 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825925881} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84ae572fef1171b41ab287d1c9b5da63, type: 3} + m_Name: + m_EditorClassIdentifier: + _scenes: + - AdditiveConnection + _connectionOnly: 1 + _unloadUnused: 1 + _onTriggerEnter: 0 +--- !u!1 &1155569019 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1155569020} + m_Layer: 0 + m_Name: Scene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1155569020 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1155569019} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 705507995} + - {fileID: 2114768053} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1406093434 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1406093440} + - component: {fileID: 1406093439} + - component: {fileID: 1406093438} + - component: {fileID: 1406093437} + - component: {fileID: 1406093436} + - component: {fileID: 1406093435} + m_Layer: 0 + m_Name: Global + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1406093435 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1406093434} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1406093436 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1406093434} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a35bce0c956282a42a90a04b25492fb6, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1406093437 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1406093434} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &1406093438 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1406093434} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 84ae572fef1171b41ab287d1c9b5da63, type: 3} + m_Name: + m_EditorClassIdentifier: + _scenes: + - AdditiveGlobal + _connectionOnly: 0 + _unloadUnused: 1 + _onTriggerEnter: 0 +--- !u!114 &1406093439 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1406093434} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fa23b6e6f9b08d74885e3707aa0d9bc7, type: 3} + m_Name: + m_EditorClassIdentifier: + _moveObject: 0 + _moveAllObjects: 0 + _replaceOption: 2 + _scenes: + - AdditiveGlobal + _connectionOnly: 0 + _automaticallyUnload: 1 + _onTriggerEnter: 1 +--- !u!4 &1406093440 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1406093434} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 4.89, y: -3, z: 10} + m_LocalScale: {x: 15, y: 15, z: 15} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2114768049 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2114768053} + - component: {fileID: 2114768052} + - component: {fileID: 2114768051} + - component: {fileID: 2114768050} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &2114768050 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2114768049} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2114768051 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2114768049} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &2114768052 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2114768049} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &2114768053 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2114768049} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -5, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_Children: [] + m_Father: {fileID: 1155569020} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &174578014943721374 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6832184529280211084} + - component: {fileID: 9050426448999039876} + - component: {fileID: 3730311944083398519} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1661284633666962301 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7114397409874979456} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &2085292595826649312 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292595826649325} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2d50394614f8feb4eb0567fb7618d84d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &2085292595826649313 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292595826649325} + m_CullTransparentMesh: 0 +--- !u!1 &2085292595826649325 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2085292595826649326} + - component: {fileID: 2085292595826649313} + - component: {fileID: 2085292595826649312} + - component: {fileID: 2085292595826649327} + m_Layer: 5 + m_Name: Client + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2085292595826649326 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292595826649325} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 6832184529280211084} + m_Father: {fileID: 2085292596359202251} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -96} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!114 &2085292595826649327 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292595826649325} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 2085292595826649312} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 2085292596359202263} + m_MethodName: OnClick_Client + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &2085292596010868064 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292596010868077} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1b187e63031bf7849b249c8212440c3b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &2085292596010868065 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292596010868077} + m_CullTransparentMesh: 0 +--- !u!1 &2085292596010868077 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2085292596010868078} + - component: {fileID: 2085292596010868065} + - component: {fileID: 2085292596010868064} + - component: {fileID: 2085292596010868079} + m_Layer: 5 + m_Name: Server + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2085292596010868078 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292596010868077} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4928688179816641390} + m_Father: {fileID: 2085292596359202251} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -16} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!114 &2085292596010868079 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292596010868077} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 2085292596010868064} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 2085292596359202263} + m_MethodName: OnClick_Server + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &2085292596359202248 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292596359202262} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &2085292596359202249 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292596359202262} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &2085292596359202250 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292596359202262} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &2085292596359202251 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292596359202262} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 2085292596010868078} + - {fileID: 2085292595826649326} + m_Father: {fileID: 7443408887680269496} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &2085292596359202262 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2085292596359202251} + - component: {fileID: 2085292596359202250} + - component: {fileID: 2085292596359202249} + - component: {fileID: 2085292596359202248} + - component: {fileID: 2085292596359202263} + m_Layer: 5 + m_Name: NetworkHudCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2085292596359202263 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2085292596359202262} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d3606bfdac5a4743890fc1a5ecd8f24, type: 3} + m_Name: + m_EditorClassIdentifier: + _autoStartType: 1 + _stoppedColor: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + _changingColor: {r: 0.78431374, g: 0.6862745, b: 0, a: 1} + _startedColor: {r: 0, g: 0.5882353, b: 0.64705884, a: 1} + _serverIndicator: {fileID: 1661284633666962301} + _clientIndicator: {fileID: 3730311944083398519} +--- !u!114 &3730311944083398519 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 174578014943721374} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!224 &4928688179816641390 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7114397409874979456} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2085292596010868078} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!224 &6832184529280211084 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 174578014943721374} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2085292595826649326} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &7114397409874979456 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4928688179816641390} + - component: {fileID: 7408958669887450887} + - component: {fileID: 1661284633666962301} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &7408958669887450887 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7114397409874979456} + m_CullTransparentMesh: 0 +--- !u!4 &7443408887680269496 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.2843354, y: 57.72741, z: -2.9938574} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2085292596359202251} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7443408887680269498 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7443408887680269496} + - component: {fileID: 7443408887680269499} + - component: {fileID: 7443408887680269500} + - component: {fileID: 7443408887680269501} + - component: {fileID: 7443408887680269502} + - component: {fileID: 7443408887680269503} + - component: {fileID: 7443408887680269504} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &7443408887680269499 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2c95dfde7d73b54dbbdc23155d35d36, type: 3} + m_Name: + m_EditorClassIdentifier: + _logging: {fileID: 0} + _spawnablePrefabs: {fileID: 11400000, guid: 3a54436bdb916194f99da0d17231e617, type: 2} + _refreshDefaultPrefabs: 1 + _runInBackground: 1 + _dontDestroyOnLoad: 1 + _objectPool: {fileID: 0} + _persistence: 0 +--- !u!114 &7443408887680269500 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3fdaae44044276a49a52229c1597e33b, type: 3} + m_Name: + m_EditorClassIdentifier: + _updateOrder: 0 + _timingType: 0 + _allowTickDropping: 0 + _maximumFrameTicks: 2 + _tickRate: 30 + _pingInterval: 1 + _timingInterval: 2 + _physicsMode: 0 +--- !u!114 &7443408887680269501 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6f48f002b825cbd45a19bd96d90f9edb, type: 3} + m_Name: + m_EditorClassIdentifier: + _unreliableMTU: 1023 + _ipv4BindAddress: + _ipv6BindAddress: + _port: 7770 + _maximumClients: 4095 + _clientAddress: localhost + _timeout: 15 +--- !u!114 &7443408887680269502 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 68828c85278210948b9d50a8db3aab74, type: 3} + m_Name: + m_EditorClassIdentifier: + _authenticator: {fileID: 0} + _syncTypeRate: 0.1 + SpawnPacking: + Position: 0 + Rotation: 2 + Scale: 2 + _changeFrameRate: 1 + _frameRate: 9999 + _shareIds: 1 + _startOnHeadless: 1 + _limitClientMTU: 1 +--- !u!114 &7443408887680269503 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 211a9f6ec51ddc14f908f5acc0cd0423, type: 3} + m_Name: + m_EditorClassIdentifier: + _playerPrefab: {fileID: 611616139817875448, guid: bf5f023b4017a5e41a9815ec5745df3d, + type: 3} + _addToDefaultScene: 0 + Spawns: [] +--- !u!114 &7443408887680269504 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 15895a51081447d46bda466e7e830c08, type: 3} + m_Name: + m_EditorClassIdentifier: + _sceneProcessor: {fileID: 0} + _lightProbeUpdating: 0 + _moveClientHostObjects: 1 + _setActiveScene: 0 +--- !u!222 &9050426448999039876 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 174578014943721374} + m_CullTransparentMesh: 0 diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveMain.unity.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveMain.unity.meta new file mode 100644 index 0000000..86dfccb --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Additive/AdditiveMain.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e7d3ac2d556912042aca9aa1947aea07 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace.meta new file mode 100644 index 0000000..b86e4a0 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1daac01325da73f41a38e1da80d8bba4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceConnection.unity b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceConnection.unity new file mode 100644 index 0000000..836be96 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceConnection.unity @@ -0,0 +1,624 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &76845508 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 76845512} + - component: {fileID: 76845511} + - component: {fileID: 76845510} + - component: {fileID: 76845509} + - component: {fileID: 76845514} + - component: {fileID: 76845513} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &76845509 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &76845510 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &76845511 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &76845512 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -19.2, y: 3.8, z: -0.43} + m_LocalScale: {x: 4, y: 4, z: 4} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &76845513 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: -1 + _scenePathHash: 3254454948 + k__BackingField: 13977777569408466860 + k__BackingField: 0 + _sceneNetworkObjects: + - {fileID: 76845513} + k__BackingField: 0 + k__BackingField: 0 + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + _isNetworked: 1 + _isGlobal: 0 + _defaultDespawnType: 0 +--- !u!114 &76845514 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76845508} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c71fd7f855ec523429999fc4e14a1928, type: 3} + m_Name: + m_EditorClassIdentifier: + _overrideType: 3 + _updateHostVisibility: 1 + _observerConditions: + - {fileID: 11400000, guid: 2033f54fd2794464bae08fa5a55c8996, type: 2} +--- !u!1 &603255273 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 603255274} + m_Layer: 0 + m_Name: Triggers + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &603255274 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 603255273} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -22.68, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 979031081727779170} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &748707377276284900 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 748707377276284902} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: -2.2843354, y: 60.72741, z: -2.9938574} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 748707378658658307} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!108 &748707377276284901 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 748707377276284902} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 1 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!1 &748707377276284902 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 748707377276284900} + - component: {fileID: 748707377276284901} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &748707378551427530 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 748707378551427534} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -5, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_Children: [] + m_Father: {fileID: 748707378658658307} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &748707378551427531 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 748707378551427534} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &748707378551427532 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 748707378551427534} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!64 &748707378551427533 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 748707378551427534} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &748707378551427534 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 748707378551427530} + - component: {fileID: 748707378551427531} + - component: {fileID: 748707378551427532} + - component: {fileID: 748707378551427533} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &748707378658658307 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 748707378658658308} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 748707377276284900} + - {fileID: 748707378551427530} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &748707378658658308 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 748707378658658307} + m_Layer: 0 + m_Name: Scene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &979031081727779169 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 979031081727779174} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fa23b6e6f9b08d74885e3707aa0d9bc7, type: 3} + m_Name: + m_EditorClassIdentifier: + _moveObject: 1 + _moveAllObjects: 0 + _replaceOption: 0 + _scenes: + - ReplaceMain + _connectionOnly: 1 + _automaticallyUnload: 1 + _onTriggerEnter: 1 +--- !u!4 &979031081727779170 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 979031081727779174} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.87, y: -3, z: 0} + m_LocalScale: {x: 15, y: 15, z: 15} + m_Children: [] + m_Father: {fileID: 603255274} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &979031081727779171 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 979031081727779174} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &979031081727779172 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 979031081727779174} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 2e7517d1496ae784f94a2307a88e2bb5, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!135 &979031081727779173 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 979031081727779174} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &979031081727779174 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 979031081727779170} + - component: {fileID: 979031081727779169} + - component: {fileID: 979031081727779171} + - component: {fileID: 979031081727779172} + - component: {fileID: 979031081727779173} + m_Layer: 0 + m_Name: Connection + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceConnection.unity.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceConnection.unity.meta new file mode 100644 index 0000000..0eb3735 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceConnection.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 58053e81b62de3a499afaf0f73d01b01 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceGlobal.unity b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceGlobal.unity new file mode 100644 index 0000000..4181a2f --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceGlobal.unity @@ -0,0 +1,724 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1808099118 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1808099119} + - component: {fileID: 1808099124} + - component: {fileID: 1808099123} + - component: {fileID: 1808099122} + - component: {fileID: 1808099120} + m_Layer: 0 + m_Name: SphereChild + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1808099119 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1808099118} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.637, z: 0} + m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} + m_Children: [] + m_Father: {fileID: 1950515031} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1808099120 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1808099118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 3074121493 + k__BackingField: 13203251279664725889 + k__BackingField: 0 + _sceneNetworkObjects: + - {fileID: 1808099120} + - {fileID: 1950515032} + k__BackingField: 1 + k__BackingField: 1 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1950515032} + k__BackingField: [] + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!135 &1808099122 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1808099118} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1808099123 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1808099118} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1808099124 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1808099118} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1950515027 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1950515031} + - component: {fileID: 1950515030} + - component: {fileID: 1950515029} + - component: {fileID: 1950515028} + - component: {fileID: 1950515033} + - component: {fileID: 1950515032} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1950515028 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1950515029 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1950515030 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1950515031 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 24.31, y: 3, z: -5.47} + m_LocalScale: {x: 4, y: 4, z: 4} + m_Children: + - {fileID: 1808099119} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1950515032 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 65535 + k__BackingField: 0 + _scenePathHash: 3074121493 + k__BackingField: 13203251279314293806 + k__BackingField: 0 + _sceneNetworkObjects: + - {fileID: 1808099120} + - {fileID: 1950515032} + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: + - {fileID: 1808099120} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1950515033 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1950515027} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c71fd7f855ec523429999fc4e14a1928, type: 3} + m_Name: + m_EditorClassIdentifier: + _overrideType: 3 + _updateHostVisibility: 1 + _observerConditions: + - {fileID: 11400000, guid: 2033f54fd2794464bae08fa5a55c8996, type: 2} +--- !u!1 &1722183419489630397 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1722183419489630399} + - component: {fileID: 1722183419489630398} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1722183419489630398 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1722183419489630397} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 1 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1722183419489630399 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1722183419489630397} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: -2.2843354, y: 60.72741, z: -2.9938574} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1722183420925353816} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!33 &1722183420764669584 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1722183420764669589} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1722183420764669585 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1722183420764669589} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -5, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_Children: [] + m_Father: {fileID: 1722183420925353816} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1722183420764669589 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1722183420764669585} + - component: {fileID: 1722183420764669584} + - component: {fileID: 1722183420764669591} + - component: {fileID: 1722183420764669590} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &1722183420764669590 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1722183420764669589} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1722183420764669591 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1722183420764669589} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &1722183420925353816 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1722183420925353823} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1722183419489630399} + - {fileID: 1722183420764669585} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1722183420925353823 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1722183420925353816} + m_Layer: 0 + m_Name: Scene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &5581392219061976576 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5581392219061976826} + - component: {fileID: 5581392219061976581} + - component: {fileID: 5581392219061976583} + - component: {fileID: 5581392219061976582} + - component: {fileID: 5581392219061976577} + m_Layer: 0 + m_Name: Global + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &5581392219061976577 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5581392219061976576} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &5581392219061976581 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5581392219061976576} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fa23b6e6f9b08d74885e3707aa0d9bc7, type: 3} + m_Name: + m_EditorClassIdentifier: + _moveObject: 0 + _moveAllObjects: 1 + _replaceOption: 0 + _scenes: + - ReplaceMain + _connectionOnly: 0 + _automaticallyUnload: 1 + _onTriggerEnter: 1 +--- !u!23 &5581392219061976582 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5581392219061976576} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 2e7517d1496ae784f94a2307a88e2bb5, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &5581392219061976583 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5581392219061976576} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &5581392219061976826 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5581392219061976576} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 30.66, y: -3, z: -1.24} + m_LocalScale: {x: 15, y: 15, z: 15} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceGlobal.unity.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceGlobal.unity.meta new file mode 100644 index 0000000..58f62b6 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceGlobal.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fddd81e62368fe9448b0eb0a80da6bb4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMain.unity b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMain.unity new file mode 100644 index 0000000..f1be5e0 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMain.unity @@ -0,0 +1,1306 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 705507994} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 4890085278179872738, guid: 8fa881c2b33440b488753a73333b050d, + type: 2} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &40691391 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 40691392} + m_Layer: 0 + m_Name: Triggers + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &40691392 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 40691391} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 825925885} + - {fileID: 1406093440} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &705507993 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 705507995} + - component: {fileID: 705507994} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &705507994 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705507993} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 1 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &705507995 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 705507993} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: -2.2843354, y: 60.72741, z: -2.9938574} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1155569020} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &825925881 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 825925885} + - component: {fileID: 825925886} + - component: {fileID: 825925884} + - component: {fileID: 825925883} + - component: {fileID: 825925882} + m_Layer: 0 + m_Name: Connection + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &825925882 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825925881} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &825925883 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825925881} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: d0a99caade0a68842b2274726d1bc7c3, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &825925884 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825925881} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &825925885 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825925881} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2.4611313, y: -3, z: 2.2759757} + m_LocalScale: {x: 15, y: 15, z: 15} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 40691392} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &825925886 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 825925881} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fa23b6e6f9b08d74885e3707aa0d9bc7, type: 3} + m_Name: + m_EditorClassIdentifier: + _moveObject: 1 + _moveAllObjects: 0 + _replaceOption: 0 + _scenes: + - ReplaceConnection + _connectionOnly: 1 + _automaticallyUnload: 1 + _onTriggerEnter: 1 +--- !u!1 &1155569019 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1155569020} + m_Layer: 0 + m_Name: Scene + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1155569020 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1155569019} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 705507995} + - {fileID: 2114768053} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1406093434 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1406093440} + - component: {fileID: 1406093439} + - component: {fileID: 1406093437} + - component: {fileID: 1406093436} + - component: {fileID: 1406093435} + m_Layer: 0 + m_Name: Global + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1406093435 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1406093434} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1406093436 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1406093434} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a35bce0c956282a42a90a04b25492fb6, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1406093437 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1406093434} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &1406093439 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1406093434} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fa23b6e6f9b08d74885e3707aa0d9bc7, type: 3} + m_Name: + m_EditorClassIdentifier: + _moveObject: 0 + _moveAllObjects: 1 + _replaceOption: 1 + _scenes: + - ReplaceGlobal + _connectionOnly: 0 + _automaticallyUnload: 1 + _onTriggerEnter: 1 +--- !u!4 &1406093440 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1406093434} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 13.88, y: -3, z: 2.2759757} + m_LocalScale: {x: 15, y: 15, z: 15} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 40691392} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2114768049 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2114768053} + - component: {fileID: 2114768052} + - component: {fileID: 2114768051} + - component: {fileID: 2114768050} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &2114768050 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2114768049} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2114768051 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2114768049} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &2114768052 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2114768049} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &2114768053 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2114768049} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -5, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1155569020} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1357903939251608625 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2553749094314996952} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &2553749094314996952 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9208822351047973834} + - component: {fileID: 6666759449596494018} + - component: {fileID: 1357903939251608625} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &3896340524768297019 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4875127092859136454} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4462211894441225126 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894441225131} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2d50394614f8feb4eb0567fb7618d84d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &4462211894441225127 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894441225131} + m_CullTransparentMesh: 0 +--- !u!224 &4462211894441225128 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894441225131} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 9208822351047973834} + m_Father: {fileID: 4462211894982264461} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -96} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!114 &4462211894441225129 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894441225131} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4462211894441225126} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4462211894982264465} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Client + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &4462211894441225131 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4462211894441225128} + - component: {fileID: 4462211894441225127} + - component: {fileID: 4462211894441225126} + - component: {fileID: 4462211894441225129} + m_Layer: 5 + m_Name: Client + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &4462211894961511974 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894961511979} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1b187e63031bf7849b249c8212440c3b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &4462211894961511975 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894961511979} + m_CullTransparentMesh: 0 +--- !u!224 &4462211894961511976 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894961511979} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7312354082057744424} + m_Father: {fileID: 4462211894982264461} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -16} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!114 &4462211894961511977 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894961511979} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4462211894961511974} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4462211894982264465} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Server + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &4462211894961511979 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4462211894961511976} + - component: {fileID: 4462211894961511975} + - component: {fileID: 4462211894961511974} + - component: {fileID: 4462211894961511977} + m_Layer: 5 + m_Name: Server + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!223 &4462211894982264460 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894982264464} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &4462211894982264461 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894982264464} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4462211894961511976} + - {fileID: 4462211894441225128} + m_Father: {fileID: 7443408887680269496} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &4462211894982264462 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894982264464} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &4462211894982264463 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894982264464} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!1 &4462211894982264464 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4462211894982264461} + - component: {fileID: 4462211894982264460} + - component: {fileID: 4462211894982264465} + - component: {fileID: 4462211894982264463} + - component: {fileID: 4462211894982264462} + m_Layer: 5 + m_Name: NetworkHudCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &4462211894982264465 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4462211894982264464} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d3606bfdac5a4743890fc1a5ecd8f24, type: 3} + m_Name: + m_EditorClassIdentifier: + _autoStartType: 2 + _stoppedColor: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + _changingColor: {r: 0.78431374, g: 0.6862745, b: 0, a: 1} + _startedColor: {r: 0, g: 0.5882353, b: 0.64705884, a: 1} + _serverIndicator: {fileID: 3896340524768297019} + _clientIndicator: {fileID: 1357903939251608625} +--- !u!1 &4875127092859136454 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7312354082057744424} + - component: {fileID: 5173910453633412161} + - component: {fileID: 3896340524768297019} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &5173910453633412161 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4875127092859136454} + m_CullTransparentMesh: 0 +--- !u!222 &6666759449596494018 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2553749094314996952} + m_CullTransparentMesh: 0 +--- !u!224 &7312354082057744424 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4875127092859136454} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4462211894961511976} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &7443408887680269493 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 211a9f6ec51ddc14f908f5acc0cd0423, type: 3} + m_Name: + m_EditorClassIdentifier: + _playerPrefab: {fileID: 611616139817875448, guid: bf5f023b4017a5e41a9815ec5745df3d, + type: 3} + _addToDefaultScene: 0 + Spawns: [] +--- !u!4 &7443408887680269496 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4462211894982264461} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &7443408887680269498 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7443408887680269496} + - component: {fileID: 7443408887680269499} + - component: {fileID: 7443408887680269493} + - component: {fileID: 7443408887680269500} + - component: {fileID: 7443408887680269501} + - component: {fileID: 7443408887680269502} + - component: {fileID: 7443408887680269503} + m_Layer: 0 + m_Name: 'NetworkManager ' + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &7443408887680269499 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2c95dfde7d73b54dbbdc23155d35d36, type: 3} + m_Name: + m_EditorClassIdentifier: + _refreshDefaultPrefabs: 1 + _runInBackground: 1 + _dontDestroyOnLoad: 1 + _objectPool: {fileID: 0} + _persistence: 0 + _logging: {fileID: 0} + _spawnablePrefabs: {fileID: 11400000, guid: 68e79e63a16f2c74e81f070bd36822b8, type: 2} +--- !u!114 &7443408887680269500 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3fdaae44044276a49a52229c1597e33b, type: 3} + m_Name: + m_EditorClassIdentifier: + _updateOrder: 0 + _timingType: 0 + _allowTickDropping: 0 + _maximumFrameTicks: 2 + _tickRate: 30 + _pingInterval: 1 + _physicsMode: 0 +--- !u!114 &7443408887680269501 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6f48f002b825cbd45a19bd96d90f9edb, type: 3} + m_Name: + m_EditorClassIdentifier: + _timeout: 15 + _dontRoute: 0 + _unreliableMtu: 1023 + _ipv4BindAddress: + _enableIpv6: 1 + _ipv6BindAddress: + _port: 7770 + _maximumClients: 4095 + _clientAddress: localhost +--- !u!114 &7443408887680269502 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 15895a51081447d46bda466e7e830c08, type: 3} + m_Name: + m_EditorClassIdentifier: + _sceneProcessor: {fileID: 0} + _lightProbeUpdating: 0 + _moveClientHostObjects: 1 + _setActiveScene: 1 +--- !u!114 &7443408887680269503 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887680269498} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d331f979d46e8e4a9fc90070c596d44, type: 3} + m_Name: + m_EditorClassIdentifier: + _enableNetworkLod: 0 + _levelOfDetailDistances: [] + _updateHostVisibility: 1 + _defaultConditions: [] +--- !u!224 &9208822351047973834 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2553749094314996952} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4462211894441225128} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMain.unity.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMain.unity.meta new file mode 100644 index 0000000..5276e6e --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMain.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 099398b014b86004abd99a7d21cf417a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMainSettings.lighting b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMainSettings.lighting new file mode 100644 index 0000000..7095b63 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMainSettings.lighting @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!850595691 &4890085278179872738 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ReplaceMainSettings + serializedVersion: 4 + m_GIWorkflowMode: 1 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 1 + m_LightmapMaxSize: 1024 + m_BakeResolution: 40 + m_Padding: 2 + m_LightmapCompression: 3 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 256 + m_FinalGatherFiltering: 1 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRMinBounces: 2 + m_PVREnvironmentMIS: 0 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_PVRTiledBaking: 0 diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMainSettings.lighting.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMainSettings.lighting.meta new file mode 100644 index 0000000..5c32135 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scenes/Replace/ReplaceMainSettings.lighting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8fa881c2b33440b488753a73333b050d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4890085278179872738 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts.meta new file mode 100644 index 0000000..99b53a1 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46f0b48d71e410342872ac48531da35e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/PlayerController.cs b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/PlayerController.cs new file mode 100644 index 0000000..b2933bc --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/PlayerController.cs @@ -0,0 +1,78 @@ +using FishNet.Connection; +using FishNet.Object; +using UnityEngine; + +namespace FishNet.Example.Scened +{ + + + public class PlayerController : NetworkBehaviour + { + [SerializeField] + private GameObject _camera; + [SerializeField] + private float _moveRate = 4f; + [SerializeField] + private bool _clientAuth = true; + + private void Awake() + { + Debug.Log(transform.position); + } + public override void OnStartClient() + { + if (base.IsOwner) + _camera.SetActive(true); + } + + private void Update() + { + if (!base.IsOwner) + return; + + float hor = Input.GetAxisRaw("Horizontal"); + float ver = Input.GetAxisRaw("Vertical"); + + /* If ground cannot be found for 20 units then bump up 3 units. + * This is just to keep player on ground if they fall through + * when changing scenes. */ + if (_clientAuth || (!_clientAuth && base.IsServerStarted)) + { + if (!Physics.Linecast(transform.position + new Vector3(0f, 0.3f, 0f), transform.position - (Vector3.one * 20f))) + transform.position += new Vector3(0f, 3f, 0f); + } + + if (_clientAuth) + Move(hor, ver); + else + ServerMove(hor, ver); + } + + [ServerRpc] + private void ServerMove(float hor, float ver) + { + Move(hor, ver); + } + + private void Move(float hor, float ver) + { + float gravity = -10f * Time.deltaTime; + //If ray hits floor then cancel gravity. + Ray ray = new Ray(transform.position + new Vector3(0f, 0.05f, 0f), -Vector3.up); + if (Physics.Raycast(ray, 0.1f + -gravity)) + gravity = 0f; + + /* Moving. */ + Vector3 direction = new Vector3( + 0f, + gravity, + ver * _moveRate * Time.deltaTime); + + transform.position += transform.TransformDirection(direction); + transform.Rotate(new Vector3(0f, hor * 100f * Time.deltaTime, 0f)); + } + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/PlayerController.cs.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/PlayerController.cs.meta new file mode 100644 index 0000000..cbdc08d --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/PlayerController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26e4f626a9ca9704f9befe7673a8dd15 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneLoaderExample.cs b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneLoaderExample.cs new file mode 100644 index 0000000..ac272f4 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneLoaderExample.cs @@ -0,0 +1,148 @@ +using FishNet.Connection; +using FishNet.Managing.Logging; +using FishNet.Managing.Scened; +using FishNet.Object; +using System.Collections.Generic; +using UnityEngine; + +namespace FishNet.Example.Scened +{ + + /// + /// Loads a single scene, additive scenes, or both when a client + /// enters or exits this trigger. + /// + public class SceneLoaderExample : MonoBehaviour + { + /// + /// True to move the triggering object. + /// + [Tooltip("True to move the triggering object.")] + [SerializeField] + private bool _moveObject = true; + /// + /// True to move all connection objects (clients). + /// + [Tooltip("True to move all connection objects (clients).")] + [SerializeField] + private bool _moveAllObjects; + /// + /// True to replace current scenes with new scenes. First scene loaded will become active scene. + /// + [Tooltip("True to replace current scenes with new scenes. First scene loaded will become active scene.")] + [SerializeField] + private ReplaceOption _replaceOption = ReplaceOption.None; + /// + /// Scenes to load. + /// + [Tooltip("Scenes to load.")] + [SerializeField] + private string[] _scenes = new string[0]; + /// + /// True to only unload for the connectioning causing the trigger. + /// + [Tooltip("True to only unload for the connectioning causing the trigger.")] + [SerializeField] + private bool _connectionOnly; + /// + /// True to automatically unload the loaded scenes when no more connections are using them. + /// + [Tooltip("True to automatically unload the loaded scenes when no more connections are using them.")] + [SerializeField] + private bool _automaticallyUnload = true; + /// + /// True to fire when entering the trigger. False to fire when exiting the trigger. + /// + [Tooltip("True to fire when entering the trigger. False to fire when exiting the trigger.")] + [SerializeField] + private bool _onTriggerEnter = true; + + /// + /// Used to prevent excessive triggering when two clients are loaded and server is separate. + /// Client may enter trigger intentionally then when moved to a new scene will re-enter trigger + /// since original scene will still be loaded on server due to another client being in it. + /// This scenario is extremely unlikely in production but keep it in mind. + /// + private Dictionary _triggeredTimes = new Dictionary(); + + + [Server(Logging = LoggingType.Off)] + private void OnTriggerEnter(Collider other) + { + if (!_onTriggerEnter) + return; + + LoadScene(other.GetComponent()); + } + + [Server(Logging = LoggingType.Off)] + private void OnTriggerExit(Collider other) + { + if (_onTriggerEnter) + return; + + LoadScene(other.GetComponent()); + } + + private void LoadScene(NetworkObject triggeringIdentity) + { + if (!InstanceFinder.NetworkManager.IsServerStarted) + return; + + //NetworkObject isn't necessarily needed but to ensure its the player only run if found. + if (triggeringIdentity == null) + return; + + /* Dont let trigger hit twice by same connection too frequently + * See _triggeredTimes field for more info. */ + if (_triggeredTimes.TryGetValue(triggeringIdentity.Owner, out float time)) + { + if (Time.time - time < 0.5f) + return; + } + _triggeredTimes[triggeringIdentity.Owner] = Time.time; + + //Which objects to move. + List movedObjects = new List(); + if (_moveAllObjects) + { + foreach (NetworkConnection item in InstanceFinder.ServerManager.Clients.Values) + { + foreach (NetworkObject nob in item.Objects) + movedObjects.Add(nob); + } + } + else if (_moveObject) + { + movedObjects.Add(triggeringIdentity); + } + //Load options. + LoadOptions loadOptions = new LoadOptions + { + AutomaticallyUnload = _automaticallyUnload, + }; + + //Make scene data. + SceneLoadData sld = new SceneLoadData(_scenes); + sld.PreferredActiveScene = new PreferredScene(sld.SceneLookupDatas[0]); + sld.ReplaceScenes = _replaceOption; + sld.Options = loadOptions; + sld.MovedNetworkObjects = movedObjects.ToArray(); + + //Load for connection only. + if (_connectionOnly) + InstanceFinder.SceneManager.LoadConnectionScenes(triggeringIdentity.Owner, sld); + //Load for all clients. + else + InstanceFinder.SceneManager.LoadGlobalScenes(sld); + + + } + + + } + + + + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneLoaderExample.cs.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneLoaderExample.cs.meta new file mode 100644 index 0000000..ee3fa3f --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneLoaderExample.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa23b6e6f9b08d74885e3707aa0d9bc7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneUnloaderExample.cs b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneUnloaderExample.cs new file mode 100644 index 0000000..5289d00 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneUnloaderExample.cs @@ -0,0 +1,91 @@ +using FishNet.Managing.Logging; +using FishNet.Managing.Scened; +using FishNet.Object; +using UnityEngine; + +namespace FishNet.Example.Scened +{ + + /// + /// Unloads specified scenes when entering or exiting this trigger. + /// + public class SceneUnloaderExample : MonoBehaviour + { + /// + /// Scenes to unload. + /// + [Tooltip("Scenes to unload.")] + [SerializeField] + private string[] _scenes = new string[0]; + /// + /// True to only unload for the connectioning causing the trigger. + /// + [Tooltip("True to only unload for the connectioning causing the trigger.")] + [SerializeField] + private bool _connectionOnly; + /// + /// True to unload unused scenes. + /// + [Tooltip("True to unload unused scenes.")] + [SerializeField] + private bool _unloadUnused = true; + /// + /// True to fire when entering the trigger. False to fire when exiting the trigger. + /// + [Tooltip("True to fire when entering the trigger. False to fire when exiting the trigger.")] + [SerializeField] + private bool _onTriggerEnter = true; + + + [Server(Logging = LoggingType.Off)] + private void OnTriggerEnter(Collider other) + { + if (!_onTriggerEnter) + return; + + UnloadScenes(other.gameObject.GetComponent()); + } + + [Server(Logging = LoggingType.Off)] + private void OnTriggerExit(Collider other) + { + if (_onTriggerEnter) + return; + + UnloadScenes(other.gameObject.GetComponent()); + } + + /// + /// Unload scenes. + /// + /// + private void UnloadScenes(NetworkObject triggeringIdentity) + { + if (!InstanceFinder.NetworkManager.IsServerStarted) + return; + + //NetworkObject isn't necessarily needed but to ensure its the player only run if nob is found. + if (triggeringIdentity == null) + return; + + UnloadOptions unloadOptions = new UnloadOptions() + { + Mode = (_unloadUnused) ? UnloadOptions.ServerUnloadMode.UnloadUnused : UnloadOptions.ServerUnloadMode.KeepUnused + }; + + SceneUnloadData sud = new SceneUnloadData(_scenes); + sud.Options = unloadOptions; + + //Unload only for the triggering connection. + if (_connectionOnly) + InstanceFinder.SceneManager.UnloadConnectionScenes(triggeringIdentity.Owner, sud); + //Unload for all players. + else + InstanceFinder.SceneManager.UnloadGlobalScenes(sud); + } + + + } + + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneUnloaderExample.cs.meta b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneUnloaderExample.cs.meta new file mode 100644 index 0000000..ba09def --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager (Old Examples)/Scripts/SceneUnloaderExample.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 84ae572fef1171b41ab287d1c9b5da63 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager.meta b/Assets/FishNet/Demos/SceneManager.meta new file mode 100644 index 0000000..2a159c4 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 73b29a5af2f04864699941fc23d5e110 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes.meta new file mode 100644 index 0000000..33b8a63 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 790edab37fb30a74b8e438c04b447d60 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Additive Scenes READ ME.txt b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Additive Scenes READ ME.txt new file mode 100644 index 0000000..0b954bb --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Additive Scenes READ ME.txt @@ -0,0 +1,28 @@ +This demo shows how to use additive scenes per connection, both prewarming scenes on the server +as well hot-loading and unloading them on clients. AOI is separated by scenes and objects in +each scene, as well relative distance to the player. + + +Setup: + - Place scenes in build settings, AdditiveScene_Start first, then the remainder scenes. + - Start on AdditiveScene_Start for server and client. + +On server: + - Start/press play and start server. + +On client: + - Start/press play and start client. + + +Notes: + All scenes are loaded immediately on the server using ServerScenePrewarmer. +When loaded they are marked to not automatically unload, and KeepUnused when unloading. +See ServerScenePrewarmer and LeveLoader notes for more details. + + The Player script is only used to move the player object on the server. It has no functionality +on the scene management. Waypoint is only used to tell the player where to move. + + Demo works as clientHost as well server or client only. Load multiple clients to see the +Observer system work on moving objects across different scenes! + + See NetworkManager > ObserverManager in AdditiveScene_Start to view ObserverConditions. \ No newline at end of file diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Additive Scenes READ ME.txt.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Additive Scenes READ ME.txt.meta new file mode 100644 index 0000000..36c674e --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Additive Scenes READ ME.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 82ddd0874516b9040b167b083badc176 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials.meta new file mode 100644 index 0000000..c2893c0 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 726a49d6d35281a4aa8f6015d79246fd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Ground.mat b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Ground.mat new file mode 100644 index 0000000..8e4181e --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Ground.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Ground + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.18867922, g: 0, b: 0.12506457, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Ground.mat.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Ground.mat.meta new file mode 100644 index 0000000..96410c1 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Ground.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 83bc8ce733133754198df883775fe67b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Player.mat b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Player.mat new file mode 100644 index 0000000..4d121aa --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Player.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Player + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.6132076, g: 0.5462585, b: 0.32106623, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Player.mat.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Player.mat.meta new file mode 100644 index 0000000..26e651e --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/Player.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a159d46f2a1d7034382d44be4cf8aa37 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeGrowth.mat b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeGrowth.mat new file mode 100644 index 0000000..56825c2 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeGrowth.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: TreeGrowth + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.206275, g: 0.7075472, b: 0.09011214, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeGrowth.mat.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeGrowth.mat.meta new file mode 100644 index 0000000..3d8ed5c --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeGrowth.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 92aa8b0f5f5816f4cae8c6f2091860d4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeStump.mat b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeStump.mat new file mode 100644 index 0000000..847a813 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeStump.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: TreeStump + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.4528302, g: 0.13425772, b: 0, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeStump.mat.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeStump.mat.meta new file mode 100644 index 0000000..c492e5f --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Materials/TreeStump.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 15634b93de15be5419ffed25bc199637 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Models.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Models.meta new file mode 100644 index 0000000..f42a1f8 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Models.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 24cb991248d4645448d297cef8db2667 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Models/Tree.fbx b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Models/Tree.fbx new file mode 100644 index 0000000..af7a055 Binary files /dev/null and b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Models/Tree.fbx differ diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Models/Tree.fbx.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Models/Tree.fbx.meta new file mode 100644 index 0000000..4668f5c --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Models/Tree.fbx.meta @@ -0,0 +1,97 @@ +fileFormatVersion: 2 +guid: d912959aabd6a3e439552066ae82eb71 +ModelImporter: + serializedVersion: 19301 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Observer Conditions.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Observer Conditions.meta new file mode 100644 index 0000000..8605a4f --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Observer Conditions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fa6a1647ec1d24048a454ab29a4ae703 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Observer Conditions/DistanceCondition.asset b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Observer Conditions/DistanceCondition.asset new file mode 100644 index 0000000..1fcc5ea --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Observer Conditions/DistanceCondition.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7c3e28fa2e37d1d41b4f63c8a0cc2553, type: 3} + m_Name: DistanceCondition + m_EditorClassIdentifier: + NetworkObject: {fileID: 0} + _maximumDistance: 13 + _hideDistancePercent: 0.1 diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Observer Conditions/DistanceCondition.asset.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Observer Conditions/DistanceCondition.asset.meta new file mode 100644 index 0000000..58b023e --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Observer Conditions/DistanceCondition.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 37bd3d466aaa29b4da784cddaaa365ea +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs.meta new file mode 100644 index 0000000..d416963 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a4ba80779d8f594a99ac095c656b95e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/Player.prefab b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/Player.prefab new file mode 100644 index 0000000..5629354 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/Player.prefab @@ -0,0 +1,566 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1814087131438229314 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6217164647077334158} + - component: {fileID: 364480097386140387} + m_Layer: 0 + m_Name: Spot Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6217164647077334158 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1814087131438229314} + m_LocalRotation: {x: 0.5735764, y: 0, z: 0, w: 0.8191521} + m_LocalPosition: {x: 0, y: 3, z: 2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6508211851680439895} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 70, y: 0, z: 0} +--- !u!108 &364480097386140387 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1814087131438229314} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 0 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 2.5 + m_Range: 15 + m_SpotAngle: 105 + m_InnerSpotAngle: 1 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!1 &2977802116279124631 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4020278404774456499} + - component: {fileID: 1556184897009707061} + - component: {fileID: 6310157271063819311} + m_Layer: 0 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4020278404774456499 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2977802116279124631} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6605224599093577347} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1556184897009707061 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2977802116279124631} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6310157271063819311 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2977802116279124631} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a159d46f2a1d7034382d44be4cf8aa37, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!1 &6605224598710239337 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6605224598710239336} + - component: {fileID: 6605224598710239381} + - component: {fileID: 6605224598710239382} + - component: {fileID: 6605224598710239383} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6605224598710239336 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6605224598710239337} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.5, z: 0.372} + m_LocalScale: {x: 0.75, y: 0.2, z: 0.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6605224599093577347} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &6605224598710239381 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6605224598710239337} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6605224598710239382 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6605224598710239337} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a159d46f2a1d7034382d44be4cf8aa37, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &6605224598710239383 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6605224598710239337} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &6605224599093577351 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6605224599093577347} + - component: {fileID: 8192566354860284824} + - component: {fileID: 6767263130208162619} + - component: {fileID: -1062563901163859699} + - component: {fileID: 6105665237106955699} + - component: {fileID: -7170926880071132319} + m_Layer: 0 + m_Name: Player + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6605224599093577347 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6605224599093577351} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 20, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4020278404774456499} + - {fileID: 6605224598710239336} + - {fileID: 6508211851680439895} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8192566354860284824 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6605224599093577351} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 6767263130208162619} + - {fileID: -7170926880071132319} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 0, y: 20, z: 0} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 1, y: 1, z: 1} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _teleportThreshold: 1 + k__BackingField: 20 + k__BackingField: 0 + _scenePathHash: 0 + k__BackingField: 0 + k__BackingField: 5491988111533709812 +--- !u!114 &6767263130208162619 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6605224599093577351} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c8541d1cca4da7043b84a0d563939dea, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 8192566354860284824} + _networkObjectCache: {fileID: 8192566354860284824} + _ownerObjects: {fileID: 6508211851680439895} + _moveRate: 3 +--- !u!54 &-1062563901163859699 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6605224599093577351} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!136 &6105665237106955699 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6605224599093577351} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 1 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &-7170926880071132319 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6605224599093577351} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a2836e36774ca1c4bbbee976e17b649c, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 1 + _addedNetworkObject: {fileID: 8192566354860284824} + _networkObjectCache: {fileID: 8192566354860284824} + _componentConfiguration: 0 + _synchronizeParent: 0 + _packing: + Position: 1 + Rotation: 1 + Scale: 0 + _interpolation: 2 + _extrapolation: 2 + _enableTeleport: 0 + _teleportThreshold: 0.5 + _scaleThreshold: 1 + _clientAuthoritative: 0 + _sendToOwner: 1 + _enableNetworkLod: 1 + _interval: 1 + _synchronizePosition: 1 + _positionSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeRotation: 1 + _rotationSnapping: + X: 0 + Y: 0 + Z: 0 + _synchronizeScale: 1 + _scaleSnapping: + X: 0 + Y: 0 + Z: 0 +--- !u!1 &7242742394113443571 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6508211851680439895} + m_Layer: 0 + m_Name: OwnerObjects + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &6508211851680439895 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7242742394113443571} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1653722379618799168} + - {fileID: 6217164647077334158} + m_Father: {fileID: 6605224599093577347} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &8611472312372460170 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1653722379618799168} + - component: {fileID: 8497199479931662325} + - component: {fileID: 2671839467167852026} + m_Layer: 0 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1653722379618799168 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8611472312372460170} + m_LocalRotation: {x: 0.5735764, y: -0, z: -0, w: 0.8191521} + m_LocalPosition: {x: 0, y: 5, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6508211851680439895} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 70, y: 0, z: 0} +--- !u!20 &8497199479931662325 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8611472312372460170} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &2671839467167852026 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8611472312372460170} + m_Enabled: 1 diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/Player.prefab.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/Player.prefab.meta new file mode 100644 index 0000000..9c42368 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/Player.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6331b3542e64a564c81bc39cedf70c8d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/_SceneManager_Additive Scenes_Prefabs.asset b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/_SceneManager_Additive Scenes_Prefabs.asset new file mode 100644 index 0000000..cb251a0 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/_SceneManager_Additive Scenes_Prefabs.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4489d77032a81ef42b0067acf2737d4d, type: 3} + m_Name: _SceneManager_Additive Scenes_Prefabs + m_EditorClassIdentifier: + _prefabs: + - {fileID: 8192566354860284824, guid: 6331b3542e64a564c81bc39cedf70c8d, type: 3} diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/_SceneManager_Additive Scenes_Prefabs.asset.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/_SceneManager_Additive Scenes_Prefabs.asset.meta new file mode 100644 index 0000000..c8e83b3 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Prefabs/_SceneManager_Additive Scenes_Prefabs.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 223fa01133c52c7469e6520b901bcebd +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes.meta new file mode 100644 index 0000000..352f146 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4f574493adcd0c841bc7be2e53b79af8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0.meta new file mode 100644 index 0000000..e8bd9bc --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b626fdcb395bf5a448c33f78241beace +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0.unity b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0.unity new file mode 100644 index 0000000..7872b31 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0.unity @@ -0,0 +1,3417 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 112000002, guid: 4bb692eb322f5154c996f4ae7d8d8bb2, + type: 2} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!114 &309548902 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149464853042} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916609073408795 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 3 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 3.58, y: 0.5, z: -3.188} + Rotation: {x: -0, y: 0.8870109, z: -0, w: 0.46174863} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &340750621 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149360249931} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916606267508506 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 10 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 4.3, y: 0.5, z: -5.39} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &377764780 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149398439672} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916607747366810 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 11 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -3.1, y: 0.5, z: 5.64} + Rotation: {x: 0, y: 0.6427876, z: 0, w: 0.7660445} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &599706548 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148679833312} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916609991826377 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 2 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -1.85, y: 0.5, z: -3.188} + Rotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &685977916 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148767525992} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916609097021590 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 5 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -3.41, y: 0.5, z: -4.14} + Rotation: {x: -0, y: 0.76604444, z: -0, w: 0.64278764} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &768984459 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148715813081} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916606877619991 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 7 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 3.47, y: 0.5, z: 2.42} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &774807863 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148720704613} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916606515809699 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 9 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -5, y: 0.5, z: -6.24} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1116894006 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148124831330} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916609216004217 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 4 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -1.97, y: 0.5, z: 2.16} + Rotation: {x: 0, y: -0.60876137, z: -0, w: 0.7933534} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1139518620 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148146278856} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916608300850528 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 1 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 2.0644817, y: 0.5, z: -0.2750473} + Rotation: {x: 0, y: -0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &1300759153 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300759154} + - component: {fileID: 1300759155} + m_Layer: 0 + m_Name: Waypoint 0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1300759154 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1300759153} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1521876172} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1300759155 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1300759153} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70028e1b1708627408637ab9a3cd6bd4, type: 3} + m_Name: + m_EditorClassIdentifier: + WaypointIndex: 0 +--- !u!1 &1521876168 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1521876172} + - component: {fileID: 1521876171} + - component: {fileID: 1521876170} + - component: {fileID: 1521876169} + m_Layer: 0 + m_Name: Platform + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1521876169 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1521876170 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 83bc8ce733133754198df883775fe67b, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1521876171 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1521876172 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 15, y: 1, z: 15} + m_Children: + - {fileID: 1300759154} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1538803105 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148545714383} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916607311625750 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 12 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 2.88, y: 0.5, z: 5.64} + Rotation: {x: 0, y: 0.2588191, z: 0, w: 0.9659258} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1582765032 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148455845556} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916609329666249 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 8 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -5, y: 0.5, z: 2.42} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &1617785153 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1617785157} + - component: {fileID: 1617785156} + - component: {fileID: 1617785155} + - component: {fileID: 1617785154} + m_Layer: 0 + m_Name: LevelLoader + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1617785154 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1617785153} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916606231790496 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 1617785155} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -2.5, y: 0, z: 2.5} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 20, y: 5, z: 20} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1617785155 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1617785153} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 02e5160f1a9b4d047a6cbdb3f094a86d, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 1617785154} + _networkObjectCache: {fileID: 1617785154} +--- !u!65 &1617785156 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1617785153} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!4 &1617785157 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1617785153} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.5, y: 0, z: 2.5} + m_LocalScale: {x: 20, y: 5, z: 20} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1796835396 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147729872144} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916609924310884 + k__BackingField: 0 + k__BackingField: 1 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 6 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 1940549179} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 1.12, y: 0.5, z: -4.14} + Rotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &1940549177 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1940549178} + - component: {fileID: 1940549180} + - component: {fileID: 1940549179} + m_Layer: 0 + m_Name: Trees(Networked) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1940549178 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1940549177} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 543450652602714994} + - {fileID: 543450653134138458} + - {fileID: 543450653399068808} + - {fileID: 543450652583335128} + - {fileID: 543450653022639826} + - {fileID: 543450651936747434} + - {fileID: 543450652972982883} + - {fileID: 543450652125852686} + - {fileID: 543450652925478623} + - {fileID: 543450653367867121} + - {fileID: 543450653322206274} + - {fileID: 543450652194710133} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1940549179 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1940549177} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 1783928975 + k__BackingField: 7661916606449198928 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 1940549180} + k__BackingField: {fileID: 0} + k__BackingField: + - {fileID: 1139518620} + - {fileID: 599706548} + - {fileID: 309548902} + - {fileID: 1116894006} + - {fileID: 685977916} + - {fileID: 1796835396} + - {fileID: 768984459} + - {fileID: 1582765032} + - {fileID: 774807863} + - {fileID: 340750621} + - {fileID: 377764780} + - {fileID: 1538803105} + SerializedTransformProperties: + Position: {x: 0, y: 0, z: 0} + Rotation: {x: -0, y: -0, z: -0, w: 1} + LocalScale: {x: 1, y: 1, z: 1} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1940549180 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1940549177} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b06d5bb8c7e0da04581df0b9454b81b7, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 1940549179} + _networkObjectCache: {fileID: 1940549179} + _scenes: [] +--- !u!4 &543450651936747434 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147729872144} + m_LocalRotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + m_LocalPosition: {x: 1.12, y: 0.5, z: -4.14} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264251231121313} + - {fileID: 3745622626888447183} + m_Father: {fileID: 1940549178} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 25, z: 0} +--- !u!4 &543450652125852686 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148455845556} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: -5, y: 0.5, z: 2.42} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252116546565} + - {fileID: 3745622627236409195} + m_Father: {fileID: 1940549178} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450652194710133 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148545714383} + m_LocalRotation: {x: 0, y: 0.2588191, z: 0, w: 0.9659258} + m_LocalPosition: {x: 2.88, y: 0.5, z: 5.64} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252030116478} + - {fileID: 3745622627167254800} + m_Father: {fileID: 1940549178} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 30, z: 0} +--- !u!4 &543450652583335128 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148124831330} + m_LocalRotation: {x: 0, y: -0.60876137, z: -0, w: 0.7933534} + m_LocalPosition: {x: -1.97, y: 0.5, z: 2.16} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251642795219} + - {fileID: 3745622627315748797} + m_Father: {fileID: 1940549178} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: -75, z: 0} +--- !u!4 &543450652602714994 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148146278856} + m_LocalRotation: {x: 0, y: -0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 2.0644817, y: 0.5, z: -0.2750473} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251624459129} + - {fileID: 3745622627296464919} + m_Father: {fileID: 1940549178} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: -50, z: 0} +--- !u!4 &543450652925478623 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148720704613} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: -5, y: 0.5, z: -6.24} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252391687892} + - {fileID: 3745622628047445434} + m_Father: {fileID: 1940549178} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450652972982883 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148715813081} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 3.47, y: 0.5, z: 2.42} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252393218664} + - {fileID: 3745622627999660294} + m_Father: {fileID: 1940549178} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450653022639826 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148767525992} + m_LocalRotation: {x: -0, y: 0.76604444, z: -0, w: 0.64278764} + m_LocalPosition: {x: -3.41, y: 0.5, z: -4.14} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264252346439385} + - {fileID: 3745622627950218679} + m_Father: {fileID: 1940549178} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 100, z: 0} +--- !u!4 &543450653134138458 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148679833312} + m_LocalRotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + m_LocalPosition: {x: -1.85, y: 0.5, z: -3.188} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264252164172881} + - {fileID: 3745622627838768959} + m_Father: {fileID: 1940549178} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 25, z: 0} +--- !u!4 &543450653322206274 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149398439672} + m_LocalRotation: {x: 0, y: 0.6427876, z: 0, w: 0.7660445} + m_LocalPosition: {x: -3.1, y: 0.5, z: 5.64} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264253052722249} + - {fileID: 3745622628187260711} + m_Father: {fileID: 1940549178} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 80, z: 0} +--- !u!4 &543450653367867121 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149360249931} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 4.3, y: 0.5, z: -5.39} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264253090158330} + - {fileID: 3745622628141829524} + m_Father: {fileID: 1940549178} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450653399068808 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149464853042} + m_LocalRotation: {x: -0, y: 0.8870109, z: -0, w: 0.46174863} + m_LocalPosition: {x: 3.58, y: 0.5, z: -3.188} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252991336579} + - {fileID: 3745622628110642157} + m_Father: {fileID: 1940549178} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 125, z: 0} +--- !u!1 &832149484401935230 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628141829524} + - component: {fileID: 5334037119529810698} + - component: {fileID: 4539702728046028757} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484422433229 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628187260711} + - component: {fileID: 5334037119567999417} + - component: {fileID: 4539702728024485222} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484504966407 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628110642157} + - component: {fileID: 5334037119632301427} + - component: {fileID: 4539702728081932716} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484744800725 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627838768959} + - component: {fileID: 5334037119921013153} + - component: {fileID: 4539702727810194814} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484780124140 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627999660294} + - component: {fileID: 5334037119956995992} + - component: {fileID: 4539702727635407687} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484836000592 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628047445434} + - component: {fileID: 5334037119963999012} + - component: {fileID: 4539702727616231419} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484864602973 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627950218679} + - component: {fileID: 5334037120010828585} + - component: {fileID: 4539702727720200182} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485284597501 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627296464919} + - component: {fileID: 5334037118315832969} + - component: {fileID: 4539702729415260758} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485295518039 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627315748797} + - component: {fileID: 5334037118292293923} + - component: {fileID: 4539702729434670588} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485643964801 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627236409195} + - component: {fileID: 5334037118623291893} + - component: {fileID: 4539702728952530218} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485684160506 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627167254800} + - component: {fileID: 5334037118713155470} + - component: {fileID: 4539702729017725777} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485958969893 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622626888447183} + - component: {fileID: 5334037118971052625} + - component: {fileID: 4539702728738791054} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132147729872144 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450651936747434} + - component: {fileID: 1796835396} + m_Layer: 0 + m_Name: Tree (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148124831330 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652583335128} + - component: {fileID: 1116894006} + m_Layer: 0 + m_Name: Tree (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148146278856 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652602714994} + - component: {fileID: 1139518620} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148455845556 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652125852686} + - component: {fileID: 1582765032} + m_Layer: 0 + m_Name: Tree (7) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148545714383 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652194710133} + - component: {fileID: 1538803105} + m_Layer: 0 + m_Name: Tree (11) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148679833312 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653134138458} + - component: {fileID: 599706548} + m_Layer: 0 + m_Name: Tree (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148715813081 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652972982883} + - component: {fileID: 768984459} + m_Layer: 0 + m_Name: Tree (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148720704613 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652925478623} + - component: {fileID: 774807863} + m_Layer: 0 + m_Name: Tree (8) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148767525992 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653022639826} + - component: {fileID: 685977916} + m_Layer: 0 + m_Name: Tree (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149360249931 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653367867121} + - component: {fileID: 340750621} + m_Layer: 0 + m_Name: Tree (9) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149398439672 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653322206274} + - component: {fileID: 377764780} + m_Layer: 0 + m_Name: Tree (10) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149464853042 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653399068808} + - component: {fileID: 309548902} + m_Layer: 0 + m_Name: Tree (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1300264251231121313 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940502980620} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450651936747434} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251624459129 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939839093972} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652602714994} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251642795219 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939856405374} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652583335128} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252030116478 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940245046739} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652194710133} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252116546565 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940179063720} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652125852686} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252164172881 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941452647420} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653134138458} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252346439385 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941566583156} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653022639826} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252391687892 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941529198969} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652925478623} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252393218664 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941479450053} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652972982883} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252991336579 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941188040494} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653399068808} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264253052722249 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941132409828} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653322206274} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264253090158330 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941086581079} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653367867121} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1622145354585426575 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940245046739} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145354683260148 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940179063720} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145354991313800 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939839093972} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355006573602 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939856405374} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355401168720 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940502980620} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355822291058 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941188040494} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355857165835 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941086581079} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355877528760 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941132409828} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356450381352 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941566583156} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356503501465 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941479450053} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356555595301 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941529198969} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356598592672 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941452647420} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &3745622626888447183 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485958969893} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450651936747434} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627167254800 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485684160506} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652194710133} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627236409195 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485643964801} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652125852686} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627296464919 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485284597501} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652602714994} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627315748797 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485295518039} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652583335128} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627838768959 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484744800725} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653134138458} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627950218679 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484864602973} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653022639826} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627999660294 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484780124140} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652972982883} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628047445434 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484836000592} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652925478623} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628110642157 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484504966407} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653399068808} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628141829524 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484401935230} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653367867121} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628187260711 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484422433229} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653322206274} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4024461403916522246 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941086581079} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461403946326453 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941132409828} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404014310783 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941188040494} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404595316628 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941479450053} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404623274792 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941529198969} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404644479781 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941566583156} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404831967661 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941452647420} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404889068025 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940179063720} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404965824386 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940245046739} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405354447151 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939856405374} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405365341829 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939839093972} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405781502557 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940502980620} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!23 &4539702727616231419 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484836000592} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702727635407687 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484780124140} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702727720200182 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484864602973} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702727810194814 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484744800725} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728024485222 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484422433229} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728046028757 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484401935230} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728081932716 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484504966407} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728738791054 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485958969893} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728952530218 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485643964801} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702729017725777 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485684160506} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702729415260758 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485284597501} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702729434670588 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485295518039} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &5334037118292293923 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485295518039} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118315832969 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485284597501} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118623291893 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485643964801} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118713155470 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485684160506} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118971052625 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485958969893} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119529810698 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484401935230} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119567999417 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484422433229} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119632301427 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484504966407} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119921013153 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484744800725} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119956995992 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484780124140} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119963999012 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484836000592} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037120010828585 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484864602973} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!1 &9013638939839093972 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251624459129} + - component: {fileID: 4024461405365341829} + - component: {fileID: 1622145354991313800} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638939856405374 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251642795219} + - component: {fileID: 4024461405354447151} + - component: {fileID: 1622145355006573602} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940179063720 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252116546565} + - component: {fileID: 4024461404889068025} + - component: {fileID: 1622145354683260148} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940245046739 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252030116478} + - component: {fileID: 4024461404965824386} + - component: {fileID: 1622145354585426575} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940502980620 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251231121313} + - component: {fileID: 4024461405781502557} + - component: {fileID: 1622145355401168720} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941086581079 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264253090158330} + - component: {fileID: 4024461403916522246} + - component: {fileID: 1622145355857165835} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941132409828 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264253052722249} + - component: {fileID: 4024461403946326453} + - component: {fileID: 1622145355877528760} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941188040494 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252991336579} + - component: {fileID: 4024461404014310783} + - component: {fileID: 1622145355822291058} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941452647420 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252164172881} + - component: {fileID: 4024461404831967661} + - component: {fileID: 1622145356598592672} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941479450053 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252393218664} + - component: {fileID: 4024461404595316628} + - component: {fileID: 1622145356503501465} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941529198969 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252391687892} + - component: {fileID: 4024461404623274792} + - component: {fileID: 1622145356555595301} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941566583156 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252346439385} + - component: {fileID: 4024461404644479781} + - component: {fileID: 1622145356450381352} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0.unity.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0.unity.meta new file mode 100644 index 0000000..1f801bf --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7643cdc3eefb15f4f8608cc633c55f7e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/LightingData.asset b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/LightingData.asset new file mode 100644 index 0000000..ef16e6c Binary files /dev/null and b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/LightingData.asset differ diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/LightingData.asset.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/LightingData.asset.meta new file mode 100644 index 0000000..1788a37 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/LightingData.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4bb692eb322f5154c996f4ae7d8d8bb2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 6475696996188705980 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/ReflectionProbe-0.exr b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/ReflectionProbe-0.exr new file mode 100644 index 0000000..c5ff2d1 Binary files /dev/null and b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/ReflectionProbe-0.exr differ diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/ReflectionProbe-0.exr.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/ReflectionProbe-0.exr.meta new file mode 100644 index 0000000..ff7eb2a --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0/ReflectionProbe-0.exr.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 8f9333d1d50759749b86feeaf8c086f3 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 1 + seamlessCubemap: 1 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 2 + aniso: 0 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 2 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 100 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_1.unity b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_1.unity new file mode 100644 index 0000000..13f9cdc --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_1.unity @@ -0,0 +1,3334 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 112000008, guid: 4bb692eb322f5154c996f4ae7d8d8bb2, + type: 2} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!114 &16174716 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149171090216} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835757413014822 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -3.1, y: 0.5, z: 5.64} + Rotation: {x: 0, y: 0.6427876, z: 0, w: 0.7660445} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &21877550 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149175611002} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835755883586605 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -1.85, y: 0.5, z: -3.188} + Rotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &134092196 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149153736944} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835757272480829 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 3.47, y: 0.5, z: 2.42} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &506336288 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149525981516} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835757665523139 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 4.3, y: 0.5, z: -5.39} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &681283498 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 681283499} + m_Layer: 0 + m_Name: Trees(Networked) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &681283499 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 681283498} + m_LocalRotation: {x: 0, y: -0.7071068, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 15} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 543450652058643369} + - {fileID: 543450653720097984} + - {fileID: 543450652669645364} + - {fileID: 543450651910458001} + - {fileID: 543450652830724776} + - {fileID: 543450651919309379} + - {fileID: 543450653608079946} + - {fileID: 543450652970055944} + - {fileID: 543450652415889240} + - {fileID: 543450653193892854} + - {fileID: 543450653692504466} + - {fileID: 543450652965335488} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: -90, z: 0} +--- !u!114 &743347758 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148689251194} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835756569217493 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 2.88, y: 0.5, z: 5.64} + Rotation: {x: 0, y: 0.2588191, z: 0, w: 0.9659258} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &763797222 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148710745010} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835759131787395 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -5, y: 0.5, z: 2.42} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &877696326 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148825171986} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835757121416791 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -3.41, y: 0.5, z: -4.14} + Rotation: {x: -0, y: 0.76604444, z: -0, w: 0.64278764} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1072264674 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149018544270} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835757339173242 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 3.58, y: 0.5, z: -3.188} + Rotation: {x: -0, y: 0.8870109, z: -0, w: 0.46174863} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &1080970248 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1080970249} + - component: {fileID: 1080970250} + m_Layer: 0 + m_Name: Waypoint 1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1080970249 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1080970248} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1521876172} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1080970250 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1080970248} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70028e1b1708627408637ab9a3cd6bd4, type: 3} + m_Name: + m_EditorClassIdentifier: + WaypointIndex: 1 +--- !u!114 &1284073654 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148156618210} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835756505474772 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -5, y: 0.5, z: -6.24} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &1369662610 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1369662614} + - component: {fileID: 1369662613} + - component: {fileID: 1369662612} + - component: {fileID: 1369662611} + m_Layer: 0 + m_Name: LevelLoader + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1369662611 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1369662610} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835758866849625 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 1369662612} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -2.5, y: 0, z: 12.5} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 20, y: 5, z: 20} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1369662612 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1369662610} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 02e5160f1a9b4d047a6cbdb3f094a86d, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 1369662611} + _networkObjectCache: {fileID: 1369662611} +--- !u!65 &1369662613 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1369662610} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!4 &1369662614 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1369662610} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.5, y: 0, z: 12.5} + m_LocalScale: {x: 20, y: 5, z: 20} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1521876168 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1521876172} + - component: {fileID: 1521876171} + - component: {fileID: 1521876170} + - component: {fileID: 1521876169} + m_Layer: 0 + m_Name: Platform + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1521876169 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1521876170 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 83bc8ce733133754198df883775fe67b, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1521876171 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1521876172 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 15} + m_LocalScale: {x: 15, y: 1, z: 15} + m_Children: + - {fileID: 1080970249} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1649773637 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147583332627} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835759944572420 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 2.0644817, y: 0.5, z: -0.2750473} + Rotation: {x: 0, y: -0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1780989355 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147714523385} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835756291161831 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 1.12, y: 0.5, z: -4.14} + Rotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1789832573 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147722457131} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 966907422 + k__BackingField: 4152835759922413422 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -1.97, y: 0.5, z: 2.16} + Rotation: {x: 0, y: -0.60876137, z: -0, w: 0.7933534} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!4 &543450651910458001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147722457131} + m_LocalRotation: {x: 0, y: -0.60876137, z: -0, w: 0.7933534} + m_LocalPosition: {x: -1.97, y: 0.5, z: 2.16} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251242449562} + - {fileID: 3745622626914980340} + m_Father: {fileID: 681283499} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: -75, z: 0} +--- !u!4 &543450651919309379 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147714523385} + m_LocalRotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + m_LocalPosition: {x: 1.12, y: 0.5, z: -4.14} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264251251432008} + - {fileID: 3745622626906128678} + m_Father: {fileID: 681283499} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 25, z: 0} +--- !u!4 &543450652058643369 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147583332627} + m_LocalRotation: {x: 0, y: -0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 2.0644817, y: 0.5, z: -0.2750473} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251109747618} + - {fileID: 3745622626766549196} + m_Father: {fileID: 681283499} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: -50, z: 0} +--- !u!4 &543450652415889240 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148156618210} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: -5, y: 0.5, z: -6.24} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251878133587} + - {fileID: 3745622627482932285} + m_Father: {fileID: 681283499} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450652669645364 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149018544270} + m_LocalRotation: {x: -0, y: 0.8870109, z: -0, w: 0.46174863} + m_LocalPosition: {x: 3.58, y: 0.5, z: -3.188} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252631011903} + - {fileID: 3745622627766045009} + m_Father: {fileID: 681283499} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 125, z: 0} +--- !u!4 &543450652830724776 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148825171986} + m_LocalRotation: {x: -0, y: 0.76604444, z: -0, w: 0.64278764} + m_LocalPosition: {x: -3.41, y: 0.5, z: -4.14} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264252552786595} + - {fileID: 3745622627605080525} + m_Father: {fileID: 681283499} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 100, z: 0} +--- !u!4 &543450652965335488 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148689251194} + m_LocalRotation: {x: 0, y: 0.2588191, z: 0, w: 0.9659258} + m_LocalPosition: {x: 2.88, y: 0.5, z: 5.64} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252418961867} + - {fileID: 3745622628007602853} + m_Father: {fileID: 681283499} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 30, z: 0} +--- !u!4 &543450652970055944 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148710745010} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: -5, y: 0.5, z: 2.42} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252398516483} + - {fileID: 3745622628002882157} + m_Father: {fileID: 681283499} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450653193892854 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149525981516} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 4.3, y: 0.5, z: -5.39} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264253197038589} + - {fileID: 3745622628315850899} + m_Father: {fileID: 681283499} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450653608079946 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149153736944} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 3.47, y: 0.5, z: 2.42} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252763976257} + - {fileID: 3745622628438534447} + m_Father: {fileID: 681283499} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450653692504466 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149171090216} + m_LocalRotation: {x: 0, y: 0.6427876, z: 0, w: 0.7660445} + m_LocalPosition: {x: -3.1, y: 0.5, z: 5.64} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252747704729} + - {fileID: 3745622628354142967} + m_Father: {fileID: 681283499} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 80, z: 0} +--- !u!4 &543450653720097984 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149175611002} + m_LocalRotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + m_LocalPosition: {x: -1.85, y: 0.5, z: -3.188} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264252737680587} + - {fileID: 3745622628326289317} + m_Father: {fileID: 681283499} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 25, z: 0} +--- !u!1 &832149484144961477 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628438534447} + - component: {fileID: 5334037119321186225} + - component: {fileID: 4539702728275739502} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484184002895 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628326289317} + - component: {fileID: 5334037119345154363} + - component: {fileID: 4539702728364688868} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484194823197 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628354142967} + - component: {fileID: 5334037119338529897} + - component: {fileID: 4539702728392677558} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484567537273 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628315850899} + - component: {fileID: 5334037119695527437} + - component: {fileID: 4539702727884620498} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484774665351 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628002882157} + - component: {fileID: 5334037119954031859} + - component: {fileID: 4539702727638763564} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484804547663 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628007602853} + - component: {fileID: 5334037119932537915} + - component: {fileID: 4539702727643480292} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484939159335 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627605080525} + - component: {fileID: 5334037120066363219} + - component: {fileID: 4539702727509394316} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485083379643 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627766045009} + - component: {fileID: 5334037120261849039} + - component: {fileID: 4539702727334699792} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485328751319 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627482932285} + - component: {fileID: 5334037118326170275} + - component: {fileID: 4539702729266183804} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485845462566 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622626766549196} + - component: {fileID: 5334037118824515154} + - component: {fileID: 4539702728885328525} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485968465694 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622626914980340} + - component: {fileID: 5334037118965753706} + - component: {fileID: 4539702728765471669} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485976391628 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622626906128678} + - component: {fileID: 5334037118957828024} + - component: {fileID: 4539702728756489063} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132147583332627 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652058643369} + - component: {fileID: 1649773637} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132147714523385 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450651919309379} + - component: {fileID: 1780989355} + m_Layer: 0 + m_Name: Tree (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132147722457131 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450651910458001} + - component: {fileID: 1789832573} + m_Layer: 0 + m_Name: Tree (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148156618210 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652415889240} + - component: {fileID: 1284073654} + m_Layer: 0 + m_Name: Tree (8) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148689251194 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652965335488} + - component: {fileID: 743347758} + m_Layer: 0 + m_Name: Tree (11) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148710745010 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652970055944} + - component: {fileID: 763797222} + m_Layer: 0 + m_Name: Tree (7) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148825171986 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652830724776} + - component: {fileID: 877696326} + m_Layer: 0 + m_Name: Tree (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149018544270 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652669645364} + - component: {fileID: 1072264674} + m_Layer: 0 + m_Name: Tree (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149153736944 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653608079946} + - component: {fileID: 134092196} + m_Layer: 0 + m_Name: Tree (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149171090216 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653692504466} + - component: {fileID: 16174716} + m_Layer: 0 + m_Name: Tree (10) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149175611002 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653720097984} + - component: {fileID: 21877550} + m_Layer: 0 + m_Name: Tree (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149525981516 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653193892854} + - component: {fileID: 506336288} + m_Layer: 0 + m_Name: Tree (9) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1300264251109747618 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940380560399} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652058643369} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251242449562 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940530957623} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450651910458001} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251251432008 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940521975269} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450651919309379} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251878133587 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939891603710} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652415889240} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252398516483 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941484641966} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652970055944} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252418961867 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941489358438} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652965335488} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252552786595 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941622396174} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652830724776} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252631011903 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941785326994} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652669645364} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252737680587 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940868649830} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653720097984} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252747704729 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940894281268} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653692504466} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252763976257 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940844451308} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653608079946} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264253197038589 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941260735568} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653193892854} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1622145354905184162 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939891603710} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355406353003 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940530957623} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355414155961 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940521975269} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355555570515 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940380560399} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355750251276 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941260735568} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356041608250 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940868649830} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356048613736 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940894281268} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356132981424 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940844451308} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356266240718 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941785326994} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356394764882 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941622396174} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356498440690 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941484641966} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356528326970 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941489358438} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &3745622626766549196 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485845462566} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652058643369} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622626906128678 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485976391628} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450651919309379} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622626914980340 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485968465694} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450651910458001} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627482932285 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485328751319} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652415889240} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627605080525 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484939159335} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652830724776} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627766045009 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485083379643} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652669645364} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628002882157 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484774665351} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652970055944} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628007602853 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484804547663} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652965335488} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628315850899 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484567537273} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653193892854} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628326289317 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484184002895} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653720097984} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628354142967 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484194823197} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653692504466} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628438534447 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484144961477} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653608079946} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4024461403818014209 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941260735568} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404223813565 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940844451308} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404241095781 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940894281268} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404268687671 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940868649830} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404358629315 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941785326994} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404452501343 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941622396174} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404587635767 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941489358438} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404600745215 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941484641966} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405119892143 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939891603710} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405755740006 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940530957623} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405764591540 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940521975269} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405895536222 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940380560399} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!23 &4539702727334699792 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485083379643} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702727509394316 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484939159335} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702727638763564 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484774665351} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702727643480292 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484804547663} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702727884620498 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484567537273} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728275739502 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484144961477} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728364688868 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484184002895} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728392677558 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484194823197} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728756489063 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485976391628} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728765471669 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485968465694} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728885328525 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485845462566} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702729266183804 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485328751319} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &5334037118326170275 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485328751319} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118824515154 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485845462566} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118957828024 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485976391628} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118965753706 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485968465694} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119321186225 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484144961477} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119338529897 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484194823197} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119345154363 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484184002895} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119695527437 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484567537273} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119932537915 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484804547663} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119954031859 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484774665351} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037120066363219 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484939159335} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037120261849039 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485083379643} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!1 &9013638939891603710 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251878133587} + - component: {fileID: 4024461405119892143} + - component: {fileID: 1622145354905184162} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940380560399 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251109747618} + - component: {fileID: 4024461405895536222} + - component: {fileID: 1622145355555570515} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940521975269 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251251432008} + - component: {fileID: 4024461405764591540} + - component: {fileID: 1622145355414155961} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940530957623 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251242449562} + - component: {fileID: 4024461405755740006} + - component: {fileID: 1622145355406353003} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940844451308 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252763976257} + - component: {fileID: 4024461404223813565} + - component: {fileID: 1622145356132981424} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940868649830 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252737680587} + - component: {fileID: 4024461404268687671} + - component: {fileID: 1622145356041608250} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940894281268 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252747704729} + - component: {fileID: 4024461404241095781} + - component: {fileID: 1622145356048613736} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941260735568 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264253197038589} + - component: {fileID: 4024461403818014209} + - component: {fileID: 1622145355750251276} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941484641966 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252398516483} + - component: {fileID: 4024461404600745215} + - component: {fileID: 1622145356498440690} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941489358438 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252418961867} + - component: {fileID: 4024461404587635767} + - component: {fileID: 1622145356528326970} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941622396174 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252552786595} + - component: {fileID: 4024461404452501343} + - component: {fileID: 1622145356394764882} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941785326994 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252631011903} + - component: {fileID: 4024461404358629315} + - component: {fileID: 1622145356266240718} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_1.unity.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_1.unity.meta new file mode 100644 index 0000000..acd20f4 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_1.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: aab2581cdfbe8f44698ef91d36f2d6c6 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_2.unity b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_2.unity new file mode 100644 index 0000000..723cad1 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_2.unity @@ -0,0 +1,3334 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 112000004, guid: 4bb692eb322f5154c996f4ae7d8d8bb2, + type: 2} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!114 &95425705 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149116643831} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325591671375611 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 3.58, y: 0.5, z: -3.188} + Rotation: {x: -0, y: 0.8870109, z: -0, w: 0.46174863} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &108939185 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 108939186} + - component: {fileID: 108939187} + m_Layer: 0 + m_Name: Waypoint 2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &108939186 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 108939185} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1521876172} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &108939187 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 108939185} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70028e1b1708627408637ab9a3cd6bd4, type: 3} + m_Name: + m_EditorClassIdentifier: + WaypointIndex: 2 +--- !u!114 &326714650 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149480978502} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325593592878854 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -3.41, y: 0.5, z: -4.14} + Rotation: {x: -0, y: 0.76604444, z: -0, w: 0.64278764} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &422957713 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 422957714} + - component: {fileID: 422957716} + - component: {fileID: 422957715} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &422957714 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 422957713} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 1383041480} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &422957715 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 422957713} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &422957716 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 422957713} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!114 &482460140 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149503556792} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325591141522992 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 4.3, y: 0.5, z: -5.39} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &552945233 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148633991967} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325592570809934 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 3.47, y: 0.5, z: 2.42} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &594330602 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 594330603} + m_Layer: 0 + m_Name: Trees(Networked) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &594330603 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 594330602} + m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} + m_LocalPosition: {x: -15, y: 0, z: 15} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 543450651859724068} + - {fileID: 543450651802355761} + - {fileID: 543450653638095693} + - {fileID: 543450652088940807} + - {fileID: 543450653415187196} + - {fileID: 543450652352743558} + - {fileID: 543450653155402149} + - {fileID: 1383041480} + - {fileID: 543450652013682271} + - {fileID: 543450653225952770} + - {fileID: 543450652407348635} + - {fileID: 543450652781764868} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} +--- !u!114 &918521586 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148864302014} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325593879424503 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 2.88, y: 0.5, z: 5.64} + Rotation: {x: 0, y: 0.2588191, z: 0, w: 0.9659258} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &1115572417 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1115572421} + - component: {fileID: 1115572420} + - component: {fileID: 1115572419} + - component: {fileID: 1115572418} + m_Layer: 0 + m_Name: LevelLoader + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1115572418 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1115572417} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325593153843102 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 1115572419} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -12.5, y: 0, z: 12.5} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 20, y: 5, z: 20} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1115572419 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1115572417} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 02e5160f1a9b4d047a6cbdb3f094a86d, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 1115572418} + _networkObjectCache: {fileID: 1115572418} +--- !u!65 &1115572420 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1115572417} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!4 &1115572421 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1115572417} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -12.5, y: 0, z: 12.5} + m_LocalScale: {x: 20, y: 5, z: 20} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1161649283 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1161649284} + - component: {fileID: 1161649286} + - component: {fileID: 1161649285} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1161649284 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1161649283} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 1383041480} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1161649285 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1161649283} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1161649286 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1161649283} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!114 &1326242419 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148198401825} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325591150408055 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -3.1, y: 0.5, z: 5.64} + Rotation: {x: 0, y: 0.6427876, z: 0, w: 0.7660445} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1355673456 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148361908796} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325592899307310 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 1.12, y: 0.5, z: -4.14} + Rotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &1383041479 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1383041480} + - component: {fileID: 1383041481} + m_Layer: 0 + m_Name: Tree (7) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1383041480 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1383041479} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: -5, y: 0.5, z: 2.42} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1161649284} + - {fileID: 422957714} + m_Father: {fileID: 594330603} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!114 &1383041481 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1383041479} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325592091372009 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -5, y: 0.5, z: 2.42} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &1521876168 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1521876172} + - component: {fileID: 1521876171} + - component: {fileID: 1521876170} + - component: {fileID: 1521876169} + m_Layer: 0 + m_Name: Platform + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1521876169 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1521876170 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 83bc8ce733133754198df883775fe67b, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1521876171 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1521876172 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} + m_LocalPosition: {x: -15, y: 0, z: 15} + m_LocalScale: {x: 15, y: 1, z: 15} + m_Children: + - {fileID: 108939186} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} +--- !u!114 &1611292399 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147544449981} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325592252218564 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -1.97, y: 0.5, z: 2.16} + Rotation: {x: 0, y: -0.60876137, z: -0, w: 0.7933534} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1686616503 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147485934821} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325592594628335 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -5, y: 0.5, z: -6.24} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1873854674 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147673857438} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325593292706399 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 2.0644817, y: 0.5, z: -0.2750473} + Rotation: {x: 0, y: -0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1931423709 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147863917195} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3624550437 + k__BackingField: 15567325591661030678 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -1.85, y: 0.5, z: -3.188} + Rotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!4 &543450651802355761 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147863917195} + m_LocalRotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + m_LocalPosition: {x: -1.85, y: 0.5, z: -3.188} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264251365230650} + - {fileID: 3745622626486145876} + m_Father: {fileID: 594330603} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 25, z: 0} +--- !u!4 &543450651859724068 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147673857438} + m_LocalRotation: {x: 0, y: -0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 2.0644817, y: 0.5, z: -0.2750473} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251292411695} + - {fileID: 3745622626965437505} + m_Father: {fileID: 594330603} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: -50, z: 0} +--- !u!4 &543450652013682271 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147485934821} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: -5, y: 0.5, z: -6.24} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251207392852} + - {fileID: 3745622626811757882} + m_Father: {fileID: 594330603} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450652088940807 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147544449981} + m_LocalRotation: {x: 0, y: -0.60876137, z: -0, w: 0.7933534} + m_LocalPosition: {x: -1.97, y: 0.5, z: 2.16} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251148400908} + - {fileID: 3745622626736415330} + m_Father: {fileID: 594330603} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: -75, z: 0} +--- !u!4 &543450652352743558 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148361908796} + m_LocalRotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + m_LocalPosition: {x: 1.12, y: 0.5, z: -4.14} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264251940751501} + - {fileID: 3745622627009270755} + m_Father: {fileID: 594330603} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 25, z: 0} +--- !u!4 &543450652407348635 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148198401825} + m_LocalRotation: {x: 0, y: 0.6427876, z: 0, w: 0.7660445} + m_LocalPosition: {x: -3.1, y: 0.5, z: 5.64} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251835841936} + - {fileID: 3745622627491555070} + m_Father: {fileID: 594330603} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 80, z: 0} +--- !u!4 &543450652781764868 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148864302014} + m_LocalRotation: {x: 0, y: 0.2588191, z: 0, w: 0.9659258} + m_LocalPosition: {x: 2.88, y: 0.5, z: 5.64} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252516540687} + - {fileID: 3745622627654302305} + m_Father: {fileID: 594330603} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 30, z: 0} +--- !u!4 &543450653155402149 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148633991967} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 3.47, y: 0.5, z: 2.42} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252210799022} + - {fileID: 3745622627817175744} + m_Father: {fileID: 594330603} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450653225952770 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149503556792} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 4.3, y: 0.5, z: -5.39} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264253216613897} + - {fileID: 3745622628283563367} + m_Father: {fileID: 594330603} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450653415187196 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149480978502} + m_LocalRotation: {x: -0, y: 0.76604444, z: -0, w: 0.64278764} + m_LocalPosition: {x: -3.41, y: 0.5, z: -4.14} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264252973900535} + - {fileID: 3745622628094261657} + m_Father: {fileID: 594330603} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 100, z: 0} +--- !u!4 &543450653638095693 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149116643831} + m_LocalRotation: {x: -0, y: 0.8870109, z: -0, w: 0.46174863} + m_LocalPosition: {x: 3.58, y: 0.5, z: -3.188} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252802380614} + - {fileID: 3745622628408256552} + m_Father: {fileID: 594330603} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 125, z: 0} +--- !u!1 &832149484106557122 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628408256552} + - component: {fileID: 5334037119284092598} + - component: {fileID: 4539702728312570473} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484488849267 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628094261657} + - component: {fileID: 5334037119648419591} + - component: {fileID: 4539702728065553368} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484527154061 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628283563367} + - component: {fileID: 5334037119673093113} + - component: {fileID: 4539702727919310630} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484731855914 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627817175744} + - component: {fileID: 5334037119875173470} + - component: {fileID: 4539702727855575169} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484962952331 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627654302305} + - component: {fileID: 5334037120105483519} + - component: {fileID: 4539702727491375136} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485354149908 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627491555070} + - component: {fileID: 5334037118367944800} + - component: {fileID: 4539702729207811263} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485534567689 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627009270755} + - component: {fileID: 5334037118531462525} + - component: {fileID: 4539702729195174306} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485731023824 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622626811757882} + - component: {fileID: 5334037118729237412} + - component: {fileID: 4539702728863444859} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485806709896 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622626736415330} + - component: {fileID: 5334037118787736828} + - component: {fileID: 4539702728922433571} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485884994219 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622626965437505} + - component: {fileID: 5334037118915037919} + - component: {fileID: 4539702728681690624} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149486093278654 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622626486145876} + - component: {fileID: 5334037119105115594} + - component: {fileID: 4539702728604940565} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132147485934821 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652013682271} + - component: {fileID: 1686616503} + m_Layer: 0 + m_Name: Tree (8) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132147544449981 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652088940807} + - component: {fileID: 1611292399} + m_Layer: 0 + m_Name: Tree (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132147673857438 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450651859724068} + - component: {fileID: 1873854674} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132147863917195 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450651802355761} + - component: {fileID: 1931423709} + m_Layer: 0 + m_Name: Tree (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148198401825 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652407348635} + - component: {fileID: 1326242419} + m_Layer: 0 + m_Name: Tree (10) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148361908796 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652352743558} + - component: {fileID: 1355673456} + m_Layer: 0 + m_Name: Tree (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148633991967 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653155402149} + - component: {fileID: 552945233} + m_Layer: 0 + m_Name: Tree (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148864302014 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652781764868} + - component: {fileID: 918521586} + m_Layer: 0 + m_Name: Tree (11) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149116643831 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653638095693} + - component: {fileID: 95425705} + m_Layer: 0 + m_Name: Tree (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149480978502 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653415187196} + - component: {fileID: 326714650} + m_Layer: 0 + m_Name: Tree (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149503556792 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653225952770} + - component: {fileID: 482460140} + m_Layer: 0 + m_Name: Tree (9) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1300264251148400908 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940352917153} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652088940807} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251207392852 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940293384697} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652013682271} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251292411695 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940445880450} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450651859724068} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251365230650 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940636766103} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450651802355761} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251835841936 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939899832893} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652407348635} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251940751501 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940088508192} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652352743558} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252210799022 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941431182851} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653155402149} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252516540687 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941670700706} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652781764868} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252802380614 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940814959851} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653638095693} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252973900535 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941171922266} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653415187196} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264253216613897 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941229101476} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653225952770} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1622145354707820668 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940088508192} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145354930181473 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939899832893} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355266793675 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940636766103} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355457351646 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940445880450} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355517743613 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940352917153} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355575637669 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940293384697} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355714187000 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941229101476} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355805903366 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941171922266} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356094839735 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940814959851} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356413962750 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941670700706} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356585257311 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941431182851} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &3745622626486145876 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149486093278654} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450651802355761} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622626736415330 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485806709896} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652088940807} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622626811757882 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485731023824} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652013682271} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622626965437505 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485884994219} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450651859724068} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627009270755 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485534567689} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652352743558} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627491555070 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485354149908} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652407348635} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627654302305 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484962952331} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652781764868} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627817175744 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484731855914} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653155402149} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628094261657 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484488849267} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653415187196} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628283563367 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484527154061} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653225952770} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628408256552 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484106557122} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653638095693} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4024461403774018549 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941229101476} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404030428939 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941171922266} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404194584250 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940814959851} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404479562995 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941670700706} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404777800786 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941431182851} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405048819057 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940088508192} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405178919020 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939899832893} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405647703494 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940636766103} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405704512211 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940445880450} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405791853480 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940293384697} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405866687728 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940352917153} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!23 &4539702727491375136 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484962952331} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702727855575169 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484731855914} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702727919310630 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484527154061} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728065553368 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484488849267} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728312570473 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484106557122} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728604940565 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149486093278654} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728681690624 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485884994219} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728863444859 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485731023824} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728922433571 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485806709896} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702729195174306 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485534567689} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702729207811263 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485354149908} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &5334037118367944800 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485354149908} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118531462525 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485534567689} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118729237412 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485731023824} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118787736828 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485806709896} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118915037919 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485884994219} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119105115594 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149486093278654} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119284092598 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484106557122} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119648419591 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484488849267} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119673093113 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484527154061} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119875173470 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484731855914} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037120105483519 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484962952331} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!1 &9013638939899832893 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251835841936} + - component: {fileID: 4024461405178919020} + - component: {fileID: 1622145354930181473} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940088508192 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251940751501} + - component: {fileID: 4024461405048819057} + - component: {fileID: 1622145354707820668} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940293384697 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251207392852} + - component: {fileID: 4024461405791853480} + - component: {fileID: 1622145355575637669} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940352917153 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251148400908} + - component: {fileID: 4024461405866687728} + - component: {fileID: 1622145355517743613} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940445880450 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251292411695} + - component: {fileID: 4024461405704512211} + - component: {fileID: 1622145355457351646} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940636766103 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251365230650} + - component: {fileID: 4024461405647703494} + - component: {fileID: 1622145355266793675} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940814959851 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252802380614} + - component: {fileID: 4024461404194584250} + - component: {fileID: 1622145356094839735} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941171922266 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252973900535} + - component: {fileID: 4024461404030428939} + - component: {fileID: 1622145355805903366} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941229101476 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264253216613897} + - component: {fileID: 4024461403774018549} + - component: {fileID: 1622145355714187000} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941431182851 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252210799022} + - component: {fileID: 4024461404777800786} + - component: {fileID: 1622145356585257311} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941670700706 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252516540687} + - component: {fileID: 4024461404479562995} + - component: {fileID: 1622145356413962750} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_2.unity.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_2.unity.meta new file mode 100644 index 0000000..6da9606 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_2.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 969cc8a8a67c58b4da9baa82a65c66bf +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_3.unity b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_3.unity new file mode 100644 index 0000000..d3e0537 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_3.unity @@ -0,0 +1,3334 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 112000006, guid: 4bb692eb322f5154c996f4ae7d8d8bb2, + type: 2} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!114 &73418659 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149094644465} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296475642484486 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -3.41, y: 0.5, z: -4.14} + Rotation: {x: -0, y: 0.76604444, z: -0, w: 0.64278764} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &79032482 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149099580878} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296475929030135 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 2.88, y: 0.5, z: 5.64} + Rotation: {x: 0, y: 0.2588191, z: 0, w: 0.9659258} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &240188781 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149261385787} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296473720981243 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 3.58, y: 0.5, z: -3.188} + Rotation: {x: -0, y: 0.8870109, z: -0, w: 0.46174863} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &444883191 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149599788453} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296475342312031 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 2.0644817, y: 0.5, z: -0.2750473} + Rotation: {x: 0, y: -0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &665252281 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148612189415} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296473385328701 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -5, y: 0.5, z: 2.42} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &893044127 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148839479501} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296474948912942 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 1.12, y: 0.5, z: -4.14} + Rotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1155450199 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148027619333} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296473710636310 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -1.85, y: 0.5, z: -3.188} + Rotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1198518658 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148070534190} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296473200013687 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -3.1, y: 0.5, z: 5.64} + Rotation: {x: 0, y: 0.6427876, z: 0, w: 0.7660445} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1340267954 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148213997822} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296474301824196 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -1.97, y: 0.5, z: 2.16} + Rotation: {x: 0, y: -0.60876137, z: -0, w: 0.7933534} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &1365027452 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1365027453} + - component: {fileID: 1365027454} + - component: {fileID: 1365027456} + - component: {fileID: 1365027455} + m_Layer: 0 + m_Name: LevelLoader + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1365027453 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1365027452} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -12.5, y: 0, z: 2.5} + m_LocalScale: {x: 20, y: 5, z: 20} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1365027454 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1365027452} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &1365027455 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1365027452} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296474482014222 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 1365027456} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -12.5, y: 0, z: 2.5} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 20, y: 5, z: 20} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!114 &1365027456 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1365027452} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 02e5160f1a9b4d047a6cbdb3f094a86d, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 1365027455} + _networkObjectCache: {fileID: 1365027455} +--- !u!1 &1521876168 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1521876172} + - component: {fileID: 1521876171} + - component: {fileID: 1521876170} + - component: {fileID: 1521876169} + m_Layer: 0 + m_Name: Platform + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1521876169 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1521876170 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 83bc8ce733133754198df883775fe67b, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1521876171 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1521876172 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521876168} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} + m_LocalPosition: {x: -15, y: 0, z: 0} + m_LocalScale: {x: 15, y: 1, z: 15} + m_Children: + - {fileID: 2077277857} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} +--- !u!114 &1566503149 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148438650299} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296474644233967 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -5, y: 0.5, z: -6.24} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &1995669880 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1995669881} + m_Layer: 0 + m_Name: Trees(Networked) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1995669881 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1995669880} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} + m_LocalPosition: {x: -15, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 543450653255075615} + - {fileID: 543450652553224895} + - {fileID: 543450653468236417} + - {fileID: 543450652401973828} + - {fileID: 543450653634928715} + - {fileID: 543450652840796791} + - {fileID: 543450651675761637} + - {fileID: 543450653068596829} + - {fileID: 543450652175734529} + - {fileID: 543450651593903160} + - {fileID: 543450652543719060} + - {fileID: 543450653621000052} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} +--- !u!114 &2024537105 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147957547359} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296474620415566 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 3.47, y: 0.5, z: 2.42} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!1 &2077277856 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2077277857} + - component: {fileID: 2077277858} + m_Layer: 0 + m_Name: Waypoint 3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2077277857 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2077277856} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1521876172} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2077277858 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2077277856} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70028e1b1708627408637ab9a3cd6bd4, type: 3} + m_Name: + m_EditorClassIdentifier: + WaypointIndex: 3 +--- !u!114 &2139679702 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147938612866} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + NetworkObserver: {fileID: 0} + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 3409873804 + k__BackingField: 14645296473191128624 + k__BackingField: 0 + k__BackingField: 0 + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _ownerTeleportThreshold: 1 + _spectatorAdaptiveInterpolation: 1 + _spectatorInterpolation: 1 + _adaptiveSmoothingType: 0 + _customSmoothingData: + InterpolationPercent: 1 + CollisionInterpolationPercent: 0.1 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 3 + _preconfiguredSmoothingDataPreview: + InterpolationPercent: 0.5 + CollisionInterpolationPercent: 0.05 + InterpolationDecreaseStep: 1 + InterpolationIncreaseStep: 2 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: [] + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: 4.3, y: 0.5, z: -5.39} + Rotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + LocalScale: {x: 0.75, y: 0.75, z: 0.75} + _isNetworked: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 +--- !u!4 &543450651593903160 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147938612866} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 4.3, y: 0.5, z: -5.39} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251559267379} + - {fileID: 3745622626694371165} + m_Father: {fileID: 1995669881} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450651675761637 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132147957547359} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 3.47, y: 0.5, z: 2.42} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251544787950} + - {fileID: 3745622626612772992} + m_Father: {fileID: 1995669881} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450652175734529 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148438650299} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: -5, y: 0.5, z: -6.24} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252132710154} + - {fileID: 3745622627186543716} + m_Father: {fileID: 1995669881} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450652401973828 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148213997822} + m_LocalRotation: {x: 0, y: -0.60876137, z: -0, w: 0.7933534} + m_LocalPosition: {x: -1.97, y: 0.5, z: 2.16} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251826272847} + - {fileID: 3745622627497189665} + m_Father: {fileID: 1995669881} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: -75, z: 0} +--- !u!4 &543450652543719060 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148070534190} + m_LocalRotation: {x: 0, y: 0.6427876, z: 0, w: 0.7660445} + m_LocalPosition: {x: -3.1, y: 0.5, z: 5.64} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264251699713695} + - {fileID: 3745622627355430385} + m_Father: {fileID: 1995669881} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 80, z: 0} +--- !u!4 &543450652553224895 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148027619333} + m_LocalRotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + m_LocalPosition: {x: -1.85, y: 0.5, z: -3.188} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264251738448564} + - {fileID: 3745622627345938906} + m_Father: {fileID: 1995669881} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 25, z: 0} +--- !u!4 &543450652840796791 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148839479501} + m_LocalRotation: {x: -0, y: 0.2164396, z: -0, w: 0.97629607} + m_LocalPosition: {x: 1.12, y: 0.5, z: -4.14} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264252541919868} + - {fileID: 3745622627595237650} + m_Father: {fileID: 1995669881} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 25, z: 0} +--- !u!4 &543450653068596829 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132148612189415} + m_LocalRotation: {x: -0, y: 0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: -5, y: 0.5, z: 2.42} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252232848982} + - {fileID: 3745622627904294200} + m_Father: {fileID: 1995669881} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 50, z: 0} +--- !u!4 &543450653255075615 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149599788453} + m_LocalRotation: {x: 0, y: -0.42261827, z: -0, w: 0.9063079} + m_LocalPosition: {x: 2.0644817, y: 0.5, z: -0.2750473} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264253119842068} + - {fileID: 3745622628254358650} + m_Father: {fileID: 1995669881} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: -50, z: 0} +--- !u!4 &543450653468236417 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149261385787} + m_LocalRotation: {x: -0, y: 0.8870109, z: -0, w: 0.46174863} + m_LocalPosition: {x: 3.58, y: 0.5, z: -3.188} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252921895562} + - {fileID: 3745622628578132452} + m_Father: {fileID: 1995669881} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 125, z: 0} +--- !u!4 &543450653621000052 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149099580878} + m_LocalRotation: {x: 0, y: 0.2588191, z: 0, w: 0.9659258} + m_LocalPosition: {x: 2.88, y: 0.5, z: 5.64} + m_LocalScale: {x: 0.75, y: 0.75, z: 0.75} + m_Children: + - {fileID: 1300264252818937727} + - {fileID: 3745622628425370641} + m_Father: {fileID: 1995669881} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 30, z: 0} +--- !u!4 &543450653634928715 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 919132149094644465} + m_LocalRotation: {x: -0, y: 0.76604444, z: -0, w: 0.64278764} + m_LocalPosition: {x: -3.41, y: 0.5, z: -4.14} + m_LocalScale: {x: 0.75000006, y: 0.75, z: 0.75000006} + m_Children: + - {fileID: 1300264252824412224} + - {fileID: 3745622628411390766} + m_Father: {fileID: 1995669881} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 100, z: 0} +--- !u!1 &832149484123702011 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628425370641} + - component: {fileID: 5334037119267043983} + - component: {fileID: 4539702728329569872} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484134888900 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628411390766} + - component: {fileID: 5334037119264181680} + - component: {fileID: 4539702728315703663} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484301635342 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628578132452} + - component: {fileID: 5334037119428851578} + - component: {fileID: 4539702728146922405} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484623778448 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622628254358650} + - component: {fileID: 5334037119769340644} + - component: {fileID: 4539702727957362235} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484676105170 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627904294200} + - component: {fileID: 5334037119855492006} + - component: {fileID: 4539702727741515641} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149484920698872 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627595237650} + - component: {fileID: 5334037120080662412} + - component: {fileID: 4539702727499551571} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485199882032 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627345938906} + - component: {fileID: 5334037118195060548} + - component: {fileID: 4539702729397736347} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485226148635 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627355430385} + - component: {fileID: 5334037118240095087} + - component: {fileID: 4539702729340004272} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485351137227 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627497189665} + - component: {fileID: 5334037118383544255} + - component: {fileID: 4539702729213447008} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149485594133134 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622627186543716} + - component: {fileID: 5334037118606113530} + - component: {fileID: 4539702728969922085} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149486150801847 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622626694371165} + - component: {fileID: 5334037119181906371} + - component: {fileID: 4539702728410643740} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &832149486203162218 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3745622626612772992} + - component: {fileID: 5334037119200851486} + - component: {fileID: 4539702728530242241} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132147938612866 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450651593903160} + - component: {fileID: 2139679702} + m_Layer: 0 + m_Name: Tree (9) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132147957547359 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450651675761637} + - component: {fileID: 2024537105} + m_Layer: 0 + m_Name: Tree (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148027619333 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652553224895} + - component: {fileID: 1155450199} + m_Layer: 0 + m_Name: Tree (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148070534190 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652543719060} + - component: {fileID: 1198518658} + m_Layer: 0 + m_Name: Tree (10) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148213997822 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652401973828} + - component: {fileID: 1340267954} + m_Layer: 0 + m_Name: Tree (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148438650299 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652175734529} + - component: {fileID: 1566503149} + m_Layer: 0 + m_Name: Tree (8) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148612189415 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653068596829} + - component: {fileID: 665252281} + m_Layer: 0 + m_Name: Tree (7) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132148839479501 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450652840796791} + - component: {fileID: 893044127} + m_Layer: 0 + m_Name: Tree (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149094644465 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653634928715} + - component: {fileID: 73418659} + m_Layer: 0 + m_Name: Tree (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149099580878 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653621000052} + - component: {fileID: 79032482} + m_Layer: 0 + m_Name: Tree (11) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149261385787 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653468236417} + - component: {fileID: 240188781} + m_Layer: 0 + m_Name: Tree (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &919132149599788453 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 543450653255075615} + - component: {fileID: 444883191} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1300264251544787950 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940766014531} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450651675761637} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251559267379 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940713786270} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450651593903160} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251699713695 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939763310898} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652543719060} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251738448564 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939751855385} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652553224895} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264251826272847 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939905732066} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652401973828} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252132710154 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940129329319} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652175734529} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252232848982 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941386047995} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653068596829} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252541919868 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941612291537} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450652840796791} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252818937727 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940831416530} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653621000052} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252824412224 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940820191213} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653634928715} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264252921895562 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940984839463} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653468236417} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &1300264253119842068 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941333721273} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 4, z: 0} + m_LocalScale: {x: 100, y: 100, z: 300} + m_Children: [] + m_Father: {fileID: 543450653255075615} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1622145354633576443 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940129329319} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145354923758270 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939905732066} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355044604485 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939751855385} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355066572398 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939763310898} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355104580383 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940766014531} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355190494402 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940713786270} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145355676217317 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941333721273} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356025688699 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940984839463} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356111347598 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940831416530} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356123162801 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940820191213} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356372363917 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941612291537} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &1622145356664143527 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941386047995} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 92aa8b0f5f5816f4cae8c6f2091860d4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &3745622626612772992 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149486203162218} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450651675761637} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622626694371165 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149486150801847} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450651593903160} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627186543716 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485594133134} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652175734529} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627345938906 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485199882032} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652553224895} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627355430385 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485226148635} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652543719060} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627497189665 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485351137227} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652401973828} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627595237650 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484920698872} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450652840796791} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622627904294200 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484676105170} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653068596829} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628254358650 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484623778448} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653255075615} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628411390766 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484134888900} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653634928715} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628425370641 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484123702011} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653621000052} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &3745622628578132452 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484301635342} + m_LocalRotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + m_LocalPosition: {x: -0, y: 0.5, z: 0} + m_LocalScale: {x: 25, y: 25, z: 50} + m_Children: [] + m_Father: {fileID: 543450653468236417} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4024461403879228136 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941333721273} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404083412854 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940984839463} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404177977987 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940831416530} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404183061948 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940820191213} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404470994816 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941612291537} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404766426026 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638941386047995} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461404871807734 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940129329319} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405164634035 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939905732066} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405249300296 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939751855385} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405306901347 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638939763310898} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405438691791 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940713786270} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &4024461405453442578 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9013638940766014531} + m_Mesh: {fileID: 3613567641014311022, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!23 &4539702727499551571 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484920698872} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702727741515641 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484676105170} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702727957362235 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484623778448} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728146922405 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484301635342} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728315703663 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484134888900} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728329569872 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484123702011} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728410643740 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149486150801847} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728530242241 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149486203162218} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702728969922085 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485594133134} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702729213447008 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485351137227} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702729340004272 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485226148635} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!23 &4539702729397736347 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485199882032} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 15634b93de15be5419ffed25bc199637, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &5334037118195060548 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485199882032} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118240095087 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485226148635} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118383544255 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485351137227} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037118606113530 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149485594133134} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119181906371 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149486150801847} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119200851486 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149486203162218} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119264181680 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484134888900} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119267043983 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484123702011} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119428851578 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484301635342} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119769340644 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484623778448} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037119855492006 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484676105170} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!33 &5334037120080662412 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832149484920698872} + m_Mesh: {fileID: -5495902117074765545, guid: d912959aabd6a3e439552066ae82eb71, type: 3} +--- !u!1 &9013638939751855385 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251738448564} + - component: {fileID: 4024461405249300296} + - component: {fileID: 1622145355044604485} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638939763310898 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251699713695} + - component: {fileID: 4024461405306901347} + - component: {fileID: 1622145355066572398} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638939905732066 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251826272847} + - component: {fileID: 4024461405164634035} + - component: {fileID: 1622145354923758270} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940129329319 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252132710154} + - component: {fileID: 4024461404871807734} + - component: {fileID: 1622145354633576443} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940713786270 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251559267379} + - component: {fileID: 4024461405438691791} + - component: {fileID: 1622145355190494402} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940766014531 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264251544787950} + - component: {fileID: 4024461405453442578} + - component: {fileID: 1622145355104580383} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940820191213 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252824412224} + - component: {fileID: 4024461404183061948} + - component: {fileID: 1622145356123162801} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940831416530 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252818937727} + - component: {fileID: 4024461404177977987} + - component: {fileID: 1622145356111347598} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638940984839463 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252921895562} + - component: {fileID: 4024461404083412854} + - component: {fileID: 1622145356025688699} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941333721273 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264253119842068} + - component: {fileID: 4024461403879228136} + - component: {fileID: 1622145355676217317} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941386047995 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252232848982} + - component: {fileID: 4024461404766426026} + - component: {fileID: 1622145356664143527} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &9013638941612291537 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1300264252541919868} + - component: {fileID: 4024461404470994816} + - component: {fileID: 1622145356372363917} + m_Layer: 0 + m_Name: Cone + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_3.unity.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_3.unity.meta new file mode 100644 index 0000000..c8cf2ad --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_3.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8ac819f926d1e914e9552e79c147082d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_Start.unity b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_Start.unity new file mode 100644 index 0000000..a42e2f6 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_Start.unity @@ -0,0 +1,879 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &860526058 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 860526059} + m_Layer: 0 + m_Name: World Center - Reference Only + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &860526059 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 860526058} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1565068570 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887457311805} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d331f979d46e8e4a9fc90070c596d44, type: 3} + m_Name: + m_EditorClassIdentifier: + _enableNetworkLod: 0 + _levelOfDetailDistances: [] + _updateHostVisibility: 1 + _defaultConditions: + - {fileID: 11400000, guid: 2033f54fd2794464bae08fa5a55c8996, type: 2} + - {fileID: 11400000, guid: 37bd3d466aaa29b4da784cddaaa365ea, type: 2} +--- !u!1 &2134535185 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2134535188} + - component: {fileID: 2134535187} + - component: {fileID: 2134535186} + m_Layer: 0 + m_Name: ServerScenePrewarmer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &2134535186 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2134535185} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26b716c41e9b56b4baafaf13a523ba2e, type: 3} + m_Name: + m_EditorClassIdentifier: + k__BackingField: 0 + k__BackingField: 0 + k__BackingField: {fileID: 0} + _networkBehaviours: + - {fileID: 2134535187} + k__BackingField: {fileID: 0} + k__BackingField: [] + SerializedTransformProperties: + Position: {x: -8.965608, y: -4.7316337, z: 9.317315} + Rotation: {x: 0, y: 0, z: 0, w: 1} + LocalScale: {x: 1, y: 1, z: 1} + _isNetworked: 1 + _isSpawnable: 1 + _isGlobal: 0 + _initializeOrder: 0 + _defaultDespawnType: 0 + NetworkObserver: {fileID: 0} + _enablePrediction: 0 + _predictionType: 0 + _graphicalObject: {fileID: 0} + _enableStateForwarding: 1 + _ownerInterpolation: 1 + _enableTeleport: 0 + _teleportThreshold: 1 + k__BackingField: 0 + k__BackingField: 0 + _scenePathHash: 2948317627 + k__BackingField: 12662927786225082631 + k__BackingField: 0 +--- !u!114 &2134535187 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2134535185} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b06d5bb8c7e0da04581df0b9454b81b7, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 2134535186} + _networkObjectCache: {fileID: 2134535186} + _scenes: + - Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_0.unity + - Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_1.unity + - Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_2.unity + - Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_3.unity +--- !u!4 &2134535188 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2134535185} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -8.965608, y: -4.7316337, z: 9.317315} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1424052073207433918 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714267701847} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &2480283714267701847 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9139860296387939653} + - component: {fileID: 6745855427850769997} + - component: {fileID: 1424052073207433918} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &3965864433628223156 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256398008137} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2b3dca501a9d8c8479dc71dd068aa8b8, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4393252311304163328 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311304163359} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0.5 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!114 &4393252311304163329 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311304163359} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!224 &4393252311304163330 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311304163359} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4393252311316957351} + - {fileID: 4393252311836867879} + m_Father: {fileID: 7443408887457311807} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &4393252311304163331 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311304163359} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &4393252311304163358 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311304163359} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6d3606bfdac5a4743890fc1a5ecd8f24, type: 3} + m_Name: + m_EditorClassIdentifier: + _autoStartType: 2 + _stoppedColor: {r: 0.25490198, g: 0.25490198, b: 0.25490198, a: 1} + _changingColor: {r: 0.78431374, g: 0.6862745, b: 0, a: 1} + _startedColor: {r: 0, g: 0.5882353, b: 0.64705884, a: 1} + _serverIndicator: {fileID: 3965864433628223156} + _clientIndicator: {fileID: 1424052073207433918} +--- !u!1 &4393252311304163359 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311304163330} + - component: {fileID: 4393252311304163358} + - component: {fileID: 4393252311304163331} + - component: {fileID: 4393252311304163328} + - component: {fileID: 4393252311304163329} + m_Layer: 5 + m_Name: NetworkHudCanvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &4393252311316957348 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311316957351} + - component: {fileID: 4393252311316957352} + - component: {fileID: 4393252311316957353} + - component: {fileID: 4393252311316957350} + m_Layer: 5 + m_Name: Server + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &4393252311316957350 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311316957348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252311316957353} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252311304163358} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Server + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!224 &4393252311316957351 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311316957348} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7233259200865887911} + m_Father: {fileID: 4393252311304163330} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -16} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!222 &4393252311316957352 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311316957348} + m_CullTransparentMesh: 0 +--- !u!114 &4393252311316957353 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311316957348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1b187e63031bf7849b249c8212440c3b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &4393252311836867876 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4393252311836867879} + - component: {fileID: 4393252311836867880} + - component: {fileID: 4393252311836867881} + - component: {fileID: 4393252311836867878} + m_Layer: 5 + m_Name: Client + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &4393252311836867878 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311836867876} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4393252311836867881} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4393252311304163358} + m_TargetAssemblyTypeName: + m_MethodName: OnClick_Client + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!224 &4393252311836867879 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311836867876} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 9139860296387939653} + m_Father: {fileID: 4393252311304163330} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -96} + m_SizeDelta: {x: 256, y: 64} + m_Pivot: {x: 0, y: 1} +--- !u!222 &4393252311836867880 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311836867876} + m_CullTransparentMesh: 0 +--- !u!114 &4393252311836867881 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4393252311836867876} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 2d50394614f8feb4eb0567fb7618d84d, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &4808982256398008137 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7233259200865887911} + - component: {fileID: 5104387649418689230} + - component: {fileID: 3965864433628223156} + m_Layer: 5 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &5104387649418689230 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256398008137} + m_CullTransparentMesh: 0 +--- !u!222 &6745855427850769997 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714267701847} + m_CullTransparentMesh: 0 +--- !u!224 &7233259200865887911 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4808982256398008137} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4393252311316957351} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &7443408887457311794 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887457311805} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 211a9f6ec51ddc14f908f5acc0cd0423, type: 3} + m_Name: + m_EditorClassIdentifier: + _playerPrefab: {fileID: 8192566354860284824, guid: 6331b3542e64a564c81bc39cedf70c8d, + type: 3} + _addToDefaultScene: 0 + Spawns: [] +--- !u!114 &7443408887457311804 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887457311805} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2c95dfde7d73b54dbbdc23155d35d36, type: 3} + m_Name: + m_EditorClassIdentifier: + _refreshDefaultPrefabs: 0 + _runInBackground: 1 + _dontDestroyOnLoad: 1 + _objectPool: {fileID: 0} + _persistence: 0 + _logging: {fileID: 0} + _spawnablePrefabs: {fileID: 11400000, guid: 223fa01133c52c7469e6520b901bcebd, type: 2} +--- !u!1 &7443408887457311805 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7443408887457311807} + - component: {fileID: 7443408887457311804} + - component: {fileID: 1565068570} + - component: {fileID: 7443408887457311794} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7443408887457311807 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7443408887457311805} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4393252311304163330} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!224 &9139860296387939653 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2480283714267701847} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4393252311836867879} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_Start.unity.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_Start.unity.meta new file mode 100644 index 0000000..327af5d --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scenes/AdditiveScenes_Start.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: afbcf8f41ca78ef4296672aeb824f605 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts.meta new file mode 100644 index 0000000..cef4b4e --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f916eef3fd3b4bd459215b28ba6255e0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/LevelLoader.cs b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/LevelLoader.cs new file mode 100644 index 0000000..056603c --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/LevelLoader.cs @@ -0,0 +1,96 @@ +using FishNet.Managing.Scened; +using FishNet.Object; +using UnityEngine; + +namespace FishNet.Demo.AdditiveScenes +{ + public class LevelLoader : NetworkBehaviour + { + + private void OnTriggerEnter(Collider other) + { + if (!base.IsServerStarted) + return; + + Player player = GetPlayerOwnedObject(other); + if (player == null) + return; + + /* Create a lookup handle using this objects scene. + * This is one of many ways FishNet knows what scene to load + * for the clients. */ + SceneLookupData lookupData = new SceneLookupData(gameObject.scene); + SceneLoadData sld = new SceneLoadData(lookupData) + { + /* Set automatically unload to false + * so the server does not unload this scene when + * there are no more connections in it. */ + Options = new LoadOptions() + { + AutomaticallyUnload = false + }, + /* Also move the client object to the new scene. + * This step is not required but may be desirable. */ + MovedNetworkObjects = new NetworkObject[] { player.NetworkObject }, + //Load scenes as additive. + ReplaceScenes = ReplaceOption.None, + //Set the preferred active scene so the client changes active scenes. + PreferredActiveScene = new PreferredScene(lookupData), + }; + + base.SceneManager.LoadConnectionScenes(player.Owner, sld); + } + + private void OnTriggerExit(Collider other) + { + if (!base.IsServerStarted) + return; + + Player player = GetPlayerOwnedObject(other); + if (player == null) + return; + + /* Create a lookup handle using this objects scene. + * This is one of many ways FishNet knows what scene to load + * for the clients. */ + SceneLookupData lookupData = new SceneLookupData(gameObject.scene); + /* Tell server to keep unused when unloading. This will keep + * the scene even if there are no connections. + * This varies from AutomaticallyUnload slightly; + * automatically unload will remove the scene on the server + * if there are no more connections, such as if players + * were to disconnect. But when manually telling a scene to + * unload you must tell the server to keep it even if unused, + * if that is your preference. */ + SceneUnloadData sud = new SceneUnloadData(lookupData) + { + Options = new UnloadOptions() + { + Mode = UnloadOptions.ServerUnloadMode.KeepUnused + } + }; + + base.SceneManager.UnloadConnectionScenes(player.Owner, sud); + } + + /// + /// Returns a Player script if the object is a player. + /// + /// + /// + private Player GetPlayerOwnedObject(Collider other) + { + /* When an object exits this trigger unload the level for the client. */ + Player player = other.GetComponent(); + //Not the player object. + if (player == null) + return null; + //No owner?? + if (!player.Owner.IsActive) + return null; + + return player; + } + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/LevelLoader.cs.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/LevelLoader.cs.meta new file mode 100644 index 0000000..70b4bb0 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/LevelLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 02e5160f1a9b4d047a6cbdb3f094a86d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Player.cs b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Player.cs new file mode 100644 index 0000000..dbfffe0 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Player.cs @@ -0,0 +1,82 @@ +using FishNet.Connection; +using FishNet.Object; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace FishNet.Demo.AdditiveScenes +{ + public class Player : NetworkBehaviour + { + + [SerializeField] + private Transform _ownerObjects; + [SerializeField] + private float _moveRate = 2f; + + private List _wayPoints = new List(); + private int _goalIndex; + private Vector3 _goalOffset; + + public override void OnStartServer() + { + _wayPoints = GameObject.FindObjectsOfType().ToList(); + /* Stagger spawn position slightly depending on player count. + * Also inverse direction so players cross each other when more + * than one. This is just demo fanciness. */ + if (base.ServerManager.Clients.Count % 2 == 0) + { + _goalOffset = new Vector3(-0.5f, 0f, 0f); + _wayPoints = _wayPoints.OrderBy(x => x.WaypointIndex).ToList(); + } + else + { + _goalOffset = new Vector3(0.5f, 0f, 0f); + _wayPoints = _wayPoints.OrderByDescending(x => x.WaypointIndex).ToList(); + } + + //Snap to current waypoint. + transform.position = _wayPoints[0].transform.position + _goalOffset; + //Set goal to next waypoint. + _goalIndex = 1; + } + + public override void OnOwnershipClient(NetworkConnection prevOwner) + { + _ownerObjects.gameObject.SetActive(base.IsOwner); + } + + private void Update() + { + //Not server or not setup. + if (!base.IsServerStarted) + return; + if (_wayPoints.Count == 0) + return; + if (_goalIndex >= _wayPoints.Count) + return; + + Vector3 posGoal = _wayPoints[_goalIndex].transform.position + _goalOffset; + transform.position = Vector3.MoveTowards(transform.position, posGoal, _moveRate * Time.deltaTime); + + Vector3 lookDirection = (posGoal - transform.position).normalized; + //Rotate to goal if there is a look direction. + if (lookDirection != Vector3.zero) + { + Quaternion rot = Quaternion.LookRotation((posGoal - transform.position).normalized, transform.up); + transform.rotation = Quaternion.RotateTowards(transform.rotation, rot, 270f * Time.deltaTime); + } + + //If at goal set next goal. + if (transform.position == posGoal) + { + _goalIndex++; + //Reset index to 0 if at last goal. + if (_goalIndex >= _wayPoints.Count) + _goalIndex = 0; + } + } + + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Player.cs.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Player.cs.meta new file mode 100644 index 0000000..9f75ceb --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Player.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8541d1cca4da7043b84a0d563939dea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/ServerScenePrewarmer.cs b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/ServerScenePrewarmer.cs new file mode 100644 index 0000000..46ba430 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/ServerScenePrewarmer.cs @@ -0,0 +1,43 @@ +using FishNet.Managing.Scened; +using FishNet.Object; +using GameKit.Dependencies.Utilities.Types; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace FishNet.Demo.AdditiveScenes +{ + + public class ServerScenePrewarmer : NetworkBehaviour + { + [SerializeField, Scene] + private string[] _scenes = new string[0]; + + public override void OnStartServer() + { + /* Load all the needed scenes at once. + * This is not really required in most situations + * but the server uses waypoints from each scene + * to move the players. The waypoints won't exist unless + * all scenes do. This can be seen in the Player + * script. */ + + /* Load scenes using the FishNet SceneManager, with automaticallyUnload + * as false. This will keep the scenes from unloading when a client + * disconnects or leaves the scene. */ + foreach (string item in _scenes) + { + SceneLookupData lookupData = new SceneLookupData(item); + SceneLoadData sld = new SceneLoadData(lookupData) + { + Options = new LoadOptions + { + AutomaticallyUnload = false + }, + }; + + base.SceneManager.LoadConnectionScenes(sld); + } + } + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/ServerScenePrewarmer.cs.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/ServerScenePrewarmer.cs.meta new file mode 100644 index 0000000..29a10f2 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/ServerScenePrewarmer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b06d5bb8c7e0da04581df0b9454b81b7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Waypoint.cs b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Waypoint.cs new file mode 100644 index 0000000..376fba3 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Waypoint.cs @@ -0,0 +1,11 @@ +using UnityEngine; + +namespace FishNet.Demo.AdditiveScenes +{ + + public class Waypoint : MonoBehaviour + { + public byte WaypointIndex; + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Waypoint.cs.meta b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Waypoint.cs.meta new file mode 100644 index 0000000..9827578 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/Additive Scenes/Scripts/Waypoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70028e1b1708627408637ab9a3cd6bd4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SceneManager/SceneManager Event Diagram.png b/Assets/FishNet/Demos/SceneManager/SceneManager Event Diagram.png new file mode 100644 index 0000000..de8858b Binary files /dev/null and b/Assets/FishNet/Demos/SceneManager/SceneManager Event Diagram.png differ diff --git a/Assets/FishNet/Demos/SceneManager/SceneManager Event Diagram.png.meta b/Assets/FishNet/Demos/SceneManager/SceneManager Event Diagram.png.meta new file mode 100644 index 0000000..33e28f3 --- /dev/null +++ b/Assets/FishNet/Demos/SceneManager/SceneManager Event Diagram.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: f2231de60d345664cb1831a2e2ebe776 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Scripts.meta b/Assets/FishNet/Demos/Scripts.meta new file mode 100644 index 0000000..8a219e2 --- /dev/null +++ b/Assets/FishNet/Demos/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b8aa3d7aa8ea4b04b8c6bf02a715a645 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/Scripts/NetworkHudCanvases.cs b/Assets/FishNet/Demos/Scripts/NetworkHudCanvases.cs new file mode 100644 index 0000000..5398d02 --- /dev/null +++ b/Assets/FishNet/Demos/Scripts/NetworkHudCanvases.cs @@ -0,0 +1,253 @@ +using FishNet.Managing; +using FishNet.Transporting; +using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.UI; + +namespace FishNet.Example +{ + + public class NetworkHudCanvases : MonoBehaviour + { + #region Types. + /// + /// Ways the HUD will automatically start a connection. + /// + private enum AutoStartType + { + Disabled, + Host, + Server, + Client + } + #endregion + + #region Serialized. + /// + /// What connections to automatically start on play. + /// + [Tooltip("What connections to automatically start on play.")] + [SerializeField] + private AutoStartType _autoStartType = AutoStartType.Disabled; + /// + /// Color when socket is stopped. + /// + [Tooltip("Color when socket is stopped.")] + [SerializeField] + private Color _stoppedColor; + /// + /// Color when socket is changing. + /// + [Tooltip("Color when socket is changing.")] + [SerializeField] + private Color _changingColor; + /// + /// Color when socket is started. + /// + [Tooltip("Color when socket is started.")] + [SerializeField] + private Color _startedColor; + [Header("Indicators")] + /// + /// Indicator for server state. + /// + [Tooltip("Indicator for server state.")] + [SerializeField] + private Image _serverIndicator; + /// + /// Indicator for client state. + /// + [Tooltip("Indicator for client state.")] + [SerializeField] + private Image _clientIndicator; + #endregion + + #region Private. + /// + /// Found NetworkManager. + /// + private NetworkManager _networkManager; + /// + /// Current state of client socket. + /// + private LocalConnectionState _clientState = LocalConnectionState.Stopped; + /// + /// Current state of server socket. + /// + private LocalConnectionState _serverState = LocalConnectionState.Stopped; +#if !ENABLE_INPUT_SYSTEM + /// + /// EventSystem for the project. + /// + private EventSystem _eventSystem; +#endif + #endregion + + void OnGUI() + { +#if ENABLE_INPUT_SYSTEM + string GetNextStateText(LocalConnectionState state) + { + if (state == LocalConnectionState.Stopped) + return "Start"; + else if (state == LocalConnectionState.Starting) + return "Starting"; + else if (state == LocalConnectionState.Stopping) + return "Stopping"; + else if (state == LocalConnectionState.Started) + return "Stop"; + else + return "Invalid"; + } + + GUILayout.BeginArea(new Rect(16, 16, 256, 9000)); + Vector2 defaultResolution = new Vector2(1920f, 1080f); + GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(Screen.width / defaultResolution.x, Screen.height / defaultResolution.y, 1)); + + GUIStyle style = GUI.skin.GetStyle("button"); + int originalFontSize = style.fontSize; + + Vector2 buttonSize = new Vector2(256f, 64f); + style.fontSize = 28; + //Server button. + if (Application.platform != RuntimePlatform.WebGLPlayer) + { + if (GUILayout.Button($"{GetNextStateText(_serverState)} Server", GUILayout.Width(buttonSize.x), GUILayout.Height(buttonSize.y))) + OnClick_Server(); + GUILayout.Space(10f); + } + + //Client button. + if (GUILayout.Button($"{GetNextStateText(_clientState)} Client", GUILayout.Width(buttonSize.x), GUILayout.Height(buttonSize.y))) + OnClick_Client(); + + style.fontSize = originalFontSize; + + GUILayout.EndArea(); +#endif + } + + private void Start() + { +#if !ENABLE_INPUT_SYSTEM + SetEventSystem(); + BaseInputModule inputModule = FindObjectOfType(); + if (inputModule == null) + gameObject.AddComponent(); +#else + _serverIndicator.transform.parent.gameObject.SetActive(false); + _clientIndicator.transform.parent.gameObject.SetActive(false); +#endif + + _networkManager = FindObjectOfType(); + if (_networkManager == null) + { + Debug.LogError("NetworkManager not found, HUD will not function."); + return; + } + else + { + UpdateColor(LocalConnectionState.Stopped, ref _serverIndicator); + UpdateColor(LocalConnectionState.Stopped, ref _clientIndicator); + _networkManager.ServerManager.OnServerConnectionState += ServerManager_OnServerConnectionState; + _networkManager.ClientManager.OnClientConnectionState += ClientManager_OnClientConnectionState; + } + + if (_autoStartType == AutoStartType.Host || _autoStartType == AutoStartType.Server) + OnClick_Server(); + if (!Application.isBatchMode && (_autoStartType == AutoStartType.Host || _autoStartType == AutoStartType.Client)) + OnClick_Client(); + } + + + private void OnDestroy() + { + if (_networkManager == null) + return; + + _networkManager.ServerManager.OnServerConnectionState -= ServerManager_OnServerConnectionState; + _networkManager.ClientManager.OnClientConnectionState -= ClientManager_OnClientConnectionState; + } + + /// + /// Updates img color baased on state. + /// + /// + /// + private void UpdateColor(LocalConnectionState state, ref Image img) + { + Color c; + if (state == LocalConnectionState.Started) + c = _startedColor; + else if (state == LocalConnectionState.Stopped) + c = _stoppedColor; + else + c = _changingColor; + + img.color = c; + } + + + private void ClientManager_OnClientConnectionState(ClientConnectionStateArgs obj) + { + _clientState = obj.ConnectionState; + UpdateColor(obj.ConnectionState, ref _clientIndicator); + } + + + private void ServerManager_OnServerConnectionState(ServerConnectionStateArgs obj) + { + _serverState = obj.ConnectionState; + UpdateColor(obj.ConnectionState, ref _serverIndicator); + } + + + public void OnClick_Server() + { + if (_networkManager == null) + return; + + if (_serverState != LocalConnectionState.Stopped) + _networkManager.ServerManager.StopConnection(true); + else + _networkManager.ServerManager.StartConnection(); + + DeselectButtons(); + } + + + public void OnClick_Client() + { + if (_networkManager == null) + return; + + if (_clientState != LocalConnectionState.Stopped) + _networkManager.ClientManager.StopConnection(); + else + _networkManager.ClientManager.StartConnection(); + + DeselectButtons(); + } + + + private void SetEventSystem() + { +#if !ENABLE_INPUT_SYSTEM + if (_eventSystem != null) + return; + _eventSystem = FindObjectOfType(); + if (_eventSystem == null) + _eventSystem = gameObject.AddComponent(); +#endif + } + + private void DeselectButtons() + { +#if !ENABLE_INPUT_SYSTEM + SetEventSystem(); + _eventSystem?.SetSelectedGameObject(null); +#endif + } + } + +} \ No newline at end of file diff --git a/Assets/FishNet/Demos/Scripts/NetworkHudCanvases.cs.meta b/Assets/FishNet/Demos/Scripts/NetworkHudCanvases.cs.meta new file mode 100644 index 0000000..e2e25fb --- /dev/null +++ b/Assets/FishNet/Demos/Scripts/NetworkHudCanvases.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d3606bfdac5a4743890fc1a5ecd8f24 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Demos/SpringBoard.prefab b/Assets/FishNet/Demos/SpringBoard.prefab new file mode 100644 index 0000000..fd33fdf --- /dev/null +++ b/Assets/FishNet/Demos/SpringBoard.prefab @@ -0,0 +1,194 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4811354048061266877 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4811354048061266878} + m_Layer: 0 + m_Name: SpringBoard + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4811354048061266878 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4811354048061266877} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -1.29, z: 10.07} + m_LocalScale: {x: 2, y: 1, z: 2} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4811354048062409393} + - {fileID: 4811354048409877186} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &4811354048062409392 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4811354048062409393} + - component: {fileID: 4811354048062409395} + - component: {fileID: 4811354048062409394} + - component: {fileID: 4811354048062409397} + - component: {fileID: 4811354048062409396} + m_Layer: 0 + m_Name: Platfrom + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4811354048062409393 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4811354048062409392} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.16999996, z: 0.029999733} + m_LocalScale: {x: 2.5, y: 0.1, z: 2.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4811354048061266878} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4811354048062409395 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4811354048062409392} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4811354048062409394 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4811354048062409392} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &4811354048062409397 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4811354048062409392} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 026366ce57064ab429b976f32c179b40, type: 3} + m_Name: + m_EditorClassIdentifier: + _componentIndexCache: 0 + _addedNetworkObject: {fileID: 0} + _networkObjectCache: {fileID: 0} + Force: 20 +--- !u!65 &4811354048062409396 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4811354048062409392} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.95, y: 1, z: 0.95} + m_Center: {x: 0, y: 0.8, z: 0} +--- !u!1 &4811354048409877185 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4811354048409877186} + - component: {fileID: 4811354048409877187} + m_Layer: 0 + m_Name: Blocker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4811354048409877186 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4811354048409877185} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.16999996, z: 0.029999733} + m_LocalScale: {x: 2.5, y: 0.1, z: 2.5} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4811354048061266878} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &4811354048409877187 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4811354048409877185} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/FishNet/Demos/SpringBoard.prefab.meta b/Assets/FishNet/Demos/SpringBoard.prefab.meta new file mode 100644 index 0000000..e849156 --- /dev/null +++ b/Assets/FishNet/Demos/SpringBoard.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b6c2b81b925937240b27f551bf41812c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/LICENSE.txt b/Assets/FishNet/LICENSE.txt new file mode 100644 index 0000000..644ab32 --- /dev/null +++ b/Assets/FishNet/LICENSE.txt @@ -0,0 +1,27 @@ +0.0 Definitions. + +0.1 "Fish-Net" means FishNet, FishNetworking, Fish-Networking, networking for Unity Engine. + +0.2 "Repository Service" means the respository service through which Fish-Net is made available. + +0.3 “Software” means the software (including code in source or object format as applicable) of Fish-Net that accompanies this License. + +0.4 "FirstGearGames" means Benjamin Berwick. + +1.0 License Grant to the Software. FirstGearGames grants to you a worldwide, non-exclusive, no-charge, and royalty-free license to reproduce, modify, and use the Software for developed game, or other content with Software. + +1.1 Exclusions. Other products of like Software (explicitly networking solutions) may not use, reverse engineer, or implement Software in part or full. Other products not of like Software, such as add-ons, tools, or assets may include, or be created for Software in it's original, unmodified form. + +1.2 Exclusions do not apply to parts of Software which are governed by a third-party license, nor to games developed with Software. + +2.0 Third-Party License Notice. Software may contain third-party licenses. If the Software is accompanied by a “third-party notices” or similar file, you acknowledge and agree that software identified in that file is governed exclusively by those separate license terms. + +3.0 Termination. This License will terminate immediately (i) on any breach by you of this License; and (ii) if you commence any form of patent litigation, including a cross-claim or counterclaim, against anyone wherein you allege that the Software constitutes direct or secondary/indirect patent infringement. + +4.0 Governing Law and Venue. This License is governed by and construed in accordance with the laws of North Carolina, United States. You and FirstGearGames agree to submit to the personal and exclusive jurisdiction of and venue in the state and federal courts located in Onslow County, North Carolina concerning any dispute arising out of this License (“Dispute”). + +5.0 Disclaimer, Limitation of Liability. Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in action of contract, tort or otherwise, arising from, out of or in connection with Software or the use or other dealings in Software. + +6.0 You agree by submitting content of any kind to Software within Repository Service does not grant you ownership to Software nor additional rights to Software. + +6.1 By submitting to Repository Service you are granting FirstGearGames with a no-charge, and royalty-free license to reproduce, modify, and use submitted content. diff --git a/Assets/FishNet/LICENSE.txt.meta b/Assets/FishNet/LICENSE.txt.meta new file mode 100644 index 0000000..5ba5b4f --- /dev/null +++ b/Assets/FishNet/LICENSE.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 83c5a6d0014103d48a0028f0ab7fec8d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins.meta b/Assets/FishNet/Plugins.meta new file mode 100644 index 0000000..ab88963 --- /dev/null +++ b/Assets/FishNet/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1efd6a2198a30b44c98e7a6e48bc92b6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap.meta b/Assets/FishNet/Plugins/Edgegap.meta new file mode 100644 index 0000000..a7ac9d9 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aef768f63d4c3c04ab05dfd075406513 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Dependencies.meta b/Assets/FishNet/Plugins/Edgegap/Dependencies.meta new file mode 100644 index 0000000..1a9b918 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Dependencies.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 14024ce6d2e64d5ba58ab20409ac648f +timeCreated: 1701785018 \ No newline at end of file diff --git a/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpEncoder.cs b/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpEncoder.cs new file mode 100644 index 0000000..6c4b15d --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpEncoder.cs @@ -0,0 +1,704 @@ +// MIRROR CHANGE: drop in Codice.Utils HttpUtility subset to not depend on Unity's plastic scm package +// SOURCE: Unity Plastic SCM package + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Text; + +namespace Edgegap.Codice.Utils // MIRROR CHANGE: namespace Edgegap.* to not collide if anyone has Plastic SCM installed already +{ + public class HttpEncoder + { + private static char[] hexChars = "0123456789abcdef".ToCharArray(); + private static object entitiesLock = new object(); + private static SortedDictionary entities; + private static HttpEncoder defaultEncoder = new HttpEncoder(); + private static HttpEncoder currentEncoder = HttpEncoder.defaultEncoder; + + private static IDictionary Entities + { + get + { + lock (HttpEncoder.entitiesLock) + { + if (HttpEncoder.entities == null) + HttpEncoder.InitEntities(); + return (IDictionary) HttpEncoder.entities; + } + } + } + + public static HttpEncoder Current + { + get => HttpEncoder.currentEncoder; + set => HttpEncoder.currentEncoder = value != null ? value : throw new ArgumentNullException(nameof (value)); + } + + public static HttpEncoder Default => HttpEncoder.defaultEncoder; + + protected internal virtual void HeaderNameValueEncode( + string headerName, + string headerValue, + out string encodedHeaderName, + out string encodedHeaderValue) + { + encodedHeaderName = !string.IsNullOrEmpty(headerName) ? HttpEncoder.EncodeHeaderString(headerName) : headerName; + if (string.IsNullOrEmpty(headerValue)) + encodedHeaderValue = headerValue; + else + encodedHeaderValue = HttpEncoder.EncodeHeaderString(headerValue); + } + + private static void StringBuilderAppend(string s, ref StringBuilder sb) + { + if (sb == null) + sb = new StringBuilder(s); + else + sb.Append(s); + } + + private static string EncodeHeaderString(string input) + { + StringBuilder sb = (StringBuilder) null; + for (int index = 0; index < input.Length; ++index) + { + char ch = input[index]; + if (ch < ' ' && ch != '\t' || ch == '\u007F') + HttpEncoder.StringBuilderAppend(string.Format("%{0:x2}", (object) (int) ch), ref sb); + } + return sb != null ? sb.ToString() : input; + } + + protected internal virtual void HtmlAttributeEncode(string value, TextWriter output) + { + if (output == null) + throw new ArgumentNullException(nameof (output)); + if (string.IsNullOrEmpty(value)) + return; + output.Write(HttpEncoder.HtmlAttributeEncode(value)); + } + + protected internal virtual void HtmlDecode(string value, TextWriter output) + { + if (output == null) + throw new ArgumentNullException(nameof (output)); + output.Write(HttpEncoder.HtmlDecode(value)); + } + + protected internal virtual void HtmlEncode(string value, TextWriter output) + { + if (output == null) + throw new ArgumentNullException(nameof (output)); + output.Write(HttpEncoder.HtmlEncode(value)); + } + + protected internal virtual byte[] UrlEncode(byte[] bytes, int offset, int count) => HttpEncoder.UrlEncodeToBytes(bytes, offset, count); + + protected internal virtual string UrlPathEncode(string value) + { + if (string.IsNullOrEmpty(value)) + return value; + MemoryStream result = new MemoryStream(); + int length = value.Length; + for (int index = 0; index < length; ++index) + HttpEncoder.UrlPathEncodeChar(value[index], (Stream) result); + return Encoding.ASCII.GetString(result.ToArray()); + } + + internal static byte[] UrlEncodeToBytes(byte[] bytes, int offset, int count) + { + int num1 = bytes != null ? bytes.Length : throw new ArgumentNullException(nameof (bytes)); + if (num1 == 0) + return new byte[0]; + if (offset < 0 || offset >= num1) + throw new ArgumentOutOfRangeException(nameof (offset)); + if (count < 0 || count > num1 - offset) + throw new ArgumentOutOfRangeException(nameof (count)); + MemoryStream result = new MemoryStream(count); + int num2 = offset + count; + for (int index = offset; index < num2; ++index) + HttpEncoder.UrlEncodeChar((char) bytes[index], (Stream) result, false); + return result.ToArray(); + } + + internal static string HtmlEncode(string s) + { + switch (s) + { + case "": + return string.Empty; + case null: + return (string) null; + default: + bool flag = false; + for (int index = 0; index < s.Length; ++index) + { + char ch = s[index]; + if (ch == '&' || ch == '"' || ch == '<' || ch == '>' || ch > '\u009F' || ch == '\'') + { + flag = true; + break; + } + } + if (!flag) + return s; + StringBuilder stringBuilder = new StringBuilder(); + int length = s.Length; + for (int index = 0; index < length; ++index) + { + char ch = s[index]; + switch (ch) + { + case '"': + stringBuilder.Append("""); + break; + case '&': + stringBuilder.Append("&"); + break; + case '\'': + stringBuilder.Append("'"); + break; + case '<': + stringBuilder.Append("<"); + break; + case '>': + stringBuilder.Append(">"); + break; + case '<': + stringBuilder.Append("<"); + break; + case '>': + stringBuilder.Append(">"); + break; + default: + if (ch > '\u009F' && ch < 'Ā') + { + stringBuilder.Append("&#"); + stringBuilder.Append(((int) ch).ToString((IFormatProvider) CultureInfo.InvariantCulture)); + stringBuilder.Append(";"); + break; + } + stringBuilder.Append(ch); + break; + } + } + return stringBuilder.ToString(); + } + } + + internal static string HtmlAttributeEncode(string s) + { + if (string.IsNullOrEmpty(s)) + return string.Empty; + bool flag = false; + for (int index = 0; index < s.Length; ++index) + { + char ch = s[index]; + int num; + switch (ch) + { + case '"': + case '&': + case '<': + num = 0; + break; + default: + num = ch != '\'' ? 1 : 0; + break; + } + if (num == 0) + { + flag = true; + break; + } + } + if (!flag) + return s; + StringBuilder stringBuilder = new StringBuilder(); + int length = s.Length; + for (int index = 0; index < length; ++index) + { + char ch = s[index]; + switch (ch) + { + case '"': + stringBuilder.Append("""); + break; + case '&': + stringBuilder.Append("&"); + break; + case '\'': + stringBuilder.Append("'"); + break; + case '<': + stringBuilder.Append("<"); + break; + default: + stringBuilder.Append(ch); + break; + } + } + return stringBuilder.ToString(); + } + + internal static string HtmlDecode(string s) + { + switch (s) + { + case "": + return string.Empty; + case null: + return (string) null; + default: + if (s.IndexOf('&') == -1) + return s; + StringBuilder stringBuilder1 = new StringBuilder(); + StringBuilder stringBuilder2 = new StringBuilder(); + StringBuilder stringBuilder3 = new StringBuilder(); + int length = s.Length; + int num1 = 0; + int num2 = 0; + bool flag1 = false; + bool flag2 = false; + for (int index = 0; index < length; ++index) + { + char ch = s[index]; + if (num1 == 0) + { + if (ch == '&') + { + stringBuilder2.Append(ch); + stringBuilder1.Append(ch); + num1 = 1; + } + else + stringBuilder3.Append(ch); + } + else if (ch == '&') + { + num1 = 1; + if (flag2) + { + stringBuilder2.Append(num2.ToString((IFormatProvider) CultureInfo.InvariantCulture)); + flag2 = false; + } + stringBuilder3.Append(stringBuilder2.ToString()); + stringBuilder2.Length = 0; + stringBuilder2.Append('&'); + } + else + { + switch (num1) + { + case 1: + if (ch == ';') + { + num1 = 0; + stringBuilder3.Append(stringBuilder2.ToString()); + stringBuilder3.Append(ch); + stringBuilder2.Length = 0; + break; + } + num2 = 0; + flag1 = false; + num1 = ch == '#' ? 3 : 2; + stringBuilder2.Append(ch); + stringBuilder1.Append(ch); + break; + case 2: + stringBuilder2.Append(ch); + if (ch == ';') + { + string str = stringBuilder2.ToString(); + if (str.Length > 1 && HttpEncoder.Entities.ContainsKey(str.Substring(1, str.Length - 2))) + str = HttpEncoder.Entities[str.Substring(1, str.Length - 2)].ToString(); + stringBuilder3.Append(str); + num1 = 0; + stringBuilder2.Length = 0; + stringBuilder1.Length = 0; + break; + } + break; + case 3: + if (ch == ';') + { + if (num2 == 0) + stringBuilder3.Append(stringBuilder1.ToString() + ";"); + else if (num2 > (int) ushort.MaxValue) + { + stringBuilder3.Append("&#"); + stringBuilder3.Append(num2.ToString((IFormatProvider) CultureInfo.InvariantCulture)); + stringBuilder3.Append(";"); + } + else + stringBuilder3.Append((char) num2); + num1 = 0; + stringBuilder2.Length = 0; + stringBuilder1.Length = 0; + flag2 = false; + } + else if (flag1 && Uri.IsHexDigit(ch)) + { + num2 = num2 * 16 + Uri.FromHex(ch); + flag2 = true; + stringBuilder1.Append(ch); + } + else if (char.IsDigit(ch)) + { + num2 = num2 * 10 + ((int) ch - 48); + flag2 = true; + stringBuilder1.Append(ch); + } + else if (num2 == 0 && (ch == 'x' || ch == 'X')) + { + flag1 = true; + stringBuilder1.Append(ch); + } + else + { + num1 = 2; + if (flag2) + { + stringBuilder2.Append(num2.ToString((IFormatProvider) CultureInfo.InvariantCulture)); + flag2 = false; + } + stringBuilder2.Append(ch); + } + break; + } + } + } + if (stringBuilder2.Length > 0) + stringBuilder3.Append(stringBuilder2.ToString()); + else if (flag2) + stringBuilder3.Append(num2.ToString((IFormatProvider) CultureInfo.InvariantCulture)); + return stringBuilder3.ToString(); + } + } + + internal static bool NotEncoded(char c) => c == '!' || c == '(' || c == ')' || c == '*' || c == '-' || c == '.' || c == '_'; + + internal static void UrlEncodeChar(char c, Stream result, bool isUnicode) + { + if (c > 'ÿ') + { + int num = (int) c; + result.WriteByte((byte) 37); + result.WriteByte((byte) 117); + int index1 = num >> 12; + result.WriteByte((byte) HttpEncoder.hexChars[index1]); + int index2 = num >> 8 & 15; + result.WriteByte((byte) HttpEncoder.hexChars[index2]); + int index3 = num >> 4 & 15; + result.WriteByte((byte) HttpEncoder.hexChars[index3]); + int index4 = num & 15; + result.WriteByte((byte) HttpEncoder.hexChars[index4]); + } + else if (c > ' ' && HttpEncoder.NotEncoded(c)) + result.WriteByte((byte) c); + else if (c == ' ') + result.WriteByte((byte) 43); + else if (c < '0' || c < 'A' && c > '9' || c > 'Z' && c < 'a' || c > 'z') + { + if (isUnicode && c > '\u007F') + { + result.WriteByte((byte) 37); + result.WriteByte((byte) 117); + result.WriteByte((byte) 48); + result.WriteByte((byte) 48); + } + else + result.WriteByte((byte) 37); + int index5 = (int) c >> 4; + result.WriteByte((byte) HttpEncoder.hexChars[index5]); + int index6 = (int) c & 15; + result.WriteByte((byte) HttpEncoder.hexChars[index6]); + } + else + result.WriteByte((byte) c); + } + + internal static void UrlPathEncodeChar(char c, Stream result) + { + if (c < '!' || c > '~') + { + byte[] bytes = Encoding.UTF8.GetBytes(c.ToString()); + for (int index1 = 0; index1 < bytes.Length; ++index1) + { + result.WriteByte((byte) 37); + int index2 = (int) bytes[index1] >> 4; + result.WriteByte((byte) HttpEncoder.hexChars[index2]); + int index3 = (int) bytes[index1] & 15; + result.WriteByte((byte) HttpEncoder.hexChars[index3]); + } + } + else if (c == ' ') + { + result.WriteByte((byte) 37); + result.WriteByte((byte) 50); + result.WriteByte((byte) 48); + } + else + result.WriteByte((byte) c); + } + + private static void InitEntities() + { + HttpEncoder.entities = new SortedDictionary((IComparer) StringComparer.Ordinal); + HttpEncoder.entities.Add("nbsp", ' '); + HttpEncoder.entities.Add("iexcl", '¡'); + HttpEncoder.entities.Add("cent", '¢'); + HttpEncoder.entities.Add("pound", '£'); + HttpEncoder.entities.Add("curren", '¤'); + HttpEncoder.entities.Add("yen", '¥'); + HttpEncoder.entities.Add("brvbar", '¦'); + HttpEncoder.entities.Add("sect", '§'); + HttpEncoder.entities.Add("uml", '¨'); + HttpEncoder.entities.Add("copy", '©'); + HttpEncoder.entities.Add("ordf", 'ª'); + HttpEncoder.entities.Add("laquo", '«'); + HttpEncoder.entities.Add("not", '¬'); + HttpEncoder.entities.Add("shy", '\u00AD'); + HttpEncoder.entities.Add("reg", '®'); + HttpEncoder.entities.Add("macr", '¯'); + HttpEncoder.entities.Add("deg", '°'); + HttpEncoder.entities.Add("plusmn", '±'); + HttpEncoder.entities.Add("sup2", '\u00B2'); + HttpEncoder.entities.Add("sup3", '\u00B3'); + HttpEncoder.entities.Add("acute", '´'); + HttpEncoder.entities.Add("micro", 'µ'); + HttpEncoder.entities.Add("para", '¶'); + HttpEncoder.entities.Add("middot", '·'); + HttpEncoder.entities.Add("cedil", '¸'); + HttpEncoder.entities.Add("sup1", '\u00B9'); + HttpEncoder.entities.Add("ordm", 'º'); + HttpEncoder.entities.Add("raquo", '»'); + HttpEncoder.entities.Add("frac14", '\u00BC'); + HttpEncoder.entities.Add("frac12", '\u00BD'); + HttpEncoder.entities.Add("frac34", '\u00BE'); + HttpEncoder.entities.Add("iquest", '¿'); + HttpEncoder.entities.Add("Agrave", 'À'); + HttpEncoder.entities.Add("Aacute", 'Á'); + HttpEncoder.entities.Add("Acirc", 'Â'); + HttpEncoder.entities.Add("Atilde", 'Ã'); + HttpEncoder.entities.Add("Auml", 'Ä'); + HttpEncoder.entities.Add("Aring", 'Å'); + HttpEncoder.entities.Add("AElig", 'Æ'); + HttpEncoder.entities.Add("Ccedil", 'Ç'); + HttpEncoder.entities.Add("Egrave", 'È'); + HttpEncoder.entities.Add("Eacute", 'É'); + HttpEncoder.entities.Add("Ecirc", 'Ê'); + HttpEncoder.entities.Add("Euml", 'Ë'); + HttpEncoder.entities.Add("Igrave", 'Ì'); + HttpEncoder.entities.Add("Iacute", 'Í'); + HttpEncoder.entities.Add("Icirc", 'Î'); + HttpEncoder.entities.Add("Iuml", 'Ï'); + HttpEncoder.entities.Add("ETH", 'Ð'); + HttpEncoder.entities.Add("Ntilde", 'Ñ'); + HttpEncoder.entities.Add("Ograve", 'Ò'); + HttpEncoder.entities.Add("Oacute", 'Ó'); + HttpEncoder.entities.Add("Ocirc", 'Ô'); + HttpEncoder.entities.Add("Otilde", 'Õ'); + HttpEncoder.entities.Add("Ouml", 'Ö'); + HttpEncoder.entities.Add("times", '×'); + HttpEncoder.entities.Add("Oslash", 'Ø'); + HttpEncoder.entities.Add("Ugrave", 'Ù'); + HttpEncoder.entities.Add("Uacute", 'Ú'); + HttpEncoder.entities.Add("Ucirc", 'Û'); + HttpEncoder.entities.Add("Uuml", 'Ü'); + HttpEncoder.entities.Add("Yacute", 'Ý'); + HttpEncoder.entities.Add("THORN", 'Þ'); + HttpEncoder.entities.Add("szlig", 'ß'); + HttpEncoder.entities.Add("agrave", 'à'); + HttpEncoder.entities.Add("aacute", 'á'); + HttpEncoder.entities.Add("acirc", 'â'); + HttpEncoder.entities.Add("atilde", 'ã'); + HttpEncoder.entities.Add("auml", 'ä'); + HttpEncoder.entities.Add("aring", 'å'); + HttpEncoder.entities.Add("aelig", 'æ'); + HttpEncoder.entities.Add("ccedil", 'ç'); + HttpEncoder.entities.Add("egrave", 'è'); + HttpEncoder.entities.Add("eacute", 'é'); + HttpEncoder.entities.Add("ecirc", 'ê'); + HttpEncoder.entities.Add("euml", 'ë'); + HttpEncoder.entities.Add("igrave", 'ì'); + HttpEncoder.entities.Add("iacute", 'í'); + HttpEncoder.entities.Add("icirc", 'î'); + HttpEncoder.entities.Add("iuml", 'ï'); + HttpEncoder.entities.Add("eth", 'ð'); + HttpEncoder.entities.Add("ntilde", 'ñ'); + HttpEncoder.entities.Add("ograve", 'ò'); + HttpEncoder.entities.Add("oacute", 'ó'); + HttpEncoder.entities.Add("ocirc", 'ô'); + HttpEncoder.entities.Add("otilde", 'õ'); + HttpEncoder.entities.Add("ouml", 'ö'); + HttpEncoder.entities.Add("divide", '÷'); + HttpEncoder.entities.Add("oslash", 'ø'); + HttpEncoder.entities.Add("ugrave", 'ù'); + HttpEncoder.entities.Add("uacute", 'ú'); + HttpEncoder.entities.Add("ucirc", 'û'); + HttpEncoder.entities.Add("uuml", 'ü'); + HttpEncoder.entities.Add("yacute", 'ý'); + HttpEncoder.entities.Add("thorn", 'þ'); + HttpEncoder.entities.Add("yuml", 'ÿ'); + HttpEncoder.entities.Add("fnof", 'ƒ'); + HttpEncoder.entities.Add("Alpha", 'Α'); + HttpEncoder.entities.Add("Beta", 'Β'); + HttpEncoder.entities.Add("Gamma", 'Γ'); + HttpEncoder.entities.Add("Delta", 'Δ'); + HttpEncoder.entities.Add("Epsilon", 'Ε'); + HttpEncoder.entities.Add("Zeta", 'Ζ'); + HttpEncoder.entities.Add("Eta", 'Η'); + HttpEncoder.entities.Add("Theta", 'Θ'); + HttpEncoder.entities.Add("Iota", 'Ι'); + HttpEncoder.entities.Add("Kappa", 'Κ'); + HttpEncoder.entities.Add("Lambda", 'Λ'); + HttpEncoder.entities.Add("Mu", 'Μ'); + HttpEncoder.entities.Add("Nu", 'Ν'); + HttpEncoder.entities.Add("Xi", 'Ξ'); + HttpEncoder.entities.Add("Omicron", 'Ο'); + HttpEncoder.entities.Add("Pi", 'Π'); + HttpEncoder.entities.Add("Rho", 'Ρ'); + HttpEncoder.entities.Add("Sigma", 'Σ'); + HttpEncoder.entities.Add("Tau", 'Τ'); + HttpEncoder.entities.Add("Upsilon", 'Υ'); + HttpEncoder.entities.Add("Phi", 'Φ'); + HttpEncoder.entities.Add("Chi", 'Χ'); + HttpEncoder.entities.Add("Psi", 'Ψ'); + HttpEncoder.entities.Add("Omega", 'Ω'); + HttpEncoder.entities.Add("alpha", 'α'); + HttpEncoder.entities.Add("beta", 'β'); + HttpEncoder.entities.Add("gamma", 'γ'); + HttpEncoder.entities.Add("delta", 'δ'); + HttpEncoder.entities.Add("epsilon", 'ε'); + HttpEncoder.entities.Add("zeta", 'ζ'); + HttpEncoder.entities.Add("eta", 'η'); + HttpEncoder.entities.Add("theta", 'θ'); + HttpEncoder.entities.Add("iota", 'ι'); + HttpEncoder.entities.Add("kappa", 'κ'); + HttpEncoder.entities.Add("lambda", 'λ'); + HttpEncoder.entities.Add("mu", 'μ'); + HttpEncoder.entities.Add("nu", 'ν'); + HttpEncoder.entities.Add("xi", 'ξ'); + HttpEncoder.entities.Add("omicron", 'ο'); + HttpEncoder.entities.Add("pi", 'π'); + HttpEncoder.entities.Add("rho", 'ρ'); + HttpEncoder.entities.Add("sigmaf", 'ς'); + HttpEncoder.entities.Add("sigma", 'σ'); + HttpEncoder.entities.Add("tau", 'τ'); + HttpEncoder.entities.Add("upsilon", 'υ'); + HttpEncoder.entities.Add("phi", 'φ'); + HttpEncoder.entities.Add("chi", 'χ'); + HttpEncoder.entities.Add("psi", 'ψ'); + HttpEncoder.entities.Add("omega", 'ω'); + HttpEncoder.entities.Add("thetasym", 'ϑ'); + HttpEncoder.entities.Add("upsih", 'ϒ'); + HttpEncoder.entities.Add("piv", 'ϖ'); + HttpEncoder.entities.Add("bull", '•'); + HttpEncoder.entities.Add("hellip", '…'); + HttpEncoder.entities.Add("prime", '′'); + HttpEncoder.entities.Add("Prime", '″'); + HttpEncoder.entities.Add("oline", '‾'); + HttpEncoder.entities.Add("frasl", '⁄'); + HttpEncoder.entities.Add("weierp", '℘'); + HttpEncoder.entities.Add("image", 'ℑ'); + HttpEncoder.entities.Add("real", 'ℜ'); + HttpEncoder.entities.Add("trade", '™'); + HttpEncoder.entities.Add("alefsym", 'ℵ'); + HttpEncoder.entities.Add("larr", '←'); + HttpEncoder.entities.Add("uarr", '↑'); + HttpEncoder.entities.Add("rarr", '→'); + HttpEncoder.entities.Add("darr", '↓'); + HttpEncoder.entities.Add("harr", '↔'); + HttpEncoder.entities.Add("crarr", '↵'); + HttpEncoder.entities.Add("lArr", '⇐'); + HttpEncoder.entities.Add("uArr", '⇑'); + HttpEncoder.entities.Add("rArr", '⇒'); + HttpEncoder.entities.Add("dArr", '⇓'); + HttpEncoder.entities.Add("hArr", '⇔'); + HttpEncoder.entities.Add("forall", '∀'); + HttpEncoder.entities.Add("part", '∂'); + HttpEncoder.entities.Add("exist", '∃'); + HttpEncoder.entities.Add("empty", '∅'); + HttpEncoder.entities.Add("nabla", '∇'); + HttpEncoder.entities.Add("isin", '∈'); + HttpEncoder.entities.Add("notin", '∉'); + HttpEncoder.entities.Add("ni", '∋'); + HttpEncoder.entities.Add("prod", '∏'); + HttpEncoder.entities.Add("sum", '∑'); + HttpEncoder.entities.Add("minus", '−'); + HttpEncoder.entities.Add("lowast", '∗'); + HttpEncoder.entities.Add("radic", '√'); + HttpEncoder.entities.Add("prop", '∝'); + HttpEncoder.entities.Add("infin", '∞'); + HttpEncoder.entities.Add("ang", '∠'); + HttpEncoder.entities.Add("and", '∧'); + HttpEncoder.entities.Add("or", '∨'); + HttpEncoder.entities.Add("cap", '∩'); + HttpEncoder.entities.Add("cup", '∪'); + HttpEncoder.entities.Add("int", '∫'); + HttpEncoder.entities.Add("there4", '∴'); + HttpEncoder.entities.Add("sim", '∼'); + HttpEncoder.entities.Add("cong", '≅'); + HttpEncoder.entities.Add("asymp", '≈'); + HttpEncoder.entities.Add("ne", '≠'); + HttpEncoder.entities.Add("equiv", '≡'); + HttpEncoder.entities.Add("le", '≤'); + HttpEncoder.entities.Add("ge", '≥'); + HttpEncoder.entities.Add("sub", '⊂'); + HttpEncoder.entities.Add("sup", '⊃'); + HttpEncoder.entities.Add("nsub", '⊄'); + HttpEncoder.entities.Add("sube", '⊆'); + HttpEncoder.entities.Add("supe", '⊇'); + HttpEncoder.entities.Add("oplus", '⊕'); + HttpEncoder.entities.Add("otimes", '⊗'); + HttpEncoder.entities.Add("perp", '⊥'); + HttpEncoder.entities.Add("sdot", '⋅'); + HttpEncoder.entities.Add("lceil", '⌈'); + HttpEncoder.entities.Add("rceil", '⌉'); + HttpEncoder.entities.Add("lfloor", '⌊'); + HttpEncoder.entities.Add("rfloor", '⌋'); + HttpEncoder.entities.Add("lang", '〈'); + HttpEncoder.entities.Add("rang", '〉'); + HttpEncoder.entities.Add("loz", '◊'); + HttpEncoder.entities.Add("spades", '♠'); + HttpEncoder.entities.Add("clubs", '♣'); + HttpEncoder.entities.Add("hearts", '♥'); + HttpEncoder.entities.Add("diams", '♦'); + HttpEncoder.entities.Add("quot", '"'); + HttpEncoder.entities.Add("amp", '&'); + HttpEncoder.entities.Add("lt", '<'); + HttpEncoder.entities.Add("gt", '>'); + HttpEncoder.entities.Add("OElig", 'Œ'); + HttpEncoder.entities.Add("oelig", 'œ'); + HttpEncoder.entities.Add("Scaron", 'Š'); + HttpEncoder.entities.Add("scaron", 'š'); + HttpEncoder.entities.Add("Yuml", 'Ÿ'); + HttpEncoder.entities.Add("circ", 'ˆ'); + HttpEncoder.entities.Add("tilde", '˜'); + HttpEncoder.entities.Add("ensp", ' '); + HttpEncoder.entities.Add("emsp", ' '); + HttpEncoder.entities.Add("thinsp", ' '); + HttpEncoder.entities.Add("zwnj", '\u200C'); + HttpEncoder.entities.Add("zwj", '\u200D'); + HttpEncoder.entities.Add("lrm", '\u200E'); + HttpEncoder.entities.Add("rlm", '\u200F'); + HttpEncoder.entities.Add("ndash", '–'); + HttpEncoder.entities.Add("mdash", '—'); + HttpEncoder.entities.Add("lsquo", '‘'); + HttpEncoder.entities.Add("rsquo", '’'); + HttpEncoder.entities.Add("sbquo", '‚'); + HttpEncoder.entities.Add("ldquo", '“'); + HttpEncoder.entities.Add("rdquo", '”'); + HttpEncoder.entities.Add("bdquo", '„'); + HttpEncoder.entities.Add("dagger", '†'); + HttpEncoder.entities.Add("Dagger", '‡'); + HttpEncoder.entities.Add("permil", '‰'); + HttpEncoder.entities.Add("lsaquo", '‹'); + HttpEncoder.entities.Add("rsaquo", '›'); + HttpEncoder.entities.Add("euro", '€'); + } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpEncoder.cs.meta b/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpEncoder.cs.meta new file mode 100644 index 0000000..a7ba535 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpEncoder.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3c9f699c227f48e381db521abe59c2e1 +timeCreated: 1701789490 \ No newline at end of file diff --git a/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpUtility.cs b/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpUtility.cs new file mode 100644 index 0000000..ea17c9e --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpUtility.cs @@ -0,0 +1,230 @@ +// MIRROR CHANGE: drop in Codice.Utils HttpUtility subset to not depend on Unity's plastic scm package +// SOURCE: Unity Plastic SCM package + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.IO; +using System.Text; + +namespace Edgegap.Codice.Utils // MIRROR CHANGE: namespace Edgegap.* to not collide if anyone has Plastic SCM installed already +{ + public sealed class HttpUtility + { + private static void WriteCharBytes(IList buf, char ch, Encoding e) + { + if (ch > 'ÿ') + { + Encoding encoding = e; + char[] chars = new char[1]{ ch }; + foreach (byte num in encoding.GetBytes(chars)) + buf.Add((object) num); + } + else + buf.Add((object) (byte) ch); + } + + public static string UrlDecode(string s, Encoding e) + { + if (null == s) + return (string) null; + if (s.IndexOf('%') == -1 && s.IndexOf('+') == -1) + return s; + if (e == null) + e = Encoding.UTF8; + long length = (long) s.Length; + List buf = new List(); + for (int index = 0; (long) index < length; ++index) + { + char ch = s[index]; + if (ch == '%' && (long) (index + 2) < length && s[index + 1] != '%') + { + if (s[index + 1] == 'u' && (long) (index + 5) < length) + { + int num = HttpUtility.GetChar(s, index + 2, 4); + if (num != -1) + { + HttpUtility.WriteCharBytes((IList) buf, (char) num, e); + index += 5; + } + else + HttpUtility.WriteCharBytes((IList) buf, '%', e); + } + else + { + int num; + if ((num = HttpUtility.GetChar(s, index + 1, 2)) != -1) + { + HttpUtility.WriteCharBytes((IList) buf, (char) num, e); + index += 2; + } + else + HttpUtility.WriteCharBytes((IList) buf, '%', e); + } + } + else if (ch == '+') + HttpUtility.WriteCharBytes((IList) buf, ' ', e); + else + HttpUtility.WriteCharBytes((IList) buf, ch, e); + } + byte[] array = buf.ToArray(); + return e.GetString(array); + } + + private static int GetInt(byte b) + { + char ch = (char) b; + if (ch >= '0' && ch <= '9') + return (int) ch - 48; + if (ch >= 'a' && ch <= 'f') + return (int) ch - 97 + 10; + return ch >= 'A' && ch <= 'F' ? (int) ch - 65 + 10 : -1; + } + + private static int GetChar(string str, int offset, int length) + { + int num1 = 0; + int num2 = length + offset; + for (int index = offset; index < num2; ++index) + { + char b = str[index]; + if (b > '\u007F') + return -1; + int num3 = HttpUtility.GetInt((byte) b); + if (num3 == -1) + return -1; + num1 = (num1 << 4) + num3; + } + return num1; + } + + public static string UrlEncode(string str) => HttpUtility.UrlEncode(str, Encoding.UTF8); + + public static string UrlEncode(string s, Encoding Enc) + { + if (s == null) + return (string) null; + if (s == string.Empty) + return string.Empty; + bool flag = false; + int length = s.Length; + for (int index = 0; index < length; ++index) + { + char c = s[index]; + if ((c < '0' || c < 'A' && c > '9' || c > 'Z' && c < 'a' || c > 'z') && !HttpEncoder.NotEncoded(c)) + { + flag = true; + break; + } + } + if (!flag) + return s; + byte[] bytes1 = new byte[Enc.GetMaxByteCount(s.Length)]; + int bytes2 = Enc.GetBytes(s, 0, s.Length, bytes1, 0); + return Encoding.ASCII.GetString(HttpUtility.UrlEncodeToBytes(bytes1, 0, bytes2)); + } + + public static byte[] UrlEncodeToBytes(byte[] bytes, int offset, int count) => bytes == null ? (byte[]) null : HttpEncoder.Current.UrlEncode(bytes, offset, count); + + public static string HtmlDecode(string s) + { + if (s == null) + return (string) null; + using (StringWriter output = new StringWriter()) + { + HttpEncoder.Current.HtmlDecode(s, (TextWriter) output); + return output.ToString(); + } + } + + public static NameValueCollection ParseQueryString(string query) => HttpUtility.ParseQueryString(query, Encoding.UTF8); + + public static NameValueCollection ParseQueryString( + string query, + Encoding encoding) + { + if (query == null) + throw new ArgumentNullException(nameof (query)); + if (encoding == null) + throw new ArgumentNullException(nameof (encoding)); + if (query.Length == 0 || query.Length == 1 && query[0] == '?') + return (NameValueCollection) new HttpUtility.HttpQSCollection(); + if (query[0] == '?') + query = query.Substring(1); + NameValueCollection result = (NameValueCollection) new HttpUtility.HttpQSCollection(); + HttpUtility.ParseQueryString(query, encoding, result); + return result; + } + + internal static void ParseQueryString( + string query, + Encoding encoding, + NameValueCollection result) + { + if (query.Length == 0) + return; + string str1 = HttpUtility.HtmlDecode(query); + int length = str1.Length; + int num1 = 0; + bool flag = true; + while (num1 <= length) + { + int startIndex = -1; + int num2 = -1; + for (int index = num1; index < length; ++index) + { + if (startIndex == -1 && str1[index] == '=') + startIndex = index + 1; + else if (str1[index] == '&') + { + num2 = index; + break; + } + } + if (flag) + { + flag = false; + if (str1[num1] == '?') + ++num1; + } + string name; + if (startIndex == -1) + { + name = (string) null; + startIndex = num1; + } + else + name = HttpUtility.UrlDecode(str1.Substring(num1, startIndex - num1 - 1), encoding); + if (num2 < 0) + { + num1 = -1; + num2 = str1.Length; + } + else + num1 = num2 + 1; + string str2 = HttpUtility.UrlDecode(str1.Substring(startIndex, num2 - startIndex), encoding); + result.Add(name, str2); + if (num1 == -1) + break; + } + } + + private sealed class HttpQSCollection : NameValueCollection + { + public override string ToString() + { + int count = this.Count; + if (count == 0) + return ""; + StringBuilder stringBuilder = new StringBuilder(); + string[] allKeys = this.AllKeys; + for (int index = 0; index < count; ++index) + stringBuilder.AppendFormat("{0}={1}&", (object) allKeys[index], (object) HttpUtility.UrlEncode(this[allKeys[index]])); + if (stringBuilder.Length > 0) + --stringBuilder.Length; + return stringBuilder.ToString(); + } + } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpUtility.cs.meta b/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpUtility.cs.meta new file mode 100644 index 0000000..578640e --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Dependencies/HttpUtility.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6f83f468a8b546fd92606db56038f9e6 +timeCreated: 1701785025 \ No newline at end of file diff --git a/Assets/FishNet/Plugins/Edgegap/Edgegap.asmdef b/Assets/FishNet/Plugins/Edgegap/Edgegap.asmdef new file mode 100644 index 0000000..e9811e2 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Edgegap.asmdef @@ -0,0 +1,20 @@ +{ + "name": "Edgegap", + "rootNamespace": "", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.unity.nuget.newtonsoft-json", + "expression": "", + "define": "NEWTONSOFT_JSON" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/FishNet/Plugins/Edgegap/Edgegap.asmdef.meta b/Assets/FishNet/Plugins/Edgegap/Edgegap.asmdef.meta new file mode 100644 index 0000000..6e3765a --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Edgegap.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 58ff3a2ca929d114eaf0ca373ff1e07a +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor.meta b/Assets/FishNet/Plugins/Edgegap/Editor.meta new file mode 100644 index 0000000..e559327 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 635b395f47dc9f742b4d71144921bb0d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api.meta new file mode 100644 index 0000000..bb66b47 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6d2a4589d6738cb4b82bb1ceebd1453f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapApiBase.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapApiBase.cs new file mode 100644 index 0000000..fd04901 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapApiBase.cs @@ -0,0 +1,280 @@ +using System; +using System.Collections.Specialized; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +// using Codice.Utils; // MIRROR CHANGE +using Edgegap.Codice.Utils; // MIRROR CHANGE +using UnityEngine; + +namespace Edgegap.Editor.Api +{ + /// + /// Handles base URL and common methods for all Edgegap APIs. + /// + public abstract class EdgegapApiBase + { + #region Vars + private readonly HttpClient _httpClient = new HttpClient(); // Base address set // MIRROR CHANGE: Unity 2020 support + protected ApiEnvironment SelectedApiEnvironment { get; } + protected EdgegapWindowMetadata.LogLevel LogLevel { get; set; } + protected bool IsLogLevelDebug => LogLevel == EdgegapWindowMetadata.LogLevel.Debug; + + /// Based on SelectedApiEnvironment. + /// + private string GetBaseUrl() => + SelectedApiEnvironment == ApiEnvironment.Staging + ? ApiEnvironment.Staging.GetApiUrl() + : ApiEnvironment.Console.GetApiUrl(); + #endregion // Vars + + + /// "console" || "staging-console"? + /// Without the "token " prefix, although we'll clear this if present + /// You may want more-verbose logs other than errs + protected EdgegapApiBase( + ApiEnvironment apiEnvironment, + string apiToken, + EdgegapWindowMetadata.LogLevel logLevel = EdgegapWindowMetadata.LogLevel.Error) + { + this.SelectedApiEnvironment = apiEnvironment; + + this._httpClient.BaseAddress = new Uri($"{GetBaseUrl()}/"); + this._httpClient.DefaultRequestHeaders.Accept.Add( + new MediaTypeWithQualityHeaderValue("application/json")); + + string cleanedApiToken = apiToken.Replace("token ", ""); // We already prefixed token below + this._httpClient.DefaultRequestHeaders.Authorization = + new AuthenticationHeaderValue("token", cleanedApiToken); + + this.LogLevel = logLevel; + } + + + #region HTTP Requests + /// + /// POST | We already added "https://api.edgegap.com/" (or similar) BaseAddress via constructor. + /// + /// + /// Serialize to your model via Newtonsoft + /// + /// - Success => returns HttpResponseMessage result + /// - Error => Catches errs => returns null (no rethrow) + /// + protected async Task PostAsync(string relativePath = "", string json = "{}") + { + StringContent stringContent = CreateStringContent(json); + Uri uri = new Uri(_httpClient.BaseAddress, relativePath); // Normalize POST uri: Can't end with `/`. + + if (IsLogLevelDebug) + Debug.Log($"PostAsync to: `{uri}` with json: `{json}`"); + + try + { + return await ExecuteRequestAsync(() => _httpClient.PostAsync(uri, stringContent)); + } + catch (Exception e) + { + Debug.LogError($"Error: {e}"); + throw; + } + } + + /// + /// PATCH | We already added "https://api.edgegap.com/" (or similar) BaseAddress via constructor. + /// + /// + /// Serialize to your model via Newtonsoft + /// + /// - Success => returns HttpResponseMessage result + /// - Error => Catches errs => returns null (no rethrow) + /// + protected async Task PatchAsync(string relativePath = "", string json = "{}") + { + StringContent stringContent = CreateStringContent(json); + Uri uri = new Uri(_httpClient.BaseAddress, relativePath); // Normalize PATCH uri: Can't end with `/`. + + if (IsLogLevelDebug) + Debug.Log($"PatchAsync to: `{uri}` with json: `{json}`"); + + // (!) As of 11/15/2023, .PatchAsync() is "unsupported by Unity" -- so we manually set the verb and SendAsync() + // Create the request manually + HttpRequestMessage patchRequest = new HttpRequestMessage(new HttpMethod("PATCH"), uri) + { + Content = stringContent, + }; + + try + { + return await ExecuteRequestAsync(() => _httpClient.SendAsync(patchRequest)); + } + catch (Exception e) + { + Debug.LogError($"Error: {e}"); + throw; + } + } + + /// + /// GET | We already added "https://api.edgegap.com/" (or similar) BaseAddress via constructor. + /// + /// + /// + /// To append to the URL; eg: "foo=0&bar=1" + /// (!) First query key should prefix nothing, as shown + /// + /// - Success => returns HttpResponseMessage result + /// - Error => Catches errs => returns null (no rethrow) + /// + protected async Task GetAsync(string relativePath = "", string customQuery = "") + { + string completeRelativeUri = prepareEdgegapUriWithQuery( + relativePath, + customQuery); + + if (IsLogLevelDebug) + Debug.Log($"GetAsync to: `{completeRelativeUri} with customQuery: `{customQuery}`"); + + try + { + return await ExecuteRequestAsync(() => _httpClient.GetAsync(completeRelativeUri)); + } + catch (Exception e) + { + Debug.LogError($"Error: {e}"); + throw; + } + } + + /// + /// DELETE | We already added "https://api.edgegap.com/" (or similar) BaseAddress via constructor. + /// + /// + /// + /// To append to the URL; eg: "foo=0&bar=1" + /// (!) First query key should prefix nothing, as shown + /// + /// - Success => returns HttpResponseMessage result + /// - Error => Catches errs => returns null (no rethrow) + /// + protected async Task DeleteAsync(string relativePath = "", string customQuery = "") + { + string completeRelativeUri = prepareEdgegapUriWithQuery( + relativePath, + customQuery); + + if (IsLogLevelDebug) + Debug.Log($"DeleteAsync to: `{completeRelativeUri} with customQuery: `{customQuery}`"); + + try + { + return await ExecuteRequestAsync(() => _httpClient.DeleteAsync(completeRelativeUri)); + } + catch (Exception e) + { + Debug.LogError($"Error: {e}"); + throw; + } + } + + /// POST || GET + /// + /// + /// + private static async Task ExecuteRequestAsync( + Func> requestFunc, + CancellationToken cancellationToken = default) + { + HttpResponseMessage response = null; + try + { + response = await requestFunc(); + } + catch (HttpRequestException e) + { + Debug.LogError($"HttpRequestException: {e.Message}"); + return null; + } + catch (TaskCanceledException e) + { + if (cancellationToken.IsCancellationRequested) + Debug.LogError("Task was cancelled by caller."); + else + Debug.LogError($"TaskCanceledException: Timeout - {e.Message}"); + return null; + } + catch (Exception e) // Generic exception handler + { + Debug.LogError($"Unexpected error occurred: {e.Message}"); + return null; + } + + // Check for a successful status code + if (response == null) + { + Debug.Log("!Success (null response) - returning 500"); + return CreateUnknown500Err(); + } + + if (!response.IsSuccessStatusCode) + { + HttpMethod httpMethod = response.RequestMessage.Method; + Debug.Log($"!Success: {(short)response.StatusCode} {response.ReasonPhrase} - " + + $"{httpMethod} | {response.RequestMessage.RequestUri}` - " + + $"{response.Content?.ReadAsStringAsync().Result}"); + } + + return response; + } + #endregion // HTTP Requests + + + #region Utils + /// Creates a UTF-8 encoded application/json + json obj + /// Arbitrary json obj + /// + private StringContent CreateStringContent(string json = "{}") => + new StringContent(json, Encoding.UTF8, "application/json"); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + private static HttpResponseMessage CreateUnknown500Err() => + new HttpResponseMessage(HttpStatusCode.InternalServerError); // 500 - Unknown // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + /// + /// Merges Edgegap-required query params (source) -> merges with custom query -> normalizes. + /// + /// + /// + /// + private string prepareEdgegapUriWithQuery(string relativePath, string customQuery) + { + // Create UriBuilder using the BaseAddress + UriBuilder uriBuilder = new UriBuilder(_httpClient.BaseAddress); + + // Add the relative path to the UriBuilder's path + uriBuilder.Path += relativePath; + + // Parse the existing query from the UriBuilder + NameValueCollection query = HttpUtility.ParseQueryString(uriBuilder.Query); + + // Add default "source=unity" param + query["source"] = "unity"; + + // Parse and merge the custom query parameters + NameValueCollection customParams = HttpUtility.ParseQueryString(customQuery); + foreach (string key in customParams) + { + query[key] = customParams[key]; + } + + // Set the merged query back to the UriBuilder + uriBuilder.Query = query.ToString(); + + // Extract the complete relative URI and return it + return uriBuilder.Uri.PathAndQuery; + } + #endregion // Utils + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapApiBase.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapApiBase.cs.meta new file mode 100644 index 0000000..735b923 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapApiBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 50379f30f5137224aa05a5c7b6b5ebba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapAppApi.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapAppApi.cs new file mode 100644 index 0000000..4e7eab1 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapAppApi.cs @@ -0,0 +1,148 @@ +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Edgegap.Editor.Api.Models.Requests; +using Edgegap.Editor.Api.Models.Results; + +namespace Edgegap.Editor.Api +{ + /// + /// Wraps the v1/app API endpoint: Applications Control API. + /// - API Doc | https://docs.edgegap.com/api/#tag/Applications + /// + public class EdgegapAppApi : EdgegapApiBase + { + public EdgegapAppApi( + ApiEnvironment apiEnvironment, + string apiToken, + EdgegapWindowMetadata.LogLevel logLevel = EdgegapWindowMetadata.LogLevel.Error) + : base(apiEnvironment, apiToken, logLevel) + { + } + + + #region API Methods + /// + /// POST to v1/app + /// - Create an application that will regroup application versions. + /// - API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/application-post + /// + /// + /// Http info with GetCreateAppResult data model + /// - Success: 200 + /// - Fail: 409 (app already exists), 400 (reached limit) + /// + public async Task> CreateApp(CreateAppRequest request) + { + HttpResponseMessage response = await PostAsync("v1/app", request.ToString()); + EdgegapHttpResult result = new EdgegapHttpResult(response); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + bool isSuccess = response.StatusCode == HttpStatusCode.OK; // 200 + if (!isSuccess) + return result; + + return result; + } + + /// + /// GET to v1/app + /// - Get an application that will regroup application versions. + /// - API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/application-post + /// + /// + /// Http info with GetCreateAppResult data model + /// - Success: 200 + /// + public async Task> GetApp(string appName) + { + HttpResponseMessage response = await GetAsync($"v1/app/{appName}"); + EdgegapHttpResult result = new EdgegapHttpResult(response); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + bool isSuccess = response.StatusCode == HttpStatusCode.OK; // 200 + if (!isSuccess) + return result; + + return result; + } + + /// + /// PATCH to v1/app/{app_name}/version/{version_name} + /// - Update an *existing* application version with new specifications. + /// - API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/app-versions-patch + /// + /// + /// Http info with UpdateAppVersionRequest data model + /// - Success: 200 + /// + public async Task> UpdateAppVersion(UpdateAppVersionRequest request) + { + string relativePath = $"v1/app/{request.AppName}/version/{request.VersionName}"; + HttpResponseMessage response = await PatchAsync(relativePath, request.ToString()); + EdgegapHttpResult result = new EdgegapHttpResult(response); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + bool isSuccess = response.StatusCode == HttpStatusCode.OK; // 200 + if (!isSuccess) + return result; + + return result; + } + + /// + /// POST to v1/app/{app_name}/version + /// - Create an new application version with new specifications. + /// - API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/app-version-post + /// + /// + /// Http info with UpdateAppVersionRequest data model + /// - Success: 200 (no result model) + /// - Fail: 409 (app already exists), 400 (reached limit) + /// + public async Task> CreateAppVersion(CreateAppVersionRequest request) + { + string relativePath = $"v1/app/{request.AppName}/version"; + HttpResponseMessage response = await PostAsync(relativePath, request.ToString()); + EdgegapHttpResult result = new EdgegapHttpResult(response); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + bool isSuccess = response.StatusCode == HttpStatusCode.OK; // 200 + + if (!isSuccess) + return result; + + return result; + } + #endregion // API Methods + + + #region Chained API Methods + /// + /// PATCH and/or POST to v1/app/: Upsert an *existing* application version with new specifications. + /// - Consumes either 1 or 2 API calls: 1st tries to PATCH, then POST if PATCH fails (!exists). + /// - API POST Doc | https://docs.edgegap.com/api/#tag/Applications/operation/app-version-post + /// - API PATCH Doc | https://docs.edgegap.com/api/#tag/Applications/operation/app-versions-patch + /// + /// + /// Http info with UpdateAppVersionRequest data model + /// - Success: 200 (no result model) + /// - Fail: 409 (app already exists), 400 (reached limit) + /// + public async Task> UpsertAppVersion(UpdateAppVersionRequest request) + { + EdgegapHttpResult result = await UpdateAppVersion(request); // PATCH + + if (result.HasErr) + { + // Try to create, instead + CreateAppVersionRequest createAppVersionRequest = CreateAppVersionRequest.FromUpdateRequest(request); + result = await CreateAppVersion(createAppVersionRequest); // POST + } + + bool isSuccess = result.StatusCode == HttpStatusCode.OK; // 200 + + if (!isSuccess) + return result; + + return result; + } + #endregion // Chained API Methods + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapAppApi.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapAppApi.cs.meta new file mode 100644 index 0000000..7f21701 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapAppApi.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b0b3b865abe64b49a4000294c4e9593 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapDeploymentsApi.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapDeploymentsApi.cs new file mode 100644 index 0000000..dda3ce2 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapDeploymentsApi.cs @@ -0,0 +1,177 @@ +using System; +using System.Net; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Edgegap.Editor.Api.Models.Requests; +using Edgegap.Editor.Api.Models.Results; +using UnityEngine.Assertions; + +namespace Edgegap.Editor.Api +{ + /// + /// Wraps the v1/[deploy | status | stop] API endpoints: Deployments Control API. + /// - API Doc | https://docs.edgegap.com/api/#tag/Deployments + /// + public class EdgegapDeploymentsApi : EdgegapApiBase + { + public EdgegapDeploymentsApi( + ApiEnvironment apiEnvironment, + string apiToken, + EdgegapWindowMetadata.LogLevel logLevel = EdgegapWindowMetadata.LogLevel.Error) + : base(apiEnvironment, apiToken, logLevel) + { + } + + + #region API Methods + /// + /// POST v1/deploy + /// - Create a new deployment. Deployment is a server instance of your application version. + /// - API Doc | https://docs.edgegap.com/api/#tag/Deployments + /// + /// + /// Http info with CreateDeploymentResult data model + /// - Success: 200 + /// + public async Task> CreateDeploymentAsync( + CreateDeploymentRequest request) + { + HttpResponseMessage response = await PostAsync("v1/deploy", request.ToString()); + EdgegapHttpResult result = new EdgegapHttpResult(response); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + bool isSuccess = response.StatusCode == HttpStatusCode.OK; // 200 + if (!isSuccess) + return result; + + return result; + } + + /// + /// GET v1/status/{requestId} + /// - Retrieve the information for a deployment. + /// - API Doc | https://docs.edgegap.com/api/#tag/Deployments/operation/deployment-status-get + /// + /// + /// Unique Identifier to keep track of your request across all Arbitrium ecosystem. + /// It's included in the response of the app deploy. Ex: "93924761ccde" + /// + /// Http info with GetDeploymentStatusResult data model + /// - Success: 200 + /// + public async Task> GetDeploymentStatusAsync(string requestId) + { + HttpResponseMessage response = await GetAsync($"v1/status/{requestId}"); + EdgegapHttpResult result = new EdgegapHttpResult(response); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + bool isSuccess = response.StatusCode == HttpStatusCode.OK; // 200 + if (!isSuccess) + return result; + + return result; + } + + /// + /// DELETE v1/stop/{requestId} + /// - Delete an instance of deployment. It will stop the running container and all its games. + /// - API Doc | https://docs.edgegap.com/api/#tag/Deployments/operation/deployment-status-get + /// + /// + /// Unique Identifier to keep track of your request across all Arbitrium ecosystem. + /// It's included in the response of the app deploy. Ex: "93924761ccde" + /// + /// Http info with GetDeploymentStatusResult data model + /// - Success: 200 + /// + public async Task> StopActiveDeploymentAsync(string requestId) + { + HttpResponseMessage response = await DeleteAsync($"v1/stop/{requestId}"); + EdgegapHttpResult result = new EdgegapHttpResult(response); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + bool isSuccess = response.StatusCode == HttpStatusCode.OK; // 200 + if (!isSuccess) + return result; + + return result; + } + #endregion // API Methods + + + #region Chained API Methods + /// + /// POST v1/deploy => GET v1/status/{requestId} + /// - Create a new deployment. Deployment is a server instance of your application version. + /// - Then => await READY status. + /// - API Doc | https://docs.edgegap.com/api/#tag/Deployments + /// + /// + /// Http info with CreateDeploymentResult data model (with a READY deployment status) + /// - Success: 200 + /// - Error: If createResult.HasErr, returns createResult + /// + public async Task> CreateDeploymentAwaitReadyStatusAsync( + CreateDeploymentRequest request, TimeSpan pollInterval) + { + EdgegapHttpResult createResponse = await CreateDeploymentAsync(request); + + // Create => + bool isCreateSuccess = createResponse.StatusCode == HttpStatusCode.OK; // 200 + if (!isCreateSuccess) + return createResponse; + + // Await Status READY => + string requestId = createResponse.Data.RequestId; + _ = await AwaitReadyStatusAsync(requestId, pollInterval); + + // Return no matter what the result; no need to validate + return createResponse; + } + + /// If you recently deployed but want to await READY status. + /// + /// + public async Task> AwaitReadyStatusAsync( + string requestId, + TimeSpan pollInterval) + { + Assert.IsTrue(!string.IsNullOrEmpty(requestId)); // Validate + + EdgegapHttpResult statusResponse = null; + CancellationTokenSource cts = new CancellationTokenSource (TimeSpan.FromMinutes( // MIRROR CHANGE: 'new()' not supported in Unity 2020 + EdgegapWindowMetadata.DEPLOYMENT_AWAIT_READY_STATUS_TIMEOUT_MINS)); + bool isReady = false; + + while (!isReady && !cts.Token.IsCancellationRequested) + { + await Task.Delay(pollInterval, cts.Token); + statusResponse = await GetDeploymentStatusAsync(requestId); + isReady = statusResponse.Data.CurrentStatus == EdgegapWindowMetadata.READY_STATUS; + } + + return statusResponse; + } + + /// If you recently stopped a deployment, but want to await TERMINATED (410) status. + /// + /// + public async Task> AwaitTerminatedDeleteStatusAsync( + string requestId, + TimeSpan pollInterval) + { + EdgegapHttpResult deleteResponse = null; + CancellationTokenSource cts = new CancellationTokenSource(TimeSpan.FromMinutes( // MIRROR CHANGE: 'new()' not supported in Unity 2020 + EdgegapWindowMetadata.DEPLOYMENT_AWAIT_READY_STATUS_TIMEOUT_MINS)); + bool isStopped = false; + + while (!isStopped && !cts.Token.IsCancellationRequested) + { + await Task.Delay(pollInterval, cts.Token); + deleteResponse = await StopActiveDeploymentAsync(requestId); + isStopped = deleteResponse.StatusCode == HttpStatusCode.Gone; // 410 + } + + return deleteResponse; + } + #endregion Chained API Methods + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapDeploymentsApi.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapDeploymentsApi.cs.meta new file mode 100644 index 0000000..08f9b34 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapDeploymentsApi.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37ecdc6abda4402419438f2284ef2d95 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapIpApi.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapIpApi.cs new file mode 100644 index 0000000..86e4b26 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapIpApi.cs @@ -0,0 +1,47 @@ +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Edgegap.Editor.Api.Models.Results; + +namespace Edgegap.Editor.Api +{ + /// + /// Wraps the v1/ip API endpoint: "IP Lookup" API. + /// - API Doc | https://docs.edgegap.com/api/#tag/IP-Lookup + /// + public class EdgegapIpApi : EdgegapApiBase + { + public EdgegapIpApi( + ApiEnvironment apiEnvironment, + string apiToken, + EdgegapWindowMetadata.LogLevel logLevel = EdgegapWindowMetadata.LogLevel.Error) + : base(apiEnvironment, apiToken, logLevel) + { + } + + + #region API Methods + /// + /// GET to v1/app + /// - Retrieve your public IP address. + /// - API Doc | https://docs.edgegap.com/api/#tag/IP-Lookup/operation/IP + /// + /// + /// Http info with GetCreateAppResult data model + /// - Success: 200 + /// - Fail: 409 (app already exists), 400 (reached limit) + /// + public async Task> GetYourPublicIp() + { + HttpResponseMessage response = await GetAsync("v1/ip"); + EdgegapHttpResult result = new EdgegapHttpResult(response); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + bool isSuccess = response.StatusCode == HttpStatusCode.OK; // 200 + if (!isSuccess) + return result; + + return result; + } + #endregion // API Methods + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapIpApi.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapIpApi.cs.meta new file mode 100644 index 0000000..fa966ab --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapIpApi.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fac4a7425623f39488af09d60549313e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapWizardApi.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapWizardApi.cs new file mode 100644 index 0000000..5d4a25f --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapWizardApi.cs @@ -0,0 +1,52 @@ +using System.Net.Http; +using System.Threading.Tasks; +using Edgegap.Editor.Api.Models.Results; +using Newtonsoft.Json.Linq; + +namespace Edgegap.Editor.Api +{ + /// Wraps the v1/wizard API endpoint. Used for internal purposes. + public class EdgegapWizardApi : EdgegapApiBase + { + /// Extended path after the base uri + public EdgegapWizardApi( + ApiEnvironment apiEnvironment, + string apiToken, + EdgegapWindowMetadata.LogLevel logLevel = EdgegapWindowMetadata.LogLevel.Error) + : base(apiEnvironment, apiToken, logLevel) + { + } + + + #region API Methods + /// POST to v1/wizard/init-quick-start + /// + /// Http info with no explicit data model + /// - Success: 204 (no result model) + /// + public async Task InitQuickStart() + { + string json = new JObject { ["source"] = "unity" }.ToString(); + HttpResponseMessage response = await PostAsync("v1/wizard/init-quick-start", json); + EdgegapHttpResult result = new EdgegapHttpResult(response); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + return result; + } + + /// GET to v1/wizard/registry-credentials + /// + /// - Http info with GetRegistryCredentialsResult data model + /// - Success: 200 + /// - Error: Likely if called before a successful InitQuickStart(), + /// or if called in a staging env. Soon, this will be available in production. + /// + public async Task> GetRegistryCredentials() + { + HttpResponseMessage response = await GetAsync("v1/wizard/registry-credentials"); + EdgegapHttpResult result = new EdgegapHttpResult(response); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + return result; + } + #endregion // API Methods + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapWizardApi.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapWizardApi.cs.meta new file mode 100644 index 0000000..5e167be --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/EdgegapWizardApi.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f6986ee67361f0b45928ccd70c7ab12c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models.meta new file mode 100644 index 0000000..2c5a793 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aed107c714fce71449ef56590221c567 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/AppPortsData.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/AppPortsData.cs new file mode 100644 index 0000000..782bc7b --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/AppPortsData.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models +{ + /// + /// Used in `UpdateAppVersionRequest`, `CreateAppVersionRequest`. + /// For GetDeploymentStatusResult, see DeploymentPortsData + /// + public class AppPortsData + { + /// 1024~49151; Default 7770 + [JsonProperty("port")] + public int Port { get; set; } = EdgegapWindowMetadata.PORT_DEFAULT; + + /// Default "UDP" + [JsonProperty("protocol")] + public string ProtocolStr { get; set; } = EdgegapWindowMetadata.DEFAULT_PROTOCOL_TYPE.ToString(); + + [JsonProperty("to_check")] + public bool ToCheck { get; set; } = true; + + [JsonProperty("tls_upgrade")] + public bool TlsUpgrade { get; set; } + + [JsonProperty("name")] + public string PortName { get; set; } = "Game Port"; + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/AppPortsData.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/AppPortsData.cs.meta new file mode 100644 index 0000000..d7e6083 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/AppPortsData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6d4864ea3706574fb35920c6fab46fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/DeploymentPortsData.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/DeploymentPortsData.cs new file mode 100644 index 0000000..972205b --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/DeploymentPortsData.cs @@ -0,0 +1,29 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models +{ + /// Used in `GetDeploymentStatus`. + public class DeploymentPortsData + { + [JsonProperty("external")] + public int External { get; set; } + + [JsonProperty("internal")] + public int Internal { get; set; } + + [JsonProperty("protocol")] + public string Protocol { get; set; } + + [JsonProperty("name")] + public string PortName { get; set; } + + [JsonProperty("tls_upgrade")] + public bool TlsUpgrade { get; set; } + + [JsonProperty("link")] + public string Link { get; set; } + + [JsonProperty("proxy")] + public int? Proxy { get; set; } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/DeploymentPortsData.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/DeploymentPortsData.cs.meta new file mode 100644 index 0000000..0efdcc2 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/DeploymentPortsData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 62d51b44b8414c9f968ca607ccb06b7e +timeCreated: 1701522748 \ No newline at end of file diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/LocationData.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/LocationData.cs new file mode 100644 index 0000000..d9c89bb --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/LocationData.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models +{ + public class LocationData + { + [JsonProperty("city")] + public string City { get; set; } + + [JsonProperty("country")] + public string Country { get; set; } + + [JsonProperty("continent")] + public string Continent { get; set; } + + [JsonProperty("administrative_division")] + public string AdministrativeDivision { get; set; } + + [JsonProperty("timezone")] + public string Timezone { get; set; } + + [JsonProperty("latitude")] + public double Latitude { get; set; } + + [JsonProperty("longitude")] + public double Longitude { get; set; } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/LocationData.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/LocationData.cs.meta new file mode 100644 index 0000000..c99e801 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/LocationData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 57eed0dbd556e074c992cf6599a1f6bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/ProtocolType.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/ProtocolType.cs new file mode 100644 index 0000000..d72086d --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/ProtocolType.cs @@ -0,0 +1,18 @@ +namespace Edgegap.Editor.Api.Models +{ + /// + /// Unity default: UDP. + /// (!) UDP !works in WebGL. + /// + public enum ProtocolType + { + /// Unity default - fastest; !works in WebGL. + UDP, + + /// Slower, but more reliable; works in WebGL. + TCP, + + /// Slower, but more reliable; works in WebGL. + WS, + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/ProtocolType.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/ProtocolType.cs.meta new file mode 100644 index 0000000..0656058 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/ProtocolType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be5acd63e783b364ebdbb783639e2d32 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests.meta new file mode 100644 index 0000000..bcd87e4 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d1b2a5c481353934f906c30ba047df9b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppRequest.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppRequest.cs new file mode 100644 index 0000000..91e3c26 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppRequest.cs @@ -0,0 +1,55 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models.Requests +{ + /// + /// Request model for https://docs.edgegap.com/api/#tag/Applications/operation/application-post + /// + public class CreateAppRequest + { + #region Required + /// *The application name. + [JsonProperty("name")] + public string AppName { get; set; } + #endregion // Required + + + #region Optional + /// *If the application can be deployed. + [JsonProperty("is_active")] + public bool IsActive { get; set; } + + /// *Image base64 string. + [JsonProperty("image")] + public string Image { get; set; } + + /// If the telemetry agent is installed on the versions of this app. + [JsonProperty("is_telemetry_agent_active")] + public bool IsTelemetryAgentActive { get; set; } + #endregion // Optional + + + /// Used by Newtonsoft + public CreateAppRequest() + { + } + + /// Init with required info + /// The application name + /// If the application can be deployed + /// Image base64 string + public CreateAppRequest( + string appName, + bool isActive, + string image) + { + this.AppName = appName; + this.IsActive = isActive; + this.Image = image; + } + + /// Parse to json str + public override string ToString() => + JsonConvert.SerializeObject(this); + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppRequest.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppRequest.cs.meta new file mode 100644 index 0000000..268be5c --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0a492d7c515b8894ea30b37db6b7efe4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppVersionRequest.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppVersionRequest.cs new file mode 100644 index 0000000..360ed43 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppVersionRequest.cs @@ -0,0 +1,225 @@ +using System; +using Newtonsoft.Json; +using UnityEngine; + +namespace Edgegap.Editor.Api.Models.Requests +{ + /// + /// Request model for `POST v1/app/{app_name}/version`. + /// API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/app-version-post + /// + public class CreateAppVersionRequest + { + #region Required + /// *The name of the application associated. + [JsonIgnore] // *Path var + public string AppName { get; set; } + + /// *The name of the application associated. + [JsonProperty("name")] + public string VersionName { get; set; } = EdgegapWindowMetadata.DEFAULT_VERSION_TAG; + + /// *The tag of your image. Default == "latest". + /// "0.1.2" || "latest" (although "latest" !recommended; use actual versions in production) + [JsonProperty("docker_tag")] + public string DockerTag { get; set; } = EdgegapWindowMetadata.DEFAULT_VERSION_TAG; + + /// *The name of your image. + /// "edgegap/demo" || "myCompany-someId/mylowercaseapp" + [JsonProperty("docker_image")] + public string DockerImage { get; set; } = ""; + + /// *The Repository where the image is. + /// "registry.edgegap.com" || "harbor.edgegap.com" || "docker.io" + [JsonProperty("docker_repository")] + public string DockerRepository { get; set; } = ""; + + /// *Units of vCPU needed (1024 = 1vcpu) + [JsonProperty("req_cpu")] + public int ReqCpu { get; set; } = 256; + + /// *Units of memory in MB needed (1024 = 1 GPU) + [JsonProperty("req_memory")] + public int ReqMemory { get; set; } = 256; + + /// *Required: At least 1 { Port, ProtocolStr }. + [JsonProperty("ports")] + public AppPortsData[] Ports { get; set; } = {}; + + /// The username to access the docker repository + [JsonProperty("private_username")] + public string PrivateUsername { get; set; } = ""; + + /// The Private Password or Token of the username (We recommend to use a token) + [JsonProperty("private_token")] + public string PrivateToken { get; set; } = ""; + #endregion // Required + + + // #region Optional + // [JsonProperty("is_active")] + // public bool IsActive { get; set; } = true; + // + // [JsonProperty("req_video")] + // public int ReqVideo { get; set; } = 256; + // + // [JsonProperty("max_duration")] + // public int MaxDuration { get; set; } = 30; + // + // [JsonProperty("use_telemetry")] + // public bool UseTelemetry { get; set; } = true; + // + // [JsonProperty("inject_context_env")] + // public bool InjectContextEnv { get; set; } = true; + // + // [JsonProperty("whitelisting_active")] + // public bool WhitelistingActive { get; set; } = true; + // + // [JsonProperty("force_cache")] + // public bool ForceCache { get; set; } + // + // [JsonProperty("cache_min_hour")] + // public int CacheMinHour { get; set; } + // + // [JsonProperty("cache_max_hour")] + // public int CacheMaxHour { get; set; } + // + // [JsonProperty("time_to_deploy")] + // public int TimeToDeploy { get; set; } = 15; + // + // [JsonProperty("enable_all_locations")] + // public bool EnableAllLocations { get; set; } + // + // [JsonProperty("termination_grace_period_seconds")] + // public int TerminationGracePeriodSeconds { get; set; } = 5; + // + // [JsonProperty("endpoint_storage")] + // public string EndpointStorage { get; set; } = ""; + // + // [JsonProperty("command")] + // public string Command { get; set; } + // + // [JsonProperty("arguments")] + // public string Arguments { get; set; } + // + // [JsonProperty("verify_image")] + // public bool VerifyImage { get; set; } + // + // [JsonProperty("session_config")] + // public SessionConfigData SessionConfig { get; set; } = new(); + // + // [JsonProperty("probe")] + // public ProbeData Probe { get; set; } = new(); + // + // [JsonProperty("envs")] + // public EnvsData[] Envs { get; set; } = {}; + // + // public class SessionConfigData + // { + // [JsonProperty("kind")] + // public string Kind { get; set; } = "Seat"; + // + // [JsonProperty("sockets")] + // public int Sockets { get; set; } = 10; + // + // [JsonProperty("autodeploy")] + // public bool Autodeploy { get; set; } = true; + // + // [JsonProperty("empty_ttl")] + // public int EmptyTtl { get; set; } = 60; + // + // [JsonProperty("session_max_duration")] + // public int SessionMaxDuration { get; set; } = 60; + // } + // + // + // public class ProbeData + // { + // [JsonProperty("optimal_ping")] + // public int OptimalPing { get; set; } = 60; + // + // [JsonProperty("rejected_ping")] + // public int RejectedPing { get; set; } = 180; + // } + // + // public class EnvsData + // { + // [JsonProperty("key")] + // public string Key { get; set; } + // + // [JsonProperty("value")] + // public string Value { get; set; } + // + // [JsonProperty("is_secret")] + // public bool IsSecret { get; set; } = true; + // } + // #endregion // Optional + + /// Used by Newtonsoft + public CreateAppVersionRequest() + { + } + + /// + /// Init with required info. + /// (!) If looking for refs, also see FromUpdateRequest() builder below. + /// + /// The name of the application. + /// + /// + /// + /// + public CreateAppVersionRequest( + string appName, + string containerRegistryUsername, + string containerRegistryPasswordToken, + int portNum, + ProtocolType protocolType) + { + this.AppName = appName; + this.PrivateUsername = containerRegistryUsername; + this.PrivateToken = containerRegistryPasswordToken; + this.Ports = new AppPortsData[] + { + new AppPortsData() // MIRROR CHANGE: 'new()' not supported in Unity 2020 + { + Port = portNum, + ProtocolStr = protocolType.ToString(), + }, + }; + } + + /// + /// Port from Update PATCH model: If you tried to Update, but !exists, you probably want to create it next. + /// + /// + public static CreateAppVersionRequest FromUpdateRequest(UpdateAppVersionRequest updateRequest) + { + // Convert the updateRequest to JSON + string json = JsonConvert.SerializeObject(updateRequest); + + // Deserialize the JSON back to CreateAppVersionRequest + CreateAppVersionRequest createReq = null; + + try + { + createReq = JsonConvert.DeserializeObject(json); + createReq.AppName = updateRequest.AppName; // Normally JsonIgnored in Update + createReq.VersionName = updateRequest.VersionName; // Normally JsonIgnored in Update + createReq.PrivateUsername = updateRequest.PrivateUsername; + createReq.PrivateToken = updateRequest.PrivateToken; + } + catch (Exception e) + { + Debug.LogError($"Error (when parsing CreateAppVersionRequest from CreateAppVersionRequest): {e}"); + throw; + } + + return createReq; + } + + /// Parse to json str + public override string ToString() => + JsonConvert.SerializeObject(this); + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppVersionRequest.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppVersionRequest.cs.meta new file mode 100644 index 0000000..cf964e4 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateAppVersionRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0bb645e2f9d04384a85739269cc8a4e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateDeploymentRequest.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateDeploymentRequest.cs new file mode 100644 index 0000000..968821c --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateDeploymentRequest.cs @@ -0,0 +1,63 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models.Requests +{ + /// + /// Request model for `POST v1/deploy`. + /// API Doc | https://docs.edgegap.com/api/#tag/Deployments/operation/deploy + /// + public class CreateDeploymentRequest + { + #region Required + /// *Required: The name of the App you want to deploy. + [JsonProperty("app_name")] + public string AppName { get; set; } + + /// + /// *Required: The name of the App Version you want to deploy; + /// if not present, the last version created is picked. + /// + [JsonProperty("version_name")] + public string VersionName { get; set; } + + /// + /// *Required: The List of IP of your user. + /// + [JsonProperty("ip_list")] + public string[] IpList { get; set; } + + /// + /// *Required: The list of IP of your user with their location (latitude, longitude). + /// + [JsonProperty("geo_ip_list")] + public string[] GeoIpList { get; set; } = {}; + #endregion // Required + + + /// Used by Newtonsoft + public CreateDeploymentRequest() + { + } + + /// Init with required info; used for a single external IP address. + /// The name of the application. + /// + /// The name of the App Version you want to deploy, if not present, + /// the last version created is picked. + /// + /// Obtain from IpApi. + public CreateDeploymentRequest( + string appName, + string versionName, + string externalIp) + { + this.AppName = appName; + this.VersionName = versionName; + this.IpList = new[] { externalIp }; + } + + /// Parse to json str + public override string ToString() => + JsonConvert.SerializeObject(this); + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateDeploymentRequest.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateDeploymentRequest.cs.meta new file mode 100644 index 0000000..3391cdd --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/CreateDeploymentRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aae7b317093230e419bc0f8be1097ea6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/UpdateAppVersionRequest.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/UpdateAppVersionRequest.cs new file mode 100644 index 0000000..8a1d76b --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/UpdateAppVersionRequest.cs @@ -0,0 +1,175 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models.Requests +{ + /// + /// Request model for `PATCH v1/app/{app_name}/version/{version_name}`. + /// Request model for https://docs.edgegap.com/api/#tag/Applications/operation/app-versions-patch + /// TODO: Split "Create" and "Update" into their own, separate models: CTRL+F for "(!)" for more info. + /// + public class UpdateAppVersionRequest + { + #region Required + /// *Required: The name of the application. + [JsonIgnore] // *Path var + public string AppName { get; set; } + #endregion // Required + + + #region Optional + /// The name of the application version. + [JsonIgnore] // *Path var + public string VersionName { get; set; } = EdgegapWindowMetadata.DEFAULT_VERSION_TAG; + + /// At least 1 { Port, ProtocolStr } + [JsonProperty("ports")] + public AppPortsData[] Ports { get; set; } = {}; + + /// The Repository where the image is. + /// "registry.edgegap.com" || "harbor.edgegap.com" || "docker.io" + [JsonProperty("docker_repository")] + public string DockerRepository { get; set; } = ""; + + /// The name of your image. + /// "edgegap/demo" || "myCompany-someId/mylowercaseapp" + [JsonProperty("docker_image")] + public string DockerImage { get; set; } = ""; + + /// The tag of your image. Default == "latest". + /// "0.1.2" || "latest" (although "latest" !recommended; use actual versions in production) + [JsonProperty("docker_tag")] + public string DockerTag { get; set; } = EdgegapWindowMetadata.DEFAULT_VERSION_TAG; + + [JsonProperty("is_active")] + public bool IsActive { get; set; } = true; + + [JsonProperty("private_username")] + public string PrivateUsername { get; set; } = ""; + + [JsonProperty("private_token")] + public string PrivateToken { get; set; } = ""; + + #region (!) Shows in API docs for PATCH, but could be CREATE only? "Unknown Args" + // [JsonProperty("req_cpu")] + // public int ReqCpu { get; set; } = 256; + // + // [JsonProperty("req_memory")] + // public int ReqMemory { get; set; } = 256; + // + // [JsonProperty("req_video")] + // public int ReqVideo { get; set; } = 256; + #endregion // (!) Shows in API docs for PATCH, but could be CREATE only? "Unknown Args" + + [JsonProperty("max_duration")] + public int MaxDuration { get; set; } = 60; + + [JsonProperty("use_telemetry")] + public bool UseTelemetry { get; set; } = true; + + [JsonProperty("inject_context_env")] + public bool InjectContextEnv { get; set; } = true; + + [JsonProperty("whitelisting_active")] + public bool WhitelistingActive { get; set; } = false; + + [JsonProperty("force_cache")] + public bool ForceCache { get; set; } + + [JsonProperty("cache_min_hour")] + public int CacheMinHour { get; set; } + + [JsonProperty("cache_max_hour")] + public int CacheMaxHour { get; set; } + + [JsonProperty("time_to_deploy")] + public int TimeToDeploy { get; set; } = 120; + + [JsonProperty("enable_all_locations")] + public bool EnableAllLocations { get; set; } + + [JsonProperty("termination_grace_period_seconds")] + public int TerminationGracePeriodSeconds { get; set; } = 5; + + // // (!) BUG: Expects empty string "" at minimum; however, empty string will throw server err + // [JsonProperty("endpoint_storage")] + // public string EndpointStorage { get; set; } + + [JsonProperty("command")] + public string Command { get; set; } + + [JsonProperty("arguments")] + public string Arguments { get; set; } + + // /// + // /// (!) Setting this will trigger a very specific type of game that will affect the AppVersion. + // /// TODO: Is leaving as null the same as commenting out? + // /// + // [JsonProperty("session_config")] + // public SessionConfigData SessionConfig { get; set; } + + [JsonProperty("probe")] + public ProbeData Probe { get; set; } = new ProbeData(); // MIRROR CHANGE: 'new()' not supported in Unity 2020 + + [JsonProperty("envs")] + public EnvsData[] Envs { get; set; } = {}; + + public class SessionConfigData + { + [JsonProperty("kind")] + public string Kind { get; set; } = "Seat"; + + [JsonProperty("sockets")] + public int Sockets { get; set; } = 10; + + [JsonProperty("autodeploy")] + public bool Autodeploy { get; set; } = true; + + [JsonProperty("empty_ttl")] + public int EmptyTtl { get; set; } = 60; + + [JsonProperty("session_max_duration")] + public int SessionMaxDuration { get; set; } = 60; + } + + public class ProbeData + { + [JsonProperty("optimal_ping")] + public int OptimalPing { get; set; } = 60; + + [JsonProperty("rejected_ping")] + public int RejectedPing { get; set; } = 180; + } + + public class EnvsData + { + [JsonProperty("key")] + public string Key { get; set; } + + [JsonProperty("value")] + public string Value { get; set; } + + [JsonProperty("is_secret")] + public bool IsSecret { get; set; } = true; + } + #endregion // Optional + + /// Used by Newtonsoft + public UpdateAppVersionRequest() + { + } + + /// + /// Init with required info. Default version/tag == "default". + /// Since we're updating, we only require the AppName. + /// + /// The name of the application. + public UpdateAppVersionRequest(string appName) + { + this.AppName = appName; + } + + /// Parse to json str + public override string ToString() => + JsonConvert.SerializeObject(this); + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/UpdateAppVersionRequest.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/UpdateAppVersionRequest.cs.meta new file mode 100644 index 0000000..eca01ed --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Requests/UpdateAppVersionRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8da9712633ee1e64faca0b960d4bed31 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results.meta new file mode 100644 index 0000000..63ab762 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aa4ceffbc97b8254885a63937def2324 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/CreateDeploymentResult.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/CreateDeploymentResult.cs new file mode 100644 index 0000000..407d681 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/CreateDeploymentResult.cs @@ -0,0 +1,53 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models.Results +{ + /// + /// Result model for `POST v1/deploy`. + /// + public class CreateDeploymentResult + { + [JsonProperty("request_id")] + public string RequestId { get; set; } + + [JsonProperty("request_dns")] + public string RequestDns { get; set; } + + [JsonProperty("request_app")] + public string RequestApp { get; set; } + + [JsonProperty("request_version")] + public string RequestVersion { get; set; } + + [JsonProperty("request_user_count")] + public int RequestUserCount { get; set; } + + [JsonProperty("city")] + public string City { get; set; } + + [JsonProperty("country")] + public string Country { get; set; } + + [JsonProperty("continent")] + public string Continent { get; set; } + + [JsonProperty("administrative_division")] + public string AdministrativeDivision { get; set; } + + [JsonProperty("tags")] + public string[] Tags { get; set; } + + [JsonProperty("container_log_storage")] + public ContainerLogStorageData ContainerLogStorage { get; set; } + + + public class ContainerLogStorageData + { + [JsonProperty("enabled")] + public bool Enabled { get; set; } + + [JsonProperty("endpoint_storage")] + public string EndpointStorage { get; set; } + } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/CreateDeploymentResult.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/CreateDeploymentResult.cs.meta new file mode 100644 index 0000000..23484d2 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/CreateDeploymentResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8361abc6f84fccd4cba26dc285d335dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapErrorResult.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapErrorResult.cs new file mode 100644 index 0000000..55b03f2 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapErrorResult.cs @@ -0,0 +1,12 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models.Results +{ + /// Edgegap error, generally just containing `message` + public class EdgegapErrorResult + { + /// Friendly, UI-facing error message from Edgegap; can be lengthy. + [JsonProperty("message")] + public string ErrorMessage { get; set; } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapErrorResult.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapErrorResult.cs.meta new file mode 100644 index 0000000..be171dd --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapErrorResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5b29093cb10cf3040b76f4fbe77a435d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapHttpResult.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapHttpResult.cs new file mode 100644 index 0000000..55b4892 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapHttpResult.cs @@ -0,0 +1,118 @@ +using System; +using System.Net; +using System.Net.Http; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using UnityEngine; + +namespace Edgegap.Editor.Api.Models.Results +{ + /// + /// Wraps the inner json data with outer http info. + /// This class overload contains no json-deserialiable data result. + /// + public class EdgegapHttpResult + { + /// HTTP Status code for the request. + public HttpStatusCode StatusCode { get; } + + /// This could be err, success, or null. + public string Json { get; } + + /// eg: "POST" + public HttpMethod HttpMethod; + + /// + /// Typically is sent by servers together with the status code. + /// Useful for fallback err descriptions, often based on the status code. + /// + public string ReasonPhrase { get; } + + /// Contains `message` with friendly info. + public bool HasErr => Error != null; + public EdgegapErrorResult Error { get; set; } + + #region Common Shortcuts + /// OK + public bool IsResultCode200 => StatusCode == HttpStatusCode.OK; + + /// NoContent + public bool IsResultCode204 => StatusCode == HttpStatusCode.NoContent; + + /// Forbidden + public bool IsResultCode403 => StatusCode == HttpStatusCode.Forbidden; + + /// Conflict + public bool IsResultCode409 => StatusCode == HttpStatusCode.Conflict; + + /// BadRequest + public bool IsResultCode400 => StatusCode == HttpStatusCode.BadRequest; + + /// Gone + public bool IsResultCode410 => StatusCode == HttpStatusCode.Gone; + #endregion // Common Shortcuts + + + /// + /// Constructor that initializes the class based on an HttpResponseMessage. + /// + public EdgegapHttpResult(HttpResponseMessage httpResponse) + { + this.ReasonPhrase = httpResponse.ReasonPhrase; + this.StatusCode = httpResponse.StatusCode; + + try + { + // TODO: This can be read async with `await`, but can't do this in a Constructor. + // Instead, make a factory builder Task => + this.Json = httpResponse.Content.ReadAsStringAsync().Result; + + this.Error = JsonConvert.DeserializeObject(Json); + if (Error != null && string.IsNullOrEmpty(Error.ErrorMessage)) + Error = null; + } + catch (Exception e) + { + Debug.LogError("Error (reading httpResponse.Content): Client expected json, " + + $"but server returned !json: {e} - "); + } + } + } + + /// + /// Wraps the inner json data with outer http info. + /// This class overload contains json-deserialiable data result. + /// + public class EdgegapHttpResult : EdgegapHttpResult + { + /// The actual result model from Json. Could be null! + public TResult Data { get; set; } + + + public EdgegapHttpResult(HttpResponseMessage httpResponse, bool isLogLevelDebug = false) + : base(httpResponse) + { + this.HttpMethod = httpResponse.RequestMessage.Method; + + // Assuming JSON content and using Newtonsoft.Json for deserialization + bool isDeserializable = httpResponse.Content != null && + httpResponse.Content.Headers.ContentType.MediaType == "application/json"; + + if (isDeserializable) + { + try + { + this.Data = JsonConvert.DeserializeObject(Json); + } + catch (Exception e) + { + Debug.LogError($"Error (deserializing EdgegapHttpResult.Data): {e} - json: {Json}"); + throw; + } + } + + if (isLogLevelDebug) + UnityEngine.Debug.Log($"{typeof(TResult).Name} result: {JObject.Parse(Json)}"); // Prettified + } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapHttpResult.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapHttpResult.cs.meta new file mode 100644 index 0000000..bc67975 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/EdgegapHttpResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 888bfc2c113487b44a3103648d2c2ae3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetCreateAppResult.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetCreateAppResult.cs new file mode 100644 index 0000000..b9df98f --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetCreateAppResult.cs @@ -0,0 +1,31 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models.Results +{ + /// + /// Result model for `[GET | POST] v1/app`. + /// POST API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/application-post + /// GET API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/application-get + /// + public class GetCreateAppResult + { + [JsonProperty("name")] + public string AppName { get; set; } + + [JsonProperty("is_active")] + public bool IsActive { get; set; } + + /// Optional + [JsonProperty("is_telemetry_agent_active")] + public bool IsTelemetryAgentActive { get; set; } + + [JsonProperty("image")] + public string Image { get; set; } + + [JsonProperty("create_time")] + public string CreateTimeStr { get; set; } + + [JsonProperty("last_updated")] + public string LastUpdatedStr { get; set; } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetCreateAppResult.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetCreateAppResult.cs.meta new file mode 100644 index 0000000..ca1a37e --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetCreateAppResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a66c935238edd8846b1e9e9e19cfab70 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetDeploymentStatusResult.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetDeploymentStatusResult.cs new file mode 100644 index 0000000..57c4540 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetDeploymentStatusResult.cs @@ -0,0 +1,89 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models.Results +{ + /// + /// Result model for `GET v1/status/{request_id}`. + /// API Doc | https://docs.edgegap.com/api/#tag/Deployments/operation/deployment-status-get + /// + public class GetDeploymentStatusResult + { + [JsonProperty("request_id")] + public string RequestId { get; set; } + + [JsonProperty("fqdn")] + public string Fqdn { get; set; } + + [JsonProperty("app_name")] + public string AppName { get; set; } + + [JsonProperty("app_version")] + public string AppVersion { get; set; } + + [JsonProperty("current_status")] + public string CurrentStatus { get; set; } + + [JsonProperty("running")] + public bool Running { get; set; } + + [JsonProperty("whitelisting_active")] + public bool WhitelistingActive { get; set; } + + [JsonProperty("start_time")] + public string StartTime { get; set; } + + [JsonProperty("removal_time")] + public string RemovalTime { get; set; } + + [JsonProperty("elapsed_time")] + public int? ElapsedTime { get; set; } + + [JsonProperty("last_status")] + public string LastStatus { get; set; } + + [JsonProperty("error")] + public bool Error { get; set; } + + [JsonProperty("error_detail")] + public string ErrorDetail { get; set; } + + [JsonProperty("public_ip")] + public string PublicIp { get; set; } + + [JsonProperty("sessions")] + public SessionData[] Sessions { get; set; } + + [JsonProperty("location")] + public LocationData Location { get; set; } + + [JsonProperty("tags")] + public string[] Tags { get; set; } + + [JsonProperty("sockets")] + public string Sockets { get; set; } + + [JsonProperty("sockets_usage")] + public string SocketsUsage { get; set; } + + [JsonProperty("command")] + public string Command { get; set; } + + [JsonProperty("arguments")] + public string Arguments { get; set; } + + /// + /// TODO: Server should swap `ports` to an array of DeploymentPortsData (instead of an object of dynamic unknown objects). + /// + /// { + /// "7777", {} + /// }, + /// { + /// "Some Port Name", {} + /// } + /// + /// + [JsonProperty("ports")] + public Dictionary PortsDict { get; set; } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetDeploymentStatusResult.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetDeploymentStatusResult.cs.meta new file mode 100644 index 0000000..55eef85 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetDeploymentStatusResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c658b7f5c5d5d0648934b0ae1d71de9a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetRegistryCredentialsResult.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetRegistryCredentialsResult.cs new file mode 100644 index 0000000..8c3bd54 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetRegistryCredentialsResult.cs @@ -0,0 +1,22 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models.Results +{ + /// + /// Result model for `GET v1/wizard/registry-credentials`. + /// + public class GetRegistryCredentialsResult + { + [JsonProperty("registry_url")] + public string RegistryUrl { get; set; } + + [JsonProperty("project")] + public string Project { get; set; } + + [JsonProperty("username")] + public string Username { get; set; } + + [JsonProperty("token")] + public string Token { get; set; } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetRegistryCredentialsResult.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetRegistryCredentialsResult.cs.meta new file mode 100644 index 0000000..d8b5099 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetRegistryCredentialsResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8e6af130c329d2b43b2f4b0dc8639477 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetYourPublicIpResult.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetYourPublicIpResult.cs new file mode 100644 index 0000000..71d76b7 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetYourPublicIpResult.cs @@ -0,0 +1,14 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models.Results +{ + /// + /// Result model for `GET v1/ip`. + /// GET API Doc | https://docs.edgegap.com/api/#tag/IP-Lookup/operation/IP + /// + public class GetYourPublicIpResult + { + [JsonProperty("public_ip")] + public string PublicIp { get; set; } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetYourPublicIpResult.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetYourPublicIpResult.cs.meta new file mode 100644 index 0000000..4f6f0ae --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/GetYourPublicIpResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 73c9651ef0fdfcb449ec0120016963a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/StopActiveDeploymentResult.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/StopActiveDeploymentResult.cs new file mode 100644 index 0000000..5d4d6a0 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/StopActiveDeploymentResult.cs @@ -0,0 +1,89 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models.Results +{ + public class StopActiveDeploymentResult + { + [JsonProperty("message")] + public string Message { get; set; } + + [JsonProperty("deployment_summary")] + public DeploymentSummaryData DeploymentSummary { get; set; } + + + public class DeploymentSummaryData + { + [JsonProperty("request_id")] + public string RequestId { get; set; } + + [JsonProperty("fqdn")] + public string Fqdn { get; set; } + + [JsonProperty("app_name")] + public string AppName { get; set; } + + [JsonProperty("app_version")] + public string AppVersion { get; set; } + + [JsonProperty("current_status")] + public string CurrentStatus { get; set; } + + [JsonProperty("running")] + public bool Running { get; set; } + + [JsonProperty("whitelisting_active")] + public bool WhitelistingActive { get; set; } + + [JsonProperty("start_time")] + public string StartTime { get; set; } + + [JsonProperty("removal_time")] + public string RemovalTime { get; set; } + + [JsonProperty("elapsed_time")] + public int ElapsedTime { get; set; } + + [JsonProperty("last_status")] + public string LastStatus { get; set; } + + [JsonProperty("error")] + public bool Error { get; set; } + + [JsonProperty("error_detail")] + public string ErrorDetail { get; set; } + + [JsonProperty("ports")] + public PortsData Ports { get; set; } + + [JsonProperty("public_ip")] + public string PublicIp { get; set; } + + [JsonProperty("sessions")] + public SessionData[] Sessions { get; set; } + + [JsonProperty("location")] + public LocationData Location { get; set; } + + [JsonProperty("tags")] + public string[] Tags { get; set; } + + [JsonProperty("sockets")] + public string Sockets { get; set; } + + [JsonProperty("sockets_usage")] + public string SocketsUsage { get; set; } + + [JsonProperty("command")] + public string Command { get; set; } + + [JsonProperty("arguments")] + public string Arguments { get; set; } + + } + + public class PortsData + { + + } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/StopActiveDeploymentResult.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/StopActiveDeploymentResult.cs.meta new file mode 100644 index 0000000..4adcc65 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/StopActiveDeploymentResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9e2e4d9424ca8f7459803e631acf912f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/UpsertAppVersionResult.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/UpsertAppVersionResult.cs new file mode 100644 index 0000000..bc869d5 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/UpsertAppVersionResult.cs @@ -0,0 +1,165 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models.Results +{ + /// + /// Result model for: + /// - `POST 1/app/{app_name}/version` + /// - `PATCH v1/app/{app_name}/version/{version_name}` + /// POST API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/application-post + /// PATCH API Doc | https://docs.edgegap.com/api/#tag/Applications/operation/app-versions-patch + /// + public class UpsertAppVersionResult + { + [JsonProperty("success")] + public bool Success { get; set; } + + [JsonProperty("version")] + public VersionData Version { get; set; } + + public class VersionData + { + [JsonProperty("name")] + public string VersionName { get; set; } + + [JsonProperty("is_active")] + public bool IsActive { get; set; } + + [JsonProperty("docker_repository")] + public string DockerRepository { get; set; } + + [JsonProperty("docker_image")] + public string DockerImage { get; set; } + + [JsonProperty("docker_tag")] + public string DockerTag { get; set; } + + [JsonProperty("private_username")] + public string PrivateUsername { get; set; } + + [JsonProperty("private_token")] + public string PrivateToken { get; set; } + + [JsonProperty("req_cpu")] + public int? ReqCpu { get; set; } + + [JsonProperty("req_memory")] + public int? ReqMemory { get; set; } + + [JsonProperty("req_video")] + public int? ReqVideo { get; set; } + + [JsonProperty("max_duration")] + public int? MaxDuration { get; set; } + + [JsonProperty("use_telemetry")] + public bool UseTelemetry { get; set; } + + [JsonProperty("inject_context_env")] + public bool InjectContextEnv { get; set; } + + [JsonProperty("whitelisting_active")] + public bool WhitelistingActive { get; set; } + + [JsonProperty("force_cache")] + public bool ForceCache { get; set; } + + [JsonProperty("cache_min_hour")] + public int? CacheMinHour { get; set; } + + [JsonProperty("cache_max_hour")] + public int? CacheMaxHour { get; set; } + + [JsonProperty("time_to_deploy")] + public int? TimeToDeploy { get; set; } + + [JsonProperty("enable_all_locations")] + public bool EnableAllLocations { get; set; } + + [JsonProperty("session_config")] + public SessionConfigData SessionConfig { get; set; } + + [JsonProperty("ports")] + public PortsData[] Ports { get; set; } + + [JsonProperty("probe")] + public ProbeData Probe { get; set; } + + [JsonProperty("envs")] + public EnvsData[] Envs { get; set; } + + [JsonProperty("verify_image")] + public bool VerifyImage { get; set; } + + [JsonProperty("termination_grace_period_seconds")] + public int? TerminationGracePeriodSeconds { get; set; } + + [JsonProperty("endpoint_storage")] + public string EndpointStorage { get; set; } + + [JsonProperty("command")] + public string Command { get; set; } + + [JsonProperty("arguments")] + public string Arguments { get; set; } + } + + public class SessionConfigData + { + [JsonProperty("kind")] + public string Kind { get; set; } + + [JsonProperty("sockets")] + public int? Sockets { get; set; } + + [JsonProperty("autodeploy")] + public bool Autodeploy { get; set; } + + [JsonProperty("empty_ttl")] + public int? EmptyTtl { get; set; } + + [JsonProperty("session_max_duration")] + public int? SessionMaxDuration { get; set; } + } + + public class PortsData + { + [JsonProperty("port")] + public int? Port { get; set; } + + [JsonProperty("protocol")] + public string Protocol { get; set; } + + [JsonProperty("to_check")] + public bool ToCheck { get; set; } + + [JsonProperty("tls_upgrade")] + public bool TlsUpgrade { get; set; } + + [JsonProperty("name")] + public string PortName { get; set; } + } + + public class ProbeData + { + [JsonProperty("optimal_ping")] + public int? OptimalPing { get; set; } + + [JsonProperty("rejected_ping")] + public int? RejectedPing { get; set; } + } + + public class EnvsData + { + [JsonProperty("key")] + public string Key { get; set; } + + [JsonProperty("value")] + public string Value { get; set; } + + [JsonProperty("is_secret")] + public bool IsSecret { get; set; } + } + + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/UpsertAppVersionResult.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/UpsertAppVersionResult.cs.meta new file mode 100644 index 0000000..e08dbf4 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/Results/UpsertAppVersionResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a7dde7d59c66d8c44b86af35e853f9f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/SessionData.cs b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/SessionData.cs new file mode 100644 index 0000000..458da78 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/SessionData.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; + +namespace Edgegap.Editor.Api.Models +{ + /// + /// Shared model for `GetDeploymentStatusResult`, `StopActiveDeploymentResult`. + /// + public class SessionData + { + [JsonProperty("session_id")] + public string SessionId { get; set; } + + [JsonProperty("status")] + public string Status { get; set; } + + [JsonProperty("ready")] + public bool Ready { get; set; } + + [JsonProperty("linked")] + public bool Linked { get; set; } + + [JsonProperty("kind")] + public string Kind { get; set; } + + [JsonProperty("user_count")] + public string UserCount { get; set; } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/SessionData.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/SessionData.cs.meta new file mode 100644 index 0000000..86d9d28 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/Api/Models/SessionData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5f9024e4ca5438e4788e461387313531 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/ButtonShaker.cs b/Assets/FishNet/Plugins/Edgegap/Editor/ButtonShaker.cs new file mode 100644 index 0000000..40203ea --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/ButtonShaker.cs @@ -0,0 +1,37 @@ +using System.Threading.Tasks; +using UnityEngine.UIElements; + +namespace Edgegap.Editor +{ + /// Slightly shake a UI button to indicate attention. + public class ButtonShaker + { + const string SHAKE_START_CLASS = "shakeStart"; + const string SHAKE_STOP_CLASS = "shakeEnd"; + private Button targetButton; + + public ButtonShaker(Button buttonToShake) => + targetButton = buttonToShake; + + /// Shake the button x times for x msDelayBetweenShakes each. + /// 1 shake = 1 bigger -> followed by 1 smaller. + /// + /// # of shakes + public async Task ApplyShakeAsync(int msDelayBetweenShakes = 40, int iterations = 2) + { + for (int i = 0; i < iterations; i++) + await shakeOnce(msDelayBetweenShakes); + } + + private async Task shakeOnce(int msDelayBetweenShakes) + { + targetButton.AddToClassList(SHAKE_START_CLASS); + await Task.Delay(msDelayBetweenShakes); // duration of the first transition + targetButton.RemoveFromClassList(SHAKE_START_CLASS); + + targetButton.AddToClassList(SHAKE_STOP_CLASS); + await Task.Delay(msDelayBetweenShakes); // duration of the second transition + targetButton.RemoveFromClassList(SHAKE_STOP_CLASS); + } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/ButtonShaker.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/ButtonShaker.cs.meta new file mode 100644 index 0000000..7272ca6 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/ButtonShaker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f963d64ffcf32ba4bba54fe1cd70b5a1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapBuildUtils.cs b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapBuildUtils.cs new file mode 100644 index 0000000..cbae559 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapBuildUtils.cs @@ -0,0 +1,300 @@ +#if UNITY_EDITOR +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using UnityEditor; +using UnityEditor.Build.Reporting; + +using Debug = UnityEngine.Debug; + +namespace Edgegap +{ + internal static class EdgegapBuildUtils + { + public static bool IsArmCPU() => + RuntimeInformation.ProcessArchitecture == Architecture.Arm || + RuntimeInformation.ProcessArchitecture == Architecture.Arm64; + + public static BuildReport BuildServer() + { + IEnumerable scenes = EditorBuildSettings.scenes.Select(s=>s.path); + BuildPlayerOptions options = new BuildPlayerOptions + { + scenes = scenes.ToArray(), + target = BuildTarget.StandaloneLinux64, + // MIRROR CHANGE +#if UNITY_2021_3_OR_NEWER + subtarget = (int)StandaloneBuildSubtarget.Server, // dedicated server with UNITY_SERVER define +#else + options = BuildOptions.EnableHeadlessMode, // obsolete and missing UNITY_SERVER define +#endif + // END MIRROR CHANGE + locationPathName = "Builds/EdgegapServer/ServerBuild" + }; + + return BuildPipeline.BuildPlayer(options); + } + + public static async Task DockerSetupAndInstallationCheck() + { + if (!File.Exists("Dockerfile")) + { + File.WriteAllText("Dockerfile", dockerFileText); + } + + string output = null; + string error = null; + await RunCommand_DockerVersion(msg => output = msg, msg => error = msg); // MIRROR CHANGE + if (!string.IsNullOrEmpty(error)) + { + Debug.LogError(error); + return false; + } + Debug.Log($"[Edgegap] Docker version detected: {output}"); // MIRROR CHANGE + return true; + } + + // MIRROR CHANGE + static async Task RunCommand_DockerVersion(Action outputReciever = null, Action errorReciever = null) + { +#if UNITY_EDITOR_WIN + await RunCommand("cmd.exe", "/c docker --version", outputReciever, errorReciever); +#elif UNITY_EDITOR_OSX + await RunCommand("/bin/bash", "-c \"docker --version\"", outputReciever, errorReciever); +#elif UNITY_EDITOR_LINUX + await RunCommand("/bin/bash", "-c \"docker --version\"", outputReciever, errorReciever); +#else + Debug.LogError("The platform is not supported yet."); +#endif + } + + // MIRROR CHANGE + public static async Task RunCommand_DockerBuild(string registry, string imageRepo, string tag, Action onStatusUpdate) + { + string realErrorMessage = null; + + // ARM -> x86 support: + // build commands use 'buildx' on ARM cpus for cross compilation. + // otherwise docker builds would not launch when deployed because + // Edgegap's infrastructure is on x86. instead the deployment logs + // would show an error in a linux .go file with 'not found'. + string buildCommand = IsArmCPU() ? "buildx build --platform linux/amd64" : "build"; + +#if UNITY_EDITOR_WIN + await RunCommand("docker.exe", $"{buildCommand} -t {registry}/{imageRepo}:{tag} .", onStatusUpdate, +#elif UNITY_EDITOR_OSX + await RunCommand("/bin/bash", $"-c \"docker {buildCommand} -t {registry}/{imageRepo}:{tag} .\"", onStatusUpdate, +#elif UNITY_EDITOR_LINUX + await RunCommand("/bin/bash", $"-c \"docker {buildCommand} -t {registry}/{imageRepo}:{tag} .\"", onStatusUpdate, +#endif + (msg) => + { + if (msg.Contains("ERROR")) + { + realErrorMessage = msg; + } + onStatusUpdate(msg); + }); + + if (realErrorMessage != null) + { + throw new Exception(realErrorMessage); + } + } + + public static async Task<(bool, string)> RunCommand_DockerPush(string registry, string imageRepo, string tag, Action onStatusUpdate) + { + string error = string.Empty; +#if UNITY_EDITOR_WIN + await RunCommand("docker.exe", $"push {registry}/{imageRepo}:{tag}", onStatusUpdate, (msg) => error += msg + "\n"); +#elif UNITY_EDITOR_OSX + await RunCommand("/bin/bash", $"-c \"docker push {registry}/{imageRepo}:{tag}\"", onStatusUpdate, (msg) => error += msg + "\n"); +#elif UNITY_EDITOR_LINUX + await RunCommand("/bin/bash", $"-c \"docker push {registry}/{imageRepo}:{tag}\"", onStatusUpdate, (msg) => error += msg + "\n"); +#endif + if (!string.IsNullOrEmpty(error)) + { + Debug.LogError(error); + return (false, error); + } + return (true, null); + } + // END MIRROR CHANGE + + static async Task RunCommand(string command, string arguments, Action outputReciever = null, Action errorReciever = null) + { + ProcessStartInfo startInfo = new ProcessStartInfo() + { + FileName = command, + Arguments = arguments, + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true, + }; + + // MIRROR CHANGE +#if !UNITY_EDITOR_WIN + // on mac, commands like 'docker' aren't found because it's not in the application's PATH + // even if it runs on mac's terminal. + // to solve this we need to do two steps: + // 1. add /usr/bin/local to PATH if it's not there already. often this is missing in the application. + // this is where docker is usually instaled. + // 2. add PATH to ProcessStartInfo + string existingPath = Environment.GetEnvironmentVariable("PATH"); + string customPath = $"{existingPath}:/usr/local/bin"; + startInfo.EnvironmentVariables["PATH"] = customPath; + // Debug.Log("PATH: " + customPath); +#endif + // END MIRROR CHANGE + + Process proc = new Process() { StartInfo = startInfo, }; + proc.EnableRaisingEvents = true; + + ConcurrentQueue errors = new ConcurrentQueue(); + ConcurrentQueue outputs = new ConcurrentQueue(); + + void pipeQueue(ConcurrentQueue q, Action opt) + { + while (!q.IsEmpty) + { + if (q.TryDequeue(out string msg) && !string.IsNullOrWhiteSpace(msg)) + { + opt?.Invoke(msg); + } + } + } + + proc.OutputDataReceived += (s, e) => outputs.Enqueue(e.Data); + proc.ErrorDataReceived += (s, e) => errors.Enqueue(e.Data); + + proc.Start(); + proc.BeginOutputReadLine(); + proc.BeginErrorReadLine(); + + while (!proc.HasExited) + { + await Task.Delay(100); + pipeQueue(errors, errorReciever); + pipeQueue(outputs, outputReciever); + } + + pipeQueue(errors, errorReciever); + pipeQueue(outputs, outputReciever); + + + } + + static void Proc_OutputDataReceived(object sender, DataReceivedEventArgs e) + { + throw new NotImplementedException(); + } + + static Regex lastDigitsRegex = new Regex("([0-9])+$"); + + public static string IncrementTag(string tag) + { + Match lastDigits = lastDigitsRegex.Match(tag); + if (!lastDigits.Success) + { + return tag + " _1"; + } + + int number = int.Parse(lastDigits.Groups[0].Value); + + number++; + + return lastDigitsRegex.Replace(tag, number.ToString()); + } + + public static void UpdateEdgegapAppTag(string tag) + { + // throw new NotImplementedException(); + } + + // -batchmode -nographics remains for Unity 2019/2020 support pre-dedicated server builds + static string dockerFileText = @"FROM ubuntu:bionic + +ARG DEBIAN_FRONTEND=noninteractive + +COPY Builds/EdgegapServer /root/build/ + +WORKDIR /root/ + +RUN chmod +x /root/build/ServerBuild + +ENTRYPOINT [ ""/root/build/ServerBuild"", ""-batchmode"", ""-nographics""] +"; + + /// Run a Docker cmd with streaming log response. TODO: Plugin to other Docker cmds + /// Throws if logs contain "ERROR" + /// + /// ex: "registry.edgegap.com" + /// ex: "robot$mycompany-asdf+client-push" + /// Different from ApiToken; sometimes called "Container Registry Password" + /// Log stream + // MIRROR CHANGE: CROSS PLATFORM SUPPORT + static async Task RunCommand_DockerLogin( + string registryUrl, + string repoUsername, + string repoPasswordToken, + Action outputReciever = null, Action errorReciever = null) + { + // TODO: Use --password-stdin for security (!) This is no easy task for child Process | https://stackoverflow.com/q/51489359/6541639 + // (!) Don't use single quotes for cross-platform support (works unexpectedly in `cmd`). + + try + { +#if UNITY_EDITOR_WIN + await RunCommand("cmd.exe", $"/c docker login -u \"{repoUsername}\" --password \"{repoPasswordToken}\" \"{registryUrl}\"", outputReciever, errorReciever); +#elif UNITY_EDITOR_OSX + await RunCommand("/bin/bash", $"-c \"docker login -u \"{repoUsername}\" --password \"{repoPasswordToken}\" \"{registryUrl}\"\"", outputReciever, errorReciever); +#elif UNITY_EDITOR_LINUX + await RunCommand("/bin/bash", $"-c \"docker login -u \"{repoUsername}\" --password \"{repoPasswordToken}\" \"{registryUrl}\"\"", outputReciever, errorReciever); +#else + Debug.LogError("The platform is not supported yet."); +#endif + } + catch (Exception e) + { + Debug.LogError($"Error: {e}"); + return false; + } + + return true; + } + + /// + /// v2: Login to Docker Registry via RunCommand(), returning streamed log messages: + /// "docker login {registryUrl} {repository} {repoUsername} {repoPasswordToken}" + /// + /// ex: "registry.edgegap.com" + /// ex: "robot$mycompany-asdf+client-push" + /// Different from ApiToken; sometimes called "Container Registry Password" + /// Log stream + /// isSuccess + public static async Task LoginContainerRegistry( + string registryUrl, + string repoUsername, + string repoPasswordToken, + Action onStatusUpdate) + { + string error = null; + await RunCommand_DockerLogin(registryUrl, repoUsername, repoPasswordToken, onStatusUpdate, msg => error = msg); // MIRROR CHANGE + if (error.Contains("ERROR")) + { + Debug.LogError(error); + return false; + } + return true; + } + + } +} +#endif \ No newline at end of file diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapBuildUtils.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapBuildUtils.cs.meta new file mode 100644 index 0000000..03529c4 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapBuildUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 97dadab2a073d8b47bf9a270401f0a8f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapScriptEditor.cs b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapScriptEditor.cs new file mode 100644 index 0000000..4c329b2 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapScriptEditor.cs @@ -0,0 +1,27 @@ +#if UNITY_EDITOR +using UnityEditor; +using UnityEngine.UIElements; +using Edgegap; + +[CustomEditor(typeof(EdgegapToolScript))] +public class EdgegapPluginScriptEditor : Editor +{ + VisualElement _serverDataContainer; + + private void OnEnable() + { + _serverDataContainer = EdgegapServerDataManager.GetServerDataVisualTree(); + EdgegapServerDataManager.RegisterServerDataContainer(_serverDataContainer); + } + + private void OnDisable() + { + EdgegapServerDataManager.DeregisterServerDataContainer(_serverDataContainer); + } + + public override VisualElement CreateInspectorGUI() + { + return _serverDataContainer; + } +} +#endif \ No newline at end of file diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapScriptEditor.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapScriptEditor.cs.meta new file mode 100644 index 0000000..60f708f --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapScriptEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c4c676ae6dcca0e458c6a8f06571f8fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerData.uss b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerData.uss new file mode 100644 index 0000000..15cb5e3 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerData.uss @@ -0,0 +1,81 @@ +.row__port-table { + padding: 2px 4px; + display: flex; + flex-direction: row; + align-items: center; + width: auto; + justify-content: space-around; + -unity-text-align: middle-left; +} + + .row__port-table > * { + width: 0px; + flex-grow: 1; + align-self: center; + margin: 0px; + padding: 0px; + } + +.focusable:hover { + background-color: rgba(0,0,0,0.2); + border-radius: 3px; +} + +.row__dns { + display: flex; + flex-direction: row; + align-items: center; + width: auto; + justify-content: space-between; + -unity-text-align: middle-left; +} + +.row__status { + display: flex; + flex-direction: row; + align-items: center; + width: auto; + justify-content: space-between; + -unity-text-align: middle-left; +} + +.label__header { + -unity-font-style: bold +} + +.label__status { + -unity-font-style: bold; + border-radius: 2px; + width: 100px; + color: #fff; + -unity-text-align: middle-center; +} + +.label__info-text { + padding: 8px; + margin: 4px; + border-radius: 3px; + -unity-text-align: middle-center; + white-space: normal; + background-color: rgba(42, 42, 42, 0.5); +} + +.container { + margin: 8px 0px; +} + +.bg--secondary { + background-color: #8a8a8a; +} + +.bg--success { + background-color: #90be6d; +} + +.bg--danger { + background-color: #f94144; +} + +.bg--warning { + background-color: #f9c74f; +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerData.uss.meta b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerData.uss.meta new file mode 100644 index 0000000..b9cce48 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerData.uss.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da5e3f58bd8cde14789f7c61df3f59f4 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} + disableValidation: 0 diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerDataManager.cs b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerDataManager.cs new file mode 100644 index 0000000..b4dc287 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerDataManager.cs @@ -0,0 +1,242 @@ +using IO.Swagger.Model; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; + +namespace Edgegap +{ + static class EdgegapServerDataManagerUtils + { + public static Label GetHeader(string text) + { + Label header = new Label(text); + header.AddToClassList("label__header"); + + return header; + } + + public static VisualElement GetHeaderRow() + { + VisualElement row = new VisualElement(); + row.AddToClassList("row__port-table"); + row.AddToClassList("label__header"); + + row.Add(new Label("Name")); + row.Add(new Label("External")); + row.Add(new Label("Internal")); + row.Add(new Label("ProtocolStr")); + row.Add(new Label("Link")); + + return row; + } + + public static VisualElement GetRowFromPortResponse(PortMapping port) + { + VisualElement row = new VisualElement(); + row.AddToClassList("row__port-table"); + row.AddToClassList("focusable"); + + + row.Add(new Label(port.Name)); + row.Add(new Label(port.External.ToString())); + row.Add(new Label(port.Internal.ToString())); + row.Add(new Label(port.Protocol)); + row.Add(GetCopyButton("Copy", port.Link)); + + return row; + } + + public static Button GetCopyButton(string btnText, string copiedText) + { + Button copyBtn = new Button(); + copyBtn.text = btnText; + copyBtn.clickable.clicked += () => GUIUtility.systemCopyBuffer = copiedText; + + return copyBtn; + } + + public static Button GetLinkButton(string btnText, string targetUrl) + { + Button copyBtn = new Button(); + copyBtn.text = btnText; + copyBtn.clickable.clicked += () => UnityEngine.Application.OpenURL(targetUrl); + + return copyBtn; + } + public static Label GetInfoText(string innerText) + { + Label infoText = new Label(innerText); + infoText.AddToClassList("label__info-text"); + + return infoText; + } + } + + /// + /// Utility class to centrally manage the Edgegap server data, and create / update the elements displaying the server info. + /// + public static class EdgegapServerDataManager + { + internal static Status _serverData; + private static ApiEnvironment _apiEnvironment; + + // UI elements + private static readonly StyleSheet _serverDataStylesheet; + private static readonly List _serverDataContainers = new List(); + + public static Status GetServerStatus() => _serverData; + + static EdgegapServerDataManager() + { +#if UNITY_EDITOR + _serverDataStylesheet = AssetDatabase.LoadAssetAtPath("Assets/Edgegap/Editor/EdgegapServerData.uss"); +#endif + } + public static void RegisterServerDataContainer(VisualElement serverDataContainer) + { + _serverDataContainers.Add(serverDataContainer); + } + public static void DeregisterServerDataContainer(VisualElement serverDataContainer) + { + _serverDataContainers.Remove(serverDataContainer); + } + public static void SetServerData(Status serverData, ApiEnvironment apiEnvironment) + { + _serverData = serverData; + _apiEnvironment = apiEnvironment; + RefreshServerDataContainers(); + } + + private static VisualElement GetStatusSection() + { + ServerStatus serverStatus = _serverData.GetServerStatus(); + string dashboardUrl = _apiEnvironment.GetDashboardUrl(); + string requestId = _serverData.RequestId; + string deploymentDashboardUrl = ""; + + if (!string.IsNullOrEmpty(requestId) && !string.IsNullOrEmpty(dashboardUrl)) + { + deploymentDashboardUrl = $"{dashboardUrl}/arbitrium/deployment/read/{requestId}/"; + } + + VisualElement container = new VisualElement(); + container.AddToClassList("container"); + + container.Add(EdgegapServerDataManagerUtils.GetHeader("Server Status")); + + VisualElement row = new VisualElement(); + row.AddToClassList("row__status"); + + // Status pill + Label statusLabel = new Label(serverStatus.GetLabelText()); + statusLabel.AddToClassList(serverStatus.GetStatusBgClass()); + statusLabel.AddToClassList("label__status"); + row.Add(statusLabel); + + // Link to dashboard + if (!string.IsNullOrEmpty(deploymentDashboardUrl)) + { + row.Add(EdgegapServerDataManagerUtils.GetLinkButton("See in the dashboard", deploymentDashboardUrl)); + } + else + { + row.Add(new Label("Could not resolve link to this deployment")); + } + + container.Add(row); + + return container; + } + + private static VisualElement GetDnsSection() + { + string serverDns = _serverData.Fqdn; + + VisualElement container = new VisualElement(); + container.AddToClassList("container"); + + container.Add(EdgegapServerDataManagerUtils.GetHeader("Server DNS")); + + VisualElement row = new VisualElement(); + row.AddToClassList("row__dns"); + row.AddToClassList("focusable"); + + row.Add(new Label(serverDns)); + row.Add(EdgegapServerDataManagerUtils.GetCopyButton("Copy", serverDns)); + + container.Add(row); + + return container; + } + + private static VisualElement GetPortsSection() + { + List serverPorts = _serverData.Ports.Values.ToList(); + + VisualElement container = new VisualElement(); + container.AddToClassList("container"); + + container.Add(EdgegapServerDataManagerUtils.GetHeader("Server PortsDict")); + container.Add(EdgegapServerDataManagerUtils.GetHeaderRow()); + + VisualElement portList = new VisualElement(); + + if (serverPorts.Count > 0) + { + foreach (PortMapping port in serverPorts) + { + portList.Add(EdgegapServerDataManagerUtils.GetRowFromPortResponse(port)); + } + } + else + { + portList.Add(new Label("No port configured for this app version.")); + } + + container.Add(portList); + + return container; + } + + public static VisualElement GetServerDataVisualTree() + { + VisualElement serverDataTree = new VisualElement(); + serverDataTree.styleSheets.Add(_serverDataStylesheet); + + bool hasServerData = _serverData != null; + bool isReady = hasServerData && _serverData.GetServerStatus().IsOneOf(ServerStatus.Ready, ServerStatus.Error); + + if (hasServerData) + { + serverDataTree.Add(GetStatusSection()); + + if (isReady) + { + serverDataTree.Add(GetDnsSection()); + serverDataTree.Add(GetPortsSection()); + } + else + { + serverDataTree.Add(EdgegapServerDataManagerUtils.GetInfoText("Additional information will be displayed when the server is ready.")); + } + } + else + { + serverDataTree.Add(EdgegapServerDataManagerUtils.GetInfoText("Server data will be displayed here when a server is running.")); + } + + return serverDataTree; + } + + private static void RefreshServerDataContainers() + { + foreach (VisualElement serverDataContainer in _serverDataContainers) + { + serverDataContainer.Clear(); + serverDataContainer.Add(GetServerDataVisualTree()); // Cannot reuse a same instance of VisualElement + } + } + } +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerDataManager.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerDataManager.cs.meta new file mode 100644 index 0000000..65da2ab --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapServerDataManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39f5f27c13279a34eb116630a00e41c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapToolScript.cs b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapToolScript.cs new file mode 100644 index 0000000..870190d --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapToolScript.cs @@ -0,0 +1,12 @@ +using UnityEngine; +using Edgegap; +using IO.Swagger.Model; + +/// +/// This script acts as an interface to display and use the necessary variables from the Edgegap tool. +/// The server info can be accessed from the tool window, as well as through the public script property. +/// +public class EdgegapToolScript : MonoBehaviour +{ + public Status ServerStatus => EdgegapServerDataManager.GetServerStatus(); +} diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapToolScript.cs.meta b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapToolScript.cs.meta new file mode 100644 index 0000000..d584893 --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapToolScript.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5963202433da25448a22def99f5a598b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapWindow.cs b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapWindow.cs new file mode 100644 index 0000000..57ef56a --- /dev/null +++ b/Assets/FishNet/Plugins/Edgegap/Editor/EdgegapWindow.cs @@ -0,0 +1,985 @@ +#if UNITY_EDITOR +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; +using UnityEditor.UIElements; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Collections.Generic; +using Newtonsoft.Json; +using System.Net; +using System.Text; +using System; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using IO.Swagger.Model; +using UnityEditor.Build.Reporting; +using Application = UnityEngine.Application; + +namespace Edgegap +{ + public class EdgegapWindow : EditorWindow + { + // MIRROR CHANGE: create HTTPClient in-place to avoid InvalidOperationExceptions when reusing + // static readonly HttpClient _httpClient = new HttpClient(); + // END MIRROR CHANGE + + const string EditorDataSerializationName = "EdgegapSerializationData"; + const int ServerStatusCronjobIntervalMs = 10000; // Interval at which the server status is updated + + // MIRROR CHANGE + // get the path of this .cs file so we don't need to hardcode paths to + // the .uxml and .uss files: + // https://forum.unity.com/threads/too-many-hard-coded-paths-in-the-templates-and-documentation.728138/ + // this way users can move this folder without breaking UIToolkit paths. + internal string StylesheetPath => + Path.GetDirectoryName(AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this))); + // END MIRROR CHANGE + + readonly System.Timers.Timer _updateServerStatusCronjob = new System.Timers.Timer(ServerStatusCronjobIntervalMs); + + [SerializeField] string _userExternalIp; + [SerializeField] string _apiKey; + [SerializeField] ApiEnvironment _apiEnvironment; + [SerializeField] string _appName; + [SerializeField] string _appVersionName; + [SerializeField] string _deploymentRequestId; + + [SerializeField] string _containerRegistry; + [SerializeField] string _containerImageRepo; + [SerializeField] string _containerImageTag; + [SerializeField] bool _autoIncrementTag = true; + + + VisualTreeAsset _visualTree; + bool _shouldUpdateServerStatus = false; + + // Interactable elements + EnumField _apiEnvironmentSelect; + TextField _apiKeyInput; + TextField _appNameInput; + TextField _appVersionNameInput; + TextField _containerRegistryInput; + TextField _containerImageRepoInput; + TextField _containerImageTagInput; + Toggle _autoIncrementTagInput; + Button _connectionButton; + Button _serverActionButton; + Button _documentationBtn; + Button _buildAndPushServerBtn; + + // Readonly elements + Label _connectionStatusLabel; + VisualElement _serverDataContainer; + + // server data manager + StyleSheet _serverDataStylesheet; + List _serverDataContainers = new List(); + + [Obsolete("See EdgegapWindowV2.ShowEdgegapToolWindow()")] + // [MenuItem("Edgegap/Server Management")] + public static void ShowEdgegapToolWindow() + { + EdgegapWindow window = GetWindow(); + window.titleContent = new GUIContent("Edgegap Hosting"); // MIRROR CHANGE + } + + protected void OnEnable() + { + // Set root VisualElement and style + // BEGIN MIRROR CHANGE + _visualTree = AssetDatabase.LoadAssetAtPath($"{StylesheetPath}/EdgegapWindow.uxml"); + StyleSheet styleSheet = AssetDatabase.LoadAssetAtPath($"{StylesheetPath}/EdgegapWindow.uss"); + _serverDataStylesheet = AssetDatabase.LoadAssetAtPath($"{StylesheetPath}/EdgegapServerData.uss"); + // END MIRROR CHANGE + rootVisualElement.styleSheets.Add(styleSheet); + + LoadToolData(); + + if (string.IsNullOrWhiteSpace(_userExternalIp)) + { + _userExternalIp = GetExternalIpAddress(); + } + } + + protected void Update() + { + if (_shouldUpdateServerStatus) + { + _shouldUpdateServerStatus = false; + UpdateServerStatus(); + } + } + + public void CreateGUI() + { + rootVisualElement.Clear(); + _visualTree.CloneTree(rootVisualElement); + + InitUIElements(); + SyncFormWithObject(); + + bool hasActiveDeployment = !string.IsNullOrEmpty(_deploymentRequestId); + + if (hasActiveDeployment) + { + RestoreActiveDeployment(); + } + else + { + DisconnectCallback(); + } + } + + protected void OnDestroy() + { + bool deploymentActive = !string.IsNullOrEmpty(_deploymentRequestId); + + if (deploymentActive) + { + EditorUtility.DisplayDialog( + "Warning", + $"You have an active deployment ({_deploymentRequestId}) that won't be stopped automatically.", + "Ok" + ); + } + } + + protected void OnDisable() + { + SyncObjectWithForm(); + SaveToolData(); + DeregisterServerDataContainer(_serverDataContainer); + } + + /// + /// Binds the form inputs to the associated variables and initializes the inputs as required. + /// Requires the VisualElements to be loaded before this call. Otherwise, the elements cannot be found. + /// + void InitUIElements() + { + _apiEnvironmentSelect = rootVisualElement.Q("environmentSelect"); + _apiKeyInput = rootVisualElement.Q("apiKey"); + _appNameInput = rootVisualElement.Q("appName"); + _appVersionNameInput = rootVisualElement.Q("appVersionName"); + + _containerRegistryInput = rootVisualElement.Q("containerRegistry"); + _containerImageRepoInput = rootVisualElement.Q("containerImageRepo"); + _containerImageTagInput = rootVisualElement.Q("tag"); + _autoIncrementTagInput = rootVisualElement.Q("autoIncrementTag"); + + _connectionButton = rootVisualElement.Q