mirror of
https://github.com/Dadechin/Unity-WebSocket.git
synced 2025-07-03 20:04:33 +00:00
28 lines
921 B
C#
28 lines
921 B
C#
using FishNet.CodeGenerating.Helping.Extension;
|
|
using MonoFN.Cecil;
|
|
using MonoFN.Cecil.Cil;
|
|
|
|
namespace FishNet.CodeGenerating.Extension
|
|
{
|
|
|
|
|
|
internal static class ILProcessorExtensions
|
|
{
|
|
/// <summary>
|
|
/// Creates a variable type within the body and returns it's VariableDef.
|
|
/// </summary>
|
|
internal static VariableDefinition CreateVariable(this ILProcessor processor, CodegenSession session, System.Type variableType)
|
|
{
|
|
return processor.Body.Method.CreateVariable(session, variableType);
|
|
}
|
|
/// <summary>
|
|
/// Creates a variable type within the body and returns it's VariableDef.
|
|
/// </summary>
|
|
internal static VariableDefinition CreateVariable(this ILProcessor processor, CodegenSession session, TypeReference variableTr)
|
|
{
|
|
return processor.Body.Method.CreateVariable(variableTr);
|
|
}
|
|
}
|
|
|
|
|
|
} |