【3Dゲームエンジン】Unity質問スレッド15 [転載禁止]©5ch.net
■ このスレッドは過去ログ倉庫に格納されています
0281名前は開発中のものです。
2015/02/02(月) 14:18:32.56ID:uLgNzaWxpublic YourDontDestroyObject : MonoBehavior {
public PlayBGM(int scene) {
// bra bra bra
}
}
// some new scene detection script
void Start() {
GameObject go = Find("/OurDontDestroyObjectName");
if(go == nil) {
// may be first scene
} else {
//
YourDontDestroyObject bgmController = go.GetComponent<YourDontDestroyObject>();
bgmController.PlayBGM(SCENE_INDEX);
}
}
■ このスレッドは過去ログ倉庫に格納されています