Decompiled source of ZibraFireSmokeAndLiquid v1.1.2

Plugin/TheWeavers.ZibraFireSmokeAndLiquid.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using TheWeavers.ZibraFireSmokeAndLiquid.NetcodePatcher;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("TheWeavers.ZibraFireSmokeAndLiquid")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.1.2.0")]
[assembly: AssemblyInformationalVersion("1.1.2+5970cb35427a82ac505e3b6ec8115027a2bd6ba4")]
[assembly: AssemblyProduct("ZibraFireSmokeAndLiquid")]
[assembly: AssemblyTitle("TheWeavers.ZibraFireSmokeAndLiquid")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Zibra
{
	[BepInPlugin("TheWeavers.ZibraFireSmokeAndLiquid", "ZibraFireSmokeAndLiquid", "1.1.2")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger = null;

		internal static string pluginPath = "";

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Starting to unwrap assemblies!");
			string path = Paths.PluginPath;
			string[] directories = Directory.GetDirectories(path, "TheWeavers-ZibraFireSmokeAndLiquid*");
			if (directories.Length == 0)
			{
				Logger.LogWarning((object)"No directories matching 'TheWeavers-ZibraFireSmokeAndLiquid*' found.");
				return;
			}
			pluginPath = directories[0];
			Logger.LogInfo((object)("Found matching directory: " + pluginPath));
			InjectNativeFileIntoGame();
			LoadDependencies(pluginPath);
		}

		private void LoadDependencies(string targetDirectory)
		{
			if (Directory.Exists(targetDirectory))
			{
				string[] files = Directory.GetFiles(targetDirectory, "ZibraAI*.dll");
				foreach (string path in files)
				{
					try
					{
						Assembly.LoadFile(path);
						Logger.LogInfo((object)("Loaded " + Path.GetFileName(path) + " successfully."));
					}
					catch (Exception ex)
					{
						Logger.LogError((object)("Failed to load " + Path.GetFileName(path) + ": " + ex.Message));
					}
				}
			}
			else
			{
				Logger.LogWarning((object)"Dependencies folder not found.");
			}
		}

		private void InjectNativeFileIntoGame()
		{
			string text = "Lethal Company_Data/Plugins/x86_64";
			if (!Directory.Exists(Path.Combine(Paths.GameRootPath, text)))
			{
				Directory.CreateDirectory(Path.Combine(Paths.GameRootPath, text));
			}
			File.Copy(Path.Combine(pluginPath, "ZibraLiquidNative_Win.dll"), Path.Combine(text, "ZibraLiquidNative_Win.dll"), overwrite: true);
			File.Copy(Path.Combine(pluginPath, "ZibraSmokeAndFireNative_Win.dll"), Path.Combine(text, "ZibraSmokeAndFireNative_Win.dll"), overwrite: true);
			Logger.LogInfo((object)("Successfully injected assemblies to " + text));
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "TheWeavers.ZibraFireSmokeAndLiquid";

		public const string PLUGIN_NAME = "ZibraFireSmokeAndLiquid";

		public const string PLUGIN_VERSION = "1.1.2";
	}
}
namespace TheWeavers.ZibraFireSmokeAndLiquid.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}

ZibraBasePlugin/ZibraAI.ZibraEffects.dll

Decompiled 2 months ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Rendering;
using UnityEngine.Serialization;
using UnityEngine.Timeline;
using com.zibra.common.DataStructures;
using com.zibra.common.Utilities;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyFileVersion("2.1.5.0")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.Editor")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.Liquid")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.Liquid.Editor")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.SmokeAndFire")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.SmokeAndFire.Editor")]
[assembly: AssemblyVersion("2.1.5.0")]
[CompilerGenerated]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)]
internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
{
	private struct MonoScriptData
	{
		public byte[] FilePathsData;

		public byte[] TypesData;

		public int TotalTypes;

		public int TotalFiles;

		public bool IsEditorOnly;
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	private static MonoScriptData Get()
	{
		MonoScriptData result = default(MonoScriptData);
		result.FilePathsData = new byte[1383]
		{
			0, 0, 0, 1, 0, 0, 0, 39, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			67, 111, 109, 109, 111, 110, 92, 69, 102, 102,
			101, 99, 116, 115, 46, 99, 115, 0, 0, 0,
			2, 0, 0, 0, 73, 92, 65, 115, 115, 101,
			116, 115, 92, 80, 108, 117, 103, 105, 110, 115,
			92, 90, 105, 98, 114, 97, 92, 67, 111, 109,
			109, 111, 110, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 68, 97, 116, 97, 83, 116, 114, 117,
			99, 116, 117, 114, 101, 115, 92, 77, 101, 115,
			104, 82, 101, 112, 114, 101, 115, 101, 110, 116,
			97, 116, 105, 111, 110, 46, 99, 115, 0, 0,
			0, 1, 0, 0, 0, 69, 92, 65, 115, 115,
			101, 116, 115, 92, 80, 108, 117, 103, 105, 110,
			115, 92, 90, 105, 98, 114, 97, 92, 67, 111,
			109, 109, 111, 110, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 68, 97, 116, 97, 83, 116, 114,
			117, 99, 116, 117, 114, 101, 115, 92, 86, 111,
			120, 101, 108, 69, 109, 98, 101, 100, 100, 105,
			110, 103, 46, 99, 115, 0, 0, 0, 3, 0,
			0, 0, 74, 92, 65, 115, 115, 101, 116, 115,
			92, 80, 108, 117, 103, 105, 110, 115, 92, 90,
			105, 98, 114, 97, 92, 67, 111, 109, 109, 111,
			110, 92, 83, 99, 114, 105, 112, 116, 115, 92,
			68, 97, 116, 97, 83, 116, 114, 117, 99, 116,
			117, 114, 101, 115, 92, 86, 111, 120, 101, 108,
			82, 101, 112, 114, 101, 115, 101, 110, 116, 97,
			116, 105, 111, 110, 46, 99, 115, 0, 0, 0,
			1, 0, 0, 0, 58, 92, 65, 115, 115, 101,
			116, 115, 92, 80, 108, 117, 103, 105, 110, 115,
			92, 90, 105, 98, 114, 97, 92, 67, 111, 109,
			109, 111, 110, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 83, 111, 108, 118, 101, 114, 92, 77,
			97, 110, 105, 112, 117, 108, 97, 116, 111, 114,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			75, 92, 65, 115, 115, 101, 116, 115, 92, 80,
			108, 117, 103, 105, 110, 115, 92, 90, 105, 98,
			114, 97, 92, 67, 111, 109, 109, 111, 110, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 83, 111,
			108, 118, 101, 114, 92, 77, 97, 110, 105, 112,
			117, 108, 97, 116, 111, 114, 115, 92, 83, 68,
			70, 92, 65, 110, 97, 108, 121, 116, 105, 99,
			83, 68, 70, 46, 99, 115, 0, 0, 0, 2,
			0, 0, 0, 73, 92, 65, 115, 115, 101, 116,
			115, 92, 80, 108, 117, 103, 105, 110, 115, 92,
			90, 105, 98, 114, 97, 92, 67, 111, 109, 109,
			111, 110, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 83, 111, 108, 118, 101, 114, 92, 77, 97,
			110, 105, 112, 117, 108, 97, 116, 111, 114, 115,
			92, 83, 68, 70, 92, 78, 101, 117, 114, 97,
			108, 83, 68, 70, 46, 99, 115, 0, 0, 0,
			1, 0, 0, 0, 73, 92, 65, 115, 115, 101,
			116, 115, 92, 80, 108, 117, 103, 105, 110, 115,
			92, 90, 105, 98, 114, 97, 92, 67, 111, 109,
			109, 111, 110, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 83, 111, 108, 118, 101, 114, 92, 77,
			97, 110, 105, 112, 117, 108, 97, 116, 111, 114,
			115, 92, 83, 68, 70, 92, 83, 68, 70, 79,
			98, 106, 101, 99, 116, 46, 99, 115, 0, 0,
			0, 1, 0, 0, 0, 78, 92, 65, 115, 115,
			101, 116, 115, 92, 80, 108, 117, 103, 105, 110,
			115, 92, 90, 105, 98, 114, 97, 92, 67, 111,
			109, 109, 111, 110, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 83, 111, 108, 118, 101, 114, 92,
			77, 97, 110, 105, 112, 117, 108, 97, 116, 111,
			114, 115, 92, 83, 68, 70, 92, 83, 107, 105,
			110, 110, 101, 100, 77, 101, 115, 104, 83, 68,
			70, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 74, 92, 65, 115, 115, 101, 116, 115, 92,
			80, 108, 117, 103, 105, 110, 115, 92, 90, 105,
			98, 114, 97, 92, 67, 111, 109, 109, 111, 110,
			92, 83, 99, 114, 105, 112, 116, 115, 92, 83,
			111, 108, 118, 101, 114, 92, 77, 97, 110, 105,
			112, 117, 108, 97, 116, 111, 114, 115, 92, 83,
			68, 70, 92, 84, 101, 114, 114, 97, 105, 110,
			83, 68, 70, 46, 99, 115, 0, 0, 0, 2,
			0, 0, 0, 59, 92, 65, 115, 115, 101, 116,
			115, 92, 80, 108, 117, 103, 105, 110, 115, 92,
			90, 105, 98, 114, 97, 92, 67, 111, 109, 109,
			111, 110, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 83, 111, 108, 118, 101, 114, 92, 83, 116,
			97, 116, 82, 101, 112, 111, 114, 116, 101, 114,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			61, 92, 65, 115, 115, 101, 116, 115, 92, 80,
			108, 117, 103, 105, 110, 115, 92, 90, 105, 98,
			114, 97, 92, 67, 111, 109, 109, 111, 110, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 84, 105,
			109, 101, 108, 105, 110, 101, 92, 67, 111, 110,
			116, 114, 111, 108, 65, 115, 115, 101, 116, 46,
			99, 115, 0, 0, 0, 1, 0, 0, 0, 65,
			92, 65, 115, 115, 101, 116, 115, 92, 80, 108,
			117, 103, 105, 110, 115, 92, 90, 105, 98, 114,
			97, 92, 67, 111, 109, 109, 111, 110, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 84, 105, 109,
			101, 108, 105, 110, 101, 92, 67, 111, 110, 116,
			114, 111, 108, 66, 101, 104, 97, 118, 105, 111,
			117, 114, 46, 99, 115, 0, 0, 0, 1, 0,
			0, 0, 64, 92, 65, 115, 115, 101, 116, 115,
			92, 80, 108, 117, 103, 105, 110, 115, 92, 90,
			105, 98, 114, 97, 92, 67, 111, 109, 109, 111,
			110, 92, 83, 99, 114, 105, 112, 116, 115, 92,
			84, 105, 109, 101, 108, 105, 110, 101, 92, 80,
			108, 97, 121, 98, 97, 99, 107, 67, 111, 110,
			116, 114, 111, 108, 46, 99, 115, 0, 0, 0,
			1, 0, 0, 0, 66, 92, 65, 115, 115, 101,
			116, 115, 92, 80, 108, 117, 103, 105, 110, 115,
			92, 90, 105, 98, 114, 97, 92, 67, 111, 109,
			109, 111, 110, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 84, 105, 109, 101, 108, 105, 110, 101,
			92, 90, 105, 98, 114, 97, 67, 111, 110, 116,
			114, 111, 108, 84, 114, 97, 99, 107, 46, 99,
			115, 0, 0, 0, 1, 0, 0, 0, 67, 92,
			65, 115, 115, 101, 116, 115, 92, 80, 108, 117,
			103, 105, 110, 115, 92, 90, 105, 98, 114, 97,
			92, 67, 111, 109, 109, 111, 110, 92, 83, 99,
			114, 105, 112, 116, 115, 92, 85, 116, 105, 108,
			105, 116, 105, 101, 115, 92, 65, 114, 114, 97,
			121, 67, 111, 109, 112, 97, 99, 116, 105, 102,
			105, 101, 114, 46, 99, 115, 0, 0, 0, 1,
			0, 0, 0, 64, 92, 65, 115, 115, 101, 116,
			115, 92, 80, 108, 117, 103, 105, 110, 115, 92,
			90, 105, 98, 114, 97, 92, 67, 111, 109, 109,
			111, 110, 92, 85, 116, 105, 108, 105, 116, 105,
			101, 115, 92, 82, 101, 110, 100, 101, 114, 80,
			105, 112, 101, 108, 105, 110, 101, 68, 101, 116,
			101, 99, 116, 111, 114, 46, 99, 115, 0, 0,
			0, 2, 0, 0, 0, 55, 92, 65, 115, 115,
			101, 116, 115, 92, 80, 108, 117, 103, 105, 110,
			115, 92, 90, 105, 98, 114, 97, 92, 67, 111,
			109, 109, 111, 110, 92, 85, 116, 105, 108, 105,
			116, 105, 101, 115, 92, 90, 105, 98, 114, 97,
			74, 115, 111, 110, 85, 116, 105, 108, 46, 99,
			115, 0, 0, 0, 1, 0, 0, 0, 44, 92,
			65, 115, 115, 101, 116, 115, 92, 80, 108, 117,
			103, 105, 110, 115, 92, 90, 105, 98, 114, 97,
			92, 67, 111, 109, 109, 111, 110, 92, 90, 105,
			98, 114, 97, 72, 97, 115, 104, 49, 50, 56,
			46, 99, 115
		};
		result.TypesData = new byte[1209]
		{
			0, 0, 0, 0, 24, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 99, 111, 109, 109, 111,
			110, 124, 69, 102, 102, 101, 99, 116, 115, 0,
			0, 0, 0, 50, 99, 111, 109, 46, 122, 105,
			98, 114, 97, 46, 99, 111, 109, 109, 111, 110,
			46, 68, 97, 116, 97, 83, 116, 114, 117, 99,
			116, 117, 114, 101, 115, 124, 77, 101, 115, 104,
			82, 101, 112, 114, 101, 115, 101, 110, 116, 97,
			116, 105, 111, 110, 0, 0, 0, 0, 57, 99,
			111, 109, 46, 122, 105, 98, 114, 97, 46, 99,
			111, 109, 109, 111, 110, 46, 68, 97, 116, 97,
			83, 116, 114, 117, 99, 116, 117, 114, 101, 115,
			124, 83, 107, 105, 110, 110, 101, 100, 77, 101,
			115, 104, 82, 101, 112, 114, 101, 115, 101, 110,
			116, 97, 116, 105, 111, 110, 0, 0, 0, 0,
			46, 99, 111, 109, 46, 122, 105, 98, 114, 97,
			46, 99, 111, 109, 109, 111, 110, 46, 68, 97,
			116, 97, 83, 116, 114, 117, 99, 116, 117, 114,
			101, 115, 124, 86, 111, 120, 101, 108, 69, 109,
			98, 101, 100, 100, 105, 110, 103, 0, 0, 0,
			0, 47, 99, 111, 109, 46, 122, 105, 98, 114,
			97, 46, 99, 111, 109, 109, 111, 110, 46, 68,
			97, 116, 97, 83, 116, 114, 117, 99, 116, 117,
			114, 101, 115, 124, 79, 98, 106, 101, 99, 116,
			84, 114, 97, 110, 115, 102, 111, 114, 109, 0,
			0, 0, 0, 51, 99, 111, 109, 46, 122, 105,
			98, 114, 97, 46, 99, 111, 109, 109, 111, 110,
			46, 68, 97, 116, 97, 83, 116, 114, 117, 99,
			116, 117, 114, 101, 115, 124, 86, 111, 120, 101,
			108, 82, 101, 112, 114, 101, 115, 101, 110, 116,
			97, 116, 105, 111, 110, 0, 0, 0, 0, 58,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			99, 111, 109, 109, 111, 110, 46, 68, 97, 116,
			97, 83, 116, 114, 117, 99, 116, 117, 114, 101,
			115, 124, 83, 107, 105, 110, 110, 101, 100, 86,
			111, 120, 101, 108, 82, 101, 112, 114, 101, 115,
			101, 110, 116, 97, 116, 105, 111, 110, 0, 0,
			0, 0, 41, 99, 111, 109, 46, 122, 105, 98,
			114, 97, 46, 99, 111, 109, 109, 111, 110, 46,
			77, 97, 110, 105, 112, 117, 108, 97, 116, 111,
			114, 115, 124, 77, 97, 110, 105, 112, 117, 108,
			97, 116, 111, 114, 0, 0, 0, 0, 39, 99,
			111, 109, 46, 122, 105, 98, 114, 97, 46, 99,
			111, 109, 109, 111, 110, 46, 83, 68, 70, 79,
			98, 106, 101, 99, 116, 115, 124, 65, 110, 97,
			108, 121, 116, 105, 99, 83, 68, 70, 0, 0,
			0, 0, 37, 99, 111, 109, 46, 122, 105, 98,
			114, 97, 46, 99, 111, 109, 109, 111, 110, 46,
			83, 68, 70, 79, 98, 106, 101, 99, 116, 115,
			124, 78, 101, 117, 114, 97, 108, 83, 68, 70,
			0, 0, 0, 0, 51, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 99, 111, 109, 109, 111,
			110, 46, 83, 68, 70, 79, 98, 106, 101, 99,
			116, 115, 124, 78, 101, 117, 114, 97, 108, 83,
			68, 70, 82, 101, 112, 114, 101, 115, 101, 110,
			116, 97, 116, 105, 111, 110, 0, 0, 0, 0,
			37, 99, 111, 109, 46, 122, 105, 98, 114, 97,
			46, 99, 111, 109, 109, 111, 110, 46, 83, 68,
			70, 79, 98, 106, 101, 99, 116, 115, 124, 83,
			68, 70, 79, 98, 106, 101, 99, 116, 0, 0,
			0, 0, 42, 99, 111, 109, 46, 122, 105, 98,
			114, 97, 46, 99, 111, 109, 109, 111, 110, 46,
			83, 68, 70, 79, 98, 106, 101, 99, 116, 115,
			124, 83, 107, 105, 110, 110, 101, 100, 77, 101,
			115, 104, 83, 68, 70, 0, 0, 0, 0, 38,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			99, 111, 109, 109, 111, 110, 46, 83, 68, 70,
			79, 98, 106, 101, 99, 116, 115, 124, 84, 101,
			114, 114, 97, 105, 110, 83, 68, 70, 0, 0,
			0, 0, 36, 99, 111, 109, 46, 122, 105, 98,
			114, 97, 46, 99, 111, 109, 109, 111, 110, 46,
			83, 111, 108, 118, 101, 114, 124, 83, 116, 97,
			116, 82, 101, 112, 111, 114, 116, 101, 114, 0,
			0, 0, 0, 46, 99, 111, 109, 46, 122, 105,
			98, 114, 97, 46, 99, 111, 109, 109, 111, 110,
			46, 83, 111, 108, 118, 101, 114, 124, 83, 116,
			97, 116, 82, 101, 112, 111, 114, 116, 101, 114,
			67, 111, 108, 108, 101, 99, 116, 105, 111, 110,
			0, 0, 0, 0, 38, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 99, 111, 109, 109, 111,
			110, 46, 84, 105, 109, 101, 108, 105, 110, 101,
			124, 67, 111, 110, 116, 114, 111, 108, 65, 115,
			115, 101, 116, 0, 0, 0, 0, 42, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 99, 111,
			109, 109, 111, 110, 46, 84, 105, 109, 101, 108,
			105, 110, 101, 124, 67, 111, 110, 116, 114, 111,
			108, 66, 101, 104, 97, 118, 105, 111, 117, 114,
			0, 0, 0, 0, 41, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 99, 111, 109, 109, 111,
			110, 46, 84, 105, 109, 101, 108, 105, 110, 101,
			124, 80, 108, 97, 121, 98, 97, 99, 107, 67,
			111, 110, 116, 114, 111, 108, 0, 0, 0, 0,
			43, 99, 111, 109, 46, 122, 105, 98, 114, 97,
			46, 99, 111, 109, 109, 111, 110, 46, 84, 105,
			109, 101, 108, 105, 110, 101, 124, 90, 105, 98,
			114, 97, 67, 111, 110, 116, 114, 111, 108, 84,
			114, 97, 99, 107, 0, 0, 0, 0, 44, 99,
			111, 109, 46, 122, 105, 98, 114, 97, 46, 99,
			111, 109, 109, 111, 110, 46, 85, 116, 105, 108,
			105, 116, 105, 101, 115, 124, 65, 114, 114, 97,
			121, 67, 111, 109, 112, 97, 99, 116, 105, 102,
			105, 101, 114, 0, 0, 0, 0, 49, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 99, 111,
			109, 109, 111, 110, 46, 85, 116, 105, 108, 105,
			116, 105, 101, 115, 124, 82, 101, 110, 100, 101,
			114, 80, 105, 112, 101, 108, 105, 110, 101, 68,
			101, 116, 101, 99, 116, 111, 114, 0, 0, 0,
			0, 40, 99, 111, 109, 46, 122, 105, 98, 114,
			97, 46, 99, 111, 109, 109, 111, 110, 46, 85,
			116, 105, 108, 105, 116, 105, 101, 115, 124, 90,
			105, 98, 114, 97, 74, 115, 111, 110, 85, 116,
			105, 108, 0, 0, 0, 0, 48, 99, 111, 109,
			46, 122, 105, 98, 114, 97, 46, 99, 111, 109,
			109, 111, 110, 46, 85, 116, 105, 108, 105, 116,
			105, 101, 115, 46, 90, 105, 98, 114, 97, 74,
			115, 111, 110, 85, 116, 105, 108, 124, 87, 114,
			97, 112, 112, 101, 114, 0, 0, 0, 0, 39,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			99, 111, 109, 109, 111, 110, 46, 85, 116, 105,
			108, 105, 116, 105, 101, 115, 124, 90, 105, 98,
			114, 97, 72, 97, 115, 104, 49, 50, 56
		};
		result.TotalFiles = 19;
		result.TotalTypes = 25;
		result.IsEditorOnly = false;
		return result;
	}
}
namespace com.zibra.common
{
	public static class Effects
	{
		public const string VersionStandard = "2.1.5.0";

		public const string Version = "2.1.5";

		public const bool IsPreReleaseVersion = false;

		public const string DistributionType = "OTP";

		public const string BaseMenuBarPath = "ZibraAI/";

		public const string LiquidGameObjectMenuPath = "GameObject/Zibra Liquid/";

		public const string LiquidComponentMenuPath = "Zibra Liquid/";

		public const string SmokeAndFireGameObjectMenuPath = "GameObject/Zibra Smoke and Fire/";

		public const string SmokeAndFireComponentMenuPath = "Zibra Smoke & Fire/";

		public const string ZibraVDBComponentMenuPath = "ZibraVDB/";

		public const string ZibraVDBGameObjectMenuPath = "GameObject/ZibraVDB/";

		public const string ScalableComponentMenuPath = "Zibra Scalable/";

		public const string ScalableGameObjectMenuPath = "GameObject/Zibra Scalable/";

		public const string SDFsComponentMenuPath = "Zibra SDFs/";
	}
}
namespace com.zibra.common.Utilities
{
	internal static class ArrayCompactifier
	{
		public static string IntToString(this IEnumerable<int> array)
		{
			return Convert.ToBase64String(array.SelectMany(BitConverter.GetBytes).ToArray());
		}

		public static string FloatToString(this IEnumerable<float> array)
		{
			return Convert.ToBase64String(array.SelectMany(BitConverter.GetBytes).ToArray());
		}

		public static byte[] StringToBytes(this string input)
		{
			return Convert.FromBase64String(input);
		}

		public static float[] StringToFloat(this string input)
		{
			byte[] array = Convert.FromBase64String(input);
			float[] array2 = new float[Mathf.CeilToInt((float)array.Length / 4f)];
			for (int i = 0; i < array2.Length; i++)
			{
				array2[i] = BitConverter.ToSingle(array, i * 4);
			}
			return array2;
		}

		public static string Vector3ToString(this IEnumerable<Vector3> array)
		{
			return Convert.ToBase64String(array.SelectMany((Vector3 vec) => BitConverter.GetBytes(vec.x).Concat(BitConverter.GetBytes(vec.y)).Concat(BitConverter.GetBytes(vec.z))).ToArray());
		}
	}
	public static class RenderPipelineDetector
	{
		public enum RenderPipeline
		{
			BuiltInRP,
			URP,
			HDRP
		}

		public static RenderPipeline GetRenderPipelineType()
		{
			if (Object.op_Implicit((Object)(object)GraphicsSettings.currentRenderPipeline))
			{
				if (((object)GraphicsSettings.currentRenderPipeline).GetType().ToString().Contains("HighDefinition"))
				{
					return RenderPipeline.HDRP;
				}
				Debug.LogError((object)"Current detected render pipeline is URP, but UNITY_PIPELINE_URP is not defined");
				return RenderPipeline.URP;
			}
			return RenderPipeline.BuiltInRP;
		}

		internal static bool IsURPMissingRenderComponent(string name)
		{
			return false;
		}

		public static bool IsURPMissingDepthBuffer()
		{
			return false;
		}
	}
	internal static class ZibraJsonUtil
	{
		[Serializable]
		private struct Wrapper<T>
		{
			public T data;
		}

		private const string WRAPPER_PREFIX = "{\"data\":";

		private const string WRAPPER_SUFFIX = "}";

		public static T FromJson<T>(string json)
		{
			if (typeof(T).IsArray)
			{
				return JsonUtility.FromJson<Wrapper<T>>("{\"data\":" + json + "}").data;
			}
			return JsonUtility.FromJson<T>(json);
		}

		public static string ToJson<T>(T obj)
		{
			if (typeof(T).IsArray)
			{
				Wrapper<T> wrapper = default(Wrapper<T>);
				wrapper.data = obj;
				string text = JsonUtility.ToJson((object)wrapper);
				return text.Substring("{\"data\":".Length, text.Length - "{\"data\":".Length - "}".Length);
			}
			return JsonUtility.ToJson((object)obj);
		}
	}
	[StructLayout(LayoutKind.Sequential)]
	internal class ZibraHash128
	{
		private ulong M0;

		private ulong M1;

		private const ulong POLYNOMIAL0 = 9223372036854775808uL;

		private const ulong POLYNOMIAL1 = 3uL;

		public void Init()
		{
			M0 = 0uL;
			M1 = 0uL;
		}

		public void Append(bool input)
		{
			ulong num = (ulong)(input ? 1 : 0) ^ (M1 & 1);
			M1 >>= 1;
			M1 += (ulong)((long)(M0 & 1) * long.MinValue);
			M0 >>= 1;
			M0 ^= (ulong)((long)num * long.MinValue);
			M1 ^= num * 3;
		}

		public void Append(int input)
		{
			for (int i = 0; i < 32; i++)
			{
				Append((input & 1) != 0);
				input >>= 1;
			}
		}

		public void Append(Color32[] input)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			foreach (Color32 val in input)
			{
				Append(val.r);
				Append(val.g);
				Append(val.b);
				Append(val.a);
			}
		}

		public static bool operator ==(ZibraHash128 hash1, ZibraHash128 hash2)
		{
			if ((object)hash1 == null && (object)hash2 == null)
			{
				return true;
			}
			if ((object)hash1 == null || (object)hash2 == null)
			{
				return false;
			}
			if (hash1.M0 == hash2.M0)
			{
				return hash1.M1 == hash2.M1;
			}
			return false;
		}

		public static bool operator !=(ZibraHash128 hash1, ZibraHash128 hash2)
		{
			if ((object)hash1 == null && (object)hash2 == null)
			{
				return false;
			}
			if ((object)hash1 == null || (object)hash2 == null)
			{
				return true;
			}
			if (hash1.M0 == hash2.M0)
			{
				return hash1.M1 != hash2.M1;
			}
			return true;
		}

		public static bool operator <(ZibraHash128 hash1, ZibraHash128 hash2)
		{
			if ((object)hash1 == null && (object)hash2 == null)
			{
				return false;
			}
			if ((object)hash1 == null || (object)hash2 == null)
			{
				return (object)hash1 == null;
			}
			if (hash1.M0 >= hash2.M0)
			{
				if (hash1.M0 == hash2.M0)
				{
					return hash1.M1 < hash2.M1;
				}
				return false;
			}
			return true;
		}

		public static bool operator >(ZibraHash128 hash1, ZibraHash128 hash2)
		{
			if ((object)hash1 == null && (object)hash2 == null)
			{
				return false;
			}
			if ((object)hash1 == null || (object)hash2 == null)
			{
				return (object)hash2 == null;
			}
			if (hash1.M0 <= hash2.M0)
			{
				if (hash1.M0 == hash2.M0)
				{
					return hash1.M1 > hash2.M1;
				}
				return false;
			}
			return true;
		}

		public override bool Equals(object obj)
		{
			if (obj == null || !typeof(ZibraHash128).Equals(obj.GetType()))
			{
				return false;
			}
			ZibraHash128 zibraHash = (ZibraHash128)obj;
			return this == zibraHash;
		}

		public override int GetHashCode()
		{
			return (int)(((M0 >> 16) & 0xFFFFFFFFu) ^ (M0 & 0xFFFFFFFFu) ^ ((M1 >> 16) & 0xFFFFFFFFu) ^ (M1 & 0xFFFFFFFFu));
		}
	}
}
namespace com.zibra.common.Timeline
{
	public class ControlAsset : PlayableAsset
	{
		public float FrameRate = 30f;

		internal float ClipStart;

		internal float ClipEnd;

		public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			ScriptPlayable<ControlBehaviour> val = ScriptPlayable<ControlBehaviour>.Create(graph, 0);
			ControlBehaviour behaviour = val.GetBehaviour();
			behaviour.FrameRate = FrameRate;
			behaviour.FrameOffset = 0;
			behaviour.ClipStart = ClipStart;
			behaviour.ClipEnd = ClipEnd;
			return ScriptPlayable<ControlBehaviour>.op_Implicit(val);
		}
	}
	public class ControlBehaviour : PlayableBehaviour
	{
		public float FrameRate;

		public int FrameOffset;

		public float ClipStart;

		public float ClipEnd;

		public float Duration => ClipEnd - ClipStart;

		public override void ProcessFrame(Playable playable, FrameData info, object playerData)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			PlaybackControl playbackControl = playerData as PlaybackControl;
			if ((Object)(object)playbackControl != (Object)null)
			{
				playbackControl.SetTime((float)(PlayableExtensions.GetTime<Playable>(playable) + (double)((float)FrameOffset / FrameRate)));
				playbackControl.SetFadeCoefficient(((FrameData)(ref info)).effectiveWeight);
			}
		}

		public override void OnBehaviourPlay(Playable playable, FrameData info)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			PlaybackControl playbackControl = PlayableOutputExtensions.GetUserData<PlayableOutput>(((FrameData)(ref info)).output) as PlaybackControl;
			if ((Object)(object)playbackControl != (Object)null)
			{
				playbackControl.StartPlayback(this);
				playbackControl.SetTime((float)(PlayableExtensions.GetTime<Playable>(playable) + (double)((float)FrameOffset / FrameRate)));
				playbackControl.SetFadeCoefficient(((FrameData)(ref info)).effectiveWeight);
			}
		}

		public override void OnBehaviourPause(Playable playable, FrameData info)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			PlaybackControl playbackControl = PlayableOutputExtensions.GetUserData<PlayableOutput>(((FrameData)(ref info)).output) as PlaybackControl;
			if ((Object)(object)playbackControl != (Object)null)
			{
				playbackControl.StopPlayback();
			}
		}
	}
	public abstract class PlaybackControl : MonoBehaviour
	{
		public abstract void SetTime(float time);

		public abstract void SetFadeCoefficient(float fadeCoefficient);

		public abstract void StartPlayback(ControlBehaviour controller);

		public abstract void StopPlayback();
	}
	[TrackClipType(typeof(ControlAsset))]
	[TrackBindingType(typeof(PlaybackControl))]
	public class ZibraControlTrack : TrackAsset
	{
		private void OnEnable()
		{
			foreach (TimelineClip clip in ((TrackAsset)this).GetClips())
			{
				ControlAsset controlAsset = clip.asset as ControlAsset;
				if ((Object)(object)controlAsset != (Object)null)
				{
					controlAsset.ClipStart = (float)clip.start;
					controlAsset.ClipEnd = (float)clip.end;
				}
			}
		}
	}
}
namespace com.zibra.common.Solver
{
	public interface StatReporter
	{
		List<string> GetStats();
	}
	public static class StatReporterCollection
	{
		private static List<StatReporter> StatReporters = new List<StatReporter>();

