예제 #1
0
 // Start is called before the first frame update
 void Start()
 {
     // la variable rb2d hace referencia al rigidbody del objeto al que asignamos el script(inspector)
     rb2d          = GetComponent <Rigidbody2D>();
     controladorPJ = GetComponentInParent <ControladorPJ>();//accede al script controladorPJ del padre
 }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     controladorPJ = GetComponentInParent <ControladorPJ>();
 }