Skip to content

Instantly share code, notes, and snippets.

@kazuooooo
Created January 21, 2015 16:10
Show Gist options
  • Save kazuooooo/2296d8881b276c9b002c to your computer and use it in GitHub Desktop.
Save kazuooooo/2296d8881b276c9b002c to your computer and use it in GitHub Desktop.
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