		public static ReadOnlyCollection<StatReporter> GetStatReporters()
		{
			return StatReporters.AsReadOnly();
		}

		public static void Add(StatReporter obj)
		{
			StatReporters.Add(obj);
		}

		public static void Remove(StatReporter obj)
		{
			StatReporters.Remove(obj);
		}
	}
}
namespace com.zibra.common.SDFObjects
{
	[AddComponentMenu("Zibra SDFs/Zibra Analytic SDF")]
	[DisallowMultipleComponent]
	public class AnalyticSDF : SDFObject
	{
		public enum SDFType
		{
			Sphere,
			Box,
			Capsule,
			Torus,
			Cylinder
		}

		[FormerlySerializedAs("chosenSDFType")]
		[Tooltip("Currently chosen analytic shape")]
		public SDFType ChosenSDFType;

		[NonSerialized]
		[HideInInspector]
		[Obsolete("chosenSDFType is deprecated. Use ChosenSDFType instead.", true)]
		public SDFType chosenSDFType;

		public Vector3 GetBBoxSize()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Vector3 lossyScale = ((Component)this).transform.lossyScale;
			return (Vector3)(ChosenSDFType switch
			{
				SDFType.Capsule => new Vector3(lossyScale.x, lossyScale.y, lossyScale.x), 
				SDFType.Torus => new Vector3(lossyScale.x, lossyScale.y, lossyScale.x), 
				SDFType.Cylinder => new Vector3(lossyScale.x, lossyScale.y, lossyScale.x), 
				_ => 0.5f * lossyScale, 
			});
		}

		public override ulong GetVRAMFootprint()
		{
			return 0uL;
		}

		public override SDFObjectType GetSDFType()
		{
			return SDFObjectType.Analytic;
		}
	}
	[ExecuteInEditMode]
	[AddComponentMenu("Zibra SDFs/Zibra Neural SDF")]
	[DisallowMultipleComponent]
	public class NeuralSDF : SDFObject
	{
		internal const ulong NEURAL_SDF_VRAM_FOOTPRINT = 213712uL;

		[SerializeField]
		[FormerlySerializedAs("objectRepresentation")]
		internal NeuralSDFRepresentation ObjectRepresentation = new NeuralSDFRepresentation();

		public bool HasRepresentation()
		{
			if (ObjectRepresentation != null)
			{
				return ObjectRepresentation.HasRepresentationV3;
			}
			return false;
		}

		public override ulong GetVRAMFootprint()
		{
			if (!HasRepresentation())
			{
				return 0uL;
			}
			return 213712uL;
		}

		public override SDFObjectType GetSDFType()
		{
			return SDFObjectType.Neural;
		}
	}
	[Serializable]
	internal class NeuralSDFRepresentation
	{
		public const int BLOCK_SDF_APPROX_DIMENSION = 32;

		public const int BLOCK_EMBEDDING_GRID_DIMENSION = 21;

		public const int DEFAULT_SDF_APPROX_DIMENSION = 32;

		public const int DEFAULT_EMBEDDING_GRID_DIMENSION = 21;

		public const int PACKING = 4;

		public const int EMBEDDING_BASE_SIZE = 16;

		public const int EMBEDDING_SIZE = 4;

		[SerializeField]
		public Vector3 BoundingBoxCenter;

		[SerializeField]
		public Vector3 BoundingBoxSize;

		public Matrix4x4 ObjectTransform;

		[SerializeField]
		internal VoxelRepresentation CurrentRepresentationV3 = new VoxelRepresentation();

		[HideInInspector]
		public bool HasRepresentationV3;

		[SerializeField]
		internal VoxelEmbedding VoxelInfo;

		[SerializeField]
		public int EmbeddingResolution;

		[SerializeField]
		public int GridResolution;

		[SerializeField]
		internal ZibraHash128 ObjectHash;

		public byte GetSDGrid(int i, int j, int k, int t)
		{
			int num = i + GridResolution * (j + k * GridResolution);
			return VoxelInfo.grid[2 * num + t];
		}

		public Color32 GetEmbedding(int i, int j, int k, int t)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			int num = i + t * EmbeddingResolution + 4 * EmbeddingResolution * (j + k * EmbeddingResolution);
			return VoxelInfo.embeds[num];
		}

		internal ZibraHash128 GetHash()
		{
			if ((object)ObjectHash == null)
			{
				ObjectHash = new ZibraHash128();
				ObjectHash.Init();
				ObjectHash.Append(VoxelInfo.embeds);
			}
			return ObjectHash;
		}

		public void CreateRepresentation(int embeddingResolution, int gridResolution)
		{
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			HasRepresentationV3 = true;
			byte[] array = CurrentRepresentationV3.embeds.StringToBytes();
			VoxelInfo.grid = CurrentRepresentationV3.sd_grid.StringToBytes();
			EmbeddingResolution = embeddingResolution;
			GridResolution = gridResolution;
			int num = embeddingResolution * embeddingResolution * embeddingResolution;
			Array.Resize(ref VoxelInfo.embeds, num * 4);
			Color32 val = default(Color32);
			for (int i = 0; i < embeddingResolution; i++)
			{
				for (int j = 0; j < embeddingResolution; j++)
				{
					for (int k = 0; k < embeddingResolution; k++)
					{
						for (int l = 0; l < 4; l++)
						{
							int num2 = i + l * embeddingResolution + 4 * embeddingResolution * (j + k * embeddingResolution);
							int num3 = l + (i + embeddingResolution * (j + k * embeddingResolution)) * 4;
							((Color32)(ref val))..ctor(array[4 * num3], array[4 * num3 + 1], array[4 * num3 + 2], array[4 * num3 + 3]);
							VoxelInfo.embeds[num2] = val;
						}
					}
				}
			}
			CurrentRepresentationV3.embeds = null;
			CurrentRepresentationV3.sd_grid = null;
			float[] array2 = CurrentRepresentationV3.transform.Q.StringToFloat();
			float[] array3 = CurrentRepresentationV3.transform.T.StringToFloat();
			float[] array4 = CurrentRepresentationV3.transform.S.StringToFloat();
			Quaternion val2 = default(Quaternion);
			((Quaternion)(ref val2))..ctor(0f - array2[1], 0f - array2[2], 0f - array2[3], array2[0]);
			Vector3 val3 = default(Vector3);
			((Vector3)(ref val3))..ctor(array4[0], array4[1], array4[2]);
			Vector3 val4 = default(Vector3);
			((Vector3)(ref val4))..ctor(0f - array3[0], 0f - array3[1], 0f - array3[2]);
			ObjectTransform = Matrix4x4.Rotate(val2) * Matrix4x4.Translate(val4) * Matrix4x4.Scale(val3);
		}
	}
	[ExecuteInEditMode]
	[DisallowMultipleComponent]
	public abstract class SDFObject : MonoBehaviour
	{
		public enum SDFObjectType
		{
			Heightmap = -3,
			Group,
			Neural,
			Analytic
		}

		[Tooltip("Inverts collider so volume can only exist inside.")]
		public bool InvertSDF;

		[Tooltip("How far is the SDF surface from the object surface")]
		public float SurfaceDistance;

		public abstract ulong GetVRAMFootprint();

		public abstract SDFObjectType GetSDFType();
	}
	[AddComponentMenu("Zibra SDFs/Zibra Skinned Mesh SDF")]
	[DisallowMultipleComponent]
	public class SkinnedMeshSDF : SDFObject
	{
		[SerializeField]
		[FormerlySerializedAs("boneSDFs")]
		internal List<SDFObject> BoneSDFList = new List<SDFObject>();

		public bool HasRepresentation()
		{
			if (BoneSDFList.Count == 0)
			{
				return false;
			}
			foreach (SDFObject boneSDF in BoneSDFList)
			{
				NeuralSDF neuralSDF = boneSDF as NeuralSDF;
				if ((Object)(object)neuralSDF != (Object)null && !neuralSDF.HasRepresentation())
				{
					return false;
				}
			}
			return true;
		}

		public override ulong GetVRAMFootprint()
		{
			if (!HasRepresentation())
			{
				return 0uL;
			}
			return (ulong)BoneSDFList.Count * 213712uL;
		}

		public override SDFObjectType GetSDFType()
		{
			return SDFObjectType.Group;
		}
	}
	[AddComponentMenu("Zibra SDFs/Zibra Terrain SDF")]
	[DisallowMultipleComponent]
	public class TerrainSDF : SDFObject
	{
		internal int Resolution = 256;

		public Vector3 GetBBoxSize()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			Terrain component = ((Component)this).GetComponent<Terrain>();
			if ((Object)(object)component != (Object)null)
			{
				Bounds bounds = component.terrainData.bounds;
				return ((Bounds)(ref bounds)).size;
			}
			return Vector3.zero;
		}

		public override ulong GetVRAMFootprint()
		{
			if ((Object)(object)((Component)this).GetComponent<Terrain>() != (Object)null)
			{
				return (ulong)(Resolution * Resolution) * 2uL;
			}
			return 0uL;
		}

		public override SDFObjectType GetSDFType()
		{
			return SDFObjectType.Heightmap;
		}
	}
}
namespace com.zibra.common.Manipulators
{
	public abstract class Manipulator : MonoBehaviour
	{
	}
}
namespace com.zibra.common.DataStructures
{
	[Serializable]
	internal class MeshRepresentation
	{
		public string faces;

		public string vertices;

		public int vox_dim;

		public int sdf_dim;

		public float cutoff_weight;

		public bool static_quantization;
	}
	[Serializable]
	internal class SkinnedMeshRepresentation
	{
		public string faces;

		public string vertices;

		public string bone_ids;

		public string bone_weights;

		public int vox_dim;

		public int sdf_dim;

		public float cutoff_weight;

		public bool static_quantization;
	}
	[Serializable]
	internal struct VoxelEmbedding
	{
		public Color32[] embeds;

		public byte[] grid;
	}
	[Serializable]
	internal class ObjectTransform
	{
		public string Q;

		public string T;

		public string S;
	}
	[Serializable]
	internal class VoxelRepresentation
	{
		public string embeds;

		public string sd_grid;

		public ObjectTransform transform;
	}
	[Serializable]
	internal class SkinnedVoxelRepresentation
	{
		public VoxelRepresentation[] meshes_data;
	}
}

ZibraBasePlugin/ZibraAI.ZibraEffects.Samples.dll

Decompiled 2 months ago
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using UnityEngine;
using com.zibra.common.Solver;
using com.zibra.common.Utilities;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyFileVersion("2.1.5.0")]
[assembly: AssemblyVersion("2.1.5.0")]
[CompilerGenerated]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)]
internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
{
	private struct MonoScriptData
	{
		public byte[] FilePathsData;

		public byte[] TypesData;

		public int TotalTypes;

		public int TotalFiles;

		public bool IsEditorOnly;
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	private static MonoScriptData Get()
	{
		MonoScriptData result = default(MonoScriptData);
		result.FilePathsData = new byte[150]
		{
			0, 0, 0, 1, 0, 0, 0, 63, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			67, 111, 109, 109, 111, 110, 92, 83, 97, 109,
			112, 108, 101, 115, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 90, 105, 98, 114, 97, 70, 114,
			101, 101, 67, 97, 109, 101, 114, 97, 46, 99,
			115, 0, 0, 0, 1, 0, 0, 0, 71, 92,
			65, 115, 115, 101, 116, 115, 92, 80, 108, 117,
			103, 105, 110, 115, 92, 90, 105, 98, 114, 97,
			92, 67, 111, 109, 109, 111, 110, 92, 83, 97,
			109, 112, 108, 101, 115, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 90, 105, 98, 114, 97, 80,
			101, 114, 102, 111, 114, 109, 97, 110, 99, 101,
			79, 118, 101, 114, 108, 97, 121, 46, 99, 115
		};
		result.TypesData = new byte[98]
		{
			0, 0, 0, 0, 40, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 99, 111, 109, 109, 111,
			110, 46, 83, 97, 109, 112, 108, 101, 115, 124,
			90, 105, 98, 114, 97, 70, 114, 101, 101, 67,
			97, 109, 101, 114, 97, 0, 0, 0, 0, 48,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			99, 111, 109, 109, 111, 110, 46, 83, 97, 109,
			112, 108, 101, 115, 124, 90, 105, 98, 114, 97,
			80, 101, 114, 102, 111, 114, 109, 97, 110, 99,
			101, 79, 118, 101, 114, 108, 97, 121
		};
		result.TotalFiles = 2;
		result.TotalTypes = 2;
		result.IsEditorOnly = false;
		return result;
	}
}
namespace com.zibra.common.Samples;

internal class ZibraFreeCamera : MonoBehaviour
{
	public float camSens = 0.1f;

	public float camSpeed = 1f;

	public float fov = 60f;

	private Vector3 camPos;

	private Vector3 camVel;

	private Vector3 lastMouse;

	private Vector2 angVel;

	private float camPhi;

	private float camTheta;

	private void Start()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		Camera main = Camera.main;
		if (!((Object)(object)main == (Object)null))
		{
			camPos = ((Component)main).transform.position;
			camVel = new Vector3(0f, 0f, 0f);
			lastMouse = Input.mousePosition;
			Quaternion rotation = ((Component)main).transform.rotation;
			camPhi = ((Quaternion)(ref rotation)).eulerAngles.x;
			rotation = ((Component)main).transform.rotation;
			camTheta = ((Quaternion)(ref rotation)).eulerAngles.y;
			angVel = new Vector2(0f, 0f);
		}
	}

	protected void Update()
	{
		UpdateCamera();
	}

	private static Vector3 GetBaseInput()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = default(Vector3);
		if (Input.GetKey((KeyCode)119))
		{
			val += new Vector3(0f, 0f, 1f);
		}
		if (Input.GetKey((KeyCode)115))
		{
			val += new Vector3(0f, 0f, -1f);
		}
		if (Input.GetKey((KeyCode)97))
		{
			val += new Vector3(-1f, 0f, 0f);
		}
		if (Input.GetKey((KeyCode)100))
		{
			val += new Vector3(1f, 0f, 0f);
		}
		if (Input.GetKey((KeyCode)101))
		{
			val += new Vector3(0f, 1f, 0f);
		}
		if (Input.GetKey((KeyCode)113))
		{
			val += new Vector3(0f, -1f, 0f);
		}
		return val;
	}

	private void UpdateCamera()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Unknown result type (might be due to invalid IL or missing references)
		lastMouse = Input.mousePosition - lastMouse;
		lastMouse = new Vector3((0f - lastMouse.y) * camSens, lastMouse.x * camSens, 0f);
		if (Input.GetMouseButtonDown(0))
		{
			lastMouse = new Vector3(0f, 0f, 0f);
		}
		if (Input.GetMouseButton(0))
		{
			angVel += new Vector2(lastMouse.x, lastMouse.y);
		}
		angVel *= 0.94f;
		camPhi += angVel.x;
		camTheta += angVel.y;
		lastMouse = Input.mousePosition;
		camVel += Quaternion.Euler(camPhi, camTheta, 0f) * GetBaseInput() * camSpeed;
		camPos += camVel * Time.smoothDeltaTime;
		camVel *= 0.94f;
		Camera main = Camera.main;
		if ((Object)(object)main != (Object)null)
		{
			((Component)main).transform.position = camPos;
			((Component)main).transform.rotation = Quaternion.Euler(camPhi, camTheta, 0f);
			if (!main.stereoEnabled)
			{
				main.fieldOfView = fov;
			}
		}
	}
}
internal class ZibraPerformanceOverlay : MonoBehaviour
{
	private string FPSLabel = "";

	private int FrameCount;

	private float ElapsedTime;

	private RenderPipeline CurrentRenderPipeline;

	private string ScriptingBackend;

	private void Start()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		CurrentRenderPipeline = RenderPipelineDetector.GetRenderPipelineType();
		ScriptingBackend = "Mono";
	}

	private void Update()
	{
		FrameCount++;
		ElapsedTime += Time.unscaledDeltaTime;
		if (ElapsedTime > 0.5f)
		{
			double num = Math.Round((float)FrameCount / ElapsedTime);
			FrameCount = 0;
			ElapsedTime = 0f;
			FPSLabel = "FPS: " + num;
		}
	}

	private void OnGUI()
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		int num = 30;
		int num2 = 0;
		int num3 = 0;
		GUI.Box(new Rect((float)(30 + num3 * 220), (float)(num + num2++ * 25), 220f, 25f), FPSLabel);
		GUI.Box(new Rect((float)(30 + num3 * 220), (float)(num + num2++ * 25), 220f, 25f), "OS: " + SystemInfo.operatingSystem);
		GUI.Box(new Rect((float)(30 + num3 * 220), (float)(num + num2++ * 25), 220f, 25f), $"Graphics API: {SystemInfo.graphicsDeviceType}");
		GUI.Box(new Rect((float)(30 + num3 * 220), (float)(num + num2++ * 25), 220f, 25f), "Unity version: " + Application.unityVersion);
		GUI.Box(new Rect((float)(30 + num3 * 220), (float)(num + num2++ * 25), 220f, 25f), "Scripting backend: " + ScriptingBackend);
		GUI.Box(new Rect((float)(30 + num3 * 220), (float)(num + num2++ * 25), 220f, 25f), $"Render pipeline: {CurrentRenderPipeline}");
		GUI.Box(new Rect((float)(30 + num3 * 220), (float)(num + num2++ * 25), 220f, 25f), $"{SystemInfo.renderingThreadingMode}");
		num += num2 * 25;
		num2 = 0;
		foreach (StatReporter statReporter in StatReporterCollection.GetStatReporters())
		{
			foreach (string stat in statReporter.GetStats())
			{
				GUI.Box(new Rect((float)(30 + num3 * 220), (float)(num + num2++ * 25), 220f, 25f), stat);
			}
			num3++;
			num2 = 0;
		}
	}
}

ZibraLiquid/ZibraAI.ZibraEffects.Liquid.Bridge.dll

Decompiled 2 months ago
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.Liquid")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.Editor")]
[assembly: AssemblyVersion("0.0.0.0")]
[CompilerGenerated]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)]
internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
{
	private struct MonoScriptData
	{
		public byte[] FilePathsData;

		public byte[] TypesData;

		public int TotalTypes;

		public int TotalFiles;

		public bool IsEditorOnly;
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	private static MonoScriptData Get()
	{
		MonoScriptData result = default(MonoScriptData);
		result.FilePathsData = new byte[67]
		{
			0, 0, 0, 2, 0, 0, 0, 59, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			76, 105, 113, 117, 105, 100, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 66, 114, 105, 100, 103,
			101, 92, 76, 105, 113, 117, 105, 100, 66, 114,
			105, 100, 103, 101, 46, 99, 115
		};
		result.TypesData = new byte[92]
		{
			0, 0, 0, 0, 36, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 108, 105, 113, 117, 105,
			100, 46, 66, 114, 105, 100, 103, 101, 124, 76,
			105, 113, 117, 105, 100, 66, 114, 105, 100, 103,
			101, 0, 0, 0, 0, 46, 99, 111, 109, 46,
			122, 105, 98, 114, 97, 46, 108, 105, 113, 117,
			105, 100, 46, 66, 114, 105, 100, 103, 101, 46,
			76, 105, 113, 117, 105, 100, 66, 114, 105, 100,
			103, 101, 124, 69, 118, 101, 110, 116, 68, 97,
			116, 97
		};
		result.TotalFiles = 1;
		result.TotalTypes = 2;
		result.IsEditorOnly = false;
		return result;
	}
}
namespace com.zibra.liquid.Bridge;

internal static class LiquidBridge
{
	public enum EventID
	{
		None,
		StepPhysics,
		DrawLiquid,
		UpdateLiquidParameters,
		UpdateManipulatorParameters,
		ClearSDFAndID,
		CreateFluidInstance,
		RegisterParticlesBuffers,
		SetCameraParameters,
		SetRenderParameters,
		RegisterManipulators,
		RegisterSolverBuffers,
		RegisterRenderResources,
		ReleaseResources,
		InitializeGpuReadback,
		UpdateReadback,
		SetCameraParams,
		UpdateMeshRenderGlobalParameters,
		InitializeGraphicsPipeline,
		UpdateSolverParameters,
		UpdateSDFObjects,
		RenderSDF,
		DrawEffectParticles
	}

	internal struct EventData
	{
		public int InstanceID;

		public IntPtr ExtraData;
	}

	public enum TextureFormat
	{
		None,
		R8G8B8A8_SNorm,
		R16G16B16A16_SFloat,
		R32G32B32A32_SFloat,
		R16_SFloat,
		R32_SFloat
	}

	public const string PluginLibraryName = "ZibraLiquidNative_Win";

	[DllImport("ZibraLiquidNative_Win")]
	public static extern IntPtr ZibraLiquid_GetRenderEventWithDataFunc();

	[DllImport("ZibraLiquidNative_Win")]
	public static extern IntPtr ZibraLiquid_GPUReadbackGetData(int InstanceID, uint size);

	[DllImport("ZibraLiquidNative_Win")]
	public static extern int ZibraLiquid_IsLoaded();

	[DllImport("ZibraLiquidNative_Win")]
	public static extern void ZibraLiquid_WaitLoad();

	[DllImport("ZibraLiquidNative_Win")]
	public static extern int ZibraLiquid_GarbageCollect();

	public static TextureFormat ToBridgeTextureFormat(GraphicsFormat format)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Invalid comparison between Unknown and I4
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected I4, but got Unknown
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Invalid comparison between Unknown and I4
		if ((int)format != 8)
		{
			switch (format - 45)
			{
			default:
				if ((int)format != 52)
				{
					break;
				}
				return TextureFormat.R32G32B32A32_SFloat;
			case 3:
				return TextureFormat.R16G16B16A16_SFloat;
			case 0:
				return TextureFormat.R16_SFloat;
			case 4:
				return TextureFormat.R32_SFloat;
			case 1:
			case 2:
				break;
			}
			return TextureFormat.None;
		}
		return TextureFormat.R8G8B8A8_SNorm;
	}

	public static int EventAndInstanceID(EventID eventID, int InstanceID)
	{
		return (int)eventID | (InstanceID << 8);
	}

	public static void SubmitInstanceEvent(CommandBuffer cmd, int instanceID, EventID eventID, IntPtr data = default(IntPtr))
	{
		EventData structure = default(EventData);
		structure.InstanceID = instanceID;
		structure.ExtraData = data;
		IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(structure));
		Marshal.StructureToPtr(structure, intPtr, fDeleteOld: true);
		cmd.IssuePluginEventAndData(ZibraLiquid_GetRenderEventWithDataFunc(), (int)eventID, intPtr);
	}

	public static bool NeedGarbageCollect()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected I4, but got Unknown
		GraphicsDeviceType graphicsDeviceType = SystemInfo.graphicsDeviceType;
		switch (graphicsDeviceType - 18)
		{
		case 0:
		case 3:
		case 5:
		case 6:
		case 7:
			return true;
		default:
			return false;
		}
	}
}

ZibraLiquid/ZibraAI.ZibraEffects.Liquid.dll

Decompiled 2 months ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.Serialization;
using com.zibra.common.Manipulators;
using com.zibra.common.SDFObjects;
using com.zibra.common.Solver;
using com.zibra.common.Utilities;
using com.zibra.liquid.Bridge;
using com.zibra.liquid.DataStructures;
using com.zibra.liquid.Manipulators;
using com.zibra.liquid.Solver;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyFileVersion("2.1.5.0")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.Liquid.Editor")]
[assembly: AssemblyVersion("2.1.5.0")]
[CompilerGenerated]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)]
internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
{
	private struct MonoScriptData
	{
		public byte[] FilePathsData;

		public byte[] TypesData;

		public int TotalTypes;

		public int TotalFiles;

		public bool IsEditorOnly;
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	private static MonoScriptData Get()
	{
		MonoScriptData result = default(MonoScriptData);
		result.FilePathsData = new byte[1358]
		{
			0, 0, 0, 1, 0, 0, 0, 90, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			76, 105, 113, 117, 105, 100, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 68, 97, 116, 97, 83,
			116, 114, 117, 99, 116, 117, 114, 101, 115, 92,
			90, 105, 98, 114, 97, 76, 105, 113, 117, 105,
			100, 65, 100, 118, 97, 110, 99, 101, 100, 82,
			101, 110, 100, 101, 114, 80, 97, 114, 97, 109,
			101, 116, 101, 114, 115, 46, 99, 115, 0, 0,
			0, 2, 0, 0, 0, 84, 92, 65, 115, 115,
			101, 116, 115, 92, 80, 108, 117, 103, 105, 110,
			115, 92, 90, 105, 98, 114, 97, 92, 76, 105,
			113, 117, 105, 100, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 68, 97, 116, 97, 83, 116, 114,
			117, 99, 116, 117, 114, 101, 115, 92, 90, 105,
			98, 114, 97, 76, 105, 113, 117, 105, 100, 77,
			97, 116, 101, 114, 105, 97, 108, 80, 97, 114,
			97, 109, 101, 116, 101, 114, 115, 46, 99, 115,
			0, 0, 0, 2, 0, 0, 0, 82, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			76, 105, 113, 117, 105, 100, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 68, 97, 116, 97, 83,
			116, 114, 117, 99, 116, 117, 114, 101, 115, 92,
			90, 105, 98, 114, 97, 76, 105, 113, 117, 105,
			100, 83, 111, 108, 118, 101, 114, 80, 97, 114,
			97, 109, 101, 116, 101, 114, 115, 46, 99, 115,
			0, 0, 0, 2, 0, 0, 0, 72, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			76, 105, 113, 117, 105, 100, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 83, 111, 108, 118, 101,
			114, 92, 76, 105, 113, 117, 105, 100, 72, 68,
			82, 80, 82, 101, 110, 100, 101, 114, 67, 111,
			109, 112, 111, 110, 101, 110, 116, 46, 99, 115,
			0, 0, 0, 3, 0, 0, 0, 58, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			76, 105, 113, 117, 105, 100, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 83, 111, 108, 118, 101,
			114, 92, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 46, 99, 115, 0, 0, 0, 1,
			0, 0, 0, 83, 92, 65, 115, 115, 101, 116,
			115, 92, 80, 108, 117, 103, 105, 110, 115, 92,
			90, 105, 98, 114, 97, 92, 76, 105, 113, 117,
			105, 100, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 83, 111, 108, 118, 101, 114, 92, 77, 97,
			110, 105, 112, 117, 108, 97, 116, 111, 114, 115,
			92, 83, 68, 70, 92, 65, 110, 97, 108, 121,
			116, 105, 99, 83, 68, 70, 67, 111, 108, 108,
			105, 100, 101, 114, 46, 99, 115, 0, 0, 0,
			1, 0, 0, 0, 78, 92, 65, 115, 115, 101,
			116, 115, 92, 80, 108, 117, 103, 105, 110, 115,
			92, 90, 105, 98, 114, 97, 92, 76, 105, 113,
			117, 105, 100, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 83, 111, 108, 118, 101, 114, 92, 77,
			97, 110, 105, 112, 117, 108, 97, 116, 111, 114,
			115, 92, 83, 68, 70, 92, 78, 101, 117, 114,
			97, 108, 67, 111, 108, 108, 105, 100, 101, 114,
			46, 99, 115, 0, 0, 0, 4, 0, 0, 0,
			79, 92, 65, 115, 115, 101, 116, 115, 92, 80,
			108, 117, 103, 105, 110, 115, 92, 90, 105, 98,
			114, 97, 92, 76, 105, 113, 117, 105, 100, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 83, 111,
			108, 118, 101, 114, 92, 77, 97, 110, 105, 112,
			117, 108, 97, 116, 111, 114, 115, 92, 90, 105,
			98, 114, 97, 76, 105, 113, 117, 105, 100, 67,
			111, 108, 108, 105, 100, 101, 114, 46, 99, 115,
			0, 0, 0, 1, 0, 0, 0, 79, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			76, 105, 113, 117, 105, 100, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 83, 111, 108, 118, 101,
			114, 92, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 115, 92, 90, 105, 98, 114, 97,
			76, 105, 113, 117, 105, 100, 68, 101, 116, 101,
			99, 116, 111, 114, 46, 99, 115, 0, 0, 0,
			1, 0, 0, 0, 78, 92, 65, 115, 115, 101,
			116, 115, 92, 80, 108, 117, 103, 105, 110, 115,
			92, 90, 105, 98, 114, 97, 92, 76, 105, 113,
			117, 105, 100, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 83, 111, 108, 118, 101, 114, 92, 77,
			97, 110, 105, 112, 117, 108, 97, 116, 111, 114,
			115, 92, 90, 105, 98, 114, 97, 76, 105, 113,
			117, 105, 100, 69, 109, 105, 116, 116, 101, 114,
			46, 99, 115, 0, 0, 0, 1, 0, 0, 0,
			81, 92, 65, 115, 115, 101, 116, 115, 92, 80,
			108, 117, 103, 105, 110, 115, 92, 90, 105, 98,
			114, 97, 92, 76, 105, 113, 117, 105, 100, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 83, 111,
			108, 118, 101, 114, 92, 77, 97, 110, 105, 112,
			117, 108, 97, 116, 111, 114, 115, 92, 90, 105,
			98, 114, 97, 76, 105, 113, 117, 105, 100, 70,
			111, 114, 99, 101, 70, 105, 101, 108, 100, 46,
			99, 115, 0, 0, 0, 1, 0, 0, 0, 86,
			92, 65, 115, 115, 101, 116, 115, 92, 80, 108,
			117, 103, 105, 110, 115, 92, 90, 105, 98, 114,
			97, 92, 76, 105, 113, 117, 105, 100, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 83, 111, 108,
			118, 101, 114, 92, 77, 97, 110, 105, 112, 117,
			108, 97, 116, 111, 114, 115, 92, 90, 105, 98,
			114, 97, 76, 105, 113, 117, 105, 100, 83, 112,
			101, 99, 105, 101, 115, 77, 111, 100, 105, 102,
			105, 101, 114, 46, 99, 115, 0, 0, 0, 1,
			0, 0, 0, 75, 92, 65, 115, 115, 101, 116,
			115, 92, 80, 108, 117, 103, 105, 110, 115, 92,
			90, 105, 98, 114, 97, 92, 76, 105, 113, 117,
			105, 100, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 83, 111, 108, 118, 101, 114, 92, 77, 97,
			110, 105, 112, 117, 108, 97, 116, 111, 114, 115,
			92, 90, 105, 98, 114, 97, 76, 105, 113, 117,
			105, 100, 86, 111, 105, 100, 46, 99, 115, 0,
			0, 0, 17, 0, 0, 0, 58, 92, 65, 115,
			115, 101, 116, 115, 92, 80, 108, 117, 103, 105,
			110, 115, 92, 90, 105, 98, 114, 97, 92, 76,
			105, 113, 117, 105, 100, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 83, 111, 108, 118, 101, 114,
			92, 90, 105, 98, 114, 97, 76, 105, 113, 117,
			105, 100, 46, 99, 115, 0, 0, 0, 1, 0,
			0, 0, 77, 92, 65, 115, 115, 101, 116, 115,
			92, 80, 108, 117, 103, 105, 110, 115, 92, 90,
			105, 98, 114, 97, 92, 76, 105, 113, 117, 105,
			100, 92, 83, 99, 114, 105, 112, 116, 115, 92,
			83, 111, 108, 118, 101, 114, 92, 90, 105, 98,
			114, 97, 76, 105, 113, 117, 105, 100, 71, 80,
			85, 71, 97, 114, 98, 97, 103, 101, 67, 111,
			108, 108, 101, 99, 116, 111, 114, 46, 99, 115,
			0, 0, 0, 4, 0, 0, 0, 70, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			76, 105, 113, 117, 105, 100, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 83, 111, 108, 118, 101,
			114, 92, 90, 105, 98, 114, 97, 77, 97, 110,
			105, 112, 117, 108, 97, 116, 111, 114, 77, 97,
			110, 97, 103, 101, 114, 46, 99, 115
		};
		result.TypesData = new byte[2609]
		{
			0, 0, 0, 0, 67, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 108, 105, 113, 117, 105,
			100, 46, 68, 97, 116, 97, 83, 116, 114, 117,
			99, 116, 117, 114, 101, 115, 124, 90, 105, 98,
			114, 97, 76, 105, 113, 117, 105, 100, 65, 100,
			118, 97, 110, 99, 101, 100, 82, 101, 110, 100,
			101, 114, 80, 97, 114, 97, 109, 101, 116, 101,
			114, 115, 0, 0, 0, 0, 61, 99, 111, 109,
			46, 122, 105, 98, 114, 97, 46, 108, 105, 113,
			117, 105, 100, 46, 68, 97, 116, 97, 83, 116,
			114, 117, 99, 116, 117, 114, 101, 115, 124, 90,
			105, 98, 114, 97, 76, 105, 113, 117, 105, 100,
			77, 97, 116, 101, 114, 105, 97, 108, 80, 97,
			114, 97, 109, 101, 116, 101, 114, 115, 0, 0,
			0, 0, 76, 99, 111, 109, 46, 122, 105, 98,
			114, 97, 46, 108, 105, 113, 117, 105, 100, 46,
			68, 97, 116, 97, 83, 116, 114, 117, 99, 116,
			117, 114, 101, 115, 46, 90, 105, 98, 114, 97,
			76, 105, 113, 117, 105, 100, 77, 97, 116, 101,
			114, 105, 97, 108, 80, 97, 114, 97, 109, 101,
			116, 101, 114, 115, 124, 76, 105, 113, 117, 105,
			100, 77, 97, 116, 101, 114, 105, 97, 108, 0,
			0, 0, 0, 59, 99, 111, 109, 46, 122, 105,
			98, 114, 97, 46, 108, 105, 113, 117, 105, 100,
			46, 68, 97, 116, 97, 83, 116, 114, 117, 99,
			116, 117, 114, 101, 115, 124, 90, 105, 98, 114,
			97, 76, 105, 113, 117, 105, 100, 83, 111, 108,
			118, 101, 114, 80, 97, 114, 97, 109, 101, 116,
			101, 114, 115, 0, 0, 0, 0, 74, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 108, 105,
			113, 117, 105, 100, 46, 68, 97, 116, 97, 83,
			116, 114, 117, 99, 116, 117, 114, 101, 115, 46,
			90, 105, 98, 114, 97, 76, 105, 113, 117, 105,
			100, 83, 111, 108, 118, 101, 114, 80, 97, 114,
			97, 109, 101, 116, 101, 114, 115, 124, 83, 111,
			108, 118, 101, 114, 83, 101, 116, 116, 105, 110,
			103, 115, 0, 0, 0, 0, 42, 99, 111, 109,
			46, 122, 105, 98, 114, 97, 46, 108, 105, 113,
			117, 105, 100, 124, 76, 105, 113, 117, 105, 100,
			72, 68, 82, 80, 82, 101, 110, 100, 101, 114,
			67, 111, 109, 112, 111, 110, 101, 110, 116, 0,
			0, 0, 0, 58, 99, 111, 109, 46, 122, 105,
			98, 114, 97, 46, 108, 105, 113, 117, 105, 100,
			46, 76, 105, 113, 117, 105, 100, 72, 68, 82,
			80, 82, 101, 110, 100, 101, 114, 67, 111, 109,
			112, 111, 110, 101, 110, 116, 124, 70, 108, 117,
			105, 100, 72, 68, 82, 80, 82, 101, 110, 100,
			101, 114, 0, 0, 0, 0, 48, 99, 111, 109,
			46, 122, 105, 98, 114, 97, 46, 108, 105, 113,
			117, 105, 100, 46, 77, 97, 110, 105, 112, 117,
			108, 97, 116, 111, 114, 115, 124, 77, 97, 110,
			105, 112, 117, 108, 97, 116, 111, 114, 67, 111,
			109, 112, 97, 114, 101, 0, 0, 0, 0, 41,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			108, 105, 113, 117, 105, 100, 46, 77, 97, 110,
			105, 112, 117, 108, 97, 116, 111, 114, 115, 124,
			77, 97, 110, 105, 112, 117, 108, 97, 116, 111,
			114, 0, 0, 0, 0, 56, 99, 111, 109, 46,
			122, 105, 98, 114, 97, 46, 108, 105, 113, 117,
			105, 100, 46, 77, 97, 110, 105, 112, 117, 108,
			97, 116, 111, 114, 115, 46, 77, 97, 110, 105,
			112, 117, 108, 97, 116, 111, 114, 124, 83, 105,
			109, 117, 108, 97, 116, 105, 111, 110, 68, 97,
			116, 97, 0, 0, 0, 0, 47, 99, 111, 109,
			46, 122, 105, 98, 114, 97, 46, 108, 105, 113,
			117, 105, 100, 46, 83, 68, 70, 79, 98, 106,
			101, 99, 116, 115, 124, 65, 110, 97, 108, 121,
			116, 105, 99, 83, 68, 70, 67, 111, 108, 108,
			105, 100, 101, 114, 0, 0, 0, 0, 42, 99,
			111, 109, 46, 122, 105, 98, 114, 97, 46, 108,
			105, 113, 117, 105, 100, 46, 83, 68, 70, 79,
			98, 106, 101, 99, 116, 115, 124, 78, 101, 117,
			114, 97, 108, 67, 111, 108, 108, 105, 100, 101,
			114, 0, 0, 0, 0, 50, 99, 111, 109, 46,
			122, 105, 98, 114, 97, 46, 108, 105, 113, 117,
			105, 100, 46, 77, 97, 110, 105, 112, 117, 108,
			97, 116, 111, 114, 115, 124, 70, 111, 114, 99,
			101, 73, 110, 116, 101, 114, 97, 99, 116, 105,
			111, 110, 68, 97, 116, 97, 0, 0, 0, 0,
			58, 99, 111, 109, 46, 122, 105, 98, 114, 97,
			46, 108, 105, 113, 117, 105, 100, 46, 77, 97,
			110, 105, 112, 117, 108, 97, 116, 111, 114, 115,
			124, 70, 111, 114, 99, 101, 73, 110, 116, 101,
			114, 97, 99, 116, 105, 111, 110, 67, 97, 108,
			108, 98, 97, 99, 107, 84, 121, 112, 101, 0,
			0, 0, 0, 49, 99, 111, 109, 46, 122, 105,
			98, 114, 97, 46, 108, 105, 113, 117, 105, 100,
			46, 77, 97, 110, 105, 112, 117, 108, 97, 116,
			111, 114, 115, 124, 90, 105, 98, 114, 97, 76,
			105, 113, 117, 105, 100, 67, 111, 108, 108, 105,
			100, 101, 114, 0, 0, 0, 0, 48, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 108, 105,
			113, 117, 105, 100, 46, 77, 97, 110, 105, 112,
			117, 108, 97, 116, 111, 114, 115, 124, 83, 68,
			70, 67, 111, 108, 108, 105, 100, 101, 114, 67,
			111, 109, 112, 97, 114, 101, 0, 0, 0, 0,
			49, 99, 111, 109, 46, 122, 105, 98, 114, 97,
			46, 108, 105, 113, 117, 105, 100, 46, 77, 97,
			110, 105, 112, 117, 108, 97, 116, 111, 114, 115,
			124, 90, 105, 98, 114, 97, 76, 105, 113, 117,
			105, 100, 68, 101, 116, 101, 99, 116, 111, 114,
			0, 0, 0, 0, 48, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 108, 105, 113, 117, 105,
			100, 46, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 115, 124, 90, 105, 98, 114, 97,
			76, 105, 113, 117, 105, 100, 69, 109, 105, 116,
			116, 101, 114, 0, 0, 0, 0, 51, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 108, 105,
			113, 117, 105, 100, 46, 77, 97, 110, 105, 112,
			117, 108, 97, 116, 111, 114, 115, 124, 90, 105,
			98, 114, 97, 76, 105, 113, 117, 105, 100, 70,
			111, 114, 99, 101, 70, 105, 101, 108, 100, 0,
			0, 0, 0, 56, 99, 111, 109, 46, 122, 105,
			98, 114, 97, 46, 108, 105, 113, 117, 105, 100,
			46, 77, 97, 110, 105, 112, 117, 108, 97, 116,
			111, 114, 115, 124, 90, 105, 98, 114, 97, 76,
			105, 113, 117, 105, 100, 83, 112, 101, 99, 105,
			101, 115, 77, 111, 100, 105, 102, 105, 101, 114,
			0, 0, 0, 0, 45, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 108, 105, 113, 117, 105,
			100, 46, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 115, 124, 90, 105, 98, 114, 97,
			76, 105, 113, 117, 105, 100, 86, 111, 105, 100,
			0, 0, 0, 0, 35, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 108, 105, 113, 117, 105,
			100, 46, 83, 111, 108, 118, 101, 114, 124, 90,
			105, 98, 114, 97, 76, 105, 113, 117, 105, 100,
			0, 0, 0, 0, 53, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 108, 105, 113, 117, 105,
			100, 46, 83, 111, 108, 118, 101, 114, 46, 90,
			105, 98, 114, 97, 76, 105, 113, 117, 105, 100,
			124, 66, 97, 107, 101, 100, 73, 110, 105, 116,
			105, 97, 108, 83, 116, 97, 116, 101, 0, 0,
			0, 0, 54, 99, 111, 109, 46, 122, 105, 98,
			114, 97, 46, 108, 105, 113, 117, 105, 100, 46,
			83, 111, 108, 118, 101, 114, 46, 90, 105, 98,
			114, 97, 76, 105, 113, 117, 105, 100, 124, 85,
			110, 105, 116, 121, 84, 101, 120, 116, 117, 114,
			101, 66, 114, 105, 100, 103, 101, 0, 0, 0,
			0, 72, 99, 111, 109, 46, 122, 105, 98, 114,
			97, 46, 108, 105, 113, 117, 105, 100, 46, 83,
			111, 108, 118, 101, 114, 46, 90, 105, 98, 114,
			97, 76, 105, 113, 117, 105, 100, 124, 82, 101,
			103, 105, 115, 116, 101, 114, 80, 97, 114, 116,
			105, 99, 108, 101, 115, 66, 117, 102, 102, 101,
			114, 115, 66, 114, 105, 100, 103, 101, 80, 97,
			114, 97, 109, 115, 0, 0, 0, 0, 63, 99,
			111, 109, 46, 122, 105, 98, 114, 97, 46, 108,
			105, 113, 117, 105, 100, 46, 83, 111, 108, 118,
			101, 114, 46, 90, 105, 98, 114, 97, 76, 105,
			113, 117, 105, 100, 124, 73, 110, 105, 116, 105,
			97, 108, 105, 122, 101, 71, 80, 85, 82, 101,
			97, 100, 98, 97, 99, 107, 80, 97, 114, 97,
			109, 115, 0, 0, 0, 0, 53, 99, 111, 109,
			46, 122, 105, 98, 114, 97, 46, 108, 105, 113,
			117, 105, 100, 46, 83, 111, 108, 118, 101, 114,
			46, 90, 105, 98, 114, 97, 76, 105, 113, 117,
			105, 100, 124, 84, 101, 120, 116, 117, 114, 101,
			85, 112, 108, 111, 97, 100, 68, 97, 116, 97,
			0, 0, 0, 0, 68, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 108, 105, 113, 117, 105,
			100, 46, 83, 111, 108, 118, 101, 114, 46, 90,
			105, 98, 114, 97, 76, 105, 113, 117, 105, 100,
			124, 82, 101, 103, 105, 115, 116, 101, 114, 77,
			97, 110, 105, 112, 117, 108, 97, 116, 111, 114,
			115, 66, 114, 105, 100, 103, 101, 80, 97, 114,
			97, 109, 115, 0, 0, 0, 0, 69, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 108, 105,
			113, 117, 105, 100, 46, 83, 111, 108, 118, 101,
			114, 46, 90, 105, 98, 114, 97, 76, 105, 113,
			117, 105, 100, 124, 82, 101, 103, 105, 115, 116,
			101, 114, 83, 111, 108, 118, 101, 114, 66, 117,
			102, 102, 101, 114, 115, 66, 114, 105, 100, 103,
			101, 80, 97, 114, 97, 109, 115, 0, 0, 0,
			0, 71, 99, 111, 109, 46, 122, 105, 98, 114,
			97, 46, 108, 105, 113, 117, 105, 100, 46, 83,
			111, 108, 118, 101, 114, 46, 90, 105, 98, 114,
			97, 76, 105, 113, 117, 105, 100, 124, 82, 101,
			103, 105, 115, 116, 101, 114, 82, 101, 110, 100,
			101, 114, 82, 101, 115, 111, 117, 114, 99, 101,
			115, 66, 114, 105, 100, 103, 101, 80, 97, 114,
			97, 109, 115, 0, 0, 0, 0, 48, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 108, 105,
			113, 117, 105, 100, 46, 83, 111, 108, 118, 101,
			114, 46, 90, 105, 98, 114, 97, 76, 105, 113,
			117, 105, 100, 124, 67, 97, 109, 101, 114, 97,
			80, 97, 114, 97, 109, 115, 0, 0, 0, 0,
			58, 99, 111, 109, 46, 122, 105, 98, 114, 97,
			46, 108, 105, 113, 117, 105, 100, 46, 83, 111,
			108, 118, 101, 114, 46, 90, 105, 98, 114, 97,
			76, 105, 113, 117, 105, 100, 124, 77, 101, 115,
			104, 82, 101, 110, 100, 101, 114, 71, 108, 111,
			98, 97, 108, 80, 97, 114, 97, 109, 115, 0,
			0, 0, 0, 48, 99, 111, 109, 46, 122, 105,
			98, 114, 97, 46, 108, 105, 113, 117, 105, 100,
			46, 83, 111, 108, 118, 101, 114, 46, 90, 105,
			98, 114, 97, 76, 105, 113, 117, 105, 100, 124,
			82, 101, 110, 100, 101, 114, 80, 97, 114, 97,
			109, 115, 0, 0, 0, 0, 52, 99, 111, 109,
			46, 122, 105, 98, 114, 97, 46, 108, 105, 113,
			117, 105, 100, 46, 83, 111, 108, 118, 101, 114,
			46, 90, 105, 98, 114, 97, 76, 105, 113, 117,
			105, 100, 124, 83, 105, 109, 117, 108, 97, 116,
			105, 111, 110, 80, 97, 114, 97, 109, 115, 0,
			0, 0, 0, 61, 99, 111, 109, 46, 122, 105,
			98, 114, 97, 46, 108, 105, 113, 117, 105, 100,
			46, 83, 111, 108, 118, 101, 114, 46, 90, 105,
			98, 114, 97, 76, 105, 113, 117, 105, 100, 124,
			80, 97, 114, 116, 105, 99, 108, 101, 83, 112,
			101, 99, 105, 101, 115, 80, 97, 114, 97, 109,
			101, 116, 101, 114, 115, 0, 0, 0, 0, 47,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			108, 105, 113, 117, 105, 100, 46, 83, 111, 108,
			118, 101, 114, 46, 90, 105, 98, 114, 97, 76,
			105, 113, 117, 105, 100, 124, 83, 104, 97, 100,
			101, 114, 80, 97, 114, 97, 109, 0, 0, 0,
			0, 48, 99, 111, 109, 46, 122, 105, 98, 114,
			97, 46, 108, 105, 113, 117, 105, 100, 46, 83,
			111, 108, 118, 101, 114, 46, 90, 105, 98, 114,
			97, 76, 105, 113, 117, 105, 100, 124, 77, 97,
			116, 101, 114, 105, 97, 108, 80, 97, 105, 114,
			0, 0, 0, 0, 51, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 108, 105, 113, 117, 105,
			100, 46, 83, 111, 108, 118, 101, 114, 46, 90,
			105, 98, 114, 97, 76, 105, 113, 117, 105, 100,
			124, 67, 97, 109, 101, 114, 97, 82, 101, 115,
			111, 117, 114, 99, 101, 115, 0, 0, 0, 0,
			54, 99, 111, 109, 46, 122, 105, 98, 114, 97,
			46, 108, 105, 113, 117, 105, 100, 46, 83, 111,
			108, 118, 101, 114, 124, 90, 105, 98, 114, 97,
			76, 105, 113, 117, 105, 100, 71, 80, 85, 71,
			97, 114, 98, 97, 103, 101, 67, 111, 108, 108,
			101, 99, 116, 111, 114, 0, 0, 0, 0, 53,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			108, 105, 113, 117, 105, 100, 46, 77, 97, 110,
			105, 112, 117, 108, 97, 116, 111, 114, 115, 124,
			90, 105, 98, 114, 97, 77, 97, 110, 105, 112,
			117, 108, 97, 116, 111, 114, 77, 97, 110, 97,
			103, 101, 114, 0, 0, 0, 0, 70, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 108, 105,
			113, 117, 105, 100, 46, 77, 97, 110, 105, 112,
			117, 108, 97, 116, 111, 114, 115, 46, 90, 105,
			98, 114, 97, 77, 97, 110, 105, 112, 117, 108,
			97, 116, 111, 114, 77, 97, 110, 97, 103, 101,
			114, 124, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 80, 97, 114, 97, 109, 0, 0,
			0, 0, 69, 99, 111, 109, 46, 122, 105, 98,
			114, 97, 46, 108, 105, 113, 117, 105, 100, 46,
			77, 97, 110, 105, 112, 117, 108, 97, 116, 111,
			114, 115, 46, 90, 105, 98, 114, 97, 77, 97,
			110, 105, 112, 117, 108, 97, 116, 111, 114, 77,
			97, 110, 97, 103, 101, 114, 124, 83, 68, 70,
			79, 98, 106, 101, 99, 116, 80, 97, 114, 97,
			109, 115, 0, 0, 0, 0, 72, 99, 111, 109,
			46, 122, 105, 98, 114, 97, 46, 108, 105, 113,
			117, 105, 100, 46, 77, 97, 110, 105, 112, 117,
			108, 97, 116, 111, 114, 115, 46, 90, 105, 98,
			114, 97, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 77, 97, 110, 97, 103, 101, 114,
			124, 77, 97, 110, 105, 112, 117, 108, 97, 116,
			111, 114, 73, 110, 100, 105, 99, 101, 115
		};
		result.TotalFiles = 16;
		result.TotalTypes = 43;
		result.IsEditorOnly = false;
		return result;
	}
}
namespace com.zibra.liquid
{
	internal class LiquidHDRPRenderComponent : CustomPassVolume
	{
		internal class FluidHDRPRender : CustomPass
		{
			public ZibraLiquid liquid;

			protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd)
			{
			}

			protected override void Execute(CustomPassContext ctx)
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_0118: Unknown result type (might be due to invalid IL or missing references)
				//IL_016b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0197: Unknown result type (might be due to invalid IL or missing references)
				//IL_019e: Invalid comparison between Unknown and I4
				//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_01db: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_020c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0217: Unknown result type (might be due to invalid IL or missing references)
				//IL_0221: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)liquid) || !liquid.IsRenderingEnabled())
				{
					return;
				}
				RTHandle cameraColorBuffer = ctx.cameraColorBuffer;
				RTHandle cameraDepthBuffer = ctx.cameraDepthBuffer;
				HDCamera hdCamera = ctx.hdCamera;
				CommandBuffer cmd = ctx.cmd;
				if (!liquid.IsCameraFiltered(hdCamera.camera) && (hdCamera.camera.cullingMask & (1 << ((Component)liquid).gameObject.layer)) != 0)
				{
					float num = (float)hdCamera.actualWidth / (float)hdCamera.camera.pixelWidth;
					Vector2 val = default(Vector2);
					((Vector2)(ref val))..ctor(num, num);
					liquid.RenderCallBack(hdCamera.camera, num);
					int num2 = Shader.PropertyToID("ZibraLiquidCameraDepthCopy");
					cmd.GetTemporaryRT(num2, hdCamera.actualWidth, hdCamera.actualHeight, 32, (FilterMode)0, (RenderTextureFormat)14);
					if (liquid.IsBackgroundCopyNeeded(hdCamera.camera))
					{
						cmd.Blit(RTHandle.op_Implicit(cameraColorBuffer), RenderTargetIdentifier.op_Implicit((Texture)(object)liquid.CameraResourcesMap[hdCamera.camera].Background), val, Vector2.zero, 0, 0);
					}
					CoreUtils.SetRenderTarget(cmd, RenderTargetIdentifier.op_Implicit(num2), (ClearFlag)0, 0, (CubemapFace)(-1), -1);
					Vector4 val2 = default(Vector4);
					((Vector4)(ref val2))..ctor((float)hdCamera.camera.pixelWidth / (float)((Texture)cameraDepthBuffer.rt).width, (float)hdCamera.camera.pixelHeight / (float)((Texture)cameraDepthBuffer.rt).height, 0f, 0f);
					Blitter.BlitTexture(cmd, cameraDepthBuffer, val2, 0f, false);
					Rect value = default(Rect);
					((Rect)(ref value))..ctor(0f, 0f, (float)hdCamera.actualWidth, (float)hdCamera.actualHeight);
					if ((int)SystemInfo.graphicsDeviceType == 21)
					{
						cmd.SetRenderTarget(RenderTargetIdentifier.op_Implicit((Texture)(object)liquid.Color0), RenderTargetIdentifier.op_Implicit((Texture)(object)liquid.Depth));
						cmd.ClearRenderTarget(true, true, Color.clear);
					}
					cmd.SetGlobalTexture("_CameraDepthTexture", RenderTargetIdentifier.op_Implicit(num2));
					liquid.RenderLiquidNative(cmd, hdCamera.camera, value);
					liquid.RenderFluid(cmd, hdCamera.camera, RTHandle.op_Implicit(cameraColorBuffer), RTHandle.op_Implicit(cameraDepthBuffer), value);
					cmd.ReleaseTemporaryRT(num2);
				}
			}

			protected override void Cleanup()
			{
			}
		}

		public FluidHDRPRender fluidPass;
	}
}
namespace com.zibra.liquid.Solver
{
	[AddComponentMenu("Zibra Liquid/Zibra Liquid")]
	[DisallowMultipleComponent]
	[RequireComponent(typeof(ZibraLiquidMaterialParameters))]
	[RequireComponent(typeof(ZibraLiquidSolverParameters))]
	[RequireComponent(typeof(ZibraLiquidAdvancedRenderParameters))]
	[RequireComponent(typeof(ZibraManipulatorManager))]
	[ExecuteInEditMode]
	public class ZibraLiquid : MonoBehaviour, StatReporter
	{
		public enum InitialStateType
		{
			NoParticles,
			BakedLiquidState
		}

		[Serializable]
		public class BakedInitialState
		{
			[SerializeField]
			public int ParticleCount;

			[SerializeField]
			public Vector4[] Positions;

			[SerializeField]
			public Vector2Int[] AffineVelocity;
		}

		public enum RenderingMode
		{
			[Obsolete("Particle Render is no longer support. Please switch to another render mode.", true)]
			ParticleRender,
			MeshRender,
			[Obsolete("Unity Render is not supported in OTP version.", true)]
			UnityRender
		}

		[StructLayout(LayoutKind.Sequential)]
		private class UnityTextureBridge
		{
			public IntPtr texture;

			public TextureFormat format;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class RegisterParticlesBuffersBridgeParams
		{
			public IntPtr PositionMass;

			public IntPtr AffineVelocity0;

			public IntPtr AffineVelocity1;

			public IntPtr ParticleNumber;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class InitializeGPUReadbackParams
		{
			public uint readbackBufferSize;

			public int maxFramesInFlight;
		}

		private struct TextureUploadData
		{
			public IntPtr data;

			public int dataSize;

			public int rowPitch;

			public int dimensionX;

			public int dimensionY;

			public int dimensionZ;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class RegisterManipulatorsBridgeParams
		{
			public int ManipulatorNum;

			public IntPtr ManipulatorBufferDynamic;

			public IntPtr SDFObjectBuffer;

			public IntPtr ManipulatorBufferStatistics;

			public IntPtr ManipulatorParams;

			public int SDFObjectCount;

			public IntPtr SDFObjectData;

			public IntPtr ManipIndices;

			public UnityTextureBridge EmbeddingsTexture;

			public UnityTextureBridge SDFGridTexture;

			public UnityTextureBridge HeightmapTexture;

			public TextureUploadData EmbeddigsData;

			public TextureUploadData SDFGridData;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class RegisterSolverBuffersBridgeParams
		{
			public IntPtr SimulationParams;

			public IntPtr PositionMassCopy;

			public IntPtr GridData;

			public IntPtr IndexGrid;

			public IntPtr GridBlur0;

			public IntPtr GridBlur1;

			public IntPtr MassCopy;

			public IntPtr TmpSDFBuff;

			public IntPtr GridNormal;

			public IntPtr NodeParticlePairs0;

			public IntPtr NodeParticlePairs1;

			public IntPtr RadixGroupData1;

			public IntPtr RadixGroupData2;

			public IntPtr RadixGroupData3;

			public IntPtr Counters;

			public IntPtr VertexIDGrid;

			public IntPtr VertexBuffer0;

			public IntPtr VertexBuffer1;

			public IntPtr QuadBuffer;

			public IntPtr TransferDataBuffer;

			public IntPtr MeshRenderIndexBuffer;

			public IntPtr ParticleSpeciesData;

			public int ParticleSpeciesCount;

			public IntPtr UnityMeshVertexBuffer;

			public IntPtr UnityMeshIndexBuffer;

			public IntPtr VertexData;

			public UnityTextureBridge GridNormals;

			public UnityTextureBridge GridDensity;

			public UnityTextureBridge GridVelocity;

			public IntPtr EffectParticleData0;

			public IntPtr EffectParticleData1;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class RegisterRenderResourcesBridgeParams
		{
			public UnityTextureBridge Depth;

			public UnityTextureBridge Color0;

			public UnityTextureBridge Color1;

			public UnityTextureBridge Color2;

			public UnityTextureBridge SceneDepth;

			public UnityTextureBridge ParticlesRT;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class CameraParams
		{
			public Matrix4x4 View;

			public Matrix4x4 Projection;

			public Matrix4x4 ProjectionInverse;

			public Matrix4x4 ViewProjection;

			public Matrix4x4 ViewProjectionInverse;

			public Matrix4x4 EyeRayCameraCoeficients;

			public Vector3 WorldSpaceCameraPos;

			public int CameraID;

			public Vector4 ZBufferParams;

			public Vector2 CameraResolution;

			public float CameraDownscaleFactor;

			private float CameraParamsPadding1;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class MeshRenderGlobalParams
		{
			public Vector2 RenderingParameterPadding1;

			public int DisableRaymarch;

			public float LiquidIOR;

			public float RayMarchIsoSurface;

			public int UnderwaterRender;

			public float RayMarchStepSize;

			public float RayMarchStepFactor;

			public int RayMarchMaxSteps;

			public int TwoBouncesEnabled;

			public Vector2Int RayMarchResolution;

			public float FoamingIntensity;

			public float FoamingDecay;

			public float FoamingThreshold;

			public float FoamBrightness;

			public Vector4 Absorption;

			public float FoamMotionBlur;

			public float FoamSize;

			public float FoamDiffusion;

			public float FoamSpawning;

			public float FoamingDecaySmoothness;

			public float FoamingOcclusionDistance;

			public float SimulationParamPadding2;

			public float SimulationParamPadding3;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class RenderParams
		{
			public float BlurRadius;

			public float RenderParamsPadding1;

			public float NeuralSamplingDistance;

			public float SDFDebug;

			public int RenderingMode;

			public int VertexOptimizationIterations;

			public int MeshOptimizationIterations;

			public float DualContourIsoValue;

			public float MeshOptimizationStep;

			public float CameraDensity;

			public int MaxVertexBufferSize;

			public int MaxIndexBufferSize;

			public Vector3 RenderParamsContainerPos;

			public float RenderParams_space0;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class SimulationParams
		{
			public Vector3 GridSize;

			public int ParticleCount;

			public Vector3 ContainerScale;

			public int NodeCount;

			public Vector3 SimulationParamsContainerPos;

			public float TimeStep;

			public int SimulationFrame;

			public float DensityBlurRadius;

			public float LiquidIsosurfaceThreshold;

			public float VertexOptimizationStep;

			public Vector3 ParticleTranslation;

			public float GlobalVelocityLimit;

			public float MinimumVelocity;

			public float BlurNormalizationConstant;

			public int MaxParticleCount;

			public int VisualizeSDF;

			public float SimulationTime;

			public float FoamBuoyancy;

			public int ParticleSpeciesCount;

			public float SimulationParameterPadding;

			public int MaxEffectParticleCount;

			public int FoamParticleLifetime;

			public float padding0;

			public int EnableContainerMovementFeedback;

			public int EnableFoam;

			public float SimulationParamPadding1;

			public float SimulationParamPadding2;

			public float SimulationParamPadding3;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class ParticleSpeciesParameters
		{
			public Vector3 Gravity;

			public float AffineAmmount;

			public float LiquidStiffness;

			public float RestDensity;

			public float SurfaceTension;

			public float AffineDivergenceDecay;

			public Vector3 Material;

			public float VelocityLimit;
		}

		private class ShaderParam
		{
			public static int AbsorptionAmount = Shader.PropertyToID("AbsorptionAmount");

			public static int Background = Shader.PropertyToID("Background");

			public static int ContainerPosition = Shader.PropertyToID("ContainerPosition");

			public static int ContainerScale = Shader.PropertyToID("ContainerScale");

			public static int DepthOUT = Shader.PropertyToID("DepthOUT");

			public static int EmissiveColor = Shader.PropertyToID("EmissiveColor");

			public static int EyeRayCameraCoeficients = Shader.PropertyToID("EyeRayCameraCoeficients");

			public static int FluidColor = Shader.PropertyToID("FluidColor");

			public static int FresnelStrength = Shader.PropertyToID("FresnelStrength");

			public static int GridDensity = Shader.PropertyToID("GridDensity");

			public static int GridNormals = Shader.PropertyToID("GridNormals");

			public static int GridSize = Shader.PropertyToID("GridSize");

			public static int LightColor = Shader.PropertyToID("LightColor");

			public static int LightDirection = Shader.PropertyToID("LightDirection");

			public static int LiquidIOR = Shader.PropertyToID("LiquidIOR");

			public static int MatAbsorption = Shader.PropertyToID("MatAbsorption");

			public static int MatMetalness = Shader.PropertyToID("MatMetalness");

			public static int MatRoughness = Shader.PropertyToID("MatRoughness");

			public static int MatScattering = Shader.PropertyToID("MatScattering");

			public static int Material1Color = Shader.PropertyToID("Material1Color");

			public static int Material1Emission = Shader.PropertyToID("Material1Emission");

			public static int Material2Color = Shader.PropertyToID("Material2Color");

			public static int Material2Emission = Shader.PropertyToID("Material2Emission");

			public static int Material3Color = Shader.PropertyToID("Material3Color");

			public static int Material3Emission = Shader.PropertyToID("Material3Emission");

			public static int MaterialData = Shader.PropertyToID("MaterialData");

			public static int MeshDepth = Shader.PropertyToID("MeshDepth");

			public static int MeshRenderData = Shader.PropertyToID("MeshRenderData");

			public static int Metalness = Shader.PropertyToID("Metalness");

			public static int ParticlesTex = Shader.PropertyToID("ParticlesTex");

			public static int ProjectionInverse = Shader.PropertyToID("ProjectionInverse");

			public static int RayMarchData = Shader.PropertyToID("RayMarchData");

			public static int RayMarchResolutionDownscale = Shader.PropertyToID("RayMarchResolutionDownscale");

			public static int ReflectionColor = Shader.PropertyToID("ReflectionColor");

			public static int ReflectionProbe = Shader.PropertyToID("ReflectionProbe");

			public static int ReflectionProbe_BoxMax = Shader.PropertyToID("ReflectionProbe_BoxMax");

			public static int ReflectionProbe_BoxMin = Shader.PropertyToID("ReflectionProbe_BoxMin");

			public static int ReflectionProbe_HDR = Shader.PropertyToID("ReflectionProbe_HDR");

			public static int ReflectionProbe_ProbePosition = Shader.PropertyToID("ReflectionProbe_ProbePosition");

			public static int RefractionColor = Shader.PropertyToID("RefractionColor");

			public static int RefractionDepthBias = Shader.PropertyToID("RefractionDepthBias");

			public static int RefractionDistortion = Shader.PropertyToID("RefractionDistortion");

			public static int RefractionMinimumDepth = Shader.PropertyToID("RefractionMinimumDepth");

			public static int RenderPipelineScale = Shader.PropertyToID("RenderPipelineScale");

			public static int Resolution = Shader.PropertyToID("Resolution");

			public static int Roughness = Shader.PropertyToID("Roughness");

			public static int SDFRender = Shader.PropertyToID("SDFRender");

			public static int ScatteringAmount = Shader.PropertyToID("ScatteringAmount");

			public static int ShadedLiquid = Shader.PropertyToID("ShadedLiquid");

			public static int TextureScale = Shader.PropertyToID("TextureScale");

			public static int ViewProjectionInverse = Shader.PropertyToID("ViewProjectionInverse");

			public static int WorldSpaceLightPos = Shader.PropertyToID("WorldSpaceLightPos");

			public LocalKeyword LiquidMeshShader_CUSTOM_REFLECTION_PROBE;

			public LocalKeyword LiquidMeshShader_FLIP_BACKGROUND_TEXTURE;

			public LocalKeyword LiquidMeshShader_FLIP_NATIVE_TEXTURES;

			public LocalKeyword LiquidMeshShader_FLIP_PARTICLES_TEXTURE;

			public LocalKeyword LiquidMeshShader_FOAM_DISABLED;

			public LocalKeyword LiquidMeshShader_RAYMARCH_DISABLED;

			public LocalKeyword LiquidMeshShader_UNDERWATER_RENDER;

			public LocalKeyword LiquidMeshShader_USE_CUBEMAP_REFRACTION;
		}

		internal struct MaterialPair
		{
			public Material CurrentMaterial;

			public Material SharedMaterial;

			public bool SetMaterial(Material mat)
			{
				if ((Object)(object)SharedMaterial != (Object)(object)mat)
				{
					CurrentMaterial = (((Object)(object)mat != (Object)null) ? Object.Instantiate<Material>(mat) : null);
					SharedMaterial = mat;
					return true;
				}
				return false;
			}
		}

		internal class CameraResources
		{
			public RenderTexture Background;

			public MaterialPair LiquidMaterial;

			public MaterialPair UpscaleMaterial;

			public MaterialPair SDFRenderMaterial;

			public bool IsDirty = true;
		}

		private enum GraphicsBufferType
		{
			Vertex,
			Index
		}

		public static List<ZibraLiquid> AllFluids = new List<ZibraLiquid>();

		public const int BAKED_LIQUID_PAID_HEADER_VALUE = 119249569;

		public const int BAKED_LIQUID_PRO_HEADER_VALUE = 387685025;

		public const float DEFAULT_SIMULATION_TIME_SCALE = 40f;

		[NonSerialized]
		public RenderTexture Color0;

		[NonSerialized]
		public RenderTexture Color1;

		[NonSerialized]
		public RenderTexture Color2;

		[NonSerialized]
		public RenderTexture UpscaleColor;

		[NonSerialized]
		public RenderTexture Depth;

		[NonSerialized]
		public RenderTexture ParticlesRT;

		[NonSerialized]
		public ComputeBuffer Counters;

		[NonSerialized]
		public ComputeBuffer VertexIDGrid;

		[NonSerialized]
		public GraphicsBuffer VertexBuffer0;

		[NonSerialized]
		public GraphicsBuffer VertexBuffer1;

		[NonSerialized]
		public ComputeBuffer QuadBuffer;

		[NonSerialized]
		public ComputeBuffer TransferDataBuffer;

		[NonSerialized]
		public GraphicsBuffer MeshRenderIndexBuffer;

		[NonSerialized]
		public GraphicsBuffer VertexProperties;

		[NonSerialized]
		public Mesh LiquidMesh;

		[NonSerialized]
		public RenderTexture HeightmapTexture;

		[NonSerialized]
		public RenderTexture GridNormalTexture;

		[NonSerialized]
		public RenderTexture DensityTexture;

		[NonSerialized]
		public RenderTexture VelocityTexture;

		[Range(1024f, 10000000f)]
		[Tooltip("Maximum number of particles simulation may have. Directly corresponds to maximum volume of liquid simulation may have. Has noticeable VRAM impact.")]
		public int MaxNumParticles = 262144;

		[Tooltip("If enabled, makes liquid render in lower resolution")]
		public bool EnableDownscale;

		[Range(0.2f, 0.99f)]
		[Tooltip("Factor of resolution downscale. Lower factor corresponds to better performance, but lower visual quality.")]
		public float DownscaleFactor = 0.5f;

		[Tooltip("Type of initial state of the liquid")]
		public InitialStateType InitialState;

		[Tooltip("Asset containing baked initial state data")]
		public TextAsset BakedInitialStateAsset;

		[Tooltip("Rendering mode of the liquid. Default is Mesh Render mode. If VR support is required switch this to Unity Render mode.")]
		public RenderingMode CurrentRenderingMode = RenderingMode.MeshRender;

		[Tooltip("Injection point where we will insert liquid rendering")]
		public CameraEvent CurrentInjectionPoint = (CameraEvent)16;

		[FormerlySerializedAs("reflectionProbe")]
		[FormerlySerializedAs("reflectionProbeHDRP")]
		[Tooltip("Reflection proble used for liquid reflections")]
		public HDProbe ReflectionProbeHDRP;

		[FormerlySerializedAs("customLightHDRP")]
		[Tooltip("Light used for liquid shading")]
		public Light CustomLightHDRP;

		[FormerlySerializedAs("reflectionProbeSRP")]
		[Tooltip("Reflection proble used for liquid reflections")]
		public ReflectionProbe ReflectionProbeBRP;

		[Range(0f, 1f)]
		[FormerlySerializedAs("timeStepMax")]
		[Tooltip("Maximum timestep that is allowed in single simulation iteration")]
		public float MaxAllowedTimestep = 1f;

		[Range(2f, 16f)]
		[FormerlySerializedAs("maxFramesInFlight")]
		[Tooltip("Fallback maximum allowed number of frames queued to render")]
		public uint MaxFramesInFlight = 3u;

		[Range(0f, 100f)]
		[FormerlySerializedAs("simTimePerSec")]
		[Tooltip("Speed of liquid simulation")]
		public float SimulationTimeScale = 40f;

		[Range(1f, 10f)]
		[FormerlySerializedAs("iterationsPerFrame")]
		[Tooltip("Number of simulation iterations to execute on each update")]
		public int SimulationIterationsPerFrame = 1;

		[Min(16f)]
		[FormerlySerializedAs("gridResolution")]
		[Tooltip("Resolution of the simulation grid. Has major impact on performance and quality. Please see documentation for details.")]
		public int GridResolution = 128;

		[Tooltip("Freezes simulation when disabled. Also decreases performance cost when disabled, since simulation won't run. Disabling this option does not prevent simulation from rendering.")]
		[FormerlySerializedAs("runSimulation")]
		public bool RunSimulation = true;

		[FormerlySerializedAs("runRendering")]
		[Tooltip("Whether to render liquid")]
		public bool RunRendering = true;

		[Tooltip("When enabled, during container movement, liquid stays in place in world space")]
		public bool EnableContainerMovementFeedback = true;

		[FormerlySerializedAs("visualizeSceneSDF")]
		[Tooltip("Whether to render visualized SDFs")]
		public bool VisualizeSceneSDF;

		[FormerlySerializedAs("containerSize")]
		public Vector3 ContainerSize = new Vector3(10f, 10f, 10f);

		[Tooltip("Use Fixed Timestep for physics simulation. Can be used to have similar behavior of liquid between different runs and machines. Use with care, if the physics simulation takes more time than Fixed Timestep, performance will be severely affected.")]
		public bool UseFixedTimestep;

		[NonSerialized]
		[Obsolete("color0 is deprecated. Please use Color0.", true)]
		public RenderTexture color0;

		[NonSerialized]
		[Obsolete("color1 is deprecated. Please use Color1.", true)]
		public RenderTexture color1;

		[NonSerialized]
		[Obsolete("color2 is deprecated. Please use Color2.", true)]
		public RenderTexture color2;

		[NonSerialized]
		[Obsolete("upscaleColor is deprecated. Please use UpscaleColor.", true)]
		public RenderTexture upscaleColor;

		[NonSerialized]
		[Obsolete("depth is deprecated. Please use Depth.", true)]
		public RenderTexture depth;

		[NonSerialized]
		[Obsolete("timestep is deprecated. Please use Timestep.", true)]
		public float timestep;

		[NonSerialized]
		[Obsolete("simulationInternalTime is deprecated. Please use SimulationInternalTime.", true)]
		public float simulationInternalTime;

		[NonSerialized]
		[Obsolete("simulationInternalFrame is deprecated. Please use SimulationInternalFrame.", true)]
		public int simulationInternalFrame;

		[NonSerialized]
		[Obsolete("reflectionProbe is deprecated. Use ReflectionProbeBRP or ReflectionProbeHDRP instead depending on your Rendering Pipeline (URP uses ReflectionProbeBRP).", true)]
		public ReflectionProbe reflectionProbe;

		[NonSerialized]
		[Obsolete("reflectionProbeHDRP is deprecated. Please use ReflectionProbeHDRP.", true)]
		public HDProbe reflectionProbeHDRP;

		[NonSerialized]
		[Obsolete("customLightHDRP is deprecated. Please use CustomLightHDRP.", true)]
		public Light customLightHDRP;

		[NonSerialized]
		[Obsolete("reflectionProbeSRP is deprecated. Please use ReflectionProbeBRP.", true)]
		public ReflectionProbe reflectionProbeSRP;

		[NonSerialized]
		[Obsolete("timeStepMax is deprecated. Please use MaxAllowedTimestep.", true)]
		public float timeStepMax;

		[NonSerialized]
		[Obsolete("maxFramesInFlight is deprecated. Please use MaxFramesInFlight.", true)]
		public uint maxFramesInFlight;

		[NonSerialized]
		[Obsolete("simTimePerSec is deprecated. Please use SimulationTimeScale.", true)]
		public float simTimePerSec;

		[NonSerialized]
		[Obsolete("activeParticleNumber is deprecated. Please use CurrentParticleNumber.", true)]
		public int activeParticleNumber;

		[NonSerialized]
		[Obsolete("iterationsPerFrame is deprecated. Please use SimulationIterationsPerFrame.", true)]
		public int iterationsPerFrame;

		[NonSerialized]
		[Obsolete("CellSize is deprecated. Please use NodeSize.", true)]
		public float CellSize;

		[NonSerialized]
		[Obsolete("gridResolution is deprecated. Please use GridResolution.", true)]
		public int gridResolution;

		[NonSerialized]
		[Obsolete("runSimulation is deprecated. Please use RunSimulation.", true)]
		public bool runSimulation;

		[NonSerialized]
		[Obsolete("runRendering is deprecated. Please use RunRendering.", true)]
		public bool runRendering;

		[NonSerialized]
		[Obsolete("visualizeSceneSDF is deprecated. Please use VisualizeSceneSDF.", true)]
		public bool visualizeSceneSDF;

		[NonSerialized]
		[Obsolete("solverParameters is deprecated. Please use SolverParameters.", true)]
		public ZibraLiquidSolverParameters solverParameters;

		[NonSerialized]
		[Obsolete("materialParameters is deprecated. Please use MaterialParameters.", true)]
		public ZibraLiquidSolverParameters materialParameters;

		[NonSerialized]
		[Obsolete("renderingParameters is deprecated. Please use AdvancedRenderParameters.", true)]
		public ZibraLiquidAdvancedRenderParameters renderingParameters;

		[NonSerialized]
		[Obsolete("containerSize is deprecated. Please use ContainerSize.", true)]
		public Vector3 containerSize;

		[NonSerialized]
		[Obsolete("initialized is deprecated. Please use Initialized.", true)]
		public bool initialized;

		[NonSerialized]
		[Obsolete("useFixedTimestep is deprecated. Please use UseFixedTimestep.", true)]
		public bool useFixedTimestep;

		private ShaderParam ShaderParamContainer = new ShaderParam();

		private RenderTexture DepthTexture;

		internal const int MPM_THREADS = 256;

		internal const int STATISTICS_PER_MANIPULATOR = 8;

		private const int RADIX_THREADS = 128;

		private const int HISTO_WIDTH = 32;

		private const int DEPTH_COPY_WORKGROUP = 16;

		private const int ADDITIONAL_VERTICES = 3000;

		private static int NextInstanceId = 0;

		private int CopyDepthID;

		private int MaxFoamParticles;

		private ZibraLiquidSolverParameters SolverParametersInternal;

		private ZibraLiquidMaterialParameters MaterialParametersInternal;

		private ZibraLiquidAdvancedRenderParameters AdvancedRenderParametersInternal;

		private ZibraManipulatorManager ManipulatorManagerInternal;

		[NonSerialized]
		private Vector2Int CurrentTextureResolution = new Vector2Int(0, 0);

		private readonly Dictionary<Camera, CommandBuffer> CameraCBs = new Dictionary<Camera, CommandBuffer>();

		private List<Camera> Cameras = new List<Camera>();

		internal Dictionary<Camera, IntPtr> CamNativeParams = new Dictionary<Camera, IntPtr>();

		private Dictionary<Camera, IntPtr> CamMeshRenderParams = new Dictionary<Camera, IntPtr>();

		private Dictionary<Camera, Vector2Int> CamRenderResolutions = new Dictionary<Camera, Vector2Int>();

		private Dictionary<Camera, Vector2Int> CamNativeResolutions = new Dictionary<Camera, Vector2Int>();

		internal Dictionary<Camera, CameraResources> CameraResourcesMap = new Dictionary<Camera, CameraResources>();

		private CameraParams CameraRenderParams;

		private MeshRenderGlobalParams MeshRenderGlobalParamsContainer;

		private RenderParams RenderParamsContainer;

		private SimulationParams LiquidParameters;

		private ComputeBuffer GridData;

		private ComputeBuffer IndexGrid;

		private ComputeBuffer GridNormal;

		private Texture3D SDFGridTexture;

		private Texture3D EmbeddingsTexture;

		private ComputeBuffer PositionMassCopy;

		private ComputeBuffer GridBlur0;

		private ComputeBuffer GridBlur1;

		private ComputeBuffer MassCopy;

		private ComputeBuffer TmpSDFBuff;

		private ComputeBuffer NodeParticlePairs0;

		private ComputeBuffer NodeParticlePairs1;

		private ComputeBuffer EffectParticleData0;

		private ComputeBuffer EffectParticleData1;

		private ComputeBuffer RadixGroupData1;

		private ComputeBuffer RadixGroupData2;

		private ComputeBuffer RadixGroupData3;

		private ComputeBuffer DynamicManipulatorData;

		private ComputeBuffer SDFObjectData;

		private ComputeBuffer ManipulatorStatistics;

		private ComputeBuffer ParticleSpeciesData;

		private CommandBuffer SolverCommandBuffer;

		private List<IntPtr> ToFreeOnExit = new List<IntPtr>();

		private RenderingMode ActiveRenderingMode = RenderingMode.MeshRender;

		private CameraEvent ActiveInjectionPoint = (CameraEvent)16;

		private IntPtr NativeManipData;

		private IntPtr NativeSDFData;

		private IntPtr NativeFluidData;

		private IntPtr NativeSolverData;

		[SerializeField]
		[HideInInspector]
		private string _SimulationGUID = Guid.NewGuid().ToString();

		[SerializeField]
		[FormerlySerializedAs("sdfColliders")]
		private List<ZibraLiquidCollider> SDFColliders = new List<ZibraLiquidCollider>();

		[SerializeField]
		[FormerlySerializedAs("manipulators")]
		private List<Manipulator> Manipulators = new List<Manipulator>();

		private LiquidHDRPRenderComponent HDRPRenderer;

		public ComputeBuffer PositionMass { get; private set; }

		public ComputeBuffer[] Affine { get; private set; }

		public ComputeBuffer ParticleNumber { get; private set; }

		public string SimulationGUID => _SimulationGUID;

		public int CurrentInstanceID { get; private set; }

		public float Timestep { get; private set; }

		public float SimulationInternalTime { get; private set; }

		public int SimulationInternalFrame { get; private set; }

		public int GridNodeCount { get; private set; }

		public Vector3Int GridSize { get; private set; }

		public int CurrentParticleNumber { get; private set; }

		public float NodeSize { get; private set; }

		public ZibraLiquidSolverParameters SolverParameters
		{
			get
			{
				if ((Object)(object)SolverParametersInternal == (Object)null)
				{
					SolverParametersInternal = ((Component)this).gameObject.GetComponent<ZibraLiquidSolverParameters>();
					if ((Object)(object)SolverParametersInternal == (Object)null)
					{
						SolverParametersInternal = ((Component)this).gameObject.AddComponent<ZibraLiquidSolverParameters>();
					}
				}
				return SolverParametersInternal;
			}
		}

		public ZibraLiquidMaterialParameters MaterialParameters
		{
			get
			{
				if ((Object)(object)MaterialParametersInternal == (Object)null)
				{
					MaterialParametersInternal = ((Component)this).gameObject.GetComponent<ZibraLiquidMaterialParameters>();
					if ((Object)(object)MaterialParametersInternal == (Object)null)
					{
						MaterialParametersInternal = ((Component)this).gameObject.AddComponent<ZibraLiquidMaterialParameters>();
					}
				}
				return MaterialParametersInternal;
			}
		}

		public ZibraLiquidAdvancedRenderParameters AdvancedRenderParameters
		{
			get
			{
				if ((Object)(object)AdvancedRenderParametersInternal == (Object)null)
				{
					AdvancedRenderParametersInternal = ((Component)this).gameObject.GetComponent<ZibraLiquidAdvancedRenderParameters>();
					if ((Object)(object)AdvancedRenderParametersInternal == (Object)null)
					{
						AdvancedRenderParametersInternal = ((Component)this).gameObject.AddComponent<ZibraLiquidAdvancedRenderParameters>();
					}
				}
				return AdvancedRenderParametersInternal;
			}
		}

		public bool Initialized { get; private set; }

		internal ZibraManipulatorManager ManipulatorManager
		{
			get
			{
				if ((Object)(object)ManipulatorManagerInternal == (Object)null)
				{
					ManipulatorManagerInternal = ((Component)this).gameObject.GetComponent<ZibraManipulatorManager>();
					if ((Object)(object)ManipulatorManagerInternal == (Object)null)
					{
						ManipulatorManagerInternal = ((Component)this).gameObject.AddComponent<ZibraManipulatorManager>();
					}
				}
				return ManipulatorManagerInternal;
			}
		}

		[Obsolete("onChanged is deprecated. Please use OnChanged.", true)]
		public event Action onChanged;

		public bool IsValidBakedLiquidHeader(int header)
		{
			if (header != 119249569)
			{
				return header == 387685025;
			}
			return true;
		}

		public bool IsLoaded()
		{
			return LiquidBridge.ZibraLiquid_IsLoaded() != 0;
		}

		public void WaitLoad()
		{
			LiquidBridge.ZibraLiquid_WaitLoad();
		}

		public void UpdateSimulationConstants()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			if (!Initialized)
			{
				NodeSize = Math.Max(ContainerSize.x, Math.Max(ContainerSize.y, ContainerSize.z)) / (float)GridResolution;
				GridSize = Vector3Int.CeilToInt(ContainerSize / NodeSize);
				Vector3Int gridSize = GridSize;
				int num = ((Vector3Int)(ref gridSize))[0];
				gridSize = GridSize;
				int num2 = num * ((Vector3Int)(ref gridSize))[1];
				gridSize = GridSize;
				GridNodeCount = num2 * ((Vector3Int)(ref gridSize))[2];
			}
		}

		public float GetParticleSize()
		{
			UpdateSimulationConstants();
			return (float)((double)NodeSize / Math.Pow(SolverParameters.ParticleDensity, 0.3333333432674408));
		}

		public bool HasEmitter()
		{
			foreach (Manipulator manipulator in Manipulators)
			{
				if (manipulator.GetManipulatorType() == Manipulator.ManipulatorType.Emitter)
				{
					return true;
				}
			}
			return false;
		}

		public ReadOnlyCollection<ZibraLiquidCollider> GetColliderList()
		{
			return SDFColliders.AsReadOnly();
		}

		public bool HasCollider(ZibraLiquidCollider collider)
		{
			return SDFColliders.Contains(collider);
		}

		public void AddCollider(ZibraLiquidCollider collider)
		{
			if (Initialized)
			{
				Debug.LogWarning((object)"We don't yet support changing number of manipulators/colliders while liquid's resources are initialized.");
			}
			else if (!SDFColliders.Contains(collider))
			{
				SDFColliders.Add(collider);
				SDFColliders.Sort(new SDFColliderCompare());
			}
		}

		public void RemoveCollider(ZibraLiquidCollider collider)
		{
			if (Initialized)
			{
				Debug.LogWarning((object)"We don't yet support changing number of manipulators/colliders while liquid's resources are initialized.");
			}
			else if (SDFColliders.Contains(collider))
			{
				SDFColliders.Remove(collider);
				SDFColliders.Sort(new SDFColliderCompare());
			}
		}

		public ReadOnlyCollection<Manipulator> GetManipulatorList()
		{
			return Manipulators.AsReadOnly();
		}

		public bool HasManipulator(Manipulator manipulator)
		{
			return Manipulators.Contains(manipulator);
		}

		public void AddManipulator(Manipulator manipulator)
		{
			if (Initialized)
			{
				Debug.LogWarning((object)"We don't yet support changing number of manipulators/colliders at runtime.");
			}
			else if (!Manipulators.Contains(manipulator))
			{
				Manipulators.Add(manipulator);
				Manipulators.Sort(new ManipulatorCompare());
			}
		}

		public void RemoveManipulator(Manipulator manipulator)
		{
			if (Initialized)
			{
				Debug.LogWarning((object)"We don't yet support changing number of manipulators/colliders at runtime.");
			}
			else if (Manipulators.Contains(manipulator))
			{
				Manipulators.Remove(manipulator);
				Manipulators.Sort(new ManipulatorCompare());
			}
		}

		public ulong GetParticleCountFootprint()
		{
			long num = 0L;
			int particleCountRounded = GetParticleCountRounded();
			long num2 = num + MaxNumParticles * 4 * 4 + 8 * particleCountRounded * 2 * 4 + particleCountRounded * 4 * 4 + particleCountRounded * 2 * 4 + particleCountRounded * 4 + 4 * MaxNumParticles * 4;
			int num3 = (int)Math.Ceiling((float)MaxNumParticles / 256f);
			int num4 = (int)Math.Ceiling((float)MaxNumParticles / 16384f);
			int num5 = (int)Math.Ceiling((float)num4 / 128f);
			return (ulong)(num2 + num3 * 32 * 4 + num4 * 32 * 4 + (num5 + 1) * 32 * 4);
		}

		public ulong GetSDFsFootprint()
		{
			ulong num = 0uL;
			foreach (ZibraLiquidCollider sDFCollider in SDFColliders)
			{
				if (!((Object)(object)sDFCollider == (Object)null))
				{
					SDFObject component = ((Component)sDFCollider).gameObject.GetComponent<SDFObject>();
					if (Object.op_Implicit((Object)(object)component))
					{
						num += component.GetVRAMFootprint();
					}
				}
			}
			return num;
		}

		public ulong GetGridFootprint()
		{
			long num = 0L;
			UpdateSimulationConstants();
			return (ulong)(num + GridNodeCount * 4 * 4 + GridNodeCount * 4 * 4 + GridNodeCount * 4 + GridNodeCount * 4 + GridNodeCount * 4 + GridNodeCount * 2 * 4 + GridNodeCount * 4 + GridNodeCount * 4 * 4 + GridNodeCount * 4 + GridNodeCount * 16 + GridNodeCount * 2 * 4 + GridNodeCount * 4 / 2 + GridNodeCount * 4 / 2);
		}

		public void InitializeSimulation()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Invalid comparison between Unknown and I4
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Expected O, but got Unknown
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Expected O, but got Unknown
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Invalid comparison between Unknown and I4
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Invalid comparison between Unknown and I4
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Invalid comparison between Unknown and I4
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Invalid comparison between Unknown and I4
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Invalid comparison between Unknown and I4
			if (Initialized)
			{
				return;
			}
			try
			{
				ActiveRenderingMode = CurrentRenderingMode;
				if ((int)RenderPipelineDetector.GetRenderPipelineType() == 2)
				{
					bool flag = false;
					if ((Object)(object)CustomLightHDRP == (Object)null)
					{
						Debug.LogError((object)"No Custom Light set in Zibra Liquid.");
						flag = true;
					}
					if ((Object)(object)ReflectionProbeHDRP == (Object)null)
					{
						Debug.LogError((object)"No reflection probe added to Zibra Liquid.");
						flag = true;
					}
					if (flag)
					{
						throw new Exception("Liquid creation failed due to missing parameter.");
					}
				}
				ValidateColliders();
				ValidateManipulators();
				if (InitialState == InitialStateType.NoParticles || (Object)(object)BakedInitialStateAsset == (Object)null)
				{
					bool flag2 = false;
					foreach (Manipulator manipulator in Manipulators)
					{
						if (manipulator.GetManipulatorType() == Manipulator.ManipulatorType.Emitter && (Object)(object)((Component)manipulator).GetComponent<SDFObject>() != (Object)null)
						{
							flag2 = true;
							break;
						}
					}
					if (!flag2)
					{
						throw new Exception("Liquid creation failed. Liquid have neither initial state nor emitters, or all emitters missing SDF component.");
					}
				}
				Camera.onPreRender = (CameraCallback)Delegate.Combine((Delegate?)(object)Camera.onPreRender, (Delegate?)new CameraCallback(RenderCallBackWrapper));
				SolverCommandBuffer = new CommandBuffer
				{
					name = "ZibraLiquid.Solver"
				};
				CurrentInstanceID = NextInstanceId++;
				ForceCloseCommandEncoder(SolverCommandBuffer);
				LiquidBridge.SubmitInstanceEvent(SolverCommandBuffer, CurrentInstanceID, (EventID)6, (IntPtr)0);
				Graphics.ExecuteCommandBuffer(SolverCommandBuffer);
				SolverCommandBuffer.Clear();
				InitializeParticles();
				InitializeGPUReadbackParams initializeGPUReadbackParams = new InitializeGPUReadbackParams();
				uint num = (uint)(ManipulatorManager.Elements * 8 * 4);
				initializeGPUReadbackParams.readbackBufferSize = 4 + num;
				GraphicsDeviceType graphicsDeviceType = SystemInfo.graphicsDeviceType;
				if ((int)graphicsDeviceType <= 14)
				{
					if ((int)graphicsDeviceType == 2 || (int)graphicsDeviceType == 14)
					{
						goto IL_01b0;
					}
				}
				else if ((int)graphicsDeviceType == 18 || graphicsDeviceType - 22 <= 1)
				{
					goto IL_01b0;
				}
				initializeGPUReadbackParams.maxFramesInFlight = (int)MaxFramesInFlight;
				goto IL_01cb;
				IL_01cb:
				IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(initializeGPUReadbackParams));
				Marshal.StructureToPtr(initializeGPUReadbackParams, intPtr, fDeleteOld: true);
				SolverCommandBuffer.Clear();
				LiquidBridge.SubmitInstanceEvent(SolverCommandBuffer, CurrentInstanceID, (EventID)14, intPtr);
				Graphics.ExecuteCommandBuffer(SolverCommandBuffer);
				ToFreeOnExit.Add(intPtr);
				InitializeSolver();
				Initialized = true;
				return;
				IL_01b0:
				initializeGPUReadbackParams.maxFramesInFlight = QualitySettings.maxQueuedFrames + 1;
				goto IL_01cb;
			}
			catch (Exception)
			{
				ClearRendering();
				ClearSolver();
				throw;
			}
		}

		public void ReleaseSimulation()
		{
			if (Initialized)
			{
				ClearRendering();
				ClearSolver();
				Initialized = false;
				ZibraLiquidGPUGarbageCollector.CreateGarbageCollector();
			}
		}

		public void UpdateSimulation(float deltaTime)
		{
			UpdateUnityRender();
			UpdateNativeRenderParams();
			if (IsSimulationEnabled())
			{
				Timestep = Math.Min(SimulationTimeScale * deltaTime / (float)SimulationIterationsPerFrame, MaxAllowedTimestep);
				for (int i = 0; i < SimulationIterationsPerFrame; i++)
				{
					StepPhysics();
				}
				SolverCommandBuffer.Clear();
				Graphics.ExecuteCommandBuffer(SolverCommandBuffer);
			}
		}

		public GameObject UpdateUnityRender()
		{
			_ = CurrentRenderingMode;
			if (Initialized)
			{
				_ = ActiveRenderingMode;
			}
			Transform val = ((Component)this).transform.Find("ZibraLiquidMesh");
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			GameObject gameObject = ((Component)val).gameObject;
			gameObject.SetActive(false);
			return gameObject;
		}

		public List<string> GetStats()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			float num = (EnableDownscale ? DownscaleFactor : 1f);
			float num2 = num * num;
			return new List<string>
			{
				"Liquid Simulation",
				"Instance: " + ((Object)this).name,
				$"Grid size: {GridSize}",
				$"Render resolution: {num * 100f}%",
				$"Render pixel count: {num2 * 100f}%",
				$"Max particle count: {MaxNumParticles}",
				$"Current particle count: {CurrentParticleNumber}"
			};
		}

		[Obsolete("Init is deprecated. Please use InitializeSimulation.", true)]
		public void Init()
		{
		}

		[Obsolete("StopSolver is deprecated. Please use ReleaseSimulation.", true)]
		public void StopSolver()
		{
		}

		private GraphicsBuffer CreateGraphicsBuffer(GraphicsBufferType type, int count, int stride)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			return new GraphicsBuffer((Target)((type == GraphicsBufferType.Vertex) ? 33 : 34), count, stride);
		}

		private IntPtr GetNativePtr(ComputeBuffer buffer)
		{
			if (buffer != null)
			{
				return buffer.GetNativeBufferPtr();
			}
			return IntPtr.Zero;
		}

		private IntPtr GetNativePtr(GraphicsBuffer buffer)
		{
			if (buffer != null)
			{
				return buffer.GetNativeBufferPtr();
			}
			return IntPtr.Zero;
		}

		private IntPtr GetNativePtr(RenderTexture texture)
		{
			if (!((Object)(object)texture == (Object)null))
			{
				return ((Texture)texture).GetNativeTexturePtr();
			}
			return IntPtr.Zero;
		}

		private IntPtr GetNativePtr(Texture3D texture)
		{
			if (!((Object)(object)texture == (Object)null))
			{
				return ((Texture)texture).GetNativeTexturePtr();
			}
			return IntPtr.Zero;
		}

		internal bool IsRenderingEnabled()
		{
			if (Initialized && RunRendering)
			{
				return SimulationInternalFrame > 1;
			}
			return false;
		}

		private bool IsSimulationEnabled()
		{
			if (Initialized)
			{
				if (!RunSimulation)
				{
					return SimulationInternalFrame <= 2;
				}
				return true;
			}
			return false;
		}

		private void SetupScriptableRenderComponent()
		{
		}

		private void ForceCloseCommandEncoder(CommandBuffer cmdList)
		{
		}

		private UnityTextureBridge MakeTextureNativeBridge(RenderTexture texture)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			UnityTextureBridge unityTextureBridge = new UnityTextureBridge();
			if ((Object)(object)texture != (Object)null)
			{
				unityTextureBridge.texture = GetNativePtr(texture);
				unityTextureBridge.format = LiquidBridge.ToBridgeTextureFormat(texture.graphicsFormat);
			}
			else
			{
				unityTextureBridge.texture = IntPtr.Zero;
				unityTextureBridge.format = (TextureFormat)0;
			}
			return unityTextureBridge;
		}

		private UnityTextureBridge MakeTextureNativeBridge(Texture3D texture)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			return new UnityTextureBridge
			{
				texture = GetNativePtr(texture),
				format = LiquidBridge.ToBridgeTextureFormat(((Texture)texture).graphicsFormat)
			};
		}

		private void OnDrawGizmosInternal(bool isSelected)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			if (!((Behaviour)this).enabled)
			{
				return;
			}
			Gizmos.color = Color.yellow;
			if (!isSelected)
			{
				Gizmos.color = new Color(Gizmos.color.r, Gizmos.color.g, Gizmos.color.b, Gizmos.color.a * 0.5f);
			}
			Gizmos.DrawWireCube(((Component)this).transform.position, ContainerSize);
			Gizmos.color = new Color(0.2f, 0.8f, 0.8f);
			if (!isSelected)
			{
				Gizmos.color = new Color(Gizmos.color.r, Gizmos.color.g, Gizmos.color.b, Gizmos.color.a * 0.5f);
			}
			float x = ContainerSize.x;
			Vector3Int gridSize = GridSize;
			float num = x / (float)((Vector3Int)(ref gridSize)).x;
			float y = ContainerSize.y;
			gridSize = GridSize;
			float num2 = y / (float)((Vector3Int)(ref gridSize)).y;
			float z = ContainerSize.z;
			gridSize = GridSize;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(num, num2, z / (float)((Vector3Int)(ref gridSize)).z);
			for (int i = -2; i <= 2; i++)
			{
				for (int j = -2; j <= 2; j++)
				{
					for (int k = -2; k <= 2; k++)
					{
						Gizmos.DrawWireCube(((Component)this).transform.position + new Vector3((float)i * val.x, (float)j * val.y, (float)k * val.z), val);
					}
				}
			}
		}

		private void OnDrawGizmosSelected()
		{
			OnDrawGizmosInternal(isSelected: true);
		}

		private void OnDrawGizmos()
		{
			OnDrawGizmosInternal(isSelected: false);
		}

		private void Awake()
		{
			SetupScriptableRenderComponent();
		}

		private void OnEnable()
		{
			SetupScriptableRenderComponent();
			AllFluids?.Add(this);
			UpdateUnityRender();
			AddToStatReporter();
			InitializeSimulation();
		}

		private void InitializeParticles()
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Expected O, but got Unknown
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Expected O, but got Unknown
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Expected O, but got Unknown
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Expected O, but got Unknown
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Expected O, but got Unknown
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Expected O, but got Unknown
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Expected O, but got Unknown
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Expected O, but got Unknown
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0317: Expected O, but got Unknown
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Expected O, but got Unknown
			//IL_0471: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b3: Unknown result type (might be due to invalid IL or missing references)
			UpdateSimulationConstants();
			LiquidParameters = new SimulationParams();
			NativeFluidData = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SimulationParams)));
			NativeSolverData = Marshal.AllocHGlobal((SolverParameters.AdditionalParticleSpecies.Count + 16) * Marshal.SizeOf(typeof(ParticleSpeciesParameters)));
			int num = (int)Math.Ceiling((double)MaxNumParticles / 256.0) * 256;
			PositionMass = new ComputeBuffer(MaxNumParticles, 16);
			Affine = (ComputeBuffer[])(object)new ComputeBuffer[2];
			Affine[0] = new ComputeBuffer(4 * num, 8);
			Affine[1] = new ComputeBuffer(4 * num, 8);
			ParticleNumber = new ComputeBuffer(128, 4);
			int[] data = new int[128];
			ParticleNumber.SetData((Array)data);
			ApplyInitialState();
			int[] array = new int[128];
			for (int i = 0; i < 128; i++)
			{
				array[i] = 0;
			}
			ParticleNumber.SetData((Array)array);
			ManipulatorManager.UpdateConst(Manipulators, SDFColliders);
			ManipulatorManager.HeightmapCountSqrt = (int)Mathf.Ceil(Mathf.Sqrt((float)ManipulatorManager.HeightmapCount));
			ManipulatorManager.HeightmapSize = Vector2Int.one * Mathf.Max(1, ManipulatorManager.HeightmapCountSqrt * SolverParameters.HeightmapResolution);
			CreateTexture(ref HeightmapTexture, ManipulatorManager.HeightmapSize, (FilterMode)0, 0, (RenderTextureFormat)15);
			ManipulatorManager.UpdateDynamic(SolverCommandBuffer, this);
			if (ManipulatorManager.TextureCount > 0)
			{
				EmbeddingsTexture = new Texture3D(ManipulatorManager.EmbeddingTextureDimension, ManipulatorManager.EmbeddingTextureDimension, ManipulatorManager.EmbeddingTextureDimension, (TextureFormat)4, false);
				SDFGridTexture = new Texture3D(ManipulatorManager.SDFTextureDimension, ManipulatorManager.SDFTextureDimension, ManipulatorManager.SDFTextureDimension, (TextureFormat)15, false);
				((Texture)EmbeddingsTexture).filterMode = (FilterMode)2;
				((Texture)SDFGridTexture).filterMode = (FilterMode)2;
			}
			else
			{
				EmbeddingsTexture = new Texture3D(1, 1, 1, (TextureFormat)4, 0);
				SDFGridTexture = new Texture3D(1, 1, 1, (TextureFormat)15, 0);
				((Texture)EmbeddingsTexture).filterMode = (FilterMode)2;
				((Texture)SDFGridTexture).filterMode = (FilterMode)2;
			}
			int num2 = Marshal.SizeOf(typeof(ZibraManipulatorManager.ManipulatorParam));
			int num3 = Marshal.SizeOf(typeof(ZibraManipulatorManager.SDFObjectParams));
			NativeManipData = Marshal.AllocHGlobal(ManipulatorManager.Elements * num2);
			NativeSDFData = Marshal.AllocHGlobal(ManipulatorManager.SDFObjectList.Count * num3);
			DynamicManipulatorData = new ComputeBuffer(Math.Max(ManipulatorManager.Elements, 1), num2);
			SDFObjectData = new ComputeBuffer(Math.Max(ManipulatorManager.SDFObjectList.Count, 1), Marshal.SizeOf(typeof(ZibraManipulatorManager.SDFObjectParams)));
			int num4 = Math.Max(8 * ManipulatorManager.Elements, 1);
			ManipulatorStatistics = new ComputeBuffer(num4, 4, (ComputeBufferType)256);
			int[] data2 = new int[num4];
			ManipulatorStatistics.SetData((Array)data2);
			GCHandle gCHandle = GCHandle.Alloc(ManipulatorManager.Indices, GCHandleType.Pinned);
			UpdateInteropBuffers();
			RegisterManipulatorsBridgeParams registerManipulatorsBridgeParams = new RegisterManipulatorsBridgeParams();
			registerManipulatorsBridgeParams.ManipulatorNum = ManipulatorManager.Elements;
			registerManipulatorsBridgeParams.ManipulatorBufferDynamic = GetNativePtr(DynamicManipulatorData);
			registerManipulatorsBridgeParams.SDFObjectBuffer = GetNativePtr(SDFObjectData);
			registerManipulatorsBridgeParams.ManipulatorBufferStatistics = ManipulatorStatistics.GetNativeBufferPtr();
			registerManipulatorsBridgeParams.ManipulatorParams = NativeManipData;
			registerManipulatorsBridgeParams.SDFObjectCount = ManipulatorManager.SDFObjectList.Count;
			registerManipulatorsBridgeParams.SDFObjectData = NativeSDFData;
			registerManipulatorsBridgeParams.ManipIndices = gCHandle.AddrOfPinnedObject();
			registerManipulatorsBridgeParams.EmbeddingsTexture = MakeTextureNativeBridge(EmbeddingsTexture);
			registerManipulatorsBridgeParams.SDFGridTexture = MakeTextureNativeBridge(SDFGridTexture);
			registerManipulatorsBridgeParams.HeightmapTexture = MakeTextureNativeBridge(HeightmapTexture);
			GCHandle gCHandle2 = default(GCHandle);
			if (ManipulatorManager.Embeddings.Length != 0)
			{
				gCHandle2 = GCHandle.Alloc(ManipulatorManager.Embeddings, GCHandleType.Pinned);
				registerManipulatorsBridgeParams.EmbeddigsData.dataSize = Marshal.SizeOf<Color32>(default(Color32)) * ManipulatorManager.Embeddings.Length;
				registerManipulatorsBridgeParams.EmbeddigsData.data = gCHandle2.AddrOfPinnedObject();
				registerManipulatorsBridgeParams.EmbeddigsData.rowPitch = Marshal.SizeOf<Color32>(default(Color32)) * ((Texture)EmbeddingsTexture).width;
				registerManipulatorsBridgeParams.EmbeddigsData.dimensionX = ((Texture)EmbeddingsTexture).width;
				registerManipulatorsBridgeParams.EmbeddigsData.dimensionY = ((Texture)EmbeddingsTexture).height;
				registerManipulatorsBridgeParams.EmbeddigsData.dimensionZ = EmbeddingsTexture.depth;
			}
			GCHandle gCHandle3 = default(GCHandle);
			if (ManipulatorManager.SDFGrid.Length != 0)
			{
				gCHandle3 = GCHandle.Alloc(ManipulatorManager.SDFGrid, GCHandleType.Pinned);
				registerManipulatorsBridgeParams.SDFGridData.dataSize = Marshal.SizeOf((byte)0) * ManipulatorManager.SDFGrid.Length;
				registerManipulatorsBridgeParams.SDFGridData.data = gCHandle3.AddrOfPinnedObject();
				registerManipulatorsBridgeParams.SDFGridData.rowPitch = Marshal.SizeOf((byte)0) * 2 * ((Texture)SDFGridTexture).width;
				registerManipulatorsBridgeParams.SDFGridData.dimensionX = ((Texture)SDFGridTexture).width;
				registerManipulatorsBridgeParams.SDFGridData.dimensionY = ((Texture)SDFGridTexture).height;
				registerManipulatorsBridgeParams.SDFGridData.dimensionZ = SDFGridTexture.depth;
			}
			IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(registerManipulatorsBridgeParams));
			Marshal.StructureToPtr(registerManipulatorsBridgeParams, intPtr, fDeleteOld: true);
			SolverCommandBuffer.Clear();
			LiquidBridge.SubmitInstanceEvent(SolverCommandBuffer, CurrentInstanceID, (EventID)10, intPtr);
			Graphics.ExecuteCommandBuffer(SolverCommandBuffer);
			gCHandle.Free();
			CameraRenderParams = new CameraParams();
			RenderParamsContainer = new RenderParams();
			MeshRenderGlobalParamsContainer = new MeshRenderGlobalParams();
			RegisterParticlesBuffersBridgeParams structure = new RegisterParticlesBuffersBridgeParams
			{
				PositionMass = GetNativePtr(PositionMass),
				AffineVelocity0 = GetNativePtr(Affine[0]),
				AffineVelocity1 = GetNativePtr(Affine[1]),
				ParticleNumber = GetNativePtr(ParticleNumber)
			};
			IntPtr intPtr2 = Marshal.AllocHGlobal(Marshal.SizeOf(structure));
			Marshal.StructureToPtr(structure, intPtr2, fDeleteOld: true);
			SolverCommandBuffer.Clear();
			LiquidBridge.SubmitInstanceEvent(SolverCommandBuffer, CurrentInstanceID, (EventID)7, intPtr2);
			Graphics.ExecuteCommandBuffer(SolverCommandBuffer);
			ToFreeOnExit.Add(intPtr2);
		}

		private int GetParticleCountRounded()
		{
			return (int)Math.Ceiling((double)MaxNumParticles / 256.0) * 256;
		}

		private void InitVolumeTexture(ref RenderTexture volume, GraphicsFormat format)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)volume))
			{
				Vector3Int gridSize = GridSize;
				int x = ((Vector3Int)(ref gridSize)).x;
				gridSize = GridSize;
				volume = new RenderTexture(x, ((Vector3Int)(ref gridSize)).y, 0, format);
				RenderTexture obj = volume;
				gridSize = GridSize;
				obj.volumeDepth = ((Vector3Int)(ref gridSize)).z;
				((Texture)volume).dimension = (TextureDimension)3;
				volume.enableRandomWrite = true;
				((Texture)volume).filterMode = (FilterMode)2;
				volume.Create();
				if (!volume.IsCreated())
				{
					volume = null;
					throw new NotSupportedException("Failed to create 3D texture.");
				}
			}
		}

		private void InitializeSolver()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Expected O, but got Unknown
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Expected O, but got Unknown
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected O, but got Unknown
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Expected O, but got Unknown
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Expected O, but got Unknown
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Expected O, but got Unknown
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Expected O, but got Unknown
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Expected O, but got Unknown
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Expected O, but got Unknown
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Expected O, but got Unknown
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Expected O, but got Unknown
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Expected O, but got Unknown
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Expected O, but got Unknown
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Expected O, but got Unknown
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Expected O, but got Unknown
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Expected O, but got Unknown
			SimulationInternalTime = 0f;
			SimulationInternalFrame = 0;
			MaxFoamParticles = MaterialParameters.MaxFoamParticles;
			Vector3Int gridSize = GridSize;
			int num = ((Vector3Int)(ref gridSize))[0];
			gridSize = GridSize;
			int num2 = num * ((Vector3Int)(ref gridSize))[1];
			gridSize = GridSize;
			GridNodeCount = num2 * ((Vector3Int)(ref gridSize))[2];
			GridData = new ComputeBuffer(GridNodeCount * 4, 4);
			GridNormal = new ComputeBuffer(GridNodeCount, 16);
			GridBlur0 = new ComputeBuffer(GridNodeCount, 4);
			GridBlur1 = new ComputeBuffer(GridNodeCount, 4);
			MassCopy = new ComputeBuffer(GridNodeCount, 4);
			ParticleSpeciesData = new ComputeBuffer(SolverParameters.AdditionalParticleSpecies.Count + 16, Marshal.SizeOf(typeof(ParticleSpeciesParameters)));
			Counters = new ComputeBuffer(8, 4);
			VertexIDGrid = new ComputeBuffer(GridNodeCount, 4);
			VertexBuffer0 = CreateGraphicsBuffer(GraphicsBufferType.Vertex, 6 * GridNodeCount, 4);
			VertexBuffer1 = CreateGraphicsBuffer(GraphicsBufferType.Vertex, 4 * GridNodeCount, 4);
			TransferDataBuffer = new ComputeBuffer(1, 4);
			MeshRenderIndexBuffer = CreateGraphicsBuffer(GraphicsBufferType.Index, 3 * GridNodeCount, 4);
			QuadBuffer = new ComputeBuffer(GridNodeCount, 4);
			VertexProperties = CreateGraphicsBuffer(GraphicsBufferType.Vertex, GridNodeCount, 24);
			IndexGrid = new ComputeBuffer(GridNodeCount, 8);
			bool flag = SystemInfo.IsFormatSupported((GraphicsFormat)48, (FormatUsage)10);
			InitVolumeTexture(ref GridNormalTexture, (GraphicsFormat)(flag ? 48 : 52));
			((Object)GridNormalTexture).name = "GridNormalTexture";
			InitVolumeTexture(ref DensityTexture, (GraphicsFormat)(flag ? 48 : 52));
			((Object)DensityTexture).name = "DensityTexture";
			InitVolumeTexture(ref VelocityTexture, (GraphicsFormat)(flag ? 48 : 52));
			((Object)VelocityTexture).name = "VelocityTexture";
			int particleCountRounded = GetParticleCountRounded();
			PositionMassCopy = new ComputeBuffer(particleCountRounded, 16);
			TmpSDFBuff = new ComputeBuffer(particleCountRounded, 4);
			NodeParticlePairs0 = new ComputeBuffer(2 * particleCountRounded, 4);
			NodeParticlePairs1 = new ComputeBuffer(2 * particleCountRounded, 4);
			EffectParticleData0 = new ComputeBuffer(4 * Math.Max(MaxFoamParticles, 1), 4);
			EffectParticleData1 = new ComputeBuffer(4 * Math.Max(MaxFoamParticles, 1), 4);
			int num3 = (int)Math.Ceiling((float)MaxNumParticles / 256f);
			int num4 = (int)Math.Ceiling((float)MaxNumParticles / 16384f);
			int num5 = (int)Math.Ceiling((float)num4 / 128f);
			RadixGroupData1 = new ComputeBuffer(num3 * 32, 4);
			RadixGroupData2 = new ComputeBuffer(num4 * 32, 4);
			RadixGroupData3 = new ComputeBuffer((num5 + 1) * 32, 4);
			SetFluidParameters();
			GCHandle gCHandle = GCHandle.Alloc(LiquidParameters, GCHandleType.Pinned);
			RegisterSolverBuffersBridgeParams structure = new RegisterSolverBuffersBridgeParams
			{
				SimulationParams = gCHandle.AddrOfPinnedObject(),
				ParticleSpeciesCount = SolverParameters.AdditionalParticleSpecies.Count + 1,
				PositionMassCopy = GetNativePtr(PositionMassCopy),
				GridData = GetNativePtr(GridData),
				IndexGrid = GetNativePtr(IndexGrid),
				GridBlur0 = GetNativePtr(GridBlur0),
				GridBlur1 = GetNativePtr(GridBlur1),
				MassCopy = GetNativePtr(MassCopy),
				TmpSDFBuff = GetNativePtr(TmpSDFBuff),
				GridNormal = GetNativePtr(GridNormal),
				NodeParticlePairs0 = GetNativePtr(NodeParticlePairs0),
				NodeParticlePairs1 = GetNativePtr(NodeParticlePairs1),
				EffectParticleData0 = GetNativePtr(EffectParticleData0),
				EffectParticleData1 = GetNativePtr(EffectParticleData1),
				RadixGroupData1 = GetNativePtr(RadixGroupData1),
				RadixGroupData2 = GetNativePtr(RadixGroupData2),
				RadixGroupData3 = GetNativePtr(RadixGroupData3),
				Counters = GetNativePtr(Counters),
				VertexIDGrid = GetNativePtr(VertexIDGrid),
				VertexBuffer0 = GetNativePtr(VertexBuffer0),
				VertexBuffer1 = GetNativePtr(VertexBuffer1),
				QuadBuffer = GetNativePtr(QuadBuffer),
				GridDensity = MakeTextureNativeBridge(DensityTexture),
				GridVelocity = MakeTextureNativeBridge(VelocityTexture),
				GridNormals = MakeTextureNativeBridge(GridNormalTexture),
				UnityMeshVertexBuffer = IntPtr.Zero,
				UnityMeshIndexBuffer = IntPtr.Zero,
				TransferDataBuffer = GetNativePtr(TransferDataBuffer),
				MeshRenderIndexBuffer = GetNativePtr(MeshRenderIndexBuffer),
				VertexData = GetNativePtr(VertexProperties),
				ParticleSpeciesData = GetNativePtr(ParticleSpeciesData)
			};
			IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(structure));
			Marshal.StructureToPtr(structure, intPtr, fDeleteOld: true);
			SolverCommandBuffer.Clear();
			LiquidBridge.SubmitInstanceEvent(SolverCommandBuffer, CurrentInstanceID, (EventID)11, intPtr);
			Graphics.ExecuteCommandBuffer(SolverCommandBuffer);
			gCHandle.Free();
			SolverCommandBuffer.Clear();
			CopyDepthID = MaterialParameters.RendererCompute.FindKernel("CS_CopyDepth");
			ToFreeOnExit.Add(intPtr);
		}

		private void Update()
		{
			if (Initialized)
			{
				ZibraLiquidGPUGarbageCollector.GCUpdateWrapper();
				if (!UseFixedTimestep)
				{
					UpdateSimulation(Time.smoothDeltaTime);
				}
				UpdateReadback();
			}
		}

		private void FixedUpdate()
		{
			if (UseFixedTimestep)
			{
				UpdateSimulation(Time.fixedDeltaTime);
			}
		}

		private void UpdateReadback()
		{
			if (IsSimulationEnabled())
			{
				SolverCommandBuffer.Clear();
				LiquidBridge.SubmitInstanceEvent(SolverCommandBuffer, CurrentInstanceID, (EventID)15, (IntPtr)0);
				Graphics.ExecuteCommandBuffer(SolverCommandBuffer);
				uint num = 4u;
				IntPtr intPtr = LiquidBridge.ZibraLiquid_GPUReadbackGetData(CurrentInstanceID, num);
				if (intPtr != IntPtr.Zero)
				{
					CurrentParticleNumber = Marshal.ReadInt32(intPtr);
				}
				UpdateManipulatorStatistics();
			}
		}

		private bool SetMaterialParams(Camera cam)
		{
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Invalid comparison between Unknown and I4
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Invalid comparison between Unknown and I4
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0407: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Unknown result type (might be due to invalid IL or missing references)
			//IL_042d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_044e: Unknown result type (might be due to invalid IL or missing references)
			//IL_046a: Unknown result type (might be due to invalid IL or missing references)
			//IL_046f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_053c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0541: Unknown result type (might be due to invalid IL or missing references)
			//IL_0582: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Unknown result type (might be due to invalid IL or missing references)
			//IL_059e: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05de: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_060e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0613: Unknown result type (might be due to invalid IL or missing references)
			//IL_062a: Unknown result type (might be due to invalid IL or missing references)
			//IL_062f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0641: Unknown result type (might be due to invalid IL or missing references)
			//IL_0646: Unknown result type (might be due to invalid IL or missing references)
			//IL_064b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0858: Unknown result type (might be due to invalid IL or missing references)
			//IL_085e: Invalid comparison between Unknown and I4
			//IL_0880: Unknown result type (might be due to invalid IL or missing references)
			//IL_0895: Unknown result type (might be due to invalid IL or missing references)
			//IL_089f: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08de: Unknown result type (might be due to invalid IL or missing references)
			//IL_072b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0732: Invalid comparison between Unknown and I4
			//IL_075e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0764: Invalid comparison between Unknown and I4
			//IL_0791: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07db: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fc: Unknown result type (might be due to invalid IL or missing references)
			CameraResources cameraResources = CameraResourcesMap[cam];
			Material material = (EnableDownscale ? MaterialParameters.UpscaleMaterial : null);
			bool flag = cameraResources.UpscaleMaterial.SetMaterial(material);
			bool flag2 = ActiveRenderingMode == RenderingMode.MeshRender;
			Material material2 = (flag2 ? MaterialParameters.FluidMeshMaterial : null);
			bool flag3 = cameraResources.LiquidMaterial.SetMaterial(material2);
			Material currentMaterial = cameraResources.LiquidMaterial.CurrentMaterial;
			if (flag3)
			{
				ShaderParamContainer.LiquidMeshShader_CUSTOM_REFLECTION_PROBE = new LocalKeyword(currentMaterial.shader, "CUSTOM_REFLECTION_PROBE");
				ShaderParamContainer.LiquidMeshShader_FLIP_BACKGROUND_TEXTURE = new LocalKeyword(currentMaterial.shader, "FLIP_BACKGROUND_TEXTURE");
				ShaderParamContainer.LiquidMeshShader_FLIP_NATIVE_TEXTURES = new LocalKeyword(currentMaterial.shader, "FLIP_NATIVE_TEXTURES");
				ShaderParamContainer.LiquidMeshShader_FLIP_PARTICLES_TEXTURE = new LocalKeyword(currentMaterial.shader, "FLIP_PARTICLES_TEXTURE");
				ShaderParamContainer.LiquidMeshShader_FOAM_DISABLED = new LocalKeyword(currentMaterial.shader, "FOAM_DISABLED");
				ShaderParamContainer.LiquidMeshShader_RAYMARCH_DISABLED = new LocalKeyword(currentMaterial.shader, "RAYMARCH_DISABLED");
				ShaderParamContainer.LiquidMeshShader_UNDERWATER_RENDER = new LocalKeyword(currentMaterial.shader, "UNDERWATER_RENDER");
				ShaderParamContainer.LiquidMeshShader_USE_CUBEMAP_REFRACTION = new LocalKeyword(currentMaterial.shader, "USE_CUBEMAP_REFRACTION");
				if ((int)RenderPipelineDetector.GetRenderPipelineType() == 2)
				{
					currentMaterial.EnableKeyword("HDRP");
				}
			}
			flag = flag || flag3;
			if (flag2)
			{
				Bounds bounds;
				if ((int)RenderPipelineDetector.GetRenderPipelineType() == 2)
				{
					if ((Object)(object)CustomLightHDRP == (Object)null)
					{
						Debug.LogError((object)"No Custom Light set in Zibra Liquid.");
					}
					else
					{
						currentMaterial.SetVector(ShaderParam.WorldSpaceLightPos, Vector4.op_Implicit(((Component)CustomLightHDRP).transform.position));
					}
					if ((Object)(object)ReflectionProbeHDRP == (Object)null)
					{
						Debug.LogError((object)"No reflection probe added to Zibra Liquid.");
					}
				}
				else
				{
					currentMaterial.SetKeyword(ref ShaderParamContainer.LiquidMeshShader_USE_CUBEMAP_REFRACTION, MaterialParameters.UseCubemapRefraction);
					currentMaterial.SetKeyword(ref ShaderParamContainer.LiquidMeshShader_CUSTOM_REFLECTION_PROBE, (Object)(object)ReflectionProbeBRP != (Object)null);
					if ((Object)(object)ReflectionProbeBRP != (Object)null)
					{
						currentMaterial.SetTexture(ShaderParam.ReflectionProbe, ReflectionProbeBRP.texture);
						currentMaterial.SetVector(ShaderParam.Ref

ZibraSmokeAndFire/ZibraAI.ZibraEffects.SmokeAndFire.Bridge.dll

Decompiled 2 months ago
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.SmokeAndFire")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.SmokeAndFire.Editor")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.Editor")]
[assembly: AssemblyVersion("0.0.0.0")]
[CompilerGenerated]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)]
internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
{
	private struct MonoScriptData
	{
		public byte[] FilePathsData;

		public byte[] TypesData;

		public int TotalTypes;

		public int TotalFiles;

		public bool IsEditorOnly;
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	private static MonoScriptData Get()
	{
		MonoScriptData result = default(MonoScriptData);
		result.FilePathsData = new byte[81]
		{
			0, 0, 0, 2, 0, 0, 0, 73, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			83, 109, 111, 107, 101, 32, 97, 110, 100, 32,
			70, 105, 114, 101, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 66, 114, 105, 100, 103, 101, 92,
			83, 109, 111, 107, 101, 65, 110, 100, 70, 105,
			114, 101, 66, 114, 105, 100, 103, 101, 46, 99,
			115
		};
		result.TypesData = new byte[120]
		{
			0, 0, 0, 0, 50, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 115, 109, 111, 107, 101,
			95, 97, 110, 100, 95, 102, 105, 114, 101, 46,
			66, 114, 105, 100, 103, 101, 124, 83, 109, 111,
			107, 101, 65, 110, 100, 70, 105, 114, 101, 66,
			114, 105, 100, 103, 101, 0, 0, 0, 0, 60,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			115, 109, 111, 107, 101, 95, 97, 110, 100, 95,
			102, 105, 114, 101, 46, 66, 114, 105, 100, 103,
			101, 46, 83, 109, 111, 107, 101, 65, 110, 100,
			70, 105, 114, 101, 66, 114, 105, 100, 103, 101,
			124, 69, 118, 101, 110, 116, 68, 97, 116, 97
		};
		result.TotalFiles = 1;
		result.TotalTypes = 2;
		result.IsEditorOnly = false;
		return result;
	}
}
namespace com.zibra.smoke_and_fire.Bridge;

internal static class SmokeAndFireBridge
{
	public enum EventID
	{
		None,
		StepPhysics,
		Draw,
		UpdateSolverParameters,
		UpdateManipulatorParameters,
		CreateFluidInstance,
		RegisterSolverBuffers,
		SetRenderParameters,
		RegisterManipulators,
		ReleaseResources,
		InitializeGpuReadback,
		UpdateReadback,
		RegisterRenderResources,
		UpdateSDFObjects,
		UpdateManipulatorIndices,
		RenderSDF
	}

	internal struct EventData
	{
		public int InstanceID;

		public IntPtr ExtraData;
	}

	public enum LogLevel
	{
		Verbose,
		Info,
		Performance,
		Warning,
		Error
	}

	public enum TextureFormat
	{
		None,
		R8G8B8A8_SNorm,
		R16G16B16A16_SFloat,
		R32G32B32A32_SFloat,
		R16_SFloat,
		R32_SFloat
	}

	public const string PluginLibraryName = "ZibraSmokeAndFireNative_Win";

	[DllImport("ZibraSmokeAndFireNative_Win")]
	public static extern IntPtr ZibraSmokeAndFire_GetRenderEventWithDataFunc();

	[DllImport("ZibraSmokeAndFireNative_Win")]
	public static extern IntPtr ZibraSmokeAndFire_GPUReadbackGetData(int InstanceID, uint size);

	[DllImport("ZibraSmokeAndFireNative_Win")]
	public static extern int ZibraSmokeAndFire_IsLoaded();

	[DllImport("ZibraSmokeAndFireNative_Win")]
	public static extern void ZibraSmokeAndFire_WaitLoad();

	[DllImport("ZibraSmokeAndFireNative_Win")]
	public static extern int ZibraSmokeAndFire_GarbageCollect();

	[DllImport("ZibraSmokeAndFireNative_Win")]
	public static extern bool ZibraSmokeAndFire_IsHardwareSupported();

	[DllImport("ZibraSmokeAndFireNative_Win")]
	public static extern IntPtr ZibraSmokeAndFire_GetSimulationPosition(int InstanceID);

	public static Vector3 GetSimulationContainerPosition(int InstanceID)
	{
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		IntPtr intPtr = ZibraSmokeAndFire_GetSimulationPosition(InstanceID);
		if (intPtr != IntPtr.Zero)
		{
			float[] array = new float[3];
			Marshal.Copy(intPtr, array, 0, 3);
			return new Vector3(array[0], array[1], array[2]);
		}
		return Vector3.zero;
	}

	public static TextureFormat ToBridgeTextureFormat(GraphicsFormat format)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Invalid comparison between Unknown and I4
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected I4, but got Unknown
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Invalid comparison between Unknown and I4
		if ((int)format != 8)
		{
			switch (format - 45)
			{
			default:
				if ((int)format != 52)
				{
					break;
				}
				return TextureFormat.R32G32B32A32_SFloat;
			case 3:
				return TextureFormat.R16G16B16A16_SFloat;
			case 0:
				return TextureFormat.R16_SFloat;
			case 4:
				return TextureFormat.R32_SFloat;
			case 1:
			case 2:
				break;
			}
			return TextureFormat.None;
		}
		return TextureFormat.R8G8B8A8_SNorm;
	}

	public static int EventAndInstanceID(EventID eventID, int InstanceID)
	{
		return (int)eventID | (InstanceID << 8);
	}

	public static void SubmitInstanceEvent(CommandBuffer cmd, int instanceID, EventID eventID, IntPtr data = default(IntPtr))
	{
		EventData structure = default(EventData);
		structure.InstanceID = instanceID;
		structure.ExtraData = data;
		IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(structure));
		Marshal.StructureToPtr(structure, intPtr, fDeleteOld: true);
		cmd.IssuePluginEventAndData(ZibraSmokeAndFire_GetRenderEventWithDataFunc(), (int)eventID, intPtr);
	}

	public static bool NeedGarbageCollect()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected I4, but got Unknown
		GraphicsDeviceType graphicsDeviceType = SystemInfo.graphicsDeviceType;
		switch (graphicsDeviceType - 18)
		{
		case 0:
		case 3:
		case 5:
		case 6:
		case 7:
			return true;
		default:
			return false;
		}
	}
}

