-
-
Save AlexMeesters/1172323f0dd887560b15bdc3d538f3f8 to your computer and use it in GitHub Desktop.
This file contains 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; | |
[RequireComponent(typeof(Rigidbody), typeof(SphereCollider))] | |
public class ResetExample : MonoBehaviour | |
{ | |
[SerializeField] private Rigidbody rigidBody; | |
[SerializeField] private SphereCollider sphereCollider; | |
#if UNITY_EDITOR | |
private void Reset() | |
{ | |
rigidBody = GetComponent<Rigidbody>(); | |
sphereCollider = GetComponent<SphereCollider>(); | |
} | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment