Exemplo n.º 1
0
    void Start()
    {
        ReadGameInfo conf = ReadGameInfo.GetInstance();

        XkGameCtrl.IsLoadingLevel = false;
        GameAudioVolume           = conf.ReadGameAudioVolume();
        GameAudioVolumeLB.text    = GameAudioVolume.ToString();

        IsOpenSetPanel = true;
        CloseAllQiNang();
        pcvr.ShaCheBtLight = StartLightState.Mie;
        pcvr.CloseFangXiangPanPower();
        pcvr.IsSlowLoopCom = false;
        m_InserNum         = Convert.ToInt32(conf.ReadInsertCoinNum());
        UpdateInsertCoin();

        BtInfoLabel.text = "";
        m_ZhujiemianXingXing.localPosition = new Vector3(-510.0f, 212.0f, 0.0f);
        string GameMode = conf.ReadGameStarMode();

        if (GameMode == "" || GameMode == null)
        {
            GameMode = "oper";
        }

        m_CoinForStar.text = conf.ReadStarCoinNumSet();
        int minSpeedPlayer = (int)conf.ReadPlayerMinSpeedVal();

        PlayerMinSpeed.text = minSpeedPlayer.ToString();
        if (GameMode == "oper")
        {
            m_GameModeDuigou1.enabled = true;
            m_GameModeDuigou2.enabled = false;
        }
        else
        {
            m_GameModeDuigou1.enabled = false;
            m_GameModeDuigou2.enabled = true;
        }

        if (JiaoZhunTexture != null)
        {
            JiaoZhunObj = JiaoZhunTexture.gameObject;
            JiaoZhunObj.SetActive(false);
        }
        InitSteerForceInfo();

        InputEventCtrl.GetInstance().ClickSetEnterBtEvent += ClickSetEnterBtEvent;
        InputEventCtrl.GetInstance().ClickSetMoveBtEvent  += ClickSetMoveBtEvent;
        InputEventCtrl.GetInstance().ClickStartBtOneEvent += ClickStartBtOneEvent;
        //InputEventCtrl.GetInstance().ClickShaCheBtEvent += ClickShaCheBtEvent;
        InputEventCtrl.GetInstance().ClickLaBaBtEvent         += ClickLaBaBtEvent;
        InputEventCtrl.GetInstance().ClickCloseDongGanBtEvent += ClickCloseDongGanBtEvent;

        if (conf.Grade == 0)
        {
            conf.Grade = 2;
        }

        switch (conf.Grade)
        {
        case 1:
            GameGradeDuiGou[0].enabled = true;
            GameGradeDuiGou[1].enabled = false;
            GameGradeDuiGou[2].enabled = false;
            break;

        case 3:
            GameGradeDuiGou[0].enabled = false;
            GameGradeDuiGou[1].enabled = false;
            GameGradeDuiGou[2].enabled = true;
            break;

        case 2:
        default:     // 默认设置为普通难度
            GameGradeDuiGou[0].enabled = false;
            GameGradeDuiGou[1].enabled = true;
            GameGradeDuiGou[2].enabled = false;
            break;
        }
        InitGameLanguage();
    }