ZibraSmokeAndFire/ZibraAI.ZibraEffects.SmokeAndFire.dll

Decompiled 2 months ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.Serialization;
using UnityEngine.XR;
using com.zibra.common.Manipulators;
using com.zibra.common.SDFObjects;
using com.zibra.common.Solver;
using com.zibra.common.Timeline;
using com.zibra.common.Utilities;
using com.zibra.smoke_and_fire.Bridge;
using com.zibra.smoke_and_fire.DataStructures;
using com.zibra.smoke_and_fire.Manipulators;
using com.zibra.smoke_and_fire.Solver;
using com.zibra.smoke_and_fire.Utilities;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyFileVersion("2.1.5.0")]
[assembly: InternalsVisibleTo("ZibraAI.ZibraEffects.SmokeAndFire.Editor")]
[assembly: AssemblyVersion("2.1.5.0")]
[CompilerGenerated]
[EditorBrowsable(EditorBrowsableState.Never)]
[GeneratedCode("Unity.MonoScriptGenerator.MonoScriptInfoGenerator", null)]
internal class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
{
	private struct MonoScriptData
	{
		public byte[] FilePathsData;

		public byte[] TypesData;

		public int TotalTypes;

		public int TotalFiles;

		public bool IsEditorOnly;
	}

	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	private static MonoScriptData Get()
	{
		MonoScriptData result = default(MonoScriptData);
		result.FilePathsData = new byte[1429]
		{
			0, 0, 0, 1, 0, 0, 0, 98, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			83, 109, 111, 107, 101, 32, 97, 110, 100, 32,
			70, 105, 114, 101, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 68, 97, 116, 97, 83, 116, 114,
			117, 99, 116, 117, 114, 101, 115, 92, 90, 105,
			98, 114, 97, 83, 109, 111, 107, 101, 65, 110,
			100, 70, 105, 114, 101, 77, 97, 116, 101, 114,
			105, 97, 108, 80, 97, 114, 97, 109, 101, 116,
			101, 114, 115, 46, 99, 115, 0, 0, 0, 1,
			0, 0, 0, 96, 92, 65, 115, 115, 101, 116,
			115, 92, 80, 108, 117, 103, 105, 110, 115, 92,
			90, 105, 98, 114, 97, 92, 83, 109, 111, 107,
			101, 32, 97, 110, 100, 32, 70, 105, 114, 101,
			92, 83, 99, 114, 105, 112, 116, 115, 92, 68,
			97, 116, 97, 83, 116, 114, 117, 99, 116, 117,
			114, 101, 115, 92, 90, 105, 98, 114, 97, 83,
			109, 111, 107, 101, 65, 110, 100, 70, 105, 114,
			101, 83, 111, 108, 118, 101, 114, 80, 97, 114,
			97, 109, 101, 116, 101, 114, 115, 46, 99, 115,
			0, 0, 0, 3, 0, 0, 0, 66, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			83, 109, 111, 107, 101, 32, 97, 110, 100, 32,
			70, 105, 114, 101, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 83, 111, 108, 118, 101, 114, 92,
			77, 97, 110, 105, 112, 117, 108, 97, 116, 111,
			114, 46, 99, 115, 0, 0, 0, 1, 0, 0,
			0, 88, 92, 65, 115, 115, 101, 116, 115, 92,
			80, 108, 117, 103, 105, 110, 115, 92, 90, 105,
			98, 114, 97, 92, 83, 109, 111, 107, 101, 32,
			97, 110, 100, 32, 70, 105, 114, 101, 92, 83,
			99, 114, 105, 112, 116, 115, 92, 83, 111, 108,
			118, 101, 114, 92, 77, 97, 110, 105, 112, 117,
			108, 97, 116, 111, 114, 115, 92, 90, 105, 98,
			114, 97, 80, 97, 114, 116, 105, 99, 108, 101,
			69, 109, 105, 116, 116, 101, 114, 46, 99, 115,
			0, 0, 0, 1, 0, 0, 0, 93, 92, 65,
			115, 115, 101, 116, 115, 92, 80, 108, 117, 103,
			105, 110, 115, 92, 90, 105, 98, 114, 97, 92,
			83, 109, 111, 107, 101, 32, 97, 110, 100, 32,
			70, 105, 114, 101, 92, 83, 99, 114, 105, 112,
			116, 115, 92, 83, 111, 108, 118, 101, 114, 92,
			77, 97, 110, 105, 112, 117, 108, 97, 116, 111,
			114, 115, 92, 90, 105, 98, 114, 97, 83, 109,
			111, 107, 101, 65, 110, 100, 70, 105, 114, 101,
			67, 111, 108, 108, 105, 100, 101, 114, 46, 99,
			115, 0, 0, 0, 1, 0, 0, 0, 93, 92,
			65, 115, 115, 101, 116, 115, 92, 80, 108, 117,
			103, 105, 110, 115, 92, 90, 105, 98, 114, 97,
			92, 83, 109, 111, 107, 101, 32, 97, 110, 100,
			32, 70, 105, 114, 101, 92, 83, 99, 114, 105,
			112, 116, 115, 92, 83, 111, 108, 118, 101, 114,
			92, 77, 97, 110, 105, 112, 117, 108, 97, 116,
			111, 114, 115, 92, 90, 105, 98, 114, 97, 83,
			109, 111, 107, 101, 65, 110, 100, 70, 105, 114,
			101, 68, 101, 116, 101, 99, 116, 111, 114, 46,
			99, 115, 0, 0, 0, 1, 0, 0, 0, 92,
			92, 65, 115, 115, 101, 116, 115, 92, 80, 108,
			117, 103, 105, 110, 115, 92, 90, 105, 98, 114,
			97, 92, 83, 109, 111, 107, 101, 32, 97, 110,
			100, 32, 70, 105, 114, 101, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 83, 111, 108, 118, 101,
			114, 92, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 115, 92, 90, 105, 98, 114, 97,
			83, 109, 111, 107, 101, 65, 110, 100, 70, 105,
			114, 101, 69, 109, 105, 116, 116, 101, 114, 46,
			99, 115, 0, 0, 0, 1, 0, 0, 0, 95,
			92, 65, 115, 115, 101, 116, 115, 92, 80, 108,
			117, 103, 105, 110, 115, 92, 90, 105, 98, 114,
			97, 92, 83, 109, 111, 107, 101, 32, 97, 110,
			100, 32, 70, 105, 114, 101, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 83, 111, 108, 118, 101,
			114, 92, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 115, 92, 90, 105, 98, 114, 97,
			83, 109, 111, 107, 101, 65, 110, 100, 70, 105,
			114, 101, 70, 111, 114, 99, 101, 70, 105, 101,
			108, 100, 46, 99, 115, 0, 0, 0, 1, 0,
			0, 0, 99, 92, 65, 115, 115, 101, 116, 115,
			92, 80, 108, 117, 103, 105, 110, 115, 92, 90,
			105, 98, 114, 97, 92, 83, 109, 111, 107, 101,
			32, 97, 110, 100, 32, 70, 105, 114, 101, 92,
			83, 99, 114, 105, 112, 116, 115, 92, 83, 111,
			108, 118, 101, 114, 92, 77, 97, 110, 105, 112,
			117, 108, 97, 116, 111, 114, 115, 92, 90, 105,
			98, 114, 97, 83, 109, 111, 107, 101, 65, 110,
			100, 70, 105, 114, 101, 84, 101, 120, 116, 117,
			114, 101, 69, 109, 105, 116, 116, 101, 114, 46,
			99, 115, 0, 0, 0, 1, 0, 0, 0, 89,
			92, 65, 115, 115, 101, 116, 115, 92, 80, 108,
			117, 103, 105, 110, 115, 92, 90, 105, 98, 114,
			97, 92, 83, 109, 111, 107, 101, 32, 97, 110,
			100, 32, 70, 105, 114, 101, 92, 83, 99, 114,
			105, 112, 116, 115, 92, 83, 111, 108, 118, 101,
			114, 92, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 115, 92, 90, 105, 98, 114, 97,
			83, 109, 111, 107, 101, 65, 110, 100, 70, 105,
			114, 101, 86, 111, 105, 100, 46, 99, 115, 0,
			0, 0, 2, 0, 0, 0, 86, 92, 65, 115,
			115, 101, 116, 115, 92, 80, 108, 117, 103, 105,
			110, 115, 92, 90, 105, 98, 114, 97, 92, 83,
			109, 111, 107, 101, 32, 97, 110, 100, 32, 70,
			105, 114, 101, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 83, 111, 108, 118, 101, 114, 92, 83,
			109, 111, 107, 101, 65, 110, 100, 70, 105, 114,
			101, 72, 68, 82, 80, 82, 101, 110, 100, 101,
			114, 67, 111, 109, 112, 111, 110, 101, 110, 116,
			46, 99, 115, 0, 0, 0, 4, 0, 0, 0,
			78, 92, 65, 115, 115, 101, 116, 115, 92, 80,
			108, 117, 103, 105, 110, 115, 92, 90, 105, 98,
			114, 97, 92, 83, 109, 111, 107, 101, 32, 97,
			110, 100, 32, 70, 105, 114, 101, 92, 83, 99,
			114, 105, 112, 116, 115, 92, 83, 111, 108, 118,
			101, 114, 92, 90, 105, 98, 114, 97, 77, 97,
			110, 105, 112, 117, 108, 97, 116, 111, 114, 77,
			97, 110, 97, 103, 101, 114, 46, 99, 115, 0,
			0, 0, 13, 0, 0, 0, 72, 92, 65, 115,
			115, 101, 116, 115, 92, 80, 108, 117, 103, 105,
			110, 115, 92, 90, 105, 98, 114, 97, 92, 83,
			109, 111, 107, 101, 32, 97, 110, 100, 32, 70,
			105, 114, 101, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 83, 111, 108, 118, 101, 114, 92, 90,
			105, 98, 114, 97, 83, 109, 111, 107, 101, 65,
			110, 100, 70, 105, 114, 101, 46, 99, 115, 0,
			0, 0, 1, 0, 0, 0, 91, 92, 65, 115,
			115, 101, 116, 115, 92, 80, 108, 117, 103, 105,
			110, 115, 92, 90, 105, 98, 114, 97, 92, 83,
			109, 111, 107, 101, 32, 97, 110, 100, 32, 70,
			105, 114, 101, 92, 83, 99, 114, 105, 112, 116,
			115, 92, 83, 111, 108, 118, 101, 114, 92, 90,
			105, 98, 114, 97, 83, 109, 111, 107, 101, 65,
			110, 100, 70, 105, 114, 101, 71, 80, 85, 71,
			97, 114, 98, 97, 103, 101, 67, 111, 108, 108,
			101, 99, 116, 111, 114, 46, 99, 115, 0, 0,
			0, 1, 0, 0, 0, 73, 92, 65, 115, 115,
			101, 116, 115, 92, 80, 108, 117, 103, 105, 110,
			115, 92, 90, 105, 98, 114, 97, 92, 83, 109,
			111, 107, 101, 32, 97, 110, 100, 32, 70, 105,
			114, 101, 92, 83, 99, 114, 105, 112, 116, 115,
			92, 85, 116, 105, 108, 105, 116, 105, 101, 115,
			92, 80, 114, 105, 109, 105, 116, 105, 118, 101,
			72, 101, 108, 112, 101, 114, 46, 99, 115
		};
		result.TypesData = new byte[2342]
		{
			0, 0, 0, 0, 75, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 115, 109, 111, 107, 101,
			95, 97, 110, 100, 95, 102, 105, 114, 101, 46,
			68, 97, 116, 97, 83, 116, 114, 117, 99, 116,
			117, 114, 101, 115, 124, 90, 105, 98, 114, 97,
			83, 109, 111, 107, 101, 65, 110, 100, 70, 105,
			114, 101, 77, 97, 116, 101, 114, 105, 97, 108,
			80, 97, 114, 97, 109, 101, 116, 101, 114, 115,
			0, 0, 0, 0, 73, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 115, 109, 111, 107, 101,
			95, 97, 110, 100, 95, 102, 105, 114, 101, 46,
			68, 97, 116, 97, 83, 116, 114, 117, 99, 116,
			117, 114, 101, 115, 124, 90, 105, 98, 114, 97,
			83, 109, 111, 107, 101, 65, 110, 100, 70, 105,
			114, 101, 83, 111, 108, 118, 101, 114, 80, 97,
			114, 97, 109, 101, 116, 101, 114, 115, 0, 0,
			0, 0, 56, 99, 111, 109, 46, 122, 105, 98,
			114, 97, 46, 115, 109, 111, 107, 101, 95, 97,
			110, 100, 95, 102, 105, 114, 101, 46, 77, 97,
			110, 105, 112, 117, 108, 97, 116, 111, 114, 115,
			124, 77, 97, 110, 105, 112, 117, 108, 97, 116,
			111, 114, 67, 111, 109, 112, 97, 114, 101, 0,
			0, 0, 0, 49, 99, 111, 109, 46, 122, 105,
			98, 114, 97, 46, 115, 109, 111, 107, 101, 95,
			97, 110, 100, 95, 102, 105, 114, 101, 46, 77,
			97, 110, 105, 112, 117, 108, 97, 116, 111, 114,
			115, 124, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 0, 0, 0, 0, 64, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 115, 109,
			111, 107, 101, 95, 97, 110, 100, 95, 102, 105,
			114, 101, 46, 77, 97, 110, 105, 112, 117, 108,
			97, 116, 111, 114, 115, 46, 77, 97, 110, 105,
			112, 117, 108, 97, 116, 111, 114, 124, 83, 105,
			109, 117, 108, 97, 116, 105, 111, 110, 68, 97,
			116, 97, 0, 0, 0, 0, 58, 99, 111, 109,
			46, 122, 105, 98, 114, 97, 46, 115, 109, 111,
			107, 101, 95, 97, 110, 100, 95, 102, 105, 114,
			101, 46, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 115, 124, 90, 105, 98, 114, 97,
			80, 97, 114, 116, 105, 99, 108, 101, 69, 109,
			105, 116, 116, 101, 114, 0, 0, 0, 0, 63,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			115, 109, 111, 107, 101, 95, 97, 110, 100, 95,
			102, 105, 114, 101, 46, 77, 97, 110, 105, 112,
			117, 108, 97, 116, 111, 114, 115, 124, 90, 105,
			98, 114, 97, 83, 109, 111, 107, 101, 65, 110,
			100, 70, 105, 114, 101, 67, 111, 108, 108, 105,
			100, 101, 114, 0, 0, 0, 0, 63, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 115, 109,
			111, 107, 101, 95, 97, 110, 100, 95, 102, 105,
			114, 101, 46, 77, 97, 110, 105, 112, 117, 108,
			97, 116, 111, 114, 115, 124, 90, 105, 98, 114,
			97, 83, 109, 111, 107, 101, 65, 110, 100, 70,
			105, 114, 101, 68, 101, 116, 101, 99, 116, 111,
			114, 0, 0, 0, 0, 62, 99, 111, 109, 46,
			122, 105, 98, 114, 97, 46, 115, 109, 111, 107,
			101, 95, 97, 110, 100, 95, 102, 105, 114, 101,
			46, 77, 97, 110, 105, 112, 117, 108, 97, 116,
			111, 114, 115, 124, 90, 105, 98, 114, 97, 83,
			109, 111, 107, 101, 65, 110, 100, 70, 105, 114,
			101, 69, 109, 105, 116, 116, 101, 114, 0, 0,
			0, 0, 65, 99, 111, 109, 46, 122, 105, 98,
			114, 97, 46, 115, 109, 111, 107, 101, 95, 97,
			110, 100, 95, 102, 105, 114, 101, 46, 77, 97,
			110, 105, 112, 117, 108, 97, 116, 111, 114, 115,
			124, 90, 105, 98, 114, 97, 83, 109, 111, 107,
			101, 65, 110, 100, 70, 105, 114, 101, 70, 111,
			114, 99, 101, 70, 105, 101, 108, 100, 0, 0,
			0, 0, 69, 99, 111, 109, 46, 122, 105, 98,
			114, 97, 46, 115, 109, 111, 107, 101, 95, 97,
			110, 100, 95, 102, 105, 114, 101, 46, 77, 97,
			110, 105, 112, 117, 108, 97, 116, 111, 114, 115,
			124, 90, 105, 98, 114, 97, 83, 109, 111, 107,
			101, 65, 110, 100, 70, 105, 114, 101, 84, 101,
			120, 116, 117, 114, 101, 69, 109, 105, 116, 116,
			101, 114, 0, 0, 0, 0, 59, 99, 111, 109,
			46, 122, 105, 98, 114, 97, 46, 115, 109, 111,
			107, 101, 95, 97, 110, 100, 95, 102, 105, 114,
			101, 46, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 115, 124, 90, 105, 98, 114, 97,
			83, 109, 111, 107, 101, 65, 110, 100, 70, 105,
			114, 101, 86, 111, 105, 100, 0, 0, 0, 0,
			56, 99, 111, 109, 46, 122, 105, 98, 114, 97,
			46, 115, 109, 111, 107, 101, 95, 97, 110, 100,
			95, 102, 105, 114, 101, 124, 83, 109, 111, 107,
			101, 65, 110, 100, 70, 105, 114, 101, 72, 68,
			82, 80, 82, 101, 110, 100, 101, 114, 67, 111,
			109, 112, 111, 110, 101, 110, 116, 0, 0, 0,
			0, 72, 99, 111, 109, 46, 122, 105, 98, 114,
			97, 46, 115, 109, 111, 107, 101, 95, 97, 110,
			100, 95, 102, 105, 114, 101, 46, 83, 109, 111,
			107, 101, 65, 110, 100, 70, 105, 114, 101, 72,
			68, 82, 80, 82, 101, 110, 100, 101, 114, 67,
			111, 109, 112, 111, 110, 101, 110, 116, 124, 70,
			108, 117, 105, 100, 72, 68, 82, 80, 82, 101,
			110, 100, 101, 114, 0, 0, 0, 0, 61, 99,
			111, 109, 46, 122, 105, 98, 114, 97, 46, 115,
			109, 111, 107, 101, 95, 97, 110, 100, 95, 102,
			105, 114, 101, 46, 77, 97, 110, 105, 112, 117,
			108, 97, 116, 111, 114, 115, 124, 90, 105, 98,
			114, 97, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 77, 97, 110, 97, 103, 101, 114,
			0, 0, 0, 0, 78, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 115, 109, 111, 107, 101,
			95, 97, 110, 100, 95, 102, 105, 114, 101, 46,
			77, 97, 110, 105, 112, 117, 108, 97, 116, 111,
			114, 115, 46, 90, 105, 98, 114, 97, 77, 97,
			110, 105, 112, 117, 108, 97, 116, 111, 114, 77,
			97, 110, 97, 103, 101, 114, 124, 77, 97, 110,
			105, 112, 117, 108, 97, 116, 111, 114, 80, 97,
			114, 97, 109, 0, 0, 0, 0, 77, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 115, 109,
			111, 107, 101, 95, 97, 110, 100, 95, 102, 105,
			114, 101, 46, 77, 97, 110, 105, 112, 117, 108,
			97, 116, 111, 114, 115, 46, 90, 105, 98, 114,
			97, 77, 97, 110, 105, 112, 117, 108, 97, 116,
			111, 114, 77, 97, 110, 97, 103, 101, 114, 124,
			83, 68, 70, 79, 98, 106, 101, 99, 116, 80,
			97, 114, 97, 109, 115, 0, 0, 0, 0, 80,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			115, 109, 111, 107, 101, 95, 97, 110, 100, 95,
			102, 105, 114, 101, 46, 77, 97, 110, 105, 112,
			117, 108, 97, 116, 111, 114, 115, 46, 90, 105,
			98, 114, 97, 77, 97, 110, 105, 112, 117, 108,
			97, 116, 111, 114, 77, 97, 110, 97, 103, 101,
			114, 124, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 73, 110, 100, 105, 99, 101, 115,
			0, 0, 0, 0, 49, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 115, 109, 111, 107, 101,
			95, 97, 110, 100, 95, 102, 105, 114, 101, 46,
			83, 111, 108, 118, 101, 114, 124, 90, 105, 98,
			114, 97, 83, 109, 111, 107, 101, 65, 110, 100,
			70, 105, 114, 101, 0, 0, 0, 0, 61, 99,
			111, 109, 46, 122, 105, 98, 114, 97, 46, 115,
			109, 111, 107, 101, 95, 97, 110, 100, 95, 102,
			105, 114, 101, 46, 83, 111, 108, 118, 101, 114,
			46, 90, 105, 98, 114, 97, 83, 109, 111, 107,
			101, 65, 110, 100, 70, 105, 114, 101, 124, 83,
			104, 97, 100, 101, 114, 80, 97, 114, 97, 109,
			0, 0, 0, 0, 68, 99, 111, 109, 46, 122,
			105, 98, 114, 97, 46, 115, 109, 111, 107, 101,
			95, 97, 110, 100, 95, 102, 105, 114, 101, 46,
			83, 111, 108, 118, 101, 114, 46, 90, 105, 98,
			114, 97, 83, 109, 111, 107, 101, 65, 110, 100,
			70, 105, 114, 101, 124, 85, 110, 105, 116, 121,
			84, 101, 120, 116, 117, 114, 101, 66, 114, 105,
			100, 103, 101, 0, 0, 0, 0, 77, 99, 111,
			109, 46, 122, 105, 98, 114, 97, 46, 115, 109,
			111, 107, 101, 95, 97, 110, 100, 95, 102, 105,
			114, 101, 46, 83, 111, 108, 118, 101, 114, 46,
			90, 105, 98, 114, 97, 83, 109, 111, 107, 101,
			65, 110, 100, 70, 105, 114, 101, 124, 82, 101,
			103, 105, 115, 116, 101, 114, 66, 117, 102, 102,
			101, 114, 115, 66, 114, 105, 100, 103, 101, 80,
			97, 114, 97, 109, 115, 0, 0, 0, 0, 85,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			115, 109, 111, 107, 101, 95, 97, 110, 100, 95,
			102, 105, 114, 101, 46, 83, 111, 108, 118, 101,
			114, 46, 90, 105, 98, 114, 97, 83, 109, 111,
			107, 101, 65, 110, 100, 70, 105, 114, 101, 124,
			82, 101, 103, 105, 115, 116, 101, 114, 82, 101,
			110, 100, 101, 114, 82, 101, 115, 111, 117, 114,
			99, 101, 115, 66, 114, 105, 100, 103, 101, 80,
			97, 114, 97, 109, 115, 0, 0, 0, 0, 77,
			99, 111, 109, 46, 122, 105, 98, 114, 97, 46,
			115, 109, 111, 107, 101, 95, 97, 110, 100, 95,
			102, 105, 114, 101, 46, 83, 111, 108, 118, 101,
			114, 46, 90, 105, 98, 114, 97, 83, 109, 111,
			107, 101, 65, 110, 100, 70, 105, 114, 101, 124,
			73, 110, 105, 116, 105, 97, 108, 105, 122, 101,
			71, 80, 85, 82, 101, 97, 100, 98, 97, 99,
			107, 80, 97, 114, 97, 109, 115, 0, 0, 0,
			0, 67, 99, 111, 109, 46, 122, 105, 98, 114,
			97, 46, 115, 109, 111, 107, 101, 95, 97, 110,
			100, 95, 102, 105, 114, 101, 46, 83, 111, 108,
			118, 101, 114, 46, 90, 105, 98, 114, 97, 83,
			109, 111, 107, 101, 65, 110, 100, 70, 105, 114,
			101, 124, 84, 101, 120, 116, 117, 114, 101, 85,
			112, 108, 111, 97, 100, 68, 97, 116, 97, 0,
			0, 0, 0, 82, 99, 111, 109, 46, 122, 105,
			98, 114, 97, 46, 115, 109, 111, 107, 101, 95,
			97, 110, 100, 95, 102, 105, 114, 101, 46, 83,
			111, 108, 118, 101, 114, 46, 90, 105, 98, 114,
			97, 83, 109, 111, 107, 101, 65, 110, 100, 70,
			105, 114, 101, 124, 82, 101, 103, 105, 115, 116,
			101, 114, 77, 97, 110, 105, 112, 117, 108, 97,
			116, 111, 114, 115, 66, 114, 105, 100, 103, 101,
			80, 97, 114, 97, 109, 115, 0, 0, 0, 0,
			66, 99, 111, 109, 46, 122, 105, 98, 114, 97,
			46, 115, 109, 111, 107, 101, 95, 97, 110, 100,
			95, 102, 105, 114, 101, 46, 83, 111, 108, 118,
			101, 114, 46, 90, 105, 98, 114, 97, 83, 109,
			111, 107, 101, 65, 110, 100, 70, 105, 114, 101,
			124, 83, 105, 109, 117, 108, 97, 116, 105, 111,
			110, 80, 97, 114, 97, 109, 115, 0, 0, 0,
			0, 62, 99, 111, 109, 46, 122, 105, 98, 114,
			97, 46, 115, 109, 111, 107, 101, 95, 97, 110,
			100, 95, 102, 105, 114, 101, 46, 83, 111, 108,
			118, 101, 114, 46, 90, 105, 98, 114, 97, 83,
			109, 111, 107, 101, 65, 110, 100, 70, 105, 114,
			101, 124, 82, 101, 110, 100, 101, 114, 80, 97,
			114, 97, 109, 115, 0, 0, 0, 0, 62, 99,
			111, 109, 46, 122, 105, 98, 114, 97, 46, 115,
			109, 111, 107, 101, 95, 97, 110, 100, 95, 102,
			105, 114, 101, 46, 83, 111, 108, 118, 101, 114,
			46, 90, 105, 98, 114, 97, 83, 109, 111, 107,
			101, 65, 110, 100, 70, 105, 114, 101, 124, 77,
			97, 116, 101, 114, 105, 97, 108, 80, 97, 105,
			114, 0, 0, 0, 0, 58, 99, 111, 109, 46,
			122, 105, 98, 114, 97, 46, 115, 109, 111, 107,
			101, 95, 97, 110, 100, 95, 102, 105, 114, 101,
			46, 83, 111, 108, 118, 101, 114, 46, 90, 105,
			98, 114, 97, 83, 109, 111, 107, 101, 65, 110,
			100, 70, 105, 114, 101, 124, 84, 101, 120, 83,
			116, 97, 116, 101, 0, 0, 0, 0, 65, 99,
			111, 109, 46, 122, 105, 98, 114, 97, 46, 115,
			109, 111, 107, 101, 95, 97, 110, 100, 95, 102,
			105, 114, 101, 46, 83, 111, 108, 118, 101, 114,
			46, 90, 105, 98, 114, 97, 83, 109, 111, 107,
			101, 65, 110, 100, 70, 105, 114, 101, 124, 67,
			97, 109, 101, 114, 97, 82, 101, 115, 111, 117,
			114, 99, 101, 115, 0, 0, 0, 0, 68, 99,
			111, 109, 46, 122, 105, 98, 114, 97, 46, 115,
			109, 111, 107, 101, 95, 97, 110, 100, 95, 102,
			105, 114, 101, 46, 83, 111, 108, 118, 101, 114,
			124, 90, 105, 98, 114, 97, 83, 109, 111, 107,
			101, 65, 110, 100, 70, 105, 114, 101, 71, 80,
			85, 71, 97, 114, 98, 97, 103, 101, 67, 111,
			108, 108, 101, 99, 116, 111, 114, 0, 0, 0,
			0, 50, 99, 111, 109, 46, 122, 105, 98, 114,
			97, 46, 115, 109, 111, 107, 101, 95, 97, 110,
			100, 95, 102, 105, 114, 101, 46, 85, 116, 105,
			108, 105, 116, 105, 101, 115, 124, 80, 114, 105,
			109, 105, 116, 105, 118, 101, 72, 101, 108, 112,
			101, 114
		};
		result.TotalFiles = 15;
		result.TotalTypes = 33;
		result.IsEditorOnly = false;
		return result;
	}
}
namespace com.zibra.smoke_and_fire
{
	internal class SmokeAndFireHDRPRenderComponent : CustomPassVolume
	{
		internal class FluidHDRPRender : CustomPass
		{
			public ZibraSmokeAndFire smokeAndFire;

