perf: DelegateExtensions.InvokeSafe marked obsolete for memory allocation reasons, soon to be removed
This commit is contained in:
@@ -31,7 +31,7 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
_position = value;
|
||||
|
||||
UpdateLocalPosition();
|
||||
OnPositionChanged?.InvokeSafe(this, previousPosition);
|
||||
OnPositionChanged?.Invoke(this, previousPosition);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
_scale = value;
|
||||
|
||||
UpdateLocalScale();
|
||||
OnScaleChanged?.InvokeSafe(this, previousScale);
|
||||
OnScaleChanged?.Invoke(this, previousScale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
_rotation = value;
|
||||
|
||||
UpdateLocalRotation();
|
||||
OnRotationChanged?.InvokeSafe(this, previousRotation);
|
||||
OnRotationChanged?.Invoke(this, previousRotation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
_localPosition = value;
|
||||
|
||||
UpdatePosition();
|
||||
OnPositionChanged?.InvokeSafe(this, previousPosition);
|
||||
OnPositionChanged?.Invoke(this, previousPosition);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
|
||||
UpdateScale();
|
||||
UpdatePosition();
|
||||
OnScaleChanged?.InvokeSafe(this, previousScale);
|
||||
OnPositionChanged?.InvokeSafe(this, previousPosition);
|
||||
OnScaleChanged?.Invoke(this, previousScale);
|
||||
OnPositionChanged?.Invoke(this, previousPosition);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
_localRotation = value;
|
||||
|
||||
UpdateRotation();
|
||||
OnRotationChanged?.InvokeSafe(this, previousRotation);
|
||||
OnRotationChanged?.Invoke(this, previousRotation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
|
||||
UpdatePosition();
|
||||
|
||||
OnPositionChanged?.InvokeSafe(this, previousPosition);
|
||||
OnPositionChanged?.Invoke(this, previousPosition);
|
||||
}
|
||||
|
||||
private void RecalculateScale(ITransform2D _, Vector2D previousScale)
|
||||
@@ -138,8 +138,8 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
UpdateScale();
|
||||
UpdatePosition();
|
||||
|
||||
OnScaleChanged?.InvokeSafe(this, previousScale);
|
||||
OnPositionChanged?.InvokeSafe(this, previousPosition);
|
||||
OnScaleChanged?.Invoke(this, previousScale);
|
||||
OnPositionChanged?.Invoke(this, previousPosition);
|
||||
}
|
||||
|
||||
private void RecalculateRotation(ITransform2D _, float previousRotation)
|
||||
@@ -152,8 +152,8 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
UpdateRotation();
|
||||
UpdatePosition();
|
||||
|
||||
OnRotationChanged?.InvokeSafe(this, previousRotation);
|
||||
OnPositionChanged?.InvokeSafe(this, previousPosition);
|
||||
OnRotationChanged?.Invoke(this, previousRotation);
|
||||
OnPositionChanged?.Invoke(this, previousPosition);
|
||||
}
|
||||
|
||||
private void UpdateLocalPosition()
|
||||
@@ -247,9 +247,9 @@ public class Transform2D : Behaviour, ITransform2D
|
||||
UpdateLocalScale();
|
||||
UpdateLocalRotation();
|
||||
|
||||
OnPositionChanged?.InvokeSafe(this, Position);
|
||||
OnScaleChanged?.InvokeSafe(this, Scale);
|
||||
OnRotationChanged?.InvokeSafe(this, Rotation);
|
||||
OnPositionChanged?.Invoke(this, Position);
|
||||
OnScaleChanged?.Invoke(this, Scale);
|
||||
OnRotationChanged?.Invoke(this, Rotation);
|
||||
}
|
||||
|
||||
private void LookForTransform2D(IBehaviourController sender, IBehaviour behaviourAdded)
|
||||
|
Reference in New Issue
Block a user