Skip to content

Commit

Permalink
addressing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
w1n7er87 committed Nov 29, 2023
1 parent a5ad9eb commit 4bda49d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
8 changes: 1 addition & 7 deletions Unity/Assets/Scripts/SCHIZO/Utilities/T2DArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class T2DArray : ScriptableObject

private void OnValidate()
{
if (textures.Count > 1 ) ClearEmpty(textures);
if (textures.Count > 1 ) textures.RemoveAll(o => o == null);
tooFewTextures = textures.Count < 2;

if (textures.Count > 1 && textures[0] != null)
Expand All @@ -37,12 +37,6 @@ private void OnValidate()
}
}

private List<T> ClearEmpty<T>(List<T> list)
{
list.RemoveAll(o => o.GetType() == typeof(T));
return list;
}

public Texture2DArray PopulateTexture2DArray()
{
List<Texture> tt = textures;
Expand Down
12 changes: 4 additions & 8 deletions Unity/Assets/Scripts/SCHIZO/VFX/MatPassID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ public void SetVector(string name, Vector4 value)
int id = Shader.PropertyToID(name);

vectors ??= [];
if (vectors.ContainsKey(id)) { vectors[id] = value; }
else { vectors.Add(id, value); }
vectors[id] = value;
}

private Dictionary<int, float> floats;
Expand All @@ -44,8 +43,7 @@ public void SetFloat(string name, float value)
int id = Shader.PropertyToID(name);

floats ??= [];
if (floats.ContainsKey(id)) { floats[id] = value; }
else{ floats.Add(id, value); }
floats[id] = value;
}

private Dictionary<int, Color> colors;
Expand All @@ -54,8 +52,7 @@ public void SetColor(string name, Color value)
int id = Shader.PropertyToID(name);

colors ??= [];
if (colors.ContainsKey(id)) { colors[id] = value; }
else { colors.Add(id, value); }
colors[id] = value;
}

private Dictionary<int, Texture> textures;
Expand All @@ -64,8 +61,7 @@ public void SetTexture(string name, Texture value)
int id = Shader.PropertyToID(name);

textures ??= [];
if (textures.ContainsKey(id)) { textures[id] = value; }
else { textures.Add(id, value); }
textures[id] = value;
}

public Material ApplyProperties(out int ID)
Expand Down

0 comments on commit 4bda49d

Please sign in to comment.