Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
    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;
        }
    }