Skip to content

Commit

Permalink
Merge pull request #48 from AnnulusGames/remove-null-check
Browse files Browse the repository at this point in the history
Remove: null checks
  • Loading branch information
AnnulusGames authored Jan 16, 2024
2 parents 214115a + f17f89c commit 86f4df3
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public static MotionHandle BindToVolume<TOptions, TAdapter>(this MotionBuilder<f
Error.IsNull(audioSource);
return builder.BindWithState(audioSource, (x, target) =>
{
if (target == null) return;
target.volume = x;
});
}
Expand All @@ -44,7 +43,6 @@ public static MotionHandle BindToPitch<TOptions, TAdapter>(this MotionBuilder<fl
Error.IsNull(audioSource);
return builder.BindWithState(audioSource, (x, target) =>
{
if (target == null) return;
target.pitch = x;
});
}
Expand All @@ -64,7 +62,6 @@ public static MotionHandle BindToAudioMixerFloat<TOptions, TAdapter>(this Motion
Error.IsNull(audioMixer);
return builder.BindWithState(audioMixer, (x, target) =>
{
if (target == null) return;
target.SetFloat(name, x);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public static MotionHandle BindToMaterialFloat<TOptions, TAdapter>(this MotionBu
Error.IsNull(material);
return builder.BindWithState(material, (x, m) =>
{
if (m == null) return;
m.SetFloat(name, x);
});
}
Expand All @@ -42,7 +41,6 @@ public static MotionHandle BindToMaterialFloat<TOptions, TAdapter>(this MotionBu
Error.IsNull(material);
return builder.BindWithState(material, (x, m) =>
{
if (m == null) return;
m.SetFloat(nameID, x);
});
}
Expand All @@ -62,7 +60,6 @@ public static MotionHandle BindToMaterialInt<TOptions, TAdapter>(this MotionBuil
Error.IsNull(material);
return builder.BindWithState(material, (x, m) =>
{
if (m == null) return;
m.SetInteger(name, x);
});
}
Expand All @@ -82,7 +79,6 @@ public static MotionHandle BindToMaterialInt<TOptions, TAdapter>(this MotionBuil
Error.IsNull(material);
return builder.BindWithState(material, (x, m) =>
{
if (m == null) return;
m.SetInteger(nameID, x);
});
}
Expand All @@ -102,7 +98,6 @@ public static MotionHandle BindToMaterialColor<TOptions, TAdapter>(this MotionBu
Error.IsNull(material);
return builder.BindWithState(material, (x, m) =>
{
if (m == null) return;
m.SetColor(name, x);
});
}
Expand All @@ -122,7 +117,6 @@ public static MotionHandle BindToMaterialColor<TOptions, TAdapter>(this MotionBu
Error.IsNull(material);
return builder.BindWithState(material, (x, m) =>
{
if (m == null) return;
m.SetColor(nameID, x);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public static MotionHandle BindToColor<TOptions, TAdapter>(this MotionBuilder<Co
Error.IsNull(spriteRenderer);
return builder.BindWithState(spriteRenderer, (x, m) =>
{
if (m == null) return;
m.color = x;
});
}
Expand All @@ -42,7 +41,6 @@ public static MotionHandle BindToColorR<TOptions, TAdapter>(this MotionBuilder<f
Error.IsNull(spriteRenderer);
return builder.BindWithState(spriteRenderer, (x, m) =>
{
if (m == null) return;
var c = m.color;
c.r = x;
m.color = c;
Expand All @@ -64,7 +62,6 @@ public static MotionHandle BindToColorG<TOptions, TAdapter>(this MotionBuilder<f
Error.IsNull(spriteRenderer);
return builder.BindWithState(spriteRenderer, (x, m) =>
{
if (m == null) return;
var c = m.color;
c.g = x;
m.color = c;
Expand All @@ -86,7 +83,6 @@ public static MotionHandle BindToColorB<TOptions, TAdapter>(this MotionBuilder<f
Error.IsNull(spriteRenderer);
return builder.BindWithState(spriteRenderer, (x, m) =>
{
if (m == null) return;
var c = m.color;
c.b = x;
m.color = c;
Expand All @@ -108,7 +104,6 @@ public static MotionHandle BindToColorA<TOptions, TAdapter>(this MotionBuilder<f
Error.IsNull(spriteRenderer);
return builder.BindWithState(spriteRenderer, (x, m) =>
{
if (m == null) return;
var c = m.color;
c.a = x;
m.color = c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public static MotionHandle BindToPosition<TOptions, TAdapter>(this MotionBuilder
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
t.position = x;
});
}
Expand All @@ -42,7 +41,6 @@ public static MotionHandle BindToPositionX<TOptions, TAdapter>(this MotionBuilde
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.position;
p.x = x;
t.position = p;
Expand All @@ -64,7 +62,6 @@ public static MotionHandle BindToPositionY<TOptions, TAdapter>(this MotionBuilde
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.position;
p.y = x;
t.position = p;
Expand All @@ -86,7 +83,6 @@ public static MotionHandle BindToPositionZ<TOptions, TAdapter>(this MotionBuilde
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.position;
p.z = x;
t.position = p;
Expand All @@ -108,7 +104,6 @@ public static MotionHandle BindToLocalPosition<TOptions, TAdapter>(this MotionBu
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
t.localPosition = x;
});
}
Expand All @@ -128,7 +123,6 @@ public static MotionHandle BindToLocalPositionX<TOptions, TAdapter>(this MotionB
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.localPosition;
p.x = x;
t.localPosition = p;
Expand All @@ -151,7 +145,6 @@ public static MotionHandle BindToLocalPositionY<TOptions, TAdapter>(this MotionB
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.localPosition;
p.y = x;
t.localPosition = p;
Expand All @@ -173,7 +166,6 @@ public static MotionHandle BindToLocalPositionZ<TOptions, TAdapter>(this MotionB
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.localPosition;
p.z = x;
t.localPosition = p;
Expand All @@ -195,7 +187,6 @@ public static MotionHandle BindToRotation<TOptions, TAdapter>(this MotionBuilder
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
t.rotation = x;
});
}
Expand All @@ -215,7 +206,6 @@ public static MotionHandle BindToLocalRotation<TOptions, TAdapter>(this MotionBu
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
t.localRotation = x;
});
}
Expand All @@ -235,7 +225,6 @@ public static MotionHandle BindToEulerAngles<TOptions, TAdapter>(this MotionBuil
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
t.eulerAngles = x;
});
}
Expand All @@ -255,7 +244,6 @@ public static MotionHandle BindToEulerAnglesX<TOptions, TAdapter>(this MotionBui
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.eulerAngles;
p.x = x;
t.eulerAngles = p;
Expand All @@ -277,7 +265,6 @@ public static MotionHandle BindToEulerAnglesY<TOptions, TAdapter>(this MotionBui
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.eulerAngles;
p.y = x;
t.eulerAngles = p;
Expand All @@ -299,7 +286,6 @@ public static MotionHandle BindToEulerAnglesZ<TOptions, TAdapter>(this MotionBui
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.eulerAngles;
p.z = x;
t.eulerAngles = p;
Expand All @@ -321,7 +307,6 @@ public static MotionHandle BindToLocalEulerAngles<TOptions, TAdapter>(this Motio
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
t.localEulerAngles = x;
});
}
Expand All @@ -341,7 +326,6 @@ public static MotionHandle BindToLocalEulerAnglesX<TOptions, TAdapter>(this Moti
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.localEulerAngles;
p.x = x;
t.localEulerAngles = p;
Expand All @@ -363,7 +347,6 @@ public static MotionHandle BindToLocalEulerAnglesY<TOptions, TAdapter>(this Moti
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.localEulerAngles;
p.y = x;
t.localEulerAngles = p;
Expand All @@ -385,7 +368,6 @@ public static MotionHandle BindToLocalEulerAnglesZ<TOptions, TAdapter>(this Moti
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.localEulerAngles;
p.z = x;
t.localEulerAngles = p;
Expand All @@ -407,7 +389,6 @@ public static MotionHandle BindToLocalScale<TOptions, TAdapter>(this MotionBuild
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
t.localScale = x;
});
}
Expand All @@ -427,7 +408,6 @@ public static MotionHandle BindToLocalScaleX<TOptions, TAdapter>(this MotionBuil
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.localScale;
p.x = x;
t.localScale = p;
Expand All @@ -449,7 +429,6 @@ public static MotionHandle BindToLocalScaleY<TOptions, TAdapter>(this MotionBuil
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.localScale;
p.y = x;
t.localScale = p;
Expand All @@ -471,7 +450,6 @@ public static MotionHandle BindToLocalScaleZ<TOptions, TAdapter>(this MotionBuil
Error.IsNull(transform);
return builder.BindWithState(transform, (x, t) =>
{
if (t == null) return;
var p = t.localScale;
p.z = x;
t.localScale = p;
Expand Down
Loading

0 comments on commit 86f4df3

Please sign in to comment.