Created
May 30, 2011 14:02
-
-
Save AngryAnt/998938 to your computer and use it in GitHub Desktop.
Explicit property type
This file contains hidden or 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
| // This: | |
| public Rigidbody target; | |
| void FixedUpdate () | |
| { | |
| target.AddForce (transform.forward * 1.0f); | |
| } | |
| // Over this: | |
| public GameObject targetGO; | |
| private Rigidbody target; | |
| void Start () | |
| { | |
| target = targetGO.GetComponent<Rigidbody> (); | |
| } | |
| void FixedUpdate () | |
| { | |
| target.AddForce (transform.forward * 1.0f); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment