Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Remove UniUnlit's cull front mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Santarh committed Oct 9, 2018
1 parent 03e1c46 commit d98fbe7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Core/Scripts/IO/MaterialExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private glTFMaterial Export_UniUnlit(Material m)
}

var cullMode = UniUnlit.Utils.GetCullMode(m);
if (cullMode == CullMode.Off)
if (cullMode == UniUnlitCullMode.Off)
{
material.doubleSided = true;
}
Expand Down
4 changes: 2 additions & 2 deletions Core/Scripts/IO/MaterialImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ public virtual Material CreateMaterial(int i, glTFMaterial x)
// culling
if (x.doubleSided)
{
UniUnlit.Utils.SetCullMode(material, CullMode.Off);
UniUnlit.Utils.SetCullMode(material, UniUnlit.UniUnlitCullMode.Off);
}
else
{
UniUnlit.Utils.SetCullMode(material, CullMode.Back);
UniUnlit.Utils.SetCullMode(material, UniUnlit.UniUnlitCullMode.Back);
}

UniUnlit.Utils.ValidateProperties(material, true);
Expand Down
2 changes: 1 addition & 1 deletion UniUnlit/Editor/UniUnlitEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private void DrawRenderingBox(MaterialEditor materialEditor, Material[] material
{
ModeChanged(materials, isRenderModeChangedByUser: true);
}
if (PopupEnum<CullMode>("Cull Mode", _cullMode, materialEditor))
if (PopupEnum<UniUnlitCullMode>("Cull Mode", _cullMode, materialEditor))
{
ModeChanged(materials, isRenderModeChangedByUser: true);
}
Expand Down
15 changes: 11 additions & 4 deletions UniUnlit/Scripts/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ public enum UniUnlitRenderMode
Transparent = 2,
}

public enum UniUnlitCullMode
{
Off = 0,
// Front = 1,
Back = 2,
}

public enum UniUnlitVertexColorBlendOp
{
None = 0,
Multiply = 1,
}

public static class Utils
{
public const string PropNameMainTex = "_MainTex";
Expand Down Expand Up @@ -44,7 +51,7 @@ public static void SetRenderMode(Material material, UniUnlitRenderMode mode)
material.SetInt(PropNameBlendMode, (int)mode);
}

public static void SetCullMode(Material material, CullMode mode)
public static void SetCullMode(Material material, UniUnlitCullMode mode)
{
material.SetInt(PropNameCullMode, (int) mode);
}
Expand All @@ -54,9 +61,9 @@ public static UniUnlitRenderMode GetRenderMode(Material material)
return (UniUnlitRenderMode)material.GetInt(PropNameBlendMode);
}

public static CullMode GetCullMode(Material material)
public static UniUnlitCullMode GetCullMode(Material material)
{
return (CullMode)material.GetInt(PropNameCullMode);
return (UniUnlitCullMode)material.GetInt(PropNameCullMode);
}

/// <summary>
Expand Down

0 comments on commit d98fbe7

Please sign in to comment.