Created
January 26, 2012 09:43
-
-
Save anchan828/1681986 to your computer and use it in GitHub Desktop.
GetConponent
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
using UnityEngine; | |
using System.Collections; | |
public class Test : MonoBehaviour | |
{ | |
void Awake () | |
{ | |
gameObject.active = false; | |
} | |
public void Call () | |
{ | |
Debug.Log ("Call"); | |
} | |
} | |
//別のオブジェクトに付加 | |
using UnityEngine; | |
using System.Collections; | |
public class NewBehaviourScript : MonoBehaviour | |
{ | |
public GameObject g; | |
void Start () | |
{ | |
g.active = false; | |
Debug.Log ("Tes"); | |
g.GetComponent<Test> ().Call (); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment