コード例 #1
0
    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);
    }
コード例 #2
0
    protected override void OnDlgInit()
    {
        cLocalization = Singlton.getInstance("NvLocalizationManager") as NvLocalizationManager;
        if (cLocalization == null)
        {
            Debug.LogError("Can Not Find Localization File!!");
        }

        for (int i = 0; i < cSongSel.Length; i++)
        {
            cSongSel[i].SetActiveRecursively(false);
            for (int j = 0; j < cSongSel[i].transform.childCount; j++)
            {
                GameObject child = cSongSel[i].transform.GetChild(j).gameObject;
                if (child.name == "sprBG")
                {
                    SprSongSelCharIcon[i] = child.GetComponent(typeof(UISprite)) as UISprite;
                }
                else if (child.name == "sprHalo")
                {
                    SprSongSelHalo[i]         = child.GetComponent(typeof(UISprite)) as UISprite;
                    SprSongSelHalo[i].enabled = (nCurSelChallengeIndex == i ? true : false);
                }
            }
        }

        SceneManager   mgr = Singlton.getInstance("SceneManager") as SceneManager;
        DcBuildingData cTempBuildingData = mgr.cShareData.lstBuildingData[mgr.cShareData.nCurSelBuildingIdx];

        for (int i = 0; i < cTempBuildingData.litSongIDs.Count; i++)
        {
            cSongSel[i].SetActiveRecursively(true);
            if (cTempBuildingData.litMasterSex[i] == 0)
            {
                SprSongSelCharIcon[i].spriteName = mgr.cShareData.strManCharIcon[(int)UnityEngine.Random.Range(0, mgr.cShareData.strManCharIcon.Length)];
            }
            else
            {
                SprSongSelCharIcon[i].spriteName = mgr.cShareData.strWomanCharIcon[(int)UnityEngine.Random.Range(0, mgr.cShareData.strWomanCharIcon.Length)];
            }
        }

        SetChallengeChallenge();
    }