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");
        }
    }
示例#3
0
    void test()
    {
        m_Localization = Singlton.getInstance("NvLocalizationManager") as NvLocalizationManager;
        if (m_Localization == null)
        {
            Debug.LogError("Can Not Find Localization File!!");
        }
        Debug.LogError("ssss" + m_Localization.GetValue("seaside_song_2_name"));

        //

        UnityEngine.TextAsset s = (UnityEngine.TextAsset)Resources.Load("TXT/KKKKK/TestJson", typeof(UnityEngine.TextAsset));
        m_ScenariogListLocal = JsonMapper.ToObject<List<KKKKK>>(s.text);

        Debug.Log("************"+m_ScenariogListLocal.Count);
        for (int i = 0; i < m_ScenariogListLocal.Count; i++)
        {
            Debug.Log(i + "=>" + m_ScenariogListLocal[i].strS1 + "++" + m_ScenariogListLocal[i].nN + "++" + m_ScenariogListLocal[i].strS2);
        }
    }
示例#4
0
    void test()
    {
        m_Localization = Singlton.getInstance("NvLocalizationManager") as NvLocalizationManager;
        if (m_Localization == null)
        {
            Debug.LogError("Can Not Find Localization File!!");
        }
        Debug.LogError("ssss" + m_Localization.GetValue("seaside_song_2_name"));

        //

        UnityEngine.TextAsset s = (UnityEngine.TextAsset)Resources.Load("TXT/KKKKK/TestJson", typeof(UnityEngine.TextAsset));
        m_ScenariogListLocal = JsonMapper.ToObject <List <KKKKK> >(s.text);

        Debug.Log("************" + m_ScenariogListLocal.Count);
        for (int i = 0; i < m_ScenariogListLocal.Count; i++)
        {
            Debug.Log(i + "=>" + m_ScenariogListLocal[i].strS1 + "++" + m_ScenariogListLocal[i].nN + "++" + m_ScenariogListLocal[i].strS2);
        }
    }
    protected override void OnDlgInit()
    {
        SceneManager mgr = Singlton.getInstance("SceneManager") as SceneManager;

        for (int i = 0; i < cRooms.Length; i++)
        {
            cRooms[i].SetActiveRecursively(false);
        }
        for (int i = 0; i < mgr.cShareData.lstRoomsData.Count; i++)
        {
            cRooms[i].SetActiveRecursively(true);

            for (int j = 0; j < cRooms[i].transform.childCount; j++)
            {
                GameObject child = cRooms[i].transform.GetChild(j).gameObject;
                if (child.name == "LabName")
                {
                    UILabel LabName = child.GetComponent(typeof(UILabel)) as UILabel;
                    LabName.text = /*cLocalization.GetValue("RoomName") + */ mgr.cShareData.lstRoomsData[i].strRoomName;
                }
                else if (child.name == "LabMode")
                {
                    UILabel LabMode = child.GetComponent(typeof(UILabel)) as UILabel;
                    LabMode.text = /*cLocalization.GetValue("DancingMode") + */ cLocalization.GetValue(mgr.cShareData.lstRoomsData[i].strMode);
                }
                else if (child.name == "LabSong")
                {
                    UILabel LabSong = child.GetComponent(typeof(UILabel)) as UILabel;
                    LabSong.text = /*cLocalization.GetValue("SongText") + */ mgr.cShareData.lstSongData[mgr.cShareData.lstRoomsData[i].nSongID].strSongName;
                }
                else if (child.name == "LabNum")
                {
                    UILabel LabNum = child.GetComponent(typeof(UILabel)) as UILabel;
                    LabNum.text = /*cLocalization.GetValue("NumberOfPeople") + */ mgr.cShareData.lstRoomsData[i].nNumOfPeople + "/3";
                }
                else if (child.name == "sprIcon")
                {
                    UISprite SprIcon = child.GetComponent(typeof(UISprite)) as UISprite;
                    if (mgr.cShareData.lstRoomsData[i].litPeopleSex[0] == 0)
                    {
                        SprIcon.spriteName = mgr.cShareData.strManCharIcon[(int)UnityEngine.Random.Range(0, mgr.cShareData.strManCharIcon.Length)];
                    }
                    else
                    {
                        SprIcon.spriteName = mgr.cShareData.strWomanCharIcon[(int)UnityEngine.Random.Range(0, mgr.cShareData.strWomanCharIcon.Length)];
                    }
                }
            }
        }

        bPlaySound = false;
        if (mgr.cShareData.bIsInBuildNewRoom)
        {
            ShowNewRoom();
            InpRoomName.text = mgr.cShareData.strCurRoomName;
            if (mgr.cShareData.cCurSongData != null)
            {
                LabSongName.text = mgr.cShareData.cCurSongData.strSongName;
            }
            else
            {
                LabSongName.text = "Random Songs";
            }
        }
        else
        {
            HideNewRoom();
        }
        bPlaySound = true;
//	for(int i=0;i<efx.transform.childCount;i++)
//	{
//		GameObject child = efx.transform.GetChild(i).gameObject;
//	}

//	aFinger = transform.Find("LeftShoulder/Arm/Hand/Finger");
//	aFinger.Rotate(Time.deltaTime*20, 0, 0);
    }
示例#6
0
    IEnumerator ShowScore(float timevalue)
    {
        yield return(new WaitForSeconds(timevalue));

        SceneManager mgr = Singlton.getInstance("SceneManager") as SceneManager;

        cBasicNumber.ShowNumber(ref SprBasicNumber, bIsRelease ? mgr.cShareData.nBasicScore : 12345);
        int nDigit = cComboNumber.ShowNumber(ref SprComboNumber, bIsRelease ? mgr.cShareData.nComboScore : 67890);

        for (int i = 0; i < SprBasicNumber.Length; i++)
        {
            SprBasicNumber[i].animation.Play();
            SprComboNumber[i].enabled = false;
        }
        StartCoroutine(DelayPlayComboNumberAnim(nDigit, 0.8f));

        if (bIsRelease ? mgr.cShareData.bIsWin : true)
        {
            SprWin.enabled = true;
            SprWin.animation.Play();

            if (bIsRelease)
            {
                if (mgr.cShareData.bIsChallengeOthers)
                {
                    if (mgr.cShareData.nBasicScore > mgr.cShareData.nHighScores)
                    {
                        LabOwnership.text = cLocalization.GetValue("GetOwnership");
                        mgr.cShareData.lstBuildingData[mgr.cShareData.nCurSelBuildingIdx].litSongMaster[mgr.cShareData.nCurSelSongIdx4Building] = mgr.cShareData.strUserName;
                        mgr.cShareData.lstBuildingData[mgr.cShareData.nCurSelBuildingIdx].litHighScores[mgr.cShareData.nCurSelSongIdx4Building] = mgr.cShareData.nBasicScore;
                        DcGlobalFunc.SaveJson(mgr.cShareData.lstBuildingData, "Assets/Resources/TXT/Table/Building.txt");
                    }
                    else
                    {
                        LabOwnership.text = cLocalization.GetValue("ChallengeFail");
                    }
                }
                else
                {
                    if (mgr.cShareData.nBasicScore > mgr.cShareData.nHighScores)
                    {
                        LabOwnership.text = cLocalization.GetValue("NewHighScores");
                        mgr.cShareData.lstBuildingData[mgr.cShareData.nCurSelBuildingIdx].litHighScores[mgr.cShareData.nCurSelSongIdx4Building] = mgr.cShareData.nBasicScore;
                        DcGlobalFunc.SaveJson(mgr.cShareData.lstBuildingData, "Assets/Resources/TXT/Table/Building.txt");
                    }
                    else
                    {
                        LabOwnership.text = cLocalization.GetValue("NoSurpass");
                    }
                }
            }
        }
        else
        {
            SprLost.enabled = true;
            SprLost.animation.Play();

            PanBgShake.animation.CrossFade("ShopBgColorChange");

            if (bIsRelease)
            {
                LabOwnership.text = cLocalization.GetValue("IsSubstandard");
            }
        }
    }