SanAndreasUnity icon indicating copy to clipboard operation
SanAndreasUnity copied to clipboard

Code improvements

Open smitdylan2001 opened this issue 1 year ago • 0 comments

Following code improvements:

  • Remove blank Unity callbacks
  • Combine .position and .rotation into .SetPositionAndRotation for better performance
  • Use tuplet for swapping values
  • Change Vector calculations for better performance
  • Use TryGetComponent to have less memory allocations when no component is present
  • Convert if-else to single return for performance
  • Put together 2 strings for better performance and less garbage allocations
  • Use SetPixels32 instead of SetPixels for better performance and lower memory usage
  • Reuse collision callbacks for lower garbage allocation

smitdylan2001 avatar Aug 07 '22 13:08 smitdylan2001