Skip to content

Instantly share code, notes, and snippets.

@AlexMeesters
Last active May 5, 2019 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexMeesters/1172323f0dd887560b15bdc3d538f3f8 to your computer and use it in GitHub Desktop.
Save AlexMeesters/1172323f0dd887560b15bdc3d538f3f8 to your computer and use it in GitHub Desktop.
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