Created
January 21, 2015 16:10
-
-
Save kazuooooo/2296d8881b276c9b002c to your computer and use it in GitHub Desktop.
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
| using UnityEngine; | |
| using System.Collections; | |
| public class studyScript : MonoBehaviour { | |
| Test test; | |
| // Use this for initialization | |
| void Start () { | |
| } | |
| // Update is called once per frame | |
| void Update () { | |
| if (Input.GetKey (KeyCode.A)) { | |
| GameObject go = GameObject.Find ("Cube") as GameObject; | |
| //他のスクリプトにメソッドを実行させる | |
| go.GetComponent<cubeScript> ().bigsize (); | |
| } | |
| if (Input.GetKey (KeyCode.B)) { | |
| //他のオブジェクトのメソッドを使い対場合はインスタンスを作って実行 | |
| test = new Test (); | |
| test.makeBigMyself (gameObject); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment