private void ShowFace(string label, CubemapFace face) { Cubemap cubemapRef = base.target as Cubemap; GUI.changed = false; Texture2D texture2D = (Texture2D)CubemapInspector.ObjectField(label, this.m_Images[(int)face], typeof(Texture2D), false, new GUILayoutOption[0]); if (GUI.changed) { TextureUtil.CopyTextureIntoCubemapFace(texture2D, cubemapRef, face); this.m_Images[(int)face] = texture2D; } }
private void ShowFace(string label, CubemapFace face) { Cubemap target = this.target as Cubemap; int index = (int)face; GUI.changed = false; Texture2D textureRef = (Texture2D)ObjectField(label, this.m_Images[index], typeof(Texture2D), false, new GUILayoutOption[0]); if (GUI.changed) { TextureUtil.CopyTextureIntoCubemapFace(textureRef, target, face); this.m_Images[index] = textureRef; } }
private void ShowFace(string label, CubemapFace face) { Cubemap target = this.target as Cubemap; int index = (int)face; GUI.changed = false; Texture2D textureRef = (Texture2D)CubemapInspector.ObjectField(label, (UnityEngine.Object) this.m_Images[index], typeof(Texture2D), false); if (!GUI.changed) { return; } TextureUtil.CopyTextureIntoCubemapFace(textureRef, target, face); this.m_Images[index] = textureRef; }
private void ShowFace(string label, CubemapFace face) { var c = target as Cubemap; var iface = (int)face; GUI.changed = false; var tex = (Texture2D)ObjectField(label, m_Images[iface], typeof(Texture2D), false); if (GUI.changed) { TextureUtil.CopyTextureIntoCubemapFace(tex, c, face); // enable this line in order to retain connections from cube faces to their corresponding // texture2D assets, this allows auto-update functionality when editing the source texture // images //TextureUtil.SetSourceTexture(c, face, tex); m_Images[iface] = tex; } }