//单击歌曲列表中某首歌时的事件响应 private void SelSong(object sender) { if (objLastSelSongBtnSender == sender) { return; } objLastSelSongBtnSender = sender; NvSoundController soundctr = Singlton.getInstance("NvSoundController") as NvSoundController; soundctr.PlaySe("ui_touch"); GameObject obj = sender as GameObject; char[] splt = { '_' }; string lastnum = DcGlobalFunc.GetLastString(obj.transform.name, splt); //Debug.Log("1111111111" + lastnum); int nSelSong = Convert.ToInt32(lastnum) - 1; SceneManager mgr = Singlton.getInstance("SceneManager") as SceneManager; for (int i = 0; i < mgr.cShareData.lstSongData.Count; i++) { SprSongListBg[i].enabled = false; } SprSongListBg[nSelSong].enabled = true; soundctr.PlaySong(mgr.cShareData.lstSongData[nSelSong].strOfficial); }
public void SetChallengeChallenge() { //Debug.Log("SetChallengeChallenge---------------------"); //Debug.Log("lstSceneData[nCurSelScene].litSongIDs[nCurSelChallengeIndex]:" + lstSceneData[nCurSelScene].litSongIDs[nCurSelChallengeIndex]); SceneManager mgr = Singlton.getInstance("SceneManager") as SceneManager; if (mgr.cShareData.nCurSelBuildingIdx >= mgr.cShareData.lstBuildingData.Count) { //Debug.Log("nCurSelScene >= lstSceneData.Count"); return; } DcBuildingData cTempBuildingData = mgr.cShareData.lstBuildingData[mgr.cShareData.nCurSelBuildingIdx]; if (nCurSelChallengeIndex >= cTempBuildingData.litSongIDs.Count) { //Debug.Log("nCurSelChallengeIndex >= cTempSceneData.litSongIDs.Count"); return; } if (cTempBuildingData.litSongIDs[nCurSelChallengeIndex] >= mgr.cShareData.lstSongData.Count) { //Debug.Log("cTempSceneData.litSongIDs[nCurSelChallengeIndex] >= lstSongData.Count"); return; } // Debug.Log("nCurSelScene:" + nCurSelScene); // Debug.Log("nCurSelChallengeIndex:" + nCurSelChallengeIndex); // Debug.Log("cTempSceneData.litSongIDs.Count:" + cTempSceneData.litSongIDs.Count); mgr.cShareData.cCurSongData = mgr.cShareData.lstSongData[cTempBuildingData.litSongIDs[nCurSelChallengeIndex]]; mgr.cShareData.strDiffLv = cTempBuildingData.litDiffLvs[nCurSelChallengeIndex]; mgr.cShareData.strMode = cTempBuildingData.litMode[nCurSelChallengeIndex]; mgr.cShareData.nHighScores = cTempBuildingData.litHighScores[nCurSelChallengeIndex]; LabSongMaster.text = cTempBuildingData.litSongMaster[nCurSelChallengeIndex]; if (LabSongMaster.text != mgr.cShareData.strUserName) { mgr.cShareData.bIsChallengeOthers = true; mgr.cShareData.nCurSelSongIdx4Building = nCurSelChallengeIndex; } else { mgr.cShareData.bIsChallengeOthers = false; } LabSongName.text = /*cLocalization.GetValue("ChallengeSongs") + */ mgr.cShareData.cCurSongData.strSongName; LabSongDifficulty.text = /*cLocalization.GetValue("ChallengeTheDifficulty") + */ cLocalization.GetValue(mgr.cShareData.strDiffLv); LabMode.text = /*cLocalization.GetValue("ChallengeMode") + */ cLocalization.GetValue(mgr.cShareData.strMode); LabHighScores.text = /*cLocalization.GetValue("ChallengeHighScores") + */ mgr.cShareData.nHighScores.ToString(); cMoneyNumber.ShowNumber(ref SprMoneyNumber, mgr.cShareData.cCurSongData.nRewardMoney); cExpNumber.ShowNumber(ref SprExpNumber, mgr.cShareData.cCurSongData.nRewardExp); NvSoundController soundctr = Singlton.getInstance("NvSoundController") as NvSoundController; soundctr.PlaySong(mgr.cShareData.cCurSongData.strAudition); }
public void StartDancing() { NvSoundController soundctr = Singlton.getInstance("NvSoundController") as NvSoundController; soundctr.PlaySong(cCurSongData.strOfficial); bIsStart = true; fBeatTime = (float)cCurSongData.nBeatTime / 1000f; if (cCurSongData.nLength != 0) { StartCoroutine(ShowReady(cCurSongData.nShowReadyTime)); StartCoroutine(ShowGo(cCurSongData.nShowGoTime)); StartCoroutine(EndDancing(cCurSongData.nLength)); } else { LabTest.text = cLocalization.GetValue("NotArrangement"); } }
void InitSprDisk() { SceneManager mgr = Singlton.getInstance("SceneManager") as SceneManager; if (nAtMiddleIdx >= 0 && nAtMiddleIdx < SprDisk.Length) { for (int i = 0; i < SprDisk.Length; i++) { // string name = "ZZZ"; // UIAtlas t = Resources.Load("UI Prefabs/Atlases/UI/ZZZ/"+name) as UIAtlas; // if ( t == null ) // { // Debug.LogError("No Such Portrait "+ name); // } SprDisk[i].spriteName = mgr.cShareData.lstSongData[i].strSpriteName; SprInverted[i].spriteName = mgr.cShareData.lstSongData[i].strSpriteName; } NvSoundController soundctr = Singlton.getInstance("NvSoundController") as NvSoundController; soundctr.PlaySong(mgr.cShareData.lstSongData[nAtMiddleIdx].strAudition); for (int i = 0; i < mgr.cShareData.lstSongData.Count; i++) { LabSongName[i].text = mgr.cShareData.lstSongData[nAtMiddleIdx].strSongName; } SprDisk[nAtMiddleIdx].transform.localPosition = new Vector3(0, 0, 0); SprDisk[nAtMiddleIdx].transform.localScale = new Vector3(250, 250, 1); SprInverted[nAtMiddleIdx].transform.localPosition = new Vector3(0, -250, 1); SprInverted[nAtMiddleIdx].transform.localScale = new Vector3(250, 250, 1); for (int i = nAtMiddleIdx - 1; i >= 0; i--) { if (i == nAtMiddleIdx - 1) { SprDisk[i].transform.localPosition = new Vector3(-205, 0, 0); SprDisk[i].transform.localScale = new Vector3(150, 150, 1); SprInverted[i].transform.localPosition = new Vector3(-205, -150, 0); SprInverted[i].transform.localScale = new Vector3(150, 150, 1); } else { Vector3 posTemp = SprDisk[i + 1].transform.localPosition; posTemp.x -= 40; SprDisk[i].transform.localPosition = posTemp; posTemp = SprDisk[i + 1].transform.localScale; posTemp.x -= 30; posTemp.y -= 30; SprDisk[i].transform.localScale = posTemp; SprInverted[i].transform.localPosition = new Vector3(SprDisk[i].transform.localPosition.x, -posTemp.y, 0); SprInverted[i].transform.localScale = posTemp; } } for (int i = nAtMiddleIdx + 1; i < SprDisk.Length; i++) { if (i == nAtMiddleIdx + 1) { SprDisk[i].transform.localPosition = new Vector3(205, 0, 0); SprDisk[i].transform.localScale = new Vector3(150, 150, 1); SprInverted[i].transform.localPosition = new Vector3(205, -150, 0); SprInverted[i].transform.localScale = new Vector3(150, 150, 1); } else { Vector3 posTemp = SprDisk[i - 1].transform.localPosition; posTemp.x += 40; SprDisk[i].transform.localPosition = posTemp; posTemp = SprDisk[i - 1].transform.localScale; posTemp.x -= 30; posTemp.y -= 30; SprDisk[i].transform.localScale = posTemp; SprInverted[i].transform.localPosition = new Vector3(SprDisk[i].transform.localPosition.x, -posTemp.y, 0); SprInverted[i].transform.localScale = posTemp; } } UpDateDepth(); } }
void Update() { SceneManager mgr = Singlton.getInstance("SceneManager") as SceneManager; switch (nState) { case 0: //turn finish nAtMiddleIdx = nNewMidIdx; nState = -2; UpDateDepth(); for (int i = 0; i < LabSongName.Length; i++) { LabSongName[i].enabled = true; LabSongName[i].text = mgr.cShareData.lstSongData[nAtMiddleIdx].strSongName; } NvSoundController soundctr = Singlton.getInstance("NvSoundController") as NvSoundController; soundctr.PlaySong(mgr.cShareData.lstSongData[nAtMiddleIdx].strAudition); break; case -1: //left turn SprEachChange(ref SprDisk, nAtMiddleIdx, -20.5f, -10f); Vector3 posCurMidPos = SprEachChange(ref SprDisk, nAtMiddleIdx + 1, -20.5f, 10f); for (int i = nAtMiddleIdx - 1; i >= 0; i--) { SprEachChange(ref SprDisk, i, -4f, -3f); } for (int i = nAtMiddleIdx + 2; i < SprDisk.Length; i++) { SprEachChange(ref SprDisk, i, -4f, 3f); } if (posCurMidPos.x <= 0) { nState = 0; } break; case 1: //right turn SprEachChange(ref SprDisk, nAtMiddleIdx, 20.5f, -10f); posCurMidPos = SprEachChange(ref SprDisk, nAtMiddleIdx - 1, 20.5f, 10f); for (int i = nAtMiddleIdx - 2; i >= 0; i--) { SprEachChange(ref SprDisk, i, 4f, 3f); } for (int i = nAtMiddleIdx + 1; i < SprDisk.Length; i++) { SprEachChange(ref SprDisk, i, 4f, -3f); } if (posCurMidPos.x >= 0) { nState = 0; } break; } if (Input.GetKeyUp(KeyCode.LeftArrow)) { Turn(1); } if (Input.GetKeyUp(KeyCode.RightArrow)) { Turn(-1); } }