// Start is called before the first frame update void Start() { goSM = GameObject.Find("SoundManager"); scSM = goSM.GetComponent <SoundMgr>(); scSM.PlaySE(0); scSM.PlayBGM(true, true, 1); // 自動スリープを無効にする Screen.sleepTimeout = SleepTimeout.NeverSleep; // Cubeプレハブを元に、インスタンスを生成、 }
IEnumerator StartFrame() { float sec = 0.0f; int frame = 0; source.Play(); while (true) { yield return null; mRenderer.sharedMaterial.mainTexture = textures[frame]; sec += Time.deltaTime; if (sec >= 0.09f) { sec = 0.0f; if (frame < textures.Length - 1) { frame++; } else { break; } } } yield return new WaitForSeconds(0.2f); SoundMgr.PlayBGM(); StageMgr sm = FindObjectOfType<StageMgr>(); //if (sm.isFinish) //{ if (sm.isRestart) { sm.RestartGo(); } else { sm.Continue(); } //} //else //{ // sm.Restart(); //} //FindObjectOfType<StageMgr>().Restart(); // Debug.Log("Finish"); }
// Use this for initialization IEnumerator Start() { //DontDestroyOnLoad (gameObject); isRestart = false; isFinish = false; isOneChance = false; GetComponent <Ranking>().isRegiRank = false; CardEffectOff(); //goalDistance = 100f; cardGauge = 0; lifeCount = 0; button.gameObject.SetActive(false); button2.gameObject.SetActive(false); button3.gameObject.SetActive(false); button4.gameObject.SetActive(false); button5.gameObject.SetActive(false); missionClear.SetActive(false); isStart = false; //bgSpriteList = new List<SpriteRenderer> (); CardObj = Instantiate(CardRes); CardObj.SetActive(false); cardTouchEffectObj = Instantiate(cardTouchEffectRes); cardTouchEffectObj.SetActive(false); FinishUI.SetActive(false); yield return(new WaitForSeconds(0.05f)); //Test LoadData(); //StartCardAnimation(); SoundMgr.PlayBGM(); }
public void actionButton() { Image bimage = button[0].GetComponent <Image>(); if (bimage.sprite == buttunImage[1]) { healSub(); } else if (bimage.sprite == buttunImage[2]) { scCM.DestroyMaze(); scGM.floor++; scSM.PlaySE(3); scSM.PlayBGM(true, true, scGM.floor + 1); scCM.makeMaze(scGM.floor); } else if (bimage.sprite == buttunImage[3]) { scCM.DestroyMaze(); scGM.floor--; scSM.PlaySE(3); scSM.PlayBGM(true, true, scGM.floor + 1); scCM.makeMaze(scGM.floor); } else if (bimage.sprite == buttunImage[4]) { if (boxGO != null) { mazeItem scMI = boxGO.GetComponent <mazeItem>(); scSM.PlaySE(4); scCM.maze[scMI.x, scMI.y, scMI.floor] = 6; switch (scMI.itemNum) { // 肉 case 0: scGM.heal++; Vector2 pos2D = transform.position; my = pos2D; setButtonImage(1, 5); goText.GetComponent <Text>().text = scGM.heal.ToString(); break; // ロングソード case 1: partialSub(1, 3.0f); setMyItemImage(0, 2); scGM.attack = 125; break; // シルバーアーマー case 2: partialSub(1, 3.0f); setMyItemImage(1, 3); scGM.deffence = 125; break; case 3: partialSub(1, 3.0f); setMyItemImage(0, 4); scGM.attack = 150; break; case 4: partialSub(1, 3.0f); setMyItemImage(1, 5); scGM.deffence = 150; break; } Instantiate(scCM.mazeItem[6], scMI.pos3D, Quaternion.identity, scCM.goFloor.transform); Destroy(boxGO); } } else { scSM.PlaySE(1); } }
public void actionButton() { Image bimage = button[0].GetComponent <Image>(); if (bimage.sprite == buttunImage[(int)ButtonItems.nuku]) { healSub(); } else if (bimage.sprite == buttunImage[(int)ButtonItems.down]) { transform.position = updownPos; scCM.DestroyMaze(); scGM.floor++; scSM.PlaySE(3); scSM.PlayBGM(true, true, scGM.floor + 1); scCM.makeMaze(scGM.floor); } else if (bimage.sprite == buttunImage[(int)ButtonItems.up]) { transform.position = updownPos; scCM.DestroyMaze(); scGM.floor--; scSM.PlaySE(3); scSM.PlayBGM(true, true, scGM.floor + 1); scCM.makeMaze(scGM.floor); } else if (bimage.sprite == buttunImage[(int)ButtonItems.box]) { if (boxGO != null) { mazeItem scMI = boxGO.GetComponent <mazeItem>(); scSM.PlaySE(4); scCM.maze[scMI.x, scMI.y, scMI.floor] = (int)Items.openBox; switch (scMI.itemNum) { // 肉 case (int)Items.niku: scGM.heal++; setButtonImage(1, (int)Items.nikuImage); goText.GetComponent <Text>().text = scGM.heal.ToString(); break; // ロングソード case (int)Items.longsword: partialSub(1, 3.0f); setMyItemImage(0, (int)Items.longsword); scGM.attack = powLongsword; break; // シルバーアーマー case (int)Items.silverarmer: partialSub(1, 3.0f); setMyItemImage(1, (int)Items.silverarmer); scGM.deffence = defSilveramer; break; // ファイアーソード case (int)Items.firesowrd: partialSub(1, 3.0f); setMyItemImage(0, (int)Items.firesowrd); scGM.attack = powFiresword; break; case (int)Items.firearmer: partialSub(1, 3.0f); setMyItemImage(1, (int)Items.firearmer); scGM.deffence = defFirerarmer; break; } Instantiate(scCM.mazeItem[6], scMI.pos3D, Quaternion.identity, scCM.goFloor.transform); Destroy(boxGO); } } else { scSM.PlaySE(1); } }
// Start is called before the first frame update void Start() { SoundMgr.PlayBGM(0); }
// Start is called before the first frame update void Start() { goSM = GameObject.Find("SoundManager"); scSM = goSM.GetComponent <SoundMgr>(); scSM.PlayBGM(true, true, 0); }
/// <summary> /// BGM再生 /// </summary> public void PlayBGM(string bgmName) { soundMgr.PlayBGM(bgmName, 1f, true); }