Created
December 1, 2020 19:54
-
-
Save unity3dcollege/16ee873557ea2d08cdf2447500231b38 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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