Class CoreUtils
Inheritance
System.Object
CoreUtils
Syntax
public static class CoreUtils
Fields
Declaration
public const int assetCreateMenuPriority1 = 230
Field Value
Type |
Description |
System.Int32 |
|
Declaration
public const int assetCreateMenuPriority2 = 241
Field Value
Type |
Description |
System.Int32 |
|
Declaration
public const int editMenuPriority1 = 320
Field Value
Type |
Description |
System.Int32 |
|
Declaration
public const int editMenuPriority2 = 331
Field Value
Type |
Description |
System.Int32 |
|
Declaration
public const int editMenuPriority3 = 342
Field Value
Type |
Description |
System.Int32 |
|
Declaration
public const int gameObjectMenuPriority = 10
Field Value
Type |
Description |
System.Int32 |
|
lookAtList
Declaration
public static readonly Vector3[] lookAtList
Field Value
Type |
Description |
Vector3[] |
|
upVectorList
Declaration
public static readonly Vector3[] upVectorList
Field Value
Type |
Description |
Vector3[] |
|
Properties
blackCubeTexture
Declaration
public static Cubemap blackCubeTexture { get; }
Property Value
blackVolumeTexture
Declaration
public static Texture3D blackVolumeTexture { get; }
Property Value
Type |
Description |
Texture3D |
|
emptyUAV
Declaration
public static RenderTexture emptyUAV { get; }
Property Value
Type |
Description |
RenderTexture |
|
magentaCubeTexture
Declaration
public static Cubemap magentaCubeTexture { get; }
Property Value
whiteCubeTexture
Declaration
public static Cubemap whiteCubeTexture { get; }
Property Value
Methods
AreAnimatedMaterialsEnabled(Camera)
Declaration
public static bool AreAnimatedMaterialsEnabled(Camera camera)
Parameters
Type |
Name |
Description |
Camera |
camera |
|
Returns
Type |
Description |
System.Boolean |
|
ArePostProcessesEnabled(Camera)
Declaration
public static bool ArePostProcessesEnabled(Camera camera)
Parameters
Type |
Name |
Description |
Camera |
camera |
|
Returns
Type |
Description |
System.Boolean |
|
ClearCubemap(CommandBuffer, RenderTexture, Color, Boolean)
Declaration
public static void ClearCubemap(CommandBuffer cmd, RenderTexture renderTexture, Color clearColor, bool clearMips = false)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTexture |
renderTexture |
|
Color |
clearColor |
|
System.Boolean |
clearMips |
|
ClearRenderTarget(CommandBuffer, ClearFlag, Color)
Declaration
public static void ClearRenderTarget(CommandBuffer cmd, ClearFlag clearFlag, Color clearColor)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
ClearFlag |
clearFlag |
|
Color |
clearColor |
|
ConvertLinearToActiveColorSpace(Color)
Declaration
public static Color ConvertLinearToActiveColorSpace(Color color)
Parameters
Type |
Name |
Description |
Color |
color |
|
Returns
ConvertSRGBToActiveColorSpace(Color)
Declaration
public static Color ConvertSRGBToActiveColorSpace(Color color)
Parameters
Type |
Name |
Description |
Color |
color |
|
Returns
CreateCubeMesh(Vector3, Vector3)
Declaration
public static Mesh CreateCubeMesh(Vector3 min, Vector3 max)
Parameters
Type |
Name |
Description |
Vector3 |
min |
|
Vector3 |
max |
|
Returns
CreateEngineMaterial(Shader)
Declaration
public static Material CreateEngineMaterial(Shader shader)
Parameters
Type |
Name |
Description |
Shader |
shader |
|
Returns
Type |
Description |
Material |
|
CreateEngineMaterial(String)
Declaration
public static Material CreateEngineMaterial(string shaderPath)
Parameters
Type |
Name |
Description |
System.String |
shaderPath |
|
Returns
Type |
Description |
Material |
|
Destroy(Object)
Declaration
public static void Destroy(Object obj)
Parameters
Type |
Name |
Description |
UnityEngine.Object |
obj |
|
Destroy(Object[])
Declaration
public static void Destroy(params Object[] objs)
Parameters
Type |
Name |
Description |
UnityEngine.Object[] |
objs |
|
DisplayUnsupportedAPIMessage(String)
Declaration
public static void DisplayUnsupportedAPIMessage(string graphicAPI = null)
Parameters
Type |
Name |
Description |
System.String |
graphicAPI |
|
DisplayUnsupportedMessage(String)
Declaration
public static void DisplayUnsupportedMessage(string msg)
Parameters
Type |
Name |
Description |
System.String |
msg |
|
DisplayUnsupportedXRMessage()
Declaration
public static void DisplayUnsupportedXRMessage()
DrawFullScreen(CommandBuffer, Material, MaterialPropertyBlock, Int32)
Declaration
public static void DrawFullScreen(CommandBuffer commandBuffer, Material material, MaterialPropertyBlock properties = null, int shaderPassId = 0)
Parameters
Type |
Name |
Description |
CommandBuffer |
commandBuffer |
|
Material |
material |
|
MaterialPropertyBlock |
properties |
|
System.Int32 |
shaderPassId |
|
DrawFullScreen(CommandBuffer, Material, RenderTargetIdentifier, MaterialPropertyBlock, Int32)
Declaration
public static void DrawFullScreen(CommandBuffer commandBuffer, Material material, RenderTargetIdentifier colorBuffer, MaterialPropertyBlock properties = null, int shaderPassId = 0)
Parameters
Type |
Name |
Description |
CommandBuffer |
commandBuffer |
|
Material |
material |
|
RenderTargetIdentifier |
colorBuffer |
|
MaterialPropertyBlock |
properties |
|
System.Int32 |
shaderPassId |
|
DrawFullScreen(CommandBuffer, Material, RenderTargetIdentifier, RenderTargetIdentifier, MaterialPropertyBlock, Int32)
Declaration
public static void DrawFullScreen(CommandBuffer commandBuffer, Material material, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthStencilBuffer, MaterialPropertyBlock properties = null, int shaderPassId = 0)
Parameters
Type |
Name |
Description |
CommandBuffer |
commandBuffer |
|
Material |
material |
|
RenderTargetIdentifier |
colorBuffer |
|
RenderTargetIdentifier |
depthStencilBuffer |
|
MaterialPropertyBlock |
properties |
|
System.Int32 |
shaderPassId |
|
DrawFullScreen(CommandBuffer, Material, RenderTargetIdentifier[], MaterialPropertyBlock, Int32)
Declaration
public static void DrawFullScreen(CommandBuffer commandBuffer, Material material, RenderTargetIdentifier[] colorBuffers, MaterialPropertyBlock properties = null, int shaderPassId = 0)
Parameters
Type |
Name |
Description |
CommandBuffer |
commandBuffer |
|
Material |
material |
|
RenderTargetIdentifier[] |
colorBuffers |
|
MaterialPropertyBlock |
properties |
|
System.Int32 |
shaderPassId |
|
DrawFullScreen(CommandBuffer, Material, RenderTargetIdentifier[], RenderTargetIdentifier, MaterialPropertyBlock, Int32)
Declaration
public static void DrawFullScreen(CommandBuffer commandBuffer, Material material, RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthStencilBuffer, MaterialPropertyBlock properties = null, int shaderPassId = 0)
Parameters
Type |
Name |
Description |
CommandBuffer |
commandBuffer |
|
Material |
material |
|
RenderTargetIdentifier[] |
colorBuffers |
|
RenderTargetIdentifier |
depthStencilBuffer |
|
MaterialPropertyBlock |
properties |
|
System.Int32 |
shaderPassId |
|
GetAllAssemblyTypes()
Declaration
public static IEnumerable<Type> GetAllAssemblyTypes()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
GetAllTypesDerivedFrom<T>()
Declaration
public static IEnumerable<Type> GetAllTypesDerivedFrom<T>()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
Type Parameters
GetRenderTargetAutoName(Int32, Int32, Int32, RenderTextureFormat, String, Boolean, Boolean, MSAASamples)
Declaration
public static string GetRenderTargetAutoName(int width, int height, int depth, RenderTextureFormat format, string name, bool mips = false, bool enableMSAA = false, MSAASamples msaaSamples = MSAASamples.None)
Parameters
Type |
Name |
Description |
System.Int32 |
width |
|
System.Int32 |
height |
|
System.Int32 |
depth |
|
RenderTextureFormat |
format |
|
System.String |
name |
|
System.Boolean |
mips |
|
System.Boolean |
enableMSAA |
|
MSAASamples |
msaaSamples |
|
Returns
Type |
Description |
System.String |
|
GetTextureAutoName(Int32, Int32, TextureFormat, TextureDimension, String, Boolean, Int32)
Declaration
public static string GetTextureAutoName(int width, int height, TextureFormat format, TextureDimension dim = null, string name = "", bool mips = false, int depth = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
width |
|
System.Int32 |
height |
|
TextureFormat |
format |
|
TextureDimension |
dim |
|
System.String |
name |
|
System.Boolean |
mips |
|
System.Int32 |
depth |
|
Returns
Type |
Description |
System.String |
|
HasFlag<T>(T, T)
Declaration
public static bool HasFlag<T>(T mask, T flag)
where T : IConvertible
Parameters
Type |
Name |
Description |
T |
mask |
|
T |
flag |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
IsSceneViewFogEnabled(Camera)
Declaration
public static bool IsSceneViewFogEnabled(Camera camera)
Parameters
Type |
Name |
Description |
Camera |
camera |
|
Returns
Type |
Description |
System.Boolean |
|
SafeRelease(ComputeBuffer)
Declaration
public static void SafeRelease(ComputeBuffer buffer)
Parameters
Type |
Name |
Description |
ComputeBuffer |
buffer |
|
SelectKeyword(Material, String, String, Boolean)
Declaration
public static void SelectKeyword(Material material, string keyword1, string keyword2, bool enableFirst)
Parameters
Type |
Name |
Description |
Material |
material |
|
System.String |
keyword1 |
|
System.String |
keyword2 |
|
System.Boolean |
enableFirst |
|
SelectKeyword(Material, String[], Int32)
Declaration
public static void SelectKeyword(Material material, string[] keywords, int enabledKeywordIndex)
Parameters
Type |
Name |
Description |
Material |
material |
|
System.String[] |
keywords |
|
System.Int32 |
enabledKeywordIndex |
|
SetKeyword(CommandBuffer, String, Boolean)
Declaration
public static void SetKeyword(CommandBuffer cmd, string keyword, bool state)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
System.String |
keyword |
|
System.Boolean |
state |
|
SetKeyword(Material, String, Boolean)
Declaration
public static void SetKeyword(Material m, string keyword, bool state)
Parameters
Type |
Name |
Description |
Material |
m |
|
System.String |
keyword |
|
System.Boolean |
state |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier, RenderBufferLoadAction, RenderBufferStoreAction, RenderTargetIdentifier, RenderBufferLoadAction, RenderBufferStoreAction, ClearFlag)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier colorBuffer, RenderBufferLoadAction colorLoadAction, RenderBufferStoreAction colorStoreAction, RenderTargetIdentifier depthBuffer, RenderBufferLoadAction depthLoadAction, RenderBufferStoreAction depthStoreAction, ClearFlag clearFlag)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier |
colorBuffer |
|
RenderBufferLoadAction |
colorLoadAction |
|
RenderBufferStoreAction |
colorStoreAction |
|
RenderTargetIdentifier |
depthBuffer |
|
RenderBufferLoadAction |
depthLoadAction |
|
RenderBufferStoreAction |
depthStoreAction |
|
ClearFlag |
clearFlag |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier, RenderBufferLoadAction, RenderBufferStoreAction, RenderTargetIdentifier, RenderBufferLoadAction, RenderBufferStoreAction, ClearFlag, Color)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier colorBuffer, RenderBufferLoadAction colorLoadAction, RenderBufferStoreAction colorStoreAction, RenderTargetIdentifier depthBuffer, RenderBufferLoadAction depthLoadAction, RenderBufferStoreAction depthStoreAction, ClearFlag clearFlag, Color clearColor)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier |
colorBuffer |
|
RenderBufferLoadAction |
colorLoadAction |
|
RenderBufferStoreAction |
colorStoreAction |
|
RenderTargetIdentifier |
depthBuffer |
|
RenderBufferLoadAction |
depthLoadAction |
|
RenderBufferStoreAction |
depthStoreAction |
|
ClearFlag |
clearFlag |
|
Color |
clearColor |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier, RenderBufferLoadAction, RenderBufferStoreAction, ClearFlag)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier buffer, RenderBufferLoadAction loadAction, RenderBufferStoreAction storeAction, ClearFlag clearFlag)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier |
buffer |
|
RenderBufferLoadAction |
loadAction |
|
RenderBufferStoreAction |
storeAction |
|
ClearFlag |
clearFlag |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier, RenderBufferLoadAction, RenderBufferStoreAction, ClearFlag, Color)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier buffer, RenderBufferLoadAction loadAction, RenderBufferStoreAction storeAction, ClearFlag clearFlag, Color clearColor)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier |
buffer |
|
RenderBufferLoadAction |
loadAction |
|
RenderBufferStoreAction |
storeAction |
|
ClearFlag |
clearFlag |
|
Color |
clearColor |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier, RenderTargetIdentifier, Int32, CubemapFace, Int32)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, int miplevel = 0, CubemapFace cubemapFace = null, int depthSlice = 0)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier |
colorBuffer |
|
RenderTargetIdentifier |
depthBuffer |
|
System.Int32 |
miplevel |
|
CubemapFace |
cubemapFace |
|
System.Int32 |
depthSlice |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier, RenderTargetIdentifier, ClearFlag, Color, Int32, CubemapFace, Int32)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag, Color clearColor, int miplevel = 0, CubemapFace cubemapFace = null, int depthSlice = 0)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier |
colorBuffer |
|
RenderTargetIdentifier |
depthBuffer |
|
ClearFlag |
clearFlag |
|
Color |
clearColor |
|
System.Int32 |
miplevel |
|
CubemapFace |
cubemapFace |
|
System.Int32 |
depthSlice |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier, RenderTargetIdentifier, ClearFlag, Int32, CubemapFace, Int32)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag, int miplevel = 0, CubemapFace cubemapFace = null, int depthSlice = 0)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier |
colorBuffer |
|
RenderTargetIdentifier |
depthBuffer |
|
ClearFlag |
clearFlag |
|
System.Int32 |
miplevel |
|
CubemapFace |
cubemapFace |
|
System.Int32 |
depthSlice |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier, ClearFlag, Color, Int32, CubemapFace, Int32)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier buffer, ClearFlag clearFlag, Color clearColor, int miplevel = 0, CubemapFace cubemapFace = null, int depthSlice = 0)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier |
buffer |
|
ClearFlag |
clearFlag |
|
Color |
clearColor |
|
System.Int32 |
miplevel |
|
CubemapFace |
cubemapFace |
|
System.Int32 |
depthSlice |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier, ClearFlag, Int32, CubemapFace, Int32)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier buffer, ClearFlag clearFlag = ClearFlag.None, int miplevel = 0, CubemapFace cubemapFace = null, int depthSlice = 0)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier |
buffer |
|
ClearFlag |
clearFlag |
|
System.Int32 |
miplevel |
|
CubemapFace |
cubemapFace |
|
System.Int32 |
depthSlice |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier[], RenderTargetIdentifier)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthBuffer)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier[] |
colorBuffers |
|
RenderTargetIdentifier |
depthBuffer |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier[], RenderTargetIdentifier, ClearFlag)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag = ClearFlag.None)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier[] |
colorBuffers |
|
RenderTargetIdentifier |
depthBuffer |
|
ClearFlag |
clearFlag |
|
SetRenderTarget(CommandBuffer, RenderTargetIdentifier[], RenderTargetIdentifier, ClearFlag, Color)
Declaration
public static void SetRenderTarget(CommandBuffer cmd, RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthBuffer, ClearFlag clearFlag, Color clearColor)
Parameters
Type |
Name |
Description |
CommandBuffer |
cmd |
|
RenderTargetIdentifier[] |
colorBuffers |
|
RenderTargetIdentifier |
depthBuffer |
|
ClearFlag |
clearFlag |
|
Color |
clearColor |
|
Swap<T>(ref T, ref T)
Declaration
public static void Swap<T>(ref T a, ref T b)
Parameters
Type |
Name |
Description |
T |
a |
|
T |
b |
|
Type Parameters