Skip to content

Instantly share code, notes, and snippets.

@anchan828
Created January 26, 2012 09:43
Show Gist options
  • Save anchan828/1681986 to your computer and use it in GitHub Desktop.
Save anchan828/1681986 to your computer and use it in GitHub Desktop.
GetConponent
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