Advertisement
Xibanya

shiny maps custom editor

Nov 5th, 2019
672
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. void ShinyMaps()
  2. {
  3. GUILayout.Label("Shiny Maps", EditorStyles.boldLabel);
  4. SmoothSource smoothSource = GetKeyword(smoothKeywords);
  5. MetalSource metalSource = GetKeyword(metalKeywords);
  6. OcclusionSource aoSource = GetKeyword(aoKeywords);
  7.  
  8. bool useFirstMap = metalSource != MetalSource.None ||
  9. smoothSource == SmoothSource.FirstMapRedChannel || smoothSource == SmoothSource.MetallicAlpha ||
  10. aoSource == OcclusionSource.FirstMapBlueChannel || aoSource == OcclusionSource.FirstMapGreenChannel;
  11. bool useSecondMap = smoothSource == SmoothSource.SecondMapRedChannel;
  12. bool useAOMap = aoSource == OcclusionSource.OcclusionMap;
  13. int indent = useFirstMap || useSecondMap || useAOMap ? 2 : 0;
  14.  
  15. if (useFirstMap) SingleLineTexture("_MetallicGlossMap", "_Metallic", displayName: "Metallic");
  16. if (useSecondMap) SingleLineTexture("_SpecGlossMap", "_Glossiness");
  17. if (!useFirstMap) Property("_Metallic", labelIndent: indent);
  18. if (!useSecondMap) Property("_Glossiness", labelIndent: indent);
  19. if (useAOMap) SingleLineTexture("_OcclusionMap", "_OcclusionStrength");
  20. else Property("_OcclusionStrength", labelIndent: indent);
  21.  
  22. EditorGUILayout.Space();
  23.  
  24. KeywordDropdown(smoothKeywords, smoothSource, "Smoothness Source",
  25. "Select none for smoothness to be controlled entirely by slider");
  26. KeywordDropdown(metalKeywords, metalSource, "Metallic Source",
  27. "Select none for metallic to be controlled entirely by slider");
  28. KeywordDropdown(aoKeywords, aoSource, "OcclusionSource");
  29. KeywordToggle("_ROUGHNESS_ON", "Using roughness?");
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement