Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ void DoCurvesGUI(bool hdr)

for (int i = 1; i < hLines; i++)
{
var offset = i * Vector2.right * gridOffset;
var offset = gridOffset * i * Vector2.right;
offset.x += gridPadding;
Handles.DrawLine(innerRect.position + offset, new Vector2(innerRect.x, innerRect.yMax - 1) + offset);
}
Expand All @@ -650,7 +650,7 @@ void DoCurvesGUI(bool hdr)

for (int i = 1; i < vLines; i++)
{
var offset = i * Vector2.up * gridOffset;
var offset = gridOffset * i * Vector2.up;
offset.y += gridPadding;
Handles.DrawLine(innerRect.position + offset, new Vector2(innerRect.xMax - 1, innerRect.y) + offset);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ public override void OnEnable()

var fields = target.GetType()
.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
.Where(t => t.FieldType.IsSubclassOf(typeof(ParameterOverride)) && t.Name != "enabled")
.Where(t =>
(t.IsPublic && t.GetCustomAttributes(typeof(NonSerializedAttribute), false).Length == 0)
|| (t.GetCustomAttributes(typeof(UnityEngine.SerializeField), false).Length > 0)
)
.Where(t => t.FieldType.IsSubclassOf(typeof(ParameterOverride)) && t.Name != "enabled" && ((t.IsPublic && t.GetCustomAttributes(typeof(NonSerializedAttribute), false).Length == 0)
|| (t.GetCustomAttributes(typeof(UnityEngine.SerializeField), false).Length > 0))
)
.ToList();

foreach (var field in fields)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ static DefineSetter()
#if UNITY_2021_3_OR_NEWER
var targets = Enum.GetValues(typeof(NamedBuildTarget))
.Cast<NamedBuildTarget>()
.Where(x => x != NamedBuildTarget.Unknown)
.Where(x => !IsObsolete(x));
.Where(x => x != NamedBuildTarget.Unknown && !IsObsolete(x));
#else
var targets = Enum.GetValues(typeof(BuildTargetGroup))
.Cast<BuildTargetGroup>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public override void Render(PostProcessRenderContext context)
cmd.ReleaseTemporaryRT(tile4);

// Pass 5 - Fourth TileMax filter (reduce to tileSize)
var tileMaxOffs = Vector2.one * (tileSize / 8f - 1f) * -0.5f;
var tileMaxOffs = (tileSize / 8f - 1f) * -0.5f * Vector2.one;
sheet.properties.SetVector(ShaderIDs.TileMaxOffs, tileMaxOffs);
sheet.properties.SetFloat(ShaderIDs.TileMaxLoop, (int)(tileSize / 8f));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ void OnDrawGizmos()
{
var c = (BoxCollider)collider;
Gizmos.DrawCube(c.center, c.size);
Gizmos.DrawWireCube(c.center, c.size + invScale * blendDistance * 4f);
Gizmos.DrawWireCube(c.center, c.size + 4f * blendDistance * invScale);
}
else if (type == typeof(SphereCollider))
{
Expand All @@ -266,7 +266,7 @@ void OnDrawGizmos()

// Mesh pivot should be centered or this won't work
Gizmos.DrawMesh(c.sharedMesh);
Gizmos.DrawWireMesh(c.sharedMesh, Vector3.zero, Quaternion.identity, Vector3.one + invScale * blendDistance * 4f);
Gizmos.DrawWireMesh(c.sharedMesh, Vector3.zero, Quaternion.identity, Vector3.one + 4f * blendDistance * invScale);
}

// Nothing for capsule (DrawCapsule isn't exposed in Gizmo), terrain, wheel and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1025,9 +1025,8 @@ public static IEnumerable<T> GetAllSceneObjects<T>()
foreach (var root in roots)
{
queue.Enqueue(root.transform);
var comp = root.GetComponent<T>();

if (comp != null)

if (root.TryGetComponent<T>(out var comp))
yield return comp;
}

Expand All @@ -1036,9 +1035,8 @@ public static IEnumerable<T> GetAllSceneObjects<T>()
foreach (Transform child in queue.Dequeue())
{
queue.Enqueue(child);
var comp = child.GetComponent<T>();

if (comp != null)

if (child.TryGetComponent<T>(out var comp))
yield return comp;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ internal void EndFrame()
// frame so keep them in the same order
if (m_Actives.Count > 0)
{
foreach (var rt in m_Actives)
m_Recycled.Add(rt);
m_Recycled.AddRange(m_Actives);

m_Actives.Clear();
}
Expand Down