Skip to content

Instantly share code, notes, and snippets.

@unity3dcollege
Created December 1, 2020 19:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save unity3dcollege/16ee873557ea2d08cdf2447500231b38 to your computer and use it in GitHub Desktop.
Save unity3dcollege/16ee873557ea2d08cdf2447500231b38 to your computer and use it in GitHub Desktop.
using UnityEngine;
public class Perf : MonoBehaviour
{
[SerializeField] int _callsPerFrame = 10000;
void Update()
{
for (int i = 0; i < _callsPerFrame; i++)
{
var rb = GetComponent<Rigidbody2D>();
rb.velocity = Vector2.up;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment