void Start() { //このスクリプトが付いているオブジェクトのAudioSouceを取得 audioSource = gameObject.GetComponent <AudioSource>(); int b; if (OpeningMenu.getMinite() <= 3) { b = 1; } else { b = 0; } int a = Random.Range(1, 4 + b); /* * //ランダムで4曲のうちどれかが鳴る(3分未満の時は3曲) * if(a==1){ * audioSource.clip = necro; * }else if(a==2){ * audioSource.clip = kurerappu; * }else if(a==3){ * audioSource.clip = sumizome; * }else if(a==4){ * audioSource.clip = badapple; * } */ audioSource.Play(); }
void Start() { playerObj = GameObject.Find("Player"); plIns = playerObj.GetComponent <PlayerScript>(); minite = OpeningMenu.getMinite(); second = 0; txt.text = "0" + minite.ToString() + ":0" + second.ToString(); }
void Start() { //PlayerScript2Dのインスタンスの取得 playerObj = GameObject.Find("Player"); plIns = playerObj.GetComponent <PlayerScript2DKey>(); //miniteをOpeningMenuのminiteで初期化 minite = OpeningMenu.getMinite(); second = 0; //表示 txt.text = "0" + minite.ToString() + ":0" + second.ToString(); }