10-12-2012, 11:51 AM
Avevo pensato tipo un java script così:
var sound : SoundController;
sound = transform.root.GetComponent(SoundController);
private var car : Car;
car = transform.GetComponent(Car);
function OnCollisionEnter(collInfo : Collision)
{
if(collInfo.gameObject.name == "hotel"){
Debug.Log("Hit the hotel");
}else if(collInfo.gameObject.name == "casetta"){
Debug.Log("Hit the casetta");
}
}
Dove all'interno pero' inserisco che quando avviene la collissione si deve aprire una finestra utilizzando GUI.DrawTexture(new Rect(0,0,Screen.width,Screen.height), MyTexture, ScaleMode.ScaleToFit);
pero' non so..dovrei comq gestire il contenuto della finestra.
var sound : SoundController;
sound = transform.root.GetComponent(SoundController);
private var car : Car;
car = transform.GetComponent(Car);
function OnCollisionEnter(collInfo : Collision)
{
if(collInfo.gameObject.name == "hotel"){
Debug.Log("Hit the hotel");
}else if(collInfo.gameObject.name == "casetta"){
Debug.Log("Hit the casetta");
}
}
Dove all'interno pero' inserisco che quando avviene la collissione si deve aprire una finestra utilizzando GUI.DrawTexture(new Rect(0,0,Screen.width,Screen.height), MyTexture, ScaleMode.ScaleToFit);
pero' non so..dovrei comq gestire il contenuto della finestra.