Beispiel #1
0
 private void Awake()
 {
     if (rbWork)
     {
         rbWork.SetCallBack(this);
     }
     if (etPriority)
     {
         etPriority.onEndEdit.AddListener(OnEndEditForChangePriority);
     }
 }
Beispiel #2
0
 private void Start()
 {
     if (rbShow != null)
     {
         rbShow.SetCallBack(this);
     }
     if (pbReputation != null)
     {
         pbReputation.SetContent(TextHandler.Instance.manager.GetTextById(100));
     }
     if (btResearch != null)
     {
         btResearch.onClick.AddListener(OnClickResearch);
     }
     if (btResearchCancel != null)
     {
         btResearchCancel.onClick.AddListener(OnClickResearchCancel);
     }
     stringForNoIng = TextHandler.Instance.manager.GetTextById(13001);
 }
Beispiel #3
0
    public void Start()
    {
        GameConfigBean gameConfig = GameDataHandler.Instance.manager.GetGameConfig();

        if (btBack != null)
        {
            btBack.onClick.AddListener(OnClickBack);
        }
        if (dvWindow != null)
        {
            dvWindow.SetCallBack(this);
            List <Dropdown.OptionData> listWindow = new List <Dropdown.OptionData>
            {
                new Dropdown.OptionData("窗口"),
                new Dropdown.OptionData("全屏")
            };
            dvWindow.SetData(listWindow);

            switch (gameConfig.window)
            {
            case 0:
                dvWindow.SetPosition("窗口");
                break;

            case 1:
                dvWindow.SetPosition("全屏");
                break;
            }
        }

        //结账选择出世法U
        if (dvCheckOut != null)
        {
            dvCheckOut.SetCallBack(this);
            List <Dropdown.OptionData> listCheckOut = new List <Dropdown.OptionData>
            {
                new Dropdown.OptionData("选择最近的柜台结账"),
                new Dropdown.OptionData("选择随机的柜台结账"),
                new Dropdown.OptionData("选择人少的柜台结账")
            };
            dvCheckOut.SetData(listCheckOut);
            switch (gameConfig.statusForCheckOut)
            {
            case 0:
                dvCheckOut.SetPosition(0);
                break;

            case 1:
                dvCheckOut.SetPosition(1);
                break;

            case 2:
                dvCheckOut.SetPosition(2);
                break;
            }
        }

        //语言选择初始化
        if (dvLanguage != null)
        {
            dvLanguage.SetCallBack(this);
            List <Dropdown.OptionData> listLanguage = new List <Dropdown.OptionData>
            {
                new Dropdown.OptionData("简体中文")
                //new Dropdown.OptionData("English")
            };
            dvLanguage.SetData(listLanguage);
            switch (GameDataHandler.Instance.manager.GetGameConfig().language)
            {
            case "cn":
                dvLanguage.SetPosition("简体中文");
                break;
            }
        }



        //音乐选择初始化
        if (pvMusic != null)
        {
            pvMusic.SetData(gameConfig.musicVolume);
            pvMusic.SetCallBack(this);
        }
        //音效选择初始化
        if (pvSound != null)
        {
            pvSound.SetData(gameConfig.soundVolume);
            pvSound.SetCallBack(this);
        }
        //环境音乐初始化
        if (pvEnvironment != null)
        {
            pvEnvironment.SetData(gameConfig.environmentVolume);
            pvEnvironment.SetCallBack(this);
        }

        //帧数设定初始化
        if (rbFrames != null)
        {
            rbFrames.SetCallBack(this);
            if (gameConfig.statusForFrames == 0)
            {
                rbFrames.ChangeStates(RadioButtonView.RadioButtonStatus.Unselected);
            }
            else if (gameConfig.statusForFrames == 1)
            {
                rbFrames.ChangeStates(RadioButtonView.RadioButtonStatus.Selected);
            }
        }
        if (etFrames != null)
        {
            etFrames.text = gameConfig.frames + "";
            etFrames.onEndEdit.AddListener(OnValueChangeForFrame);
        }

        //鼠标移动初始化
        if (rbMouseMove != null)
        {
            rbMouseMove.SetCallBack(this);
            if (gameConfig.statusForMouseMove == 0)
            {
                rbMouseMove.ChangeStates(RadioButtonView.RadioButtonStatus.Unselected);
            }
            else if (gameConfig.statusForMouseMove == 1)
            {
                rbMouseMove.ChangeStates(RadioButtonView.RadioButtonStatus.Selected);
            }
        }

        //按键提示初始化
        if (rbKeyTip != null)
        {
            rbKeyTip.SetCallBack(this);
            if (gameConfig.statusForKeyTip == 0)
            {
                rbKeyTip.ChangeStates(RadioButtonView.RadioButtonStatus.Unselected);
            }
            else if (gameConfig.statusForKeyTip == 1)
            {
                rbKeyTip.ChangeStates(RadioButtonView.RadioButtonStatus.Selected);
            }
        }
        //事件镜头跟随初始化
        if (rbEventCameraMove != null)
        {
            rbEventCameraMove.SetCallBack(this);
            if (gameConfig.statusForEventCameraMove == 0)
            {
                rbEventCameraMove.ChangeStates(RadioButtonView.RadioButtonStatus.Unselected);
            }
            else if (gameConfig.statusForEventCameraMove == 1)
            {
                rbEventCameraMove.ChangeStates(RadioButtonView.RadioButtonStatus.Selected);
            }
        }
        //事件倍速停止初始化
        if (rbEventStopTimeScale != null)
        {
            rbEventStopTimeScale.SetCallBack(this);
            if (gameConfig.statusForEventStopTimeScale == 0)
            {
                rbEventStopTimeScale.ChangeStates(RadioButtonView.RadioButtonStatus.Unselected);
            }
            else if (gameConfig.statusForEventStopTimeScale == 1)
            {
                rbEventStopTimeScale.ChangeStates(RadioButtonView.RadioButtonStatus.Selected);
            }
        }

        //事件镜头跟随初始化
        if (rbEvent != null)
        {
            rbEvent.SetCallBack(this);
            if (gameConfig.statusForEvent == 0)
            {
                rbEvent.ChangeStates(RadioButtonView.RadioButtonStatus.Unselected);
            }
            else if (gameConfig.statusForEvent == 1)
            {
                rbEvent.ChangeStates(RadioButtonView.RadioButtonStatus.Selected);
            }
        }

        //员工工作状态
        if (rbWorkerNumber != null)
        {
            rbWorkerNumber.SetCallBack(this);
            if (gameConfig.statusForWorkerNumber == 0)
            {
                rbWorkerNumber.ChangeStates(RadioButtonView.RadioButtonStatus.Unselected);
            }
            else if (gameConfig.statusForWorkerNumber == 1)
            {
                rbWorkerNumber.ChangeStates(RadioButtonView.RadioButtonStatus.Selected);
            }
        }

        //战斗的力道设定
        if (rbPowerTest != null)
        {
            rbPowerTest.SetCallBack(this);
            if (gameConfig.statusForCombatForPowerTest == 0)
            {
                rbPowerTest.ChangeStates(RadioButtonView.RadioButtonStatus.Unselected);
            }
            else if (gameConfig.statusForCombatForPowerTest == 1)
            {
                rbPowerTest.ChangeStates(RadioButtonView.RadioButtonStatus.Selected);
            }
        }

        //盘龙塔详细信息
        if (rbTownerInfo != null)
        {
            rbTownerInfo.SetCallBack(this);
            if (!gameConfig.isShowDetailsForTower)
            {
                rbTownerInfo.ChangeStates(RadioButtonView.RadioButtonStatus.Unselected);
            }
            else
            {
                rbTownerInfo.ChangeStates(RadioButtonView.RadioButtonStatus.Selected);
            }
        }

        btExitGame.onClick.AddListener(OnClickExitGame);
        btGoMain.onClick.AddListener(OnClickGoMain);
        btRestartDay.onClick.AddListener(OnClickRestartDay);
    }