			protected override void Execute(CustomPassContext ctx)
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Invalid comparison between Unknown and I4
				//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0202: Unknown result type (might be due to invalid IL or missing references)
				//IL_020c: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)smokeAndFire) || !smokeAndFire.IsRenderingEnabled())
				{
					return;
				}
				RTHandle cameraColorBuffer = ctx.cameraColorBuffer;
				RTHandle cameraDepthBuffer = ctx.cameraDepthBuffer;
				HDCamera hdCamera = ctx.hdCamera;
				CommandBuffer cmd = ctx.cmd;
				if ((hdCamera.camera.cullingMask & (1 << ((Component)smokeAndFire).gameObject.layer)) != 0)
				{
					float renderPipelineRenderScale = (float)hdCamera.actualWidth / (float)hdCamera.camera.pixelWidth;
					smokeAndFire.RenderCallBack(hdCamera.camera, renderPipelineRenderScale);
					Rect value = default(Rect);
					((Rect)(ref value))..ctor(0f, 0f, (float)hdCamera.actualWidth, (float)hdCamera.actualHeight);
					RTHandle previousFrameRT = hdCamera.GetPreviousFrameRT(1);
					cmd.SetGlobalTexture("_CameraExposureTexture", RTHandle.op_Implicit(previousFrameRT));
					bool flag = (int)((Texture)cameraColorBuffer.rt).dimension == 5;
					if (flag)
					{
						smokeAndFire.CameraResourcesMap[hdCamera.camera].SmokeAndFireMaterial.CurrentMaterial.EnableKeyword("INPUT_2D_ARRAY");
						smokeAndFire.CameraResourcesMap[hdCamera.camera].SmokeShadowProjectionMaterial.CurrentMaterial.EnableKeyword("INPUT_2D_ARRAY");
					}
					else
					{
						smokeAndFire.CameraResourcesMap[hdCamera.camera].SmokeAndFireMaterial.CurrentMaterial.DisableKeyword("INPUT_2D_ARRAY");
						smokeAndFire.CameraResourcesMap[hdCamera.camera].SmokeShadowProjectionMaterial.CurrentMaterial.DisableKeyword("INPUT_2D_ARRAY");
					}
					if (smokeAndFire.VisualizeSceneSDF)
					{
						Material currentMaterial = smokeAndFire.CameraResourcesMap[hdCamera.camera].SDFRenderMaterial.CurrentMaterial;
						currentMaterial.EnableKeyword("HDRP");
						currentMaterial.SetTexture(ZibraSmokeAndFire.ShaderParam.SmokeSDFVisualizationCameraDepth, RTHandle.op_Implicit(cameraDepthBuffer));
					}
					smokeAndFire.RenderParticlesNative(cmd, hdCamera.camera, flag);
					smokeAndFire.RenderSDFNative(cmd);
					smokeAndFire.RenderFluid(cmd, hdCamera.camera, RTHandle.op_Implicit(cameraColorBuffer), RTHandle.op_Implicit(cameraDepthBuffer), value);
				}
			}
		}

		public FluidHDRPRender fluidPass;
	}
}
namespace com.zibra.smoke_and_fire.Utilities
{
	internal static class PrimitiveHelper
	{
		private static readonly Dictionary<PrimitiveType, Mesh> PrimitiveMeshes = new Dictionary<PrimitiveType, Mesh>();

		public static GameObject CreatePrimitive(PrimitiveType type, bool withCollider)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			if (withCollider)
			{
				return GameObject.CreatePrimitive(type);
			}
			GameObject val = new GameObject(((object)(PrimitiveType)(ref type)).ToString());
			val.AddComponent<MeshFilter>().sharedMesh = GetPrimitiveMesh(type);
			val.AddComponent<MeshRenderer>();
			return val;
		}

		public static Mesh GetPrimitiveMesh(PrimitiveType type)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			if (!PrimitiveMeshes.ContainsKey(type))
			{
				CreatePrimitiveMesh(type);
			}
			return PrimitiveMeshes[type];
		}

		private static Mesh CreatePrimitiveMesh(PrimitiveType type)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			GameObject obj = GameObject.CreatePrimitive(type);
			Mesh sharedMesh = obj.GetComponent<MeshFilter>().sharedMesh;
			Object.Destroy((Object)(object)obj);
			PrimitiveMeshes[type] = sharedMesh;
			return sharedMesh;
		}
	}
}
namespace com.zibra.smoke_and_fire.Solver
{
	[AddComponentMenu("Zibra Smoke & Fire/Zibra Smoke & Fire")]
	[RequireComponent(typeof(ZibraSmokeAndFireMaterialParameters))]
	[RequireComponent(typeof(ZibraSmokeAndFireSolverParameters))]
	[RequireComponent(typeof(ZibraManipulatorManager))]
	[ExecuteInEditMode]
	public class ZibraSmokeAndFire : PlaybackControl, StatReporter
	{
		public enum SimulationMode
		{
			Smoke,
			ColoredSmoke,
			Fire
		}

		internal class ShaderParam
		{
			public static int AbsorptionColor = Shader.PropertyToID("AbsorptionColor");

			public static int BlackBodyBrightness = Shader.PropertyToID("BlackBodyBrightness");

			public static int BlueNoise = Shader.PropertyToID("BlueNoise");

			public static int Color = Shader.PropertyToID("Color");

			public static int ContainerMaxPoint = Shader.PropertyToID("ContainerMaxPoint");

			public static int ContainerMinPoint = Shader.PropertyToID("ContainerMinPoint");

			public static int ContainerPosition = Shader.PropertyToID("ContainerPosition");

			public static int ContainerScale = Shader.PropertyToID("ContainerScale");

			public static int DeltaT = Shader.PropertyToID("DeltaT");

			public static int Density = Shader.PropertyToID("Density");

			public static int DensityDownscale = Shader.PropertyToID("DensityDownscale");

			public static int DepthDest = Shader.PropertyToID("DepthDest");

			public static int DownscaleFactor = Shader.PropertyToID("DownscaleFactor");

			public static int EyeRayCameraCoeficients = Shader.PropertyToID("EyeRayCameraCoeficients");

			public static int FakeShadows = Shader.PropertyToID("FakeShadows");

			public static int FireBrightness = Shader.PropertyToID("FireBrightness");

			public static int FireColor = Shader.PropertyToID("FireColor");

			public static int FuelDensity = Shader.PropertyToID("FuelDensity");

			public static int GridSize = Shader.PropertyToID("GridSize");

			public static int Illumination = Shader.PropertyToID("Illumination");

			public static int IlluminationOUT = Shader.PropertyToID("IlluminationOUT");

			public static int IlluminationShadows = Shader.PropertyToID("IlluminationShadows");

			public static int IlluminationSoftness = Shader.PropertyToID("IlluminationSoftness");

			public static int LightColor = Shader.PropertyToID("LightColor");

			public static int LightColorArray = Shader.PropertyToID("LightColorArray");

			public static int LightCount = Shader.PropertyToID("LightCount");

			public static int LightDirWorld = Shader.PropertyToID("LightDirWorld");

			public static int LightDirection = Shader.PropertyToID("LightDirection");

			public static int LightGridSize = Shader.PropertyToID("LightGridSize");

			public static int LightPositionArray = Shader.PropertyToID("LightPositionArray");

			public static int Lightmap = Shader.PropertyToID("Lightmap");

			public static int LightmapOUT = Shader.PropertyToID("LightmapOUT");

			public static int MainLightMode = Shader.PropertyToID("MainLightMode");

			public static int OriginalCameraResolution = Shader.PropertyToID("OriginalCameraResolution");

			public static int ParticlesTex = Shader.PropertyToID("ParticlesTex");

			public static int PrimaryShadows = Shader.PropertyToID("PrimaryShadows");

			public static int ReactionSpeed = Shader.PropertyToID("ReactionSpeed");

			public static int RenderedVolume = Shader.PropertyToID("RenderedVolume");

			public static int Resolution = Shader.PropertyToID("Resolution");

			public static int SDFRenderSmoke = Shader.PropertyToID("SDFRenderSmoke");

			public static int ScatteringAttenuation = Shader.PropertyToID("ScatteringAttenuation");

			public static int ScatteringColor = Shader.PropertyToID("ScatteringColor");

			public static int ScatteringContribution = Shader.PropertyToID("ScatteringContribution");

			public static int ShadowColor = Shader.PropertyToID("ShadowColor");

			public static int ShadowDistanceDecay = Shader.PropertyToID("ShadowDistanceDecay");

			public static int ShadowGridSize = Shader.PropertyToID("ShadowGridSize");

			public static int ShadowIntensity = Shader.PropertyToID("ShadowIntensity");

			public static int ShadowMaxSteps = Shader.PropertyToID("ShadowMaxSteps");

			public static int ShadowStepSize = Shader.PropertyToID("ShadowStepSize");

			public static int Shadowmap = Shader.PropertyToID("Shadowmap");

			public static int ShadowmapOUT = Shader.PropertyToID("ShadowmapOUT");

			public static int SimulationMode = Shader.PropertyToID("SimulationMode");

			public static int SmokeDensity = Shader.PropertyToID("SmokeDensity");

			public static int SmokeSDFVisualizationCameraDepth = Shader.PropertyToID("SmokeSDFVisualizationCameraDepth");

			public static int StepScale = Shader.PropertyToID("StepScale");

			public static int StepSize = Shader.PropertyToID("StepSize");

			public static int TempThreshold = Shader.PropertyToID("TempThreshold");

			public static int TemperatureDensityDependence = Shader.PropertyToID("TemperatureDensityDependence");

			public static int Texture3DFloat = Shader.PropertyToID("Texture3DFloat");

			public static int Texture3DFloat2 = Shader.PropertyToID("Texture3DFloat2");

			public static int Texture3DFloat2Dimensions = Shader.PropertyToID("Texture3DFloat2Dimensions");

			public static int Texture3DFloat3 = Shader.PropertyToID("Texture3DFloat3");

			public static int Texture3DFloat3Dimensions = Shader.PropertyToID("Texture3DFloat3Dimensions");

			public static int Texture3DFloat4 = Shader.PropertyToID("Texture3DFloat4");

			public static int Texture3DFloat4Dimensions = Shader.PropertyToID("Texture3DFloat4Dimensions");

			public static int Texture3DFloatDimensions = Shader.PropertyToID("Texture3DFloatDimensions");

			public static int TextureScale = Shader.PropertyToID("TextureScale");

			public static int ViewProjectionInverse = Shader.PropertyToID("ViewProjectionInverse");

			public LocalKeyword SmokeShader_FLIP_NATIVE_TEXTURES;

			public LocalKeyword SmokeShader_FULLSCREEN_QUAD;

			public LocalKeyword SmokeShader_INPUT_2D_ARRAY;

			public LocalKeyword SmokeShadowProjectionShader_FLIP_NATIVE_TEXTURES;

			public LocalKeyword SmokeShadowProjectionShader_INPUT_2D_ARRAY;

			public LocalKeyword SmokeShadowProjectionShader_TRICUBIC;

			public LocalKeyword RenderCompute_INPUT_2D_ARRAY;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class UnityTextureBridge
		{
			public IntPtr texture;

			public TextureFormat format;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class RegisterBuffersBridgeParams
		{
			public IntPtr SimulationParams;

			public UnityTextureBridge RenderDensity;

			public UnityTextureBridge RenderColor;

			public UnityTextureBridge RenderIllumination;

			public UnityTextureBridge ColorTexture0;

			public UnityTextureBridge VelocityTexture0;

			public UnityTextureBridge ColorTexture1;

			public UnityTextureBridge VelocityTexture1;

			public UnityTextureBridge TmpSDFTexture;

			public UnityTextureBridge Divergence;

			public UnityTextureBridge ResidualLOD0;

			public UnityTextureBridge ResidualLOD1;

			public UnityTextureBridge ResidualLOD2;

			public UnityTextureBridge Pressure0LOD0;

			public UnityTextureBridge Pressure0LOD1;

			public UnityTextureBridge Pressure0LOD2;

			public UnityTextureBridge Pressure1LOD0;

			public UnityTextureBridge Pressure1LOD1;

			public UnityTextureBridge Pressure1LOD2;

			public IntPtr AtomicCounters;

			public UnityTextureBridge RandomTexture;

			public TextureUploadData RandomData;

			public IntPtr EffectParticleData0;

			public IntPtr EffectParticleData1;

			public IntPtr EffectParticleEmissionColorData;

			public UnityTextureBridge RenderDensityLOD;

			public UnityTextureBridge EmitterTexture;

			public UnityTextureBridge ParticleColors;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class RegisterRenderResourcesBridgeParams
		{
			public UnityTextureBridge ParticleSprites;

			public UnityTextureBridge Depth;

			public UnityTextureBridge ParticlesRT;

			public UnityTextureBridge VisualizeSDFTarget;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class InitializeGPUReadbackParams
		{
			public uint readbackBufferSize;

			public int maxFramesInFlight;
		}

		private struct TextureUploadData
		{
			public IntPtr data;

			public int dataSize;

			public int rowPitch;

			public int dimensionX;

			public int dimensionY;

			public int dimensionZ;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class RegisterManipulatorsBridgeParams
		{
			public int ManipulatorNum;

			public IntPtr ManipulatorBufferDynamic;

			public IntPtr SDFObjectBuffer;

			public IntPtr ManipulatorBufferStatistics;

			public IntPtr ManipulatorParams;

			public int SDFObjectCount;

			public IntPtr SDFObjectData;

			public IntPtr ManipIndices;

			public UnityTextureBridge EmbeddingsTexture;

			public UnityTextureBridge SDFGridTexture;

			public TextureUploadData EmbeddigsData;

			public TextureUploadData SDFGridData;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class SimulationParams
		{
			public Vector3 GridSize;

			public int NodeCount;

			public Vector3 ContainerScale;

			public float MinimumVelocity;

			public Vector3 ContainerPos;

			public float MaximumVelocity;

			public float TimeStep;

			public float SimulationTime;

			public int SimulationFrame;

			public int JacobiIterations;

			public float ColorDecay;

			public float VelocityDecay;

			public float PressureReuse;

			public float PressureReuseClamp;

			public float Sharpen;

			public float SharpenThreshold;

			public float PressureProjection;

			public float PressureClamp;

			public Vector3 Gravity;

			public float SmokeBuoyancy;

			public int LOD0Iterations;

			public int LOD1Iterations;

			public int LOD2Iterations;

			public int PreIterations;

			public float MainOverrelax;

			public float EdgeOverrelax;

			public float VolumeEdgeFadeoff;

			public int SimulationIterations;

			public Vector3 SimulationContainerPosition;

			public int SimulationMode;

			public Vector3 PreviousContainerPosition;

			public int FixVolumeWorldPosition;

			public float TempThreshold;

			public float HeatEmission;

			public float ReactionSpeed;

			public float HeatBuoyancy;

			public float SmokeDensity;

			public float FuelDensity;

			public float TemperatureDensityDependence;

			public float FireBrightness;

			public int MaxEffectParticleCount;

			public int ParticleLifetime;

			public int SimulateEffectParticles;

			public int RenderEffectParticles;

			public Vector3 GridSizeLOD;

			public int GridDownscale;
		}

		[StructLayout(LayoutKind.Sequential)]
		private class RenderParams
		{
			public Matrix4x4 View;

			public Matrix4x4 Projection;

			public Matrix4x4 ProjectionInverse;

			public Matrix4x4 ViewProjection;

			public Matrix4x4 ViewProjectionInverse;

			public Matrix4x4 EyeRayCameraCoeficients;

			public Vector3 WorldSpaceCameraPos;

			public int CameraID;

			public Vector4 ZBufferParams;

			public Vector2 CameraResolution;

			public float CameraDownscaleFactor;

			private float CameraParamsPadding1;
		}

		internal struct MaterialPair
		{
			public Material CurrentMaterial;

			public Material SharedMaterial;

			public bool SetMaterial(Material mat)
			{
				if ((Object)(object)SharedMaterial != (Object)(object)mat)
				{
					CurrentMaterial = (((Object)(object)mat != (Object)null) ? Object.Instantiate<Material>(mat) : null);
					SharedMaterial = mat;
					return true;
				}
				return false;
			}
		}

		internal struct TexState
		{
			private Texture2D Texture;

			private uint UpdateCount;

			public bool IsDirty(Texture2D texture)
			{
				if (!((Object)(object)Texture != (Object)(object)texture))
				{
					return UpdateCount != ((Texture)texture).updateCount;
				}
				return true;
			}

			public void Update(Texture2D texture)
			{
				Texture = texture;
				UpdateCount = ((Texture)texture).updateCount;
			}
		}

		internal class CameraResources
		{
			public MaterialPair SmokeAndFireMaterial;

			public MaterialPair SmokeShadowProjectionMaterial;

			public MaterialPair UpscaleMaterial;

			public MaterialPair SDFRenderMaterial;

			public bool isDirty = true;
		}

		public static List<ZibraSmokeAndFire> AllInstances = new List<ZibraSmokeAndFire>();

		[Tooltip("Setting that determines the type of simulation being performed.")]
		public SimulationMode CurrentSimulationMode = SimulationMode.Fire;

		[Tooltip("Directional light that will be used for Smoke & Fire lighting. Must be set, otherwise simulation will not start. Can be freely modified at runtime.")]
		[FormerlySerializedAs("mainLight")]
		public Light MainLight;

		[Tooltip("List of point lights that contribute to Smoke & Fire lighting. Can be freely modified at runtime. You can add up to 16 lights to that list.")]
		[FormerlySerializedAs("lights")]
		public List<Light> Lights;

		[Tooltip("Timestep used in each simulation iteration.")]
		[Range(0f, 3f)]
		[FormerlySerializedAs("TimeStep")]
		[FormerlySerializedAs("timeStep")]
		public float Timestep = 1f;

		[Tooltip("Fallback max frame latency. Used when it isn't possible to retrieve Unity's max frame latency.")]
		[Range(2f, 16f)]
		public uint MaxFramesInFlight = 3u;

		[Tooltip("Number of simulation iterations per simulation frame.")]
		[Range(1f, 10f)]
		public int SimulationIterations = 3;

		[Tooltip("Sets the resolution of the largest side of the grids container equal to this value")]
		[Min(16f)]
		[FormerlySerializedAs("gridResolution")]
		public int GridResolution = 128;

		[Tooltip("Freezes simulation when disabled. Also decreases performance cost when disabled, since simulation won't run. Disabling this option does not prevent simulation from rendering.")]
		[FormerlySerializedAs("runSimulation")]
		public bool RunSimulation = true;

		[Tooltip("Enables rendering of the smoke/fire. Disabling rendering decreases performance cost. Disabling this option does not prevent simulation from running.")]
		[FormerlySerializedAs("runRendering")]
		public bool RunRendering = true;

		[Tooltip("When enabled, moving simulation volume will not disturb simulation. When disabled, smoke/fire will try to stay in place in world space. If you want to move the simulation around the scene, you want to disable this option.")]
		[FormerlySerializedAs("fixVolumeWorldPosition")]
		public bool FixVolumeWorldPosition = true;

		[FormerlySerializedAs("visualizeSceneSDF")]
		[Tooltip("Whether to render visualized SDFs")]
		public bool VisualizeSceneSDF;

		[Tooltip("Allows you to render Smoke & Fire in lower resolution.")]
		public bool EnableDownscale;

		[Range(0.2f, 0.99f)]
		[Tooltip("Scale width/height of smoke & fire render.")]
		public float DownscaleFactor = 0.5f;

		[Tooltip("Size of the simulation volume.")]
		[FormerlySerializedAs("containerSize")]
		public Vector3 ContainerSize = new Vector3(5f, 5f, 5f);

		[NonSerialized]
		public RenderTexture VisualizeSDFTarget;

		public Vector3 SimulationContainerPosition;

		[Tooltip("Injection point used for BRP render")]
		public CameraEvent CurrentInjectionPoint = (CameraEvent)16;

		[Tooltip("Whether to limit maximum number of smoke simulation iterations per second.")]
		public bool LimitFramerate = true;

		[Min(0f)]
		public float MaximumFramerate = 60f;

		private ZibraSmokeAndFireSolverParameters SolverParametersInternal;

		private ZibraSmokeAndFireMaterialParameters MaterialParametersInternal;

		[NonSerialized]
		[Obsolete("solverParameters is deprecated. Please use SolverParameters.", true)]
		public ZibraSmokeAndFireSolverParameters solverParameters;

		[NonSerialized]
		[Obsolete("materialParameters is deprecated. Please use MaterialParameters.", true)]
		public ZibraSmokeAndFireMaterialParameters materialParameters;

		internal const int STATISTICS_PER_MANIPULATOR = 12;

		private const int WORKGROUP_SIZE_X = 8;

		private const int WORKGROUP_SIZE_Y = 8;

		private const int WORKGROUP_SIZE_Z = 6;

		private const int PARTICLE_WORKGROUP = 256;

		private const int DEPTH_COPY_WORKGROUP = 16;

		private const int TEXTURE3D_CLEAR_GROUPSIZE = 4;

		private const int MAX_LIGHT_COUNT = 16;

		private const int RANDOM_TEX_SIZE = 64;

		private const int EMITTER_GRADIENT_TEX_WIDTH = 48;

		private const int EMITTER_GRADIENT_ITEM_STRIDE = 2;

		private const int EMITTER_SPRITE_TEX_SIZE = 64;

		private const float EMITTER_PARTICLE_SIZE_SCALE = 0.1f;

		private ShaderParam ShaderParamContainer = new ShaderParam();

		private RenderTexture UpscaleColor;

		private RenderTexture Shadowmap;

		private RenderTexture Lightmap;

		private RenderTexture CameraOcclusion;

		private RenderTexture RenderDensity;

		private RenderTexture RenderDensityLOD;

		private RenderTexture RenderColor;

		private RenderTexture RenderIllumination;

		private RenderTexture ColorTexture0;

		private RenderTexture VelocityTexture0;

		private RenderTexture ColorTexture1;

		private RenderTexture VelocityTexture1;

		private RenderTexture TmpSDFTexture;

		private RenderTexture Divergence;

		private RenderTexture ResidualLOD0;

		private RenderTexture Pressure0LOD0;

		private RenderTexture Pressure1LOD0;

		private RenderTexture ResidualLOD1;

		private RenderTexture ResidualLOD2;

		private RenderTexture Pressure0LOD1;

		private RenderTexture Pressure0LOD2;

		private RenderTexture Pressure1LOD1;

		private RenderTexture Pressure1LOD2;

		private ComputeBuffer AtomicCounters;

		private ComputeBuffer EffectParticleData0;

		private ComputeBuffer EffectParticleData1;

		private ComputeBuffer EffectParticleEmissionColorData;

		private Texture3D RandomTexture;

		private RenderTexture DepthTexture;

		private RenderTexture ParticlesRT;

		private ComputeBuffer DynamicManipulatorData;

		private ComputeBuffer SDFObjectData;

		private ComputeBuffer ManipulatorStatistics;

		private Texture3D SDFGridTexture;

		private Texture3D EmbeddingsTexture;

		private Texture2D EmittersColorsTexture;

		private Texture2D EmittersColorsStagingTexture;

		private Texture3D EmittersSpriteTexture;

		private int ShadowmapID;

		private int LightmapID;

		private int IlluminationID;

		private int CopyDepthID;

		private int ClearTexture3DFloatID;

		private int ClearTexture3DFloat2ID;

		private int ClearTexture3DFloat3ID;

		private int ClearTexture3DFloat4ID;

		private Vector3Int WorkGroupsXYZ;

		private int MaxEffectParticleWorkgroups;

		private Vector3Int ShadowGridSize;

		private Vector3Int ShadowWorkGroupsXYZ;

		private Vector3Int LightGridSize;

		private Vector3Int LightWorkGroupsXYZ;

		private Vector3Int DownscaleXYZ;

		private Mesh renderQuad;

		private Mesh renderSimulationCube;

		private int CurrentInstanceID;

		private CommandBuffer solverCommandBuffer;

		private bool ForceRepaint;

		private bool isSimulationContainerPositionChanged;

		private float timeAccumulation;

		private bool forceTextureUpdate;

		private int GridDownscale = 1;

		internal int NumNodes;

		private Vector3Int GridSizeLOD;

		private CameraEvent ActiveInjectionPoint = (CameraEvent)16;

		[SerializeField]
		[FormerlySerializedAs("manipulators")]
		private List<Manipulator> Manipulators = new List<Manipulator>();

		private TexState[] EmittersSpriteTextureCache;

		private ZibraManipulatorManager ManipulatorManagerInternal;

		[SerializeField]
		[HideInInspector]
		private string _SimulationGUID = Guid.NewGuid().ToString();

		private static int ms_NextInstanceId = 0;

		private SmokeAndFireHDRPRenderComponent HDRPRenderer;

		private RenderParams cameraRenderParams;

		private SimulationParams simulationParams;

		private IntPtr NativeManipData;

		private IntPtr NativeManipIndices;

		private IntPtr NativeSDFData;

		private IntPtr NativeSimulationData;

		private List<IntPtr> toFreeOnExit = new List<IntPtr>();

		private Vector2Int CurrentTextureResolution = new Vector2Int(0, 0);

		private readonly Dictionary<Camera, CommandBuffer> cameraCBs = new Dictionary<Camera, CommandBuffer>();

		internal Dictionary<Camera, CameraResources> CameraResourcesMap = new Dictionary<Camera, CameraResources>();

		private Dictionary<Camera, IntPtr> camNativeParams = new Dictionary<Camera, IntPtr>();

		private Dictionary<Camera, IntPtr> camMeshRenderParams = new Dictionary<Camera, IntPtr>();

		private Dictionary<Camera, Vector2Int> CamRenderResolutions = new Dictionary<Camera, Vector2Int>();

		private Dictionary<Camera, Vector2Int> camNativeResolutions = new Dictionary<Camera, Vector2Int>();

		private List<Camera> cameras = new List<Camera>();

		public string SimulationGUID => _SimulationGUID;

		public SimulationMode ActiveSimulationMode { get; private set; }

		public float LastTimestep { get; private set; }

		public float SimulationInternalTime { get; private set; }

		public int SimulationInternalFrame { get; private set; }

		public Vector3Int GridSize { get; private set; }

		public float CellSize { get; private set; }

		public bool Initialized { get; private set; }

		public ZibraSmokeAndFireSolverParameters SolverParameters
		{
			get
			{
				if ((Object)(object)SolverParametersInternal == (Object)null)
				{
					SolverParametersInternal = ((Component)this).gameObject.GetComponent<ZibraSmokeAndFireSolverParameters>();
					if ((Object)(object)SolverParametersInternal == (Object)null)
					{
						SolverParametersInternal = ((Component)this).gameObject.AddComponent<ZibraSmokeAndFireSolverParameters>();
					}
				}
				return SolverParametersInternal;
			}
		}

		public ZibraSmokeAndFireMaterialParameters MaterialParameters
		{
			get
			{
				if ((Object)(object)MaterialParametersInternal == (Object)null)
				{
					MaterialParametersInternal = ((Component)this).gameObject.GetComponent<ZibraSmokeAndFireMaterialParameters>();
					if ((Object)(object)MaterialParametersInternal == (Object)null)
					{
						MaterialParametersInternal = ((Component)this).gameObject.AddComponent<ZibraSmokeAndFireMaterialParameters>();
					}
				}
				return MaterialParametersInternal;
			}
		}

		internal ZibraManipulatorManager ManipulatorManager
		{
			get
			{
				if ((Object)(object)ManipulatorManagerInternal == (Object)null)
				{
					ManipulatorManagerInternal = ((Component)this).gameObject.GetComponent<ZibraManipulatorManager>();
					if ((Object)(object)ManipulatorManagerInternal == (Object)null)
					{
						ManipulatorManagerInternal = ((Component)this).gameObject.AddComponent<ZibraManipulatorManager>();
					}
				}
				return ManipulatorManagerInternal;
			}
		}

		public bool IsLoaded()
		{
			return SmokeAndFireBridge.ZibraSmokeAndFire_IsLoaded() != 0;
		}

		public void WaitLoad()
		{
			SmokeAndFireBridge.ZibraSmokeAndFire_WaitLoad();
		}

		private void InitializeSimulation()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Invalid comparison between Unknown and I4
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Expected O, but got Unknown
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Expected O, but got Unknown
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Invalid comparison between Unknown and I4
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Invalid comparison between Unknown and I4
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Invalid comparison between Unknown and I4
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Invalid comparison between Unknown and I4
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Invalid comparison between Unknown and I4
			if (Initialized)
			{
				return;
			}
			if ((Object)(object)MainLight == (Object)null)
			{
				throw new Exception("The main light isn't assigned. SmokeAndFire was disabled.");
			}
			if (!SmokeAndFireBridge.ZibraSmokeAndFire_IsHardwareSupported())
			{
				throw new Exception("Zibra Smoke & Fire doesn't support this hardware. SmokeAndFire was disabled.");
			}
			try
			{
				if ((int)RenderPipelineDetector.GetRenderPipelineType() == 2)
				{
					bool flag = false;
					if ((Object)(object)MainLight == (Object)null)
					{
						Debug.LogError((object)"No Custom Light set in Zibra Smoke & Fire.");
						flag = true;
					}
					if (flag)
					{
						throw new Exception("Smoke & Fire creation failed due to missing parameter.");
					}
				}
				ValidateManipulators();
				bool flag2 = false;
				foreach (Manipulator manipulator in Manipulators)
				{
					if ((manipulator.GetManipulatorType() == Manipulator.ManipulatorType.Emitter || manipulator.GetManipulatorType() == Manipulator.ManipulatorType.TextureEmitter || manipulator.GetManipulatorType() == Manipulator.ManipulatorType.EffectParticleEmitter) && (Object)(object)((Component)manipulator).GetComponent<SDFObject>() != (Object)null)
					{
						flag2 = true;
						break;
					}
				}
				if (!flag2)
				{
					throw new Exception("Smoke & Fire creation failed. Simulation has no emitters, or all emitters are missing SDF component.");
				}
				Camera.onPreRender = (CameraCallback)Delegate.Combine((Delegate?)(object)Camera.onPreRender, (Delegate?)new CameraCallback(RenderCallBackWrapper));
				solverCommandBuffer = new CommandBuffer
				{
					name = "ZibraSmokeAndFire.Solver"
				};
				ActiveSimulationMode = CurrentSimulationMode;
				CurrentInstanceID = ms_NextInstanceId++;
				ForceCloseCommandEncoder(solverCommandBuffer);
				SmokeAndFireBridge.SubmitInstanceEvent(solverCommandBuffer, CurrentInstanceID, (EventID)5, (IntPtr)0);
				Graphics.ExecuteCommandBuffer(solverCommandBuffer);
				solverCommandBuffer.Clear();
				InitializeSolver();
				InitializeGPUReadbackParams initializeGPUReadbackParams = new InitializeGPUReadbackParams();
				uint readbackBufferSize = (uint)(ManipulatorManager.Elements * 12 * 4);
				initializeGPUReadbackParams.readbackBufferSize = readbackBufferSize;
				GraphicsDeviceType graphicsDeviceType = SystemInfo.graphicsDeviceType;
				if ((int)graphicsDeviceType <= 14)
				{
					if ((int)graphicsDeviceType == 2 || (int)graphicsDeviceType == 14)
					{
						goto IL_01bb;
					}
				}
				else if ((int)graphicsDeviceType == 18 || graphicsDeviceType - 22 <= 1)
				{
					goto IL_01bb;
				}
				initializeGPUReadbackParams.maxFramesInFlight = (int)MaxFramesInFlight;
				goto IL_01d6;
				IL_01d6:
				IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(initializeGPUReadbackParams));
				Marshal.StructureToPtr(initializeGPUReadbackParams, intPtr, fDeleteOld: true);
				solverCommandBuffer.Clear();
				SmokeAndFireBridge.SubmitInstanceEvent(solverCommandBuffer, CurrentInstanceID, (EventID)10, intPtr);
				Graphics.ExecuteCommandBuffer(solverCommandBuffer);
				solverCommandBuffer.Clear();
				toFreeOnExit.Add(intPtr);
				Initialized = true;
				forceTextureUpdate = true;
				return;
				IL_01bb:
				initializeGPUReadbackParams.maxFramesInFlight = QualitySettings.maxQueuedFrames + 1;
				goto IL_01d6;
			}
			catch (Exception)
			{
				ClearRendering();
				ClearSolver();
				Initialized = false;
				throw;
			}
		}

		public void ReleaseSimulation()
		{
			if (Initialized)
			{
				Initialized = false;
				ClearRendering();
				ClearSolver();
				ZibraSmokeAndFireGPUGarbageCollector.CreateGarbageCollector();
			}
		}

		public void RemoveManipulator(Manipulator manipulator)
		{
			if (Initialized)
			{
				Debug.LogWarning((object)"We don't yet support changing number of manipulators/colliders at runtime.");
			}
			else if (Manipulators.Contains(manipulator))
			{
				Manipulators.Remove(manipulator);
				Manipulators.Sort(new ManipulatorCompare());
			}
		}

		public ReadOnlyCollection<Manipulator> GetManipulatorList()
		{
			return Manipulators.AsReadOnly();
		}

		public bool HasManipulator(Manipulator manipulator)
		{
			return Manipulators.Contains(manipulator);
		}

		public void AddManipulator(Manipulator manipulator)
		{
			if (Initialized)
			{
				Debug.LogWarning((object)"We don't yet support changing number of manipulators/colliders at runtime.");
			}
			else if (!Manipulators.Contains(manipulator))
			{
				Manipulators.Add(manipulator);
				Manipulators.Sort(new ManipulatorCompare());
			}
		}

		public bool HasEmitter()
		{
			foreach (Manipulator manipulator in Manipulators)
			{
				if (manipulator.GetManipulatorType() == Manipulator.ManipulatorType.Emitter || manipulator.GetManipulatorType() == Manipulator.ManipulatorType.TextureEmitter || manipulator.GetManipulatorType() == Manipulator.ManipulatorType.EffectParticleEmitter)
				{
					return true;
				}
			}
			return false;
		}

		public void UpdateGridSize()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			if (!Initialized)
			{
				CellSize = Math.Max(ContainerSize.x, Math.Max(ContainerSize.y, ContainerSize.z)) / (float)GridResolution;
				GridSize = 8 * Vector3Int.CeilToInt(ContainerSize / (8f * CellSize));
				Vector3Int gridSize = GridSize;
				int num = ((Vector3Int)(ref gridSize))[0];
				gridSize = GridSize;
				int num2 = num * ((Vector3Int)(ref gridSize))[1];
				gridSize = GridSize;
				NumNodes = num2 * ((Vector3Int)(ref gridSize))[2];
				GridDownscale = (int)Mathf.Ceil(1f / Mathf.Max(MaterialParameters.ShadowResolution, MaterialParameters.IlluminationResolution));
				GridSizeLOD = LODGridSize(GridSize, GridDownscale);
			}
		}

		public List<string> GetStats()
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			string text = "";
			switch (CurrentSimulationMode)
			{
			case SimulationMode.Smoke:
				text = "Smoke";
				break;
			case SimulationMode.ColoredSmoke:
				text = "Colored Smoke";
				break;
			case SimulationMode.Fire:
				text = "Fire";
				break;
			}
			float num = (EnableDownscale ? DownscaleFactor : 1f);
			float num2 = num * num;
			return new List<string>
			{
				text + " Simulation",
				"Instance: " + ((Object)this).name,
				$"Grid size: {GridSize}",
				$"Render resolution: {num * 100f}%",
				$"Render pixel count: {num2 * 100f}%"
			};
		}

		[Obsolete("StopSolver is deprecated. Please use ReleaseSimulation.", true)]
		public void StopSolver()
		{
		}

		internal bool IsSimulationEnabled()
		{
			if (Initialized)
			{
				if (!RunSimulation)
				{
					return SimulationInternalFrame <= 2;
				}
				return true;
			}
			return false;
		}

		internal bool IsRenderingEnabled()
		{
			if (Initialized && RunRendering)
			{
				return SimulationInternalFrame > 1;
			}
			return false;
		}

		private void UpdateReadback()
		{
			solverCommandBuffer.Clear();
			ForceCloseCommandEncoder(solverCommandBuffer);
			SmokeAndFireBridge.SubmitInstanceEvent(solverCommandBuffer, CurrentInstanceID, (EventID)11, (IntPtr)0);
			Graphics.ExecuteCommandBuffer(solverCommandBuffer);
			UpdateManipulatorStatistics();
		}

		private void UpdateSimulation()
		{
			if (Initialized)
			{
				LastTimestep = Timestep;
				if (RunSimulation)
				{
					StepPhysics();
				}
				Illumination();
			}
		}

		private void UpdateInteropBuffers()
		{
			Marshal.StructureToPtr(simulationParams, NativeSimulationData, fDeleteOld: true);
			if (ManipulatorManager.Elements > 0)
			{
				SetInteropBuffer(NativeManipData, ManipulatorManager.ManipulatorParams);
			}
			if (ManipulatorManager.SDFObjectList.Count > 0)
			{
				SetInteropBuffer(NativeSDFData, ManipulatorManager.SDFObjectList);
			}
			SetInteropBuffer(NativeManipIndices, new List<ZibraManipulatorManager.ManipulatorIndices> { ManipulatorManager.indices });
		}

		private void UpdateSolverParameters()
		{
			SmokeAndFireBridge.SubmitInstanceEvent(solverCommandBuffer, CurrentInstanceID, (EventID)3, NativeSimulationData);
			if (ManipulatorManager.Elements > 0)
			{
				SmokeAndFireBridge.SubmitInstanceEvent(solverCommandBuffer, CurrentInstanceID, (EventID)4, NativeManipData);
			}
			if (ManipulatorManager.SDFObjectList.Count > 0)
			{
				SmokeAndFireBridge.SubmitInstanceEvent(solverCommandBuffer, CurrentInstanceID, (EventID)13, NativeSDFData);
			}
			SmokeAndFireBridge.SubmitInstanceEvent(solverCommandBuffer, CurrentInstanceID, (EventID)14, NativeManipIndices);
		}

		private void StepPhysics()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			solverCommandBuffer.Clear();
			ForceCloseCommandEncoder(solverCommandBuffer);
			bool simulationParameters = false;
			SetSimulationParameters(simulationParameters);
			ManipulatorManager.UpdateDynamic(this, LastTimestep);
			UpdateInteropBuffers();
			UpdateSolverParameters();
			SmokeAndFireBridge.SubmitInstanceEvent(solverCommandBuffer, CurrentInstanceID, (EventID)1, (IntPtr)0);
			Graphics.ExecuteCommandBuffer(solverCommandBuffer);
			Vector3 simulationContainerPosition = SimulationContainerPosition;
			SimulationContainerPosition = SmokeAndFireBridge.GetSimulationContainerPosition(CurrentInstanceID);
			isSimulationContainerPositionChanged = simulationContainerPosition != SimulationContainerPosition;
			SimulationInternalTime += LastTimestep;
			SimulationInternalFrame++;
		}

