private JSONObject WriteMaterial(Material material) { JSONObject materialObject = new JSONObject(); if (ResourcesDirectory.IsCustomMaterial(material)) { materialObject["mode"] = ResourcesDirectory.GetCustomMaterialColorMode(material).ToString(); materialObject["color"] = WriteColor(material.color); materialObject["alpha"] = ResourcesDirectory.GetCustomMaterialIsTransparent(material); } else { materialObject["name"] = material.name; } return(materialObject); }
private static MessagePackObjectDictionary WriteMaterial(Material material, bool specifyAlphaMode) { var materialDict = new MessagePackObjectDictionary(); if (ResourcesDirectory.IsCustomMaterial(material)) { materialDict[FileKeys.MATERIAL_MODE] = ResourcesDirectory.GetCustomMaterialColorMode(material).ToString(); materialDict[FileKeys.MATERIAL_COLOR] = WriteColor(material.color); if (specifyAlphaMode) { materialDict[FileKeys.MATERIAL_ALPHA] = ResourcesDirectory.GetCustomMaterialIsTransparent(material); } } else { materialDict[FileKeys.MATERIAL_NAME] = material.name; } return(materialDict); }
public void Start() { if (colorModeSet == ColorModeSet.UNLIT_ONLY) { colorMode = ColorMode.UNLIT; } else { colorMode = ColorMode.MATTE; } materialDirectory = rootDirectory; UpdateMaterialDirectory(); if (highlightMaterial != null && ResourcesDirectory.IsCustomMaterial(highlightMaterial)) { highlightMaterial = Instantiate(highlightMaterial); tab = 0; colorMode = ResourcesDirectory.GetCustomMaterialColorMode(highlightMaterial); } else { tab = 1; } }