void Start() { BGSea = GameObject.FindWithTag("BG").gameObject; islandstage = new SpriteRenderer[7] { BGSea.transform.GetChild(0).GetChild(0).GetComponent <SpriteRenderer>(), BGSea.transform.GetChild(0).GetChild(1).GetComponent <SpriteRenderer>(), BGSea.transform.GetChild(0).GetChild(2).GetComponent <SpriteRenderer>(), BGSea.transform.GetChild(0).GetChild(3).GetComponent <SpriteRenderer>(), BGSea.transform.GetChild(0).GetChild(4).GetComponent <SpriteRenderer>(), BGSea.transform.GetChild(0).GetChild(5).GetComponent <SpriteRenderer>(), BGSea.transform.GetChild(0).GetChild(6).GetComponent <SpriteRenderer>() }; if (GameObject.FindGameObjectWithTag("AllScene")) { allScene = GameObject.FindGameObjectWithTag("AllScene").transform.GetComponent <SceneManagerScript>(); ClearStageNum = allScene.GetClearData(); ClearStageCheck(); CheckFind_SceneManager = true; } if (!CheckFind_SceneManager) { Debug.Log("シーンマネージャーがないよ!"); } if (Cloudmat) { Cloudmat.EnableKeyword("cloudClear"); Cloudmat.SetFloat("_cloudClear", 0); } if (Seamat) { Seamat.EnableKeyword("WaveHeight"); Seamat.SetFloat("_WaveHeight", WaveHeight); } }
void Start() { Config_State = SelectState.BGMSlide; BGMValue = BGMslider.GetComponent <Slider>(); SEValue = SEslider.GetComponent <Slider>(); var manage = GameObject.FindGameObjectWithTag("AllScene"); if (manage) { managerScript = manage.GetComponent <SceneManagerScript>(); var data = managerScript.GetClearData(); var count = 0; for (int i = 0; i < data.Length / 2; i++) { if (data[i, 1] == 1) { count++; } } numtext.text = count + "/7"; BGMValue.value = managerScript.GetBGMVolume(); SEValue.value = managerScript.GetSEVolume(); var val = PlayerPrefs.GetFloat("BGM"); if (BGMValue.value != val) { BGMValue.value = PlayerPrefs.GetFloat("BGM", 1); SEValue.value = PlayerPrefs.GetFloat("SE", 1); } audio = manage.GetComponent <AudioSource>(); } else { BGMValue.value = PlayerPrefs.GetFloat("BGM", 1); SEValue.value = PlayerPrefs.GetFloat("SE", 1); } IconDistance = BGMValue.transform.localPosition - SEValue.transform.localPosition; text = img.transform.GetChild(0).GetComponent <Text>(); img.sprite = spriteA; mute1 = transform.GetChild(2).GetChild(5).gameObject; mute2 = transform.GetChild(3).GetChild(5).gameObject; if (BGMValue.value == 0) { mute1.SetActive(true); } else { mute1.SetActive(false); } if (SEValue.value == 0) { mute2.SetActive(true); } else { mute2.SetActive(false); } buttonA = Resources.Load <AudioClip>("Sound\\SE\\decision29"); buttonB = Resources.Load <AudioClip>("Sound\\SE\\cancel2"); warning = Resources.Load <AudioClip>("Sound\\SE\\warning2"); audioButton = gameObject.AddComponent <AudioSource>(); }