コード例 #1
0
        private static GLTFWrap GetWrapMode(this TextureWrapMode wrapMode)
        {
            switch (wrapMode)
            {
            case TextureWrapMode.Clamp:
                return(GLTFWrap.CLAMP_TO_EDGE);

            case TextureWrapMode.Repeat:
                return(GLTFWrap.REPEAT);

            case TextureWrapMode.Mirror:
            case TextureWrapMode.MirrorOnce:
                return(GLTFWrap.MIRRORED_REPEAT);

            default:
                throw new NotImplementedException(wrapMode.ToString());
            }
        }
コード例 #2
0
ファイル: TextureUtil2.cs プロジェクト: Hengle/UnityLearn-1
        // Token: 0x060003DD RID: 989 RVA: 0x000349BC File Offset: 0x00032BBC
        public static string GetWrapModeString(TextureWrapMode value)
        {
            switch ((int)value)
            {
            case -1:
            case 0:
                return("Repeat");

            case 1:
                return("Clamp");

            case 2:
                return("Mirror");

            case 3:
                return("Mirror Once");

            default:
                return(value.ToString());
            }
        }
コード例 #3
0
ファイル: BRT_TextureDataGenerator.cs プロジェクト: avi9111/x
        static string WrapModeToReadableString(TextureWrapMode wrapMode)
        {
            switch (wrapMode)
            {
            case TextureWrapMode.Repeat:
                return("Repeat");

            case TextureWrapMode.Clamp:
                return("Clamp");

            case TextureWrapMode.Mirror:
                return("Mirror");

            case TextureWrapMode.MirrorOnce:
                return("MirrorOnce");

            default:
                if ((int)wrapMode == -1)
                {
                    return(WRAP_MODE_IF_VALUE_IS_NEGATIVE_ONE);
                }
                return(string.Format("Unrecognized ({0})", wrapMode.ToString()));
            }
        }
コード例 #4
0
    public override void DrawImportSettings()
    {
        string          path            = AssetDatabase.GUIDToAssetPath(guid);
        TextureImporter textureImporter = AssetImporter.GetAtPath(path) as TextureImporter;

        //If importer is still null, asset can't be found at path
        if (textureImporter == null)
        {
            GUILayout.Label("Texture Asset with GUID: " + guid + " no longer exists.");
        }
        else
        {
            //Name
            GUILayout.Label("Name: " + name);
            //Path
            GUILayout.Label("Path: " + path);
            //GUID
            GUILayout.Label("GUID: " + guid);

            //Aniso level
            GUILayout.Label("Aniso level: " + anisoLevel.ToString(), textureImporter.anisoLevel != anisoLevel ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Border mipmap
            GUILayout.Label("Border mipmap: " + borderMipmap.ToString(), textureImporter.borderMipmap != borderMipmap ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Convert to normal map
            GUILayout.Label("Conver to normal map: " + convertToNormalmap.ToString(), textureImporter.convertToNormalmap != convertToNormalmap ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Correct gamma
            GUILayout.Label("Correct gamma: " + generateMipsInLinearSpace.ToString(), textureImporter.generateMipsInLinearSpace != generateMipsInLinearSpace ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Fadeout
            GUILayout.Label("Fadeout: " + fadeout.ToString(), textureImporter.fadeout != fadeout ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Filter mode
            GUILayout.Label("Filter mode: " + filterMode.ToString(), textureImporter.filterMode != filterMode ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Generate cubemap
            GUILayout.Label("Generate cubemap: " + generateCubemap.ToString(), textureImporter.generateCubemap != generateCubemap ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Heightmap scale
            GUILayout.Label("Heightmap scale: " + heightmapScale.ToString(), textureImporter.heightmapScale != heightmapScale ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Is readable
            GUILayout.Label("Is readable: " + isReadable.ToString(), textureImporter.isReadable != isReadable ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Lightmap
            GUILayout.Label("Lightmap: " + lightmap.ToString(), textureImporter.lightmap != lightmap ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Max texture size
            GUILayout.Label("Max texture size: " + maxTextureSize.ToString(), textureImporter.maxTextureSize != maxTextureSize ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Mipmap bias
            GUILayout.Label("Mipmap bias: " + mipMapBias.ToString(), textureImporter.mipMapBias != mipMapBias ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Mipmap enabled
            GUILayout.Label("Mipmap enabled: " + mipmapEnabled.ToString(), textureImporter.mipmapEnabled != mipmapEnabled ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Mipmap fade distance start
            GUILayout.Label("Mipmap fade distance start: " + mipmapFadeDistanceStart.ToString(), textureImporter.mipmapFadeDistanceStart != mipmapFadeDistanceStart ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Mipmap fade distance end
            GUILayout.Label("Mipmap fade distance end: " + mipmapFadeDistanceEnd.ToString(), textureImporter.mipmapFadeDistanceEnd != mipmapFadeDistanceEnd ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Mipmap filter
            GUILayout.Label("Mipmap filter: " + mipmapFilter.ToString(), textureImporter.mipmapFilter != mipmapFilter ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Normalmap
            GUILayout.Label("Normalmap: " + normalmap.ToString(), textureImporter.normalmap != normalmap ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Normalmap filter
            GUILayout.Label("Normalmap filter: " + normalmapFilter.ToString(), textureImporter.normalmapFilter != normalmapFilter ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //NPOT scale
            GUILayout.Label("NPOT scale: " + npotScale.ToString(), textureImporter.npotScale != npotScale ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Texture format
            GUILayout.Label("Texture format: " + textureFormat.ToString(), textureImporter.textureFormat != textureFormat ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Texture type
            GUILayout.Label("Texture type: " + textureType.ToString(), textureImporter.textureType != textureType ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
            //Wrap mode
            GUILayout.Label("Wrap mode: " + wrapMode.ToString(), textureImporter.wrapMode != wrapMode ? AssetSettingsWindow.singleton.redTextStyle : EditorStyles.label);
        }
    }