Class for handling Cubemap arrays.
public override void OnPreviewGUI(Rect r, GUIStyle background) { if (!SystemInfo.supportsCubemapArrayTextures || (m_Material != null && !m_Material.shader.isSupported)) { if (Event.current.type == EventType.Repaint) { EditorGUI.DropShadowLabel(new Rect(r.x, r.y, r.width, 40), "Cubemap array preview is not supported"); } return; } CubemapArray t = (CubemapArray)target; m_Material.mainTexture = t; m_PreviewUtility.BeginPreview(r, background); const float previewDistance = 6.0f; m_PreviewDir = PreviewGUI.Drag2D(m_PreviewDir, r); m_PreviewUtility.camera.transform.position = -Vector3.forward * previewDistance; m_PreviewUtility.camera.transform.rotation = Quaternion.identity; Quaternion rot = Quaternion.Euler(m_PreviewDir.y, 0, 0) * Quaternion.Euler(0, m_PreviewDir.x, 0); m_PreviewUtility.DrawMesh(m_Mesh, Vector3.zero, rot, m_Material, 0); m_PreviewUtility.Render(); Texture renderedTexture = m_PreviewUtility.EndPreview(); GUI.DrawTexture(r, renderedTexture, ScaleMode.StretchToFill, false); EditorGUI.DropShadowLabel(new Rect(r.x, r.y + 10, r.width, 30), "Slice " + m_Slice + "\nMip " + m_Mip); }
private static void Internal_Create([Writable] CubemapArray mono, int ext, int count, int mipCount, GraphicsFormat format, TextureCreationFlags flags) { if (!Internal_CreateImpl(mono, ext, count, mipCount, format, flags)) { throw new UnityException("Failed to create cubemap array texture because of invalid parameters."); } }
static public int get_isReadable(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); pushValue(l, true); pushValue(l, self.isReadable); return(2); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
private static void Internal_Create([Writable] CubemapArray mono, int ext, int count, TextureFormat format, bool mipmap, bool linear) { if (!CubemapArray.Internal_CreateImpl(mono, ext, count, format, mipmap, linear)) { throw new UnityException("Failed to create cubemap array texture because of invalid parameters."); } }
static public int SetPixels32(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif int argc = LuaDLL.lua_gettop(l); if (argc == 4) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); UnityEngine.Color32[] a1; checkArray(l, 2, out a1); UnityEngine.CubemapFace a2; a2 = (UnityEngine.CubemapFace)LuaDLL.luaL_checkinteger(l, 3); System.Int32 a3; checkType(l, 4, out a3); self.SetPixels32(a1, a2, a3); pushValue(l, true); return(1); } else if (argc == 5) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); UnityEngine.Color32[] a1; checkArray(l, 2, out a1); UnityEngine.CubemapFace a2; a2 = (UnityEngine.CubemapFace)LuaDLL.luaL_checkinteger(l, 3); System.Int32 a3; checkType(l, 4, out a3); System.Int32 a4; checkType(l, 5, out a4); self.SetPixels32(a1, a2, a3, a4); pushValue(l, true); return(1); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function SetPixels32 to call"); return(2); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
static public int constructor(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); UnityEngine.CubemapArray o; if (argc == 7) { System.Int32 a1; checkType(l, 3, out a1); System.Int32 a2; checkType(l, 4, out a2); UnityEngine.TextureFormat a3; checkEnum(l, 5, out a3); System.Boolean a4; checkType(l, 6, out a4); System.Boolean a5; checkType(l, 7, out a5); o = new UnityEngine.CubemapArray(a1, a2, a3, a4, a5); pushValue(l, true); pushValue(l, o); return(2); } else if (matchType(l, "ctor__Int32__Int32__GraphicsFormat__TextureCreationFlags", argc, 2, typeof(int), typeof(int), typeof(UnityEngine.Experimental.Rendering.GraphicsFormat), typeof(UnityEngine.Experimental.Rendering.TextureCreationFlags))) { System.Int32 a1; checkType(l, 3, out a1); System.Int32 a2; checkType(l, 4, out a2); UnityEngine.Experimental.Rendering.GraphicsFormat a3; checkEnum(l, 5, out a3); UnityEngine.Experimental.Rendering.TextureCreationFlags a4; checkEnum(l, 6, out a4); o = new UnityEngine.CubemapArray(a1, a2, a3, a4); pushValue(l, true); pushValue(l, o); return(2); } else if (matchType(l, "ctor__Int32__Int32__TextureFormat__Boolean", argc, 2, typeof(int), typeof(int), typeof(UnityEngine.TextureFormat), typeof(bool))) { System.Int32 a1; checkType(l, 3, out a1); System.Int32 a2; checkType(l, 4, out a2); UnityEngine.TextureFormat a3; checkEnum(l, 5, out a3); System.Boolean a4; checkType(l, 6, out a4); o = new UnityEngine.CubemapArray(a1, a2, a3, a4); pushValue(l, true); pushValue(l, o); return(2); } return(error(l, "New object failed.")); } catch (Exception e) { return(error(l, e)); } }
static public int Apply(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif int argc = LuaDLL.lua_gettop(l); if (argc == 1) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); self.Apply(); pushValue(l, true); return(1); } else if (argc == 2) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); self.Apply(a1); pushValue(l, true); return(1); } else if (argc == 3) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); System.Boolean a2; checkType(l, 3, out a2); self.Apply(a1, a2); pushValue(l, true); return(1); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function Apply to call"); return(2); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
public CubemapArray(int width, int cubemapCount, GraphicsFormat format, TextureCreationFlags flags, int mipCount) { bool flag = !base.ValidateFormat(format, FormatUsage.Sample); if (!flag) { CubemapArray.ValidateIsNotCrunched(flags); CubemapArray.Internal_Create(this, width, cubemapCount, mipCount, format, flags); } }
static public int get_format(IntPtr l) { try { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); pushValue(l, true); pushEnum(l, (int)self.format); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int get_isReadable(IntPtr l) { try { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); pushValue(l, true); pushValue(l, self.isReadable); return(2); } catch (Exception e) { return(error(l, e)); } }
public CubemapArray(int width, int cubemapCount, TextureFormat textureFormat, int mipCount, [DefaultValue("true")] bool linear) { bool flag = !base.ValidateFormat(textureFormat); if (!flag) { GraphicsFormat graphicsFormat = GraphicsFormatUtility.GetGraphicsFormat(textureFormat, !linear); TextureCreationFlags textureCreationFlags = (mipCount != 1) ? TextureCreationFlags.MipChain : TextureCreationFlags.None; bool flag2 = GraphicsFormatUtility.IsCrunchFormat(textureFormat); if (flag2) { textureCreationFlags |= TextureCreationFlags.Crunch; } CubemapArray.ValidateIsNotCrunched(textureCreationFlags); CubemapArray.Internal_Create(this, width, cubemapCount, mipCount, graphicsFormat, textureCreationFlags); } }
public override void OnPreviewSettings() { CubemapArray t = (CubemapArray)target; EditorGUI.BeginDisabledGroup(t.cubemapCount <= 1); EditorGUILayout.LabelField(Styles.slice, GUILayout.Width(40)); m_Slice = EditorGUILayout.IntSlider(m_Slice, 0, t.cubemapCount - 1, GUILayout.Width(120)); EditorGUI.EndDisabledGroup(); m_Material.SetInt("_SliceIndex", m_Slice); EditorGUI.BeginDisabledGroup(m_MipCount == 0); GUILayout.Box(EditorGUIUtility.IconContent("PreTextureMipMapLow"), Styles.toolbarLabel); m_Mip = Mathf.RoundToInt(GUILayout.HorizontalSlider(m_Mip, m_MipCount - 1, 0, GUILayout.Width(64))); GUILayout.Box(EditorGUIUtility.IconContent("PreTextureMipMapHigh"), Styles.toolbarLabel); EditorGUI.EndDisabledGroup(); m_Material.SetFloat("_Mip", m_Mip); }
static public int constructor(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); UnityEngine.CubemapArray o; if (argc == 5) { System.Int32 a1; checkType(l, 2, out a1); System.Int32 a2; checkType(l, 3, out a2); UnityEngine.TextureFormat a3; checkEnum(l, 4, out a3); System.Boolean a4; checkType(l, 5, out a4); o = new UnityEngine.CubemapArray(a1, a2, a3, a4); pushValue(l, true); pushValue(l, o); return(2); } else if (argc == 6) { System.Int32 a1; checkType(l, 2, out a1); System.Int32 a2; checkType(l, 3, out a2); UnityEngine.TextureFormat a3; checkEnum(l, 4, out a3); System.Boolean a4; checkType(l, 5, out a4); System.Boolean a5; checkType(l, 6, out a5); o = new UnityEngine.CubemapArray(a1, a2, a3, a4, a5); pushValue(l, true); pushValue(l, o); return(2); } return(error(l, "New object failed.")); } catch (Exception e) { return(error(l, e)); } }
static public int SetPixels32(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (argc == 6) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); UnityEngine.Color32[] a1; checkArray(l, 3, out a1); UnityEngine.CubemapFace a2; checkEnum(l, 4, out a2); System.Int32 a3; checkType(l, 5, out a3); System.Int32 a4; checkType(l, 6, out a4); self.SetPixels32(a1, a2, a3, a4); pushValue(l, true); return(1); } else if (argc == 5) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); UnityEngine.Color32[] a1; checkArray(l, 3, out a1); UnityEngine.CubemapFace a2; checkEnum(l, 4, out a2); System.Int32 a3; checkType(l, 5, out a3); self.SetPixels32(a1, a2, a3); pushValue(l, true); return(1); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function to call"); return(2); } catch (Exception e) { return(error(l, e)); } }
public override void OnPreviewSettings() { CubemapArray t = (CubemapArray)target; EditorGUI.BeginDisabledGroup(t.cubemapCount <= 1); EditorGUILayout.LabelField(Styles.slice, GUILayout.Width(40)); m_Slice = EditorGUILayout.IntSlider(m_Slice, 0, t.cubemapCount - 1, GUILayout.Width(120)); EditorGUI.EndDisabledGroup(); m_Material.SetFloat("_SliceIndex", (float)m_Slice); EditorGUI.BeginDisabledGroup(!TextureUtil.NeedsExposureControl(t)); m_ExposureSliderValue = EditorGUIInternal.ExposureSlider(m_ExposureSliderValue, ref m_ExposureSliderMax, EditorStyles.toolbarSlider); EditorGUI.EndDisabledGroup(); m_Material.SetFloat("_Exposure", GetExposureValueForTexture(t)); EditorGUI.BeginDisabledGroup(m_MipCount == 0); GUILayout.Box(EditorGUIUtility.IconContent("PreTextureMipMapLow"), Styles.toolbarLabel); m_Mip = Mathf.RoundToInt(GUILayout.HorizontalSlider(m_Mip, m_MipCount - 1, 0, GUILayout.Width(64))); GUILayout.Box(EditorGUIUtility.IconContent("PreTextureMipMapHigh"), Styles.toolbarLabel); EditorGUI.EndDisabledGroup(); m_Material.SetFloat("_Mip", m_Mip); }
static public int Apply(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (argc == 4) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); System.Boolean a1; checkType(l, 3, out a1); System.Boolean a2; checkType(l, 4, out a2); self.Apply(a1, a2); pushValue(l, true); return(1); } else if (argc == 3) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); System.Boolean a1; checkType(l, 3, out a1); self.Apply(a1); pushValue(l, true); return(1); } else if (argc == 2) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); self.Apply(); pushValue(l, true); return(1); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function to call"); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int GetPixels32(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); if (argc == 3) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); UnityEngine.CubemapFace a1; checkEnum(l, 2, out a1); System.Int32 a2; checkType(l, 3, out a2); var ret = self.GetPixels32(a1, a2); pushValue(l, true); pushValue(l, ret); return(2); } else if (argc == 4) { UnityEngine.CubemapArray self = (UnityEngine.CubemapArray)checkSelf(l); UnityEngine.CubemapFace a1; checkEnum(l, 2, out a1); System.Int32 a2; checkType(l, 3, out a2); System.Int32 a3; checkType(l, 4, out a3); var ret = self.GetPixels32(a1, a2, a3); pushValue(l, true); pushValue(l, ret); return(2); } pushValue(l, false); LuaDLL.lua_pushstring(l, "No matched override function to call"); return(2); } catch (Exception e) { return(error(l, e)); } }
public CubemapArray(int faceSize, int cubemapCount, TextureFormat format, bool mipmap, [DefaultValue("false")] bool linear) { CubemapArray.Internal_Create(this, faceSize, cubemapCount, format, mipmap, linear); }
extern private static bool Internal_CreateImpl([Writable] CubemapArray mono, int ext, int count, int mipCount, GraphicsFormat format, TextureCreationFlags flags);
private static bool Internal_CreateImpl([Writable] /* 0x00000001800D4E50-0x00000001800D4E60 */ CubemapArray mono, int ext, int count, int mipCount, GraphicsFormat format, TextureCreationFlags flags) => default; // 0x0000000180965BE0-0x0000000180965C40 private static void Internal_Create([Writable] /* 0x00000001800D4E50-0x00000001800D4E60 */ CubemapArray mono, int ext, int count, int mipCount, GraphicsFormat format, TextureCreationFlags flags) { } // 0x0000000180965C40-0x0000000180965D00
[FreeFunction] // 0x00000001800E2830-0x00000001800E2860 private static bool Internal_CreateImpl([Writable] /* 0x00000001800D4E50-0x00000001800D4E60 */ CubemapArray mono, int ext, int count, int mipCount, GraphicsFormat format, TextureCreationFlags flags) => default; // 0x0000000180965BE0-0x0000000180965C40
private static extern void Internal_Create([Writable] CubemapArray mono, int faceSize, int cubemapCount, TextureFormat format, bool mipmap, bool linear);
static public int constructor(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif int argc = LuaDLL.lua_gettop(l); UnityEngine.CubemapArray o; if (matchType(l, argc, 2, typeof(int), typeof(int), typeof(UnityEngine.Experimental.Rendering.GraphicsFormat), typeof(UnityEngine.Experimental.Rendering.TextureCreationFlags))) { System.Int32 a1; checkType(l, 2, out a1); System.Int32 a2; checkType(l, 3, out a2); UnityEngine.Experimental.Rendering.GraphicsFormat a3; a3 = (UnityEngine.Experimental.Rendering.GraphicsFormat)LuaDLL.luaL_checkinteger(l, 4); UnityEngine.Experimental.Rendering.TextureCreationFlags a4; a4 = (UnityEngine.Experimental.Rendering.TextureCreationFlags)LuaDLL.luaL_checkinteger(l, 5); o = new UnityEngine.CubemapArray(a1, a2, a3, a4); pushValue(l, true); pushValue(l, o); return(2); } else if (argc == 6) { System.Int32 a1; checkType(l, 2, out a1); System.Int32 a2; checkType(l, 3, out a2); UnityEngine.TextureFormat a3; a3 = (UnityEngine.TextureFormat)LuaDLL.luaL_checkinteger(l, 4); System.Boolean a4; checkType(l, 5, out a4); System.Boolean a5; checkType(l, 6, out a5); o = new UnityEngine.CubemapArray(a1, a2, a3, a4, a5); pushValue(l, true); pushValue(l, o); return(2); } else if (matchType(l, argc, 2, typeof(int), typeof(int), typeof(UnityEngine.TextureFormat), typeof(bool))) { System.Int32 a1; checkType(l, 2, out a1); System.Int32 a2; checkType(l, 3, out a2); UnityEngine.TextureFormat a3; a3 = (UnityEngine.TextureFormat)LuaDLL.luaL_checkinteger(l, 4); System.Boolean a4; checkType(l, 5, out a4); o = new UnityEngine.CubemapArray(a1, a2, a3, a4); pushValue(l, true); pushValue(l, o); return(2); } return(error(l, "New object failed.")); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
public CubemapArray(int faceSize, int cubemapCount, TextureFormat format, bool mipmap) { CubemapArray.Internal_Create(this, faceSize, cubemapCount, format, mipmap, false); }
private static extern bool Internal_CreateImpl([Writable] CubemapArray mono, int ext, int count, TextureFormat format, bool mipmap, bool linear);