		private void UpdateManipulatorStatistics()
		{
			if (ManipulatorManager.Elements > 0)
			{
				uint num = (uint)(ManipulatorManager.Elements * 12);
				IntPtr intPtr = SmokeAndFireBridge.ZibraSmokeAndFire_GPUReadbackGetData(CurrentInstanceID, num * 4);
				if (intPtr != IntPtr.Zero)
				{
					int[] array = new int[num];
					Marshal.Copy(intPtr, array, 0, (int)num);
					ManipulatorManager.UpdateStatistics(array, Manipulators, SolverParameters, MaterialParameters);
				}
			}
		}

		private void SetSimulationParameters(bool isStereo = false)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
			simulationParams.GridSize = Vector3Int.op_Implicit(GridSize);
			simulationParams.NodeCount = NumNodes;
			simulationParams.ContainerScale = ContainerSize;
			simulationParams.MinimumVelocity = SolverParameters.MinimumVelocity;
			simulationParams.ContainerPos = ((Component)this).transform.position;
			simulationParams.MaximumVelocity = SolverParameters.MaximumVelocity;
			simulationParams.TimeStep = LastTimestep;
			simulationParams.SimulationTime = SimulationInternalTime;
			simulationParams.SimulationFrame = SimulationInternalFrame;
			simulationParams.Sharpen = SolverParameters.Sharpen;
			simulationParams.SharpenThreshold = SolverParameters.SharpenThreshold;
			simulationParams.JacobiIterations = SolverParameters.PressureSolveIterations;
			simulationParams.ColorDecay = SolverParameters.ColorDecay;
			simulationParams.VelocityDecay = SolverParameters.VelocityDecay;
			simulationParams.PressureReuse = SolverParameters.PressureReuse;
			simulationParams.PressureReuseClamp = SolverParameters.PressureReuseClamp;
			simulationParams.PressureProjection = SolverParameters.PressureProjection;
			simulationParams.PressureClamp = SolverParameters.PressureClamp;
			simulationParams.Gravity = SolverParameters.Gravity;
			simulationParams.SmokeBuoyancy = SolverParameters.SmokeBuoyancy;
			simulationParams.LOD0Iterations = SolverParameters.LOD0Iterations;
			simulationParams.LOD1Iterations = SolverParameters.LOD1Iterations;
			simulationParams.LOD2Iterations = SolverParameters.LOD2Iterations;
			simulationParams.PreIterations = SolverParameters.PreIterations;
			simulationParams.MainOverrelax = SolverParameters.MainOverrelax;
			simulationParams.EdgeOverrelax = SolverParameters.EdgeOverrelax;
			simulationParams.VolumeEdgeFadeoff = MaterialParameters.VolumeEdgeFadeoff;
			simulationParams.SimulationIterations = SimulationIterations;
			simulationParams.SimulationMode = (int)ActiveSimulationMode;
			simulationParams.FixVolumeWorldPosition = (FixVolumeWorldPosition ? 1 : 0);
			simulationParams.FuelDensity = MaterialParameters.FuelDensity * MaterialParameters.FadeCoefficient;
			simulationParams.SmokeDensity = MaterialParameters.SmokeDensity * MaterialParameters.FadeCoefficient;
			simulationParams.TemperatureDensityDependence = MaterialParameters.TemperatureDensityDependence;
			simulationParams.FireBrightness = MaterialParameters.FireBrightness + MaterialParameters.BlackBodyBrightness;
			simulationParams.TempThreshold = SolverParameters.TempThreshold;
			simulationParams.HeatEmission = SolverParameters.HeatEmission;
			simulationParams.ReactionSpeed = SolverParameters.ReactionSpeed;
			simulationParams.HeatBuoyancy = SolverParameters.HeatBuoyancy;
			simulationParams.MaxEffectParticleCount = MaterialParameters.MaxEffectParticles;
			simulationParams.ParticleLifetime = MaterialParameters.ParticleLifetime;
			simulationParams.SimulateEffectParticles = ((!isStereo && ManipulatorManager.indices.EffectParticleEmitterEnd - ManipulatorManager.indices.EffectParticleEmitterBegin > 0) ? 1 : 0);
			simulationParams.RenderEffectParticles = ((!isStereo && ManipulatorManager.indices.EffectParticleEmitterEnd - ManipulatorManager.indices.EffectParticleEmitterBegin > 0) ? 1 : 0);
			simulationParams.GridSizeLOD = Vector3Int.op_Implicit(GridSizeLOD);
			simulationParams.GridDownscale = GridDownscale;
		}

		private void RefreshEmitterColorsTexture()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Expected O, but got Unknown
			List<Manipulator> list = Manipulators.FindAll((Manipulator manip) => manip is ZibraParticleEmitter);
			GraphicsFormat val = (GraphicsFormat)8;
			TextureCreationFlags val2 = (TextureCreationFlags)0;
			list.Sort(new ManipulatorCompare());
			if ((Object)(object)EmittersSpriteTexture == (Object)null)
			{
				int[] array = new int[3]
				{
					1,
					1,
					Mathf.Max(1, list.Count)
				};
				if (Object.op_Implicit((Object)(object)list.Find((Manipulator emitter) => (emitter as ZibraParticleEmitter).RenderMode == ZibraParticleEmitter.RenderingMode.Sprite)))
				{
					array[0] = (array[1] = 64);
				}
				EmittersSpriteTexture = new Texture3D(array[0], array[1], array[2], val, val2);
				EmittersSpriteTextureCache = new TexState[list.Count];
			}
			float num = 1f / 47f;
			for (int i = 0; i < list.Count; i++)
			{
				ZibraParticleEmitter zibraParticleEmitter = list[i] as ZibraParticleEmitter;
				for (int j = 0; j < 48; j++)
				{
					float num2 = (float)j * num;
					Color val3 = zibraParticleEmitter.ParticleColor.Evaluate(num2);
					EmittersColorsStagingTexture.SetPixel(j, i * 2, val3);
					Color black = Color.black;
					black.a = zibraParticleEmitter.ParticleSize.Evaluate(num2) * 0.1f;
					if (zibraParticleEmitter.EmissionEnabled)
					{
						black.r = zibraParticleEmitter.SmokeDensity.Evaluate(num2);
						black.g = zibraParticleEmitter.Temperature.Evaluate(num2);
						black.b = zibraParticleEmitter.Fuel.Evaluate(num2);
					}
					EmittersColorsStagingTexture.SetPixel(j, i * 2 + 1, black);
				}
				if (zibraParticleEmitter.RenderMode == ZibraParticleEmitter.RenderingMode.Sprite && EmittersSpriteTextureCache[i].IsDirty(zibraParticleEmitter.ParticleSprite))
				{
					RenderTexture val4 = new RenderTexture(64, 64, 0, val);
					Graphics.Blit((Texture)(object)zibraParticleEmitter.ParticleSprite, val4);
					int num3 = i;
					Graphics.CopyTexture((Texture)(object)val4, 0, (Texture)(object)EmittersSpriteTexture, num3);
					EmittersSpriteTextureCache[i].Update(zibraParticleEmitter.ParticleSprite);
				}
			}
			EmittersColorsStagingTexture.Apply();
			Graphics.CopyTexture((Texture)(object)EmittersColorsStagingTexture, (Texture)(object)EmittersColorsTexture);
		}

		private void InitializeNativeCameraParams(Camera cam)
		{
			if (!camNativeParams.ContainsKey(cam))
			{
				camNativeParams[cam] = Marshal.AllocHGlobal(Marshal.SizeOf(cameraRenderParams));
			}
		}

		private void SetMaterialParams(Material material, Vector2 resolution)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_033b: Unknown result type (might be due to invalid IL or missing references)
			//IL_037c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0421: Unknown result type (might be due to invalid IL or missing references)
			//IL_0488: Unknown result type (might be due to invalid IL or missing references)
			//IL_048d: Unknown result type (might be due to invalid IL or missing references)
			material.SetFloat(ShaderParam.SmokeDensity, MaterialParameters.SmokeDensity * MaterialParameters.FadeCoefficient);
			material.SetFloat(ShaderParam.FuelDensity, MaterialParameters.FuelDensity * MaterialParameters.FadeCoefficient);
			material.SetVector(ShaderParam.ShadowColor, Color.op_Implicit(MaterialParameters.ShadowAbsorptionColor));
			material.SetVector(ShaderParam.AbsorptionColor, Color.op_Implicit(MaterialParameters.AbsorptionColor));
			material.SetVector(ShaderParam.ScatteringColor, Color.op_Implicit(MaterialParameters.ScatteringColor));
			material.SetFloat(ShaderParam.ScatteringAttenuation, MaterialParameters.ScatteringAttenuation);
			material.SetFloat(ShaderParam.ScatteringContribution, MaterialParameters.ScatteringContribution);
			material.SetFloat(ShaderParam.FakeShadows, MaterialParameters.ObjectShadowIntensity);
			material.SetFloat(ShaderParam.ShadowDistanceDecay, MaterialParameters.ShadowDistanceDecay);
			material.SetFloat(ShaderParam.ShadowIntensity, MaterialParameters.ShadowIntensity);
			material.SetFloat(ShaderParam.StepSize, MaterialParameters.RayMarchingStepSize);
			material.SetInt(ShaderParam.PrimaryShadows, (MaterialParameters.ObjectPrimaryShadows && ((Behaviour)MainLight).enabled) ? 1 : 0);
			material.SetInt(ShaderParam.IlluminationShadows, MaterialParameters.ObjectIlluminationShadows ? 1 : 0);
			material.SetVector(ShaderParam.ContainerScale, Vector4.op_Implicit(ContainerSize));
			material.SetVector(ShaderParam.ContainerPosition, Vector4.op_Implicit(SimulationContainerPosition));
			material.SetVector(ShaderParam.GridSize, Vector4.op_Implicit(Vector3Int.op_Implicit(GridSize)));
			material.SetVector(ShaderParam.ShadowGridSize, Vector4.op_Implicit(Vector3Int.op_Implicit(ShadowGridSize)));
			material.SetVector(ShaderParam.LightGridSize, Vector4.op_Implicit(Vector3Int.op_Implicit(LightGridSize)));
			if ((Object)(object)MainLight == (Object)null)
			{
				Debug.LogError((object)"No main light source set in the Zibra Flames instance.");
			}
			else
			{
				material.SetVector(ShaderParam.LightColor, Vector4.op_Implicit(GetLightColor(MainLight)));
				material.SetVector(ShaderParam.LightDirWorld, Vector4.op_Implicit(((Component)MainLight).transform.rotation * new Vector3(0f, 0f, -1f)));
			}
			material.SetTexture(ShaderParam.ParticlesTex, (Texture)(object)ParticlesRT);
			material.SetTexture(ShaderParam.BlueNoise, MaterialParameters.BlueNoise);
			material.SetTexture(ShaderParam.Color, (Texture)(object)RenderColor);
			material.SetTexture(ShaderParam.Illumination, (Texture)(object)RenderIllumination);
			material.SetTexture(ShaderParam.Density, (Texture)(object)RenderDensity);
			material.SetInt(ShaderParam.DensityDownscale, 1);
			material.SetTexture(ShaderParam.Shadowmap, (Texture)(object)Shadowmap);
			material.SetTexture(ShaderParam.Lightmap, (Texture)(object)Lightmap);
			int num = (((Behaviour)MainLight).enabled ? 1 : 0);
			Vector4[] lightColors = (Vector4[])(object)new Vector4[16];
			Vector4[] lightPositions = (Vector4[])(object)new Vector4[16];
			int lights = GetLights(ref lightColors, ref lightPositions);
			material.SetVectorArray(ShaderParam.LightColorArray, lightColors);
			material.SetVectorArray(ShaderParam.LightPositionArray, lightPositions);
			material.SetInt(ShaderParam.LightCount, lights);
			material.SetInt(ShaderParam.MainLightMode, num);
			material.SetVector(ShaderParam.Resolution, Vector4.op_Implicit(resolution));
			float num2 = 1f / 3f * (ContainerSize.x + ContainerSize.y + ContainerSize.z);
			float x = ContainerSize.x;
			Vector3Int gridSize = GridSize;
			float num3 = x / (float)((Vector3Int)(ref gridSize)).x;
			float num4 = MaterialParameters.RayMarchingStepSize * num3;
			float num5 = num4 / num2;
			material.SetFloat(ShaderParam.DeltaT, num4);
			material.SetFloat(ShaderParam.StepScale, num5);
			material.SetVector(ShaderParam.ContainerMinPoint, Vector4.op_Implicit(new Vector3(SimulationContainerPosition.x - ContainerSize.x * 0.5f, SimulationContainerPosition.y - ContainerSize.y * 0.5f, SimulationContainerPosition.z - ContainerSize.z * 0.5f)));
			material.SetVector(ShaderParam.ContainerMaxPoint, Vector4.op_Implicit(new Vector3(SimulationContainerPosition.x + ContainerSize.x * 0.5f, SimulationContainerPosition.y + ContainerSize.y * 0.5f, SimulationContainerPosition.z + ContainerSize.z * 0.5f)));
		}

		private bool SetMaterialParams(Camera cam)
		{
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Invalid comparison between Unknown and I4
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Invalid comparison between Unknown and I4
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Invalid comparison between Unknown and I4
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			CameraResources cameraResources = CameraResourcesMap[cam];
			Material material = (EnableDownscale ? MaterialParameters.UpscaleMaterial : null);
			bool flag = cameraResources.UpscaleMaterial.SetMaterial(material);
			Material smokeMaterial = MaterialParameters.SmokeMaterial;
			bool flag2 = cameraResources.SmokeAndFireMaterial.SetMaterial(smokeMaterial);
			Material currentMaterial = cameraResources.SmokeAndFireMaterial.CurrentMaterial;
			if (flag2)
			{
				ShaderParamContainer.SmokeShader_FLIP_NATIVE_TEXTURES = new LocalKeyword(currentMaterial.shader, "FLIP_NATIVE_TEXTURES");
				ShaderParamContainer.SmokeShader_FULLSCREEN_QUAD = new LocalKeyword(currentMaterial.shader, "FULLSCREEN_QUAD");
				ShaderParamContainer.SmokeShader_INPUT_2D_ARRAY = new LocalKeyword(currentMaterial.shader, "INPUT_2D_ARRAY");
				if ((int)RenderPipelineDetector.GetRenderPipelineType() == 2)
				{
					currentMaterial.EnableKeyword("HDRP");
				}
			}
			flag = flag2 || flag;
			SetMaterialParams(currentMaterial, new Vector2((float)cam.pixelWidth, (float)cam.pixelHeight));
			Material shadowProjectionMaterial = MaterialParameters.ShadowProjectionMaterial;
			bool flag3 = cameraResources.SmokeShadowProjectionMaterial.SetMaterial(shadowProjectionMaterial);
			Material currentMaterial2 = cameraResources.SmokeShadowProjectionMaterial.CurrentMaterial;
			if (flag3)
			{
				ShaderParamContainer.SmokeShadowProjectionShader_FLIP_NATIVE_TEXTURES = new LocalKeyword(currentMaterial2.shader, "FLIP_NATIVE_TEXTURES");
				ShaderParamContainer.SmokeShadowProjectionShader_INPUT_2D_ARRAY = new LocalKeyword(currentMaterial2.shader, "INPUT_2D_ARRAY");
				ShaderParamContainer.SmokeShadowProjectionShader_TRICUBIC = new LocalKeyword(currentMaterial2.shader, "TRICUBIC");
				if ((int)RenderPipelineDetector.GetRenderPipelineType() == 2)
				{
					currentMaterial2.EnableKeyword("HDRP");
				}
			}
			flag = flag3 || flag;
			SetMaterialParams(currentMaterial2, new Vector2((float)cam.pixelWidth, (float)cam.pixelHeight));
			currentMaterial2.SetKeyword(ref ShaderParamContainer.SmokeShadowProjectionShader_TRICUBIC, MaterialParameters.ShadowProjectionQualityLevel == ZibraSmokeAndFireMaterialParameters.ShadowProjectionQuality.Tricubic);
			Material material2 = (VisualizeSceneSDF ? MaterialParameters.SDFRenderMaterial : null);
			bool flag4 = cameraResources.SDFRenderMaterial.SetMaterial(material2);
			flag = flag || flag4;
			if (VisualizeSceneSDF)
			{
				Material currentMaterial3 = cameraResources.SDFRenderMaterial.CurrentMaterial;
				currentMaterial3.SetTexture(ShaderParam.SDFRenderSmoke, (Texture)(object)VisualizeSDFTarget);
				if ((int)RenderPipelineDetector.GetRenderPipelineType() == 2)
				{
					if (flag4)
					{
						currentMaterial3.EnableKeyword("HDRP");
					}
					currentMaterial3.SetVector(ShaderParam.LightColor, Color.op_Implicit(MainLight.color * Mathf.Log(MainLight.intensity) / 8f));
					currentMaterial3.SetVector(ShaderParam.LightDirection, Vector4.op_Implicit(((Component)MainLight).transform.rotation * new Vector3(0f, 0f, -1f)));
				}
			}
			return flag;
		}

		internal Vector2Int ApplyDownscaleFactor(Vector2Int val)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			if (!EnableDownscale)
			{
				return val;
			}
			return new Vector2Int((int)((float)((Vector2Int)(ref val)).x * DownscaleFactor), (int)((float)((Vector2Int)(ref val)).y * DownscaleFactor));
		}

		private Vector2Int ApplyRenderPipelineRenderScale(Vector2Int val, float renderPipelineRenderScale)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2Int((int)((float)((Vector2Int)(ref val)).x * renderPipelineRenderScale), (int)((float)((Vector2Int)(ref val)).y * renderPipelineRenderScale));
		}

		private RenderTexture CreateTexture(RenderTexture texture, Vector2Int resolution, bool applyDownscaleFactor, FilterMode filterMode, int depth, RenderTextureFormat format, bool enableRandomWrite, ref bool hasBeenUpdated)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			if ((Object)(object)texture == (Object)null || ((Texture)texture).width != ((Vector2Int)(ref resolution)).x || ((Texture)texture).height != ((Vector2Int)(ref resolution)).y || forceTextureUpdate)
			{
				ZibraSmokeAndFireGPUGarbageCollector.SafeRelease(texture);
				RenderTexture val = new RenderTexture(((Vector2Int)(ref resolution)).x, ((Vector2Int)(ref resolution)).y, depth, format)
				{
					enableRandomWrite = enableRandomWrite,
					filterMode = filterMode
				};
				val.Create();
				hasBeenUpdated = true;
				return val;
			}
			return texture;
		}

		private RenderTexture CreateStereoTexture(RenderTexture texture, Vector2Int resolution, bool applyDownscaleFactor, FilterMode filterMode, int depth, RenderTextureFormat format, bool enableRandomWrite, ref bool hasBeenUpdated)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			if ((Object)(object)texture == (Object)null || ((Texture)texture).width != ((Vector2Int)(ref resolution)).x || ((Texture)texture).height != ((Vector2Int)(ref resolution)).y || forceTextureUpdate)
			{
				ZibraSmokeAndFireGPUGarbageCollector.SafeRelease(texture);
				RenderTexture val = new RenderTexture(((Vector2Int)(ref resolution)).x, ((Vector2Int)(ref resolution)).y, depth, format)
				{
					dimension = (TextureDimension)5,
					volumeDepth = 2,
					enableRandomWrite = enableRandomWrite,
					filterMode = filterMode
				};
				val.Create();
				hasBeenUpdated = true;
				return val;
			}
			return texture;
		}

		private void UpdateCameraResolution(Camera cam, float renderPipelineRenderScale)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			Vector2Int val = ((XRSettings.eyeTextureWidth != 0) ? new Vector2Int(XRSettings.eyeTextureWidth, XRSettings.eyeTextureHeight) : new Vector2Int(cam.pixelWidth, cam.pixelHeight));
			if (!XRSettings.enabled)
			{
				val = ApplyRenderPipelineRenderScale(val, renderPipelineRenderScale);
			}
			camNativeResolutions[cam] = val;
			Vector2Int value = ApplyDownscaleFactor(val);
			CamRenderResolutions[cam] = value;
		}

		internal void RenderSmokeAndFireMain(CommandBuffer cmdBuffer, Camera cam, Rect? viewport = null)
		{
			RenderSmokeAndFire(cmdBuffer, cam, viewport);
		}

		internal void UpscaleSmokeAndFireDirect(CommandBuffer cmdBuffer, Camera cam, RenderTargetIdentifier? sourceColorTexture = null, RenderTargetIdentifier? sourceDepthTexture = null, Rect? viewport = null)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			Material currentMaterial = CameraResourcesMap[cam].UpscaleMaterial.CurrentMaterial;
			Vector2Int val = camNativeResolutions[cam];
			cmdBuffer.SetViewport(new Rect(0f, 0f, (float)((Vector2Int)(ref val)).x, (float)((Vector2Int)(ref val)).y));
			cmdBuffer.SetGlobalTexture(ShaderParam.RenderedVolume, (RenderTargetIdentifier)(((??)sourceColorTexture) ?? RenderTargetIdentifier.op_Implicit((Texture)(object)UpscaleColor)));
			cmdBuffer.DrawProcedural(((Component)this).transform.localToWorldMatrix, currentMaterial, 0, (MeshTopology)0, 6);
		}

		internal void RenderSDFVisualization(CommandBuffer cmdBuffer, Camera cam, Rect? viewport = null)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			_ = CamRenderResolutions[cam];
			Material currentMaterial = CameraResourcesMap[cam].SDFRenderMaterial.CurrentMaterial;
			cmdBuffer.DrawProcedural(((Component)this).transform.localToWorldMatrix, currentMaterial, 0, (MeshTopology)0, 6);
		}

		private void UpdateCamera(Camera cam)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Unknown result type (might be due to invalid IL or missing references)
			Vector2Int val = CamRenderResolutions[cam];
			Material currentMaterial = CameraResourcesMap[cam].SmokeAndFireMaterial.CurrentMaterial;
			Material currentMaterial2 = CameraResourcesMap[cam].UpscaleMaterial.CurrentMaterial;
			Material currentMaterial3 = CameraResourcesMap[cam].SmokeShadowProjectionMaterial.CurrentMaterial;
			Material currentMaterial4 = CameraResourcesMap[cam].SDFRenderMaterial.CurrentMaterial;
			Matrix4x4 gPUProjectionMatrix = GL.GetGPUProjectionMatrix(cam.projectionMatrix, true);
			Matrix4x4 inverse = ((Matrix4x4)(ref gPUProjectionMatrix)).inverse;
			Matrix4x4 worldToCameraMatrix = cam.worldToCameraMatrix;
			Matrix4x4 viewProjection = gPUProjectionMatrix * worldToCameraMatrix;
			Matrix4x4 inverse2 = ((Matrix4x4)(ref viewProjection)).inverse;
			cameraRenderParams.View = cam.worldToCameraMatrix;
			cameraRenderParams.Projection = gPUProjectionMatrix;
			cameraRenderParams.ProjectionInverse = inverse;
			cameraRenderParams.ViewProjection = viewProjection;
			cameraRenderParams.ViewProjectionInverse = inverse2;
			cameraRenderParams.WorldSpaceCameraPos = ((Component)cam).transform.position;
			cameraRenderParams.CameraResolution = new Vector2((float)((Vector2Int)(ref val)).x, (float)((Vector2Int)(ref val)).y);
			cameraRenderParams.CameraDownscaleFactor = (EnableDownscale ? DownscaleFactor : 1f);
			float num = cam.farClipPlane / cam.nearClipPlane;
			float num2 = 1f - num;
			cameraRenderParams.ZBufferParams = new Vector4(num2, num, num2 / cam.farClipPlane, num / cam.farClipPlane);
			cameraRenderParams.CameraID = cameras.IndexOf(cam);
			Vector2 val2 = new Vector2((float)((Vector2Int)(ref val)).x, (float)((Vector2Int)(ref val)).y) / Vector2Int.op_Implicit(GetRequiredTextureResolution());
			currentMaterial.SetVector(ShaderParam.Resolution, Vector4.op_Implicit(cameraRenderParams.CameraResolution));
			currentMaterial.SetFloat(ShaderParam.DownscaleFactor, cameraRenderParams.CameraDownscaleFactor);
			currentMaterial.SetVector(ShaderParam.TextureScale, Vector4.op_Implicit(val2));
			MaterialParameters.RendererCompute.SetVector(ShaderParam.OriginalCameraResolution, Vector4.op_Implicit(new Vector2((float)cam.pixelWidth, (float)cam.pixelHeight)));
			currentMaterial3.SetMatrix(ShaderParam.ViewProjectionInverse, cameraRenderParams.ViewProjectionInverse);
			MaterialParameters.RendererCompute.SetVector(ShaderParam.Resolution, Vector4.op_Implicit(cameraRenderParams.CameraResolution));
			MaterialParameters.RendererCompute.SetMatrix(ShaderParam.ViewProjectionInverse, cameraRenderParams.ViewProjectionInverse);
			Marshal.StructureToPtr(cameraRenderParams, camNativeParams[cam], fDeleteOld: true);
			if (EnableDownscale)
			{
				currentMaterial2.SetVector(ShaderParam.TextureScale, Vector4.op_Implicit(val2));
				currentMaterial2.SetMatrix(ShaderParam.ViewProjectionInverse, cameraRenderParams.ViewProjectionInverse);
			}
			float num3 = cam.nearClipPlane * 3f;
			Bounds val3 = new Bounds(((Component)this).transform.position, ContainerSize + new Vector3(num3, num3, num3));
			bool flag = ((Bounds)(ref val3)).Contains(((Component)cam).transform.position);
			currentMaterial.SetKeyword(ref ShaderParamContainer.SmokeShader_FULLSCREEN_QUAD, flag);
			if (VisualizeSceneSDF)
			{
				currentMaterial4.SetVector(ShaderParam.TextureScale, Vector4.op_Implicit(val2));
				currentMaterial4.SetMatrix(ShaderParam.EyeRayCameraCoeficients, CalculateEyeRayCameraCoeficients(cam));
			}
		}

		private void DisableForCamera(Camera cam)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			cam.RemoveCommandBuffer(ActiveInjectionPoint, cameraCBs[cam]);
			cameraCBs[cam].Dispose();
			cameraCBs.Remove(cam);
		}

		private void UpdateNativeRenderParams(CommandBuffer cmdBuffer, Camera cam)
		{
			SmokeAndFireBridge.SubmitInstanceEvent(cmdBuffer, CurrentInstanceID, (EventID)7, camNativeParams[cam]);
		}

		internal void RenderCallBack(Camera cam, float renderPipelineRenderScale = 1f)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Invalid comparison between Unknown and I4
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Expected O, but got Unknown
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			if ((int)cam.cameraType == 4 || (int)cam.cameraType == 16 || (int)cam.cameraType == 8)
			{
				ClearCameraCommandBuffers();
				return;
			}
			if (cam.stereoEnabled)
			{
				Debug.LogError((object)"Stereo Rendering is not supported in the OTP version");
				((Behaviour)this).enabled = false;
				return;
			}
			UpdateCameraResolution(cam, renderPipelineRenderScale);
			if (!CameraResourcesMap.ContainsKey(cam))
			{
				CameraResourcesMap[cam] = new CameraResources();
			}
			if (CurrentInjectionPoint != ActiveInjectionPoint)
			{
				foreach (KeyValuePair<Camera, CommandBuffer> cameraCB in cameraCBs)
				{
					cameraCB.Key.RemoveCommandBuffer(ActiveInjectionPoint, cameraCB.Value);
					cameraCB.Key.AddCommandBuffer(CurrentInjectionPoint, cameraCB.Value);
				}
				ActiveInjectionPoint = CurrentInjectionPoint;
			}
			bool flag = (int)RenderPipelineDetector.GetRenderPipelineType() != 0 || (cam.cullingMask & (1 << ((Component)this).gameObject.layer)) != 0;
			if (!IsRenderingEnabled() || !flag || (Object)(object)MaterialParameters.SmokeMaterial == (Object)null || (Object)(object)MaterialParameters.ShadowProjectionMaterial == (Object)null || (EnableDownscale && (Object)(object)MaterialParameters.UpscaleMaterial == (Object)null))
			{
				if (cameraCBs.ContainsKey(cam))
				{
					cam.RemoveCommandBuffer(ActiveInjectionPoint, cameraCBs[cam]);
					cameraCBs[cam].Clear();
					cameraCBs.Remove(cam);
				}
				return;
			}
			bool flag2 = SetMaterialParams(cam);
			flag2 = UpdateNativeTextures(cam, renderPipelineRenderScale) || flag2;
			flag2 = !cameraCBs.ContainsKey(cam) || flag2 || isSimulationContainerPositionChanged;
			flag2 = true;
			InitializeNativeCameraParams(cam);
			UpdateCamera(cam);
			if ((int)RenderPipelineDetector.GetRenderPipelineType() == 0 && (!cameraCBs.ContainsKey(cam) || flag2))
			{
				CommandBuffer val;
				if (flag2 && cameraCBs.ContainsKey(cam))
				{
					val = cameraCBs[cam];
					val.Clear();
				}
				else
				{
					val = new CommandBuffer
					{
						name = "ZibraSmokeAndFire.Render"
					};
					cam.AddCommandBuffer(ActiveInjectionPoint, val);
					cameraCBs[cam] = val;
				}
				cam.depthTextureMode = (DepthTextureMode)1;
				RenderParticlesNative(val, cam);
				RenderSDFNative(val);
				RenderFluid(val, cam);
			}
		}

		internal void RenderSDFNative(CommandBuffer cmdBuffer)
		{
			if (VisualizeSceneSDF)
			{
				SmokeAndFireBridge.SubmitInstanceEvent(cmdBuffer, CurrentInstanceID, (EventID)15, (IntPtr)0);
			}
		}

		private void RenderCallBackWrapper(Camera cam)
		{
			RenderCallBack(cam);
		}

		internal void RenderFluid(CommandBuffer cmdBuffer, Camera cam, RenderTargetIdentifier? renderTargetParam = null, RenderTargetIdentifier? depthTargetParam = null, Rect? viewport = null)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due t