ソースを参照

Editor: Fix material browser.

Mugen87 5 年 前
コミット
e66bcfe003
2 ファイル変更10 行追加1 行削除
  1. 8 0
      editor/css/main.css
  2. 2 1
      editor/js/Sidebar.Material.js

+ 8 - 0
editor/css/main.css

@@ -661,4 +661,12 @@ select {
 		background: #222;
 	}
 
+	.Listbox .ListboxItem:hover {
+		background-color: rgba(21,60,94,0.5);
+	}
+
+	.Listbox .ListboxItem.active {
+		background-color: rgba(21,60,94,1);
+	}
+
 }

+ 2 - 1
editor/js/Sidebar.Material.js

@@ -603,13 +603,14 @@ var SidebarMaterial = function ( editor ) {
 
 				material = new materialClasses[ materialClass.getValue() ]();
 
-				if ( material.type == "RawShaderMaterial" ) {
+				if ( material.type === "RawShaderMaterial" ) {
 
 					material.vertexShader = vertexShaderVariables + material.vertexShader;
 
 				}
 
 				editor.execute( new SetMaterialCommand( editor, currentObject, material, currentMaterialSlot ), 'New Material: ' + materialClass.getValue() );
+				editor.addMaterial( material );
 				// TODO Copy other references in the scene graph
 				// keeping name and UUID then.
 				// Also there should be means to create a unique