Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Oct 9, 2018
1 parent eaba40f commit 9266e4c
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 185 deletions.
76 changes: 0 additions & 76 deletions Assets/Coffee/UIExtensions/UIEffect/Materials/ParameterTexture.mat

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ public interface IParameterTexture
int parameterIndex { get; set; }

ParameterTexture ptex { get; }

Material ptexMaterial { get; }
}

/// <summary>
Expand Down Expand Up @@ -53,10 +51,6 @@ public ParameterTexture(int channels, int instanceLimit, string propertyName)
/// <param name="target">Target.</param>
public void Register(IParameterTexture target)
{
if (!_material && target.ptexMaterial)
{
_material = target.ptexMaterial;
}
Initialize();
if (target.parameterIndex <= 0 && 0 < _stack.Count)
{
Expand Down Expand Up @@ -146,7 +140,6 @@ public float GetNormalizedIndex(IParameterTexture target)
readonly byte[] _data;
readonly Stack<int> _stack;
static List<Action> updates;
static Material _material;

/// <summary>
/// Initialize this instance.
Expand Down
25 changes: 0 additions & 25 deletions Assets/Coffee/UIExtensions/UIEffect/Scripts/Common/UIEffectBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public abstract class UIEffectBase : BaseMeshEffect, IParameterTexture
[HideInInspector]
[SerializeField] int m_Version;
[SerializeField] protected Material m_EffectMaterial;
[SerializeField] protected Material m_PtexMaterial;

/// <summary>
/// Gets or sets the parameter index.
Expand All @@ -34,11 +33,6 @@ public abstract class UIEffectBase : BaseMeshEffect, IParameterTexture
/// </summary>
public virtual ParameterTexture ptex { get { return null; } }

/// <summary>
/// Gets the ptex material.
/// </summary>
public virtual Material ptexMaterial { get { return m_PtexMaterial; } }

/// <summary>
/// Gets target graphic for effect.
/// </summary>
Expand All @@ -61,9 +55,6 @@ protected override void Reset()
/// </summary>
protected override void OnValidate()
{
#if UNITY_EDITOR
SetupPtexMaterial();
#endif
var mat = GetMaterial();
if (m_EffectMaterial != mat)
{
Expand All @@ -82,7 +73,6 @@ public void OnBeforeSerialize()

public void OnAfterDeserialize()
{
UnityEditor.EditorApplication.delayCall += SetupPtexMaterial;
UnityEditor.EditorApplication.delayCall += UpgradeIfNeeded;
}

Expand Down Expand Up @@ -119,18 +109,6 @@ protected virtual Material GetMaterial()
{
return null;
}

protected void SetupPtexMaterial()
{
if (!m_PtexMaterial)
{
m_PtexMaterial = UnityEditor.AssetDatabase.FindAssets("t:Material ParameterTexture")
.Select(x => UnityEditor.AssetDatabase.GUIDToAssetPath(x))
.Where(x => Path.GetFileNameWithoutExtension(x) == "ParameterTexture")
.Select(x => UnityEditor.AssetDatabase.LoadAssetAtPath<Material>(x))
.FirstOrDefault();
}
}
#endif

/// <summary>
Expand All @@ -146,9 +124,6 @@ public virtual void ModifyMaterial()
/// </summary>
protected override void OnEnable()
{
#if UNITY_EDITOR
SetupPtexMaterial();
#endif
if (ptex != null)
{
ptex.Register(this);
Expand Down
5 changes: 0 additions & 5 deletions Assets/Coffee/UIExtensions/UIEffect/Scripts/UIShadow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ public ShadowStyle style
/// </summary>
public ParameterTexture ptex{ get; private set; }

/// <summary>
/// Gets the ptex material.
/// </summary>
public virtual Material ptexMaterial { get { return null; } }

int _graphicVertexCount;
int _start;
int _end;
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 9266e4c

Please sign in to comment.