Skip to content

Instantly share code, notes, and snippets.

@AlexMeesters AlexMeesters/ResetExample.cs Secret
Last active May 5, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.