Last active
June 30, 2018 07:27
-
-
Save todorok1/f4e42ac230e349cef1847412f76b41f8 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
[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