Unity5質問スレat GAMEDEV
Unity5質問スレ - 暇つぶし2ch142:名前は開発中のものです。
15/08/20 00:39:55.54 Fb50snmM.net
>>140
これは申し訳ない
スクリプトA
public class A: MonoBehaviour {
public AudioClip SoundA;
public AudioClip SoundB;
public void PlaySoundA()
{GetComponent<AudioSource>().PlayOneShot(SoundA);}
public void PlaySoundB()
{GetComponent<AudioSource>().PlayOneShot(SoundB);; }
}
スクリプトB
public class B: MonoBehaviour {
void OnTriggerEnter(Collider other)
{
if (other.tag == "otherObj")
{
Destroy(other.gameObject);
GetComponent(B).PlaySoundA;
}
}

こんな感じでいいんでしょうか?


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch