Skip to content

Instantly share code, notes, and snippets.

@todorok1
Last active June 30, 2018 07:27
Show Gist options
  • Save todorok1/f4e42ac230e349cef1847412f76b41f8 to your computer and use it in GitHub Desktop.
Save todorok1/f4e42ac230e349cef1847412f76b41f8 to your computer and use it in GitHub Desktop.
コンポーネントの要求
[RequireComponent(typeof(Rigidbody))]
public class RequireComponentTest : MonoBehaviour {
Rigidbody rb;
void Start(){
rb = gameObject.GetComponent<Rigidbody>();
}
void Update(){
rb.AddForce(new Vector3(10f, 10f, 10f));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment