Пример #1
0
 private void SetBtnLockState(bool isLock)
 {
     if (isLock)
     {
         m_btnLock.SetText(LanguageData.GetContent(103));
     }
     else
     {
         m_btnLock.SetText(LanguageData.GetContent(104));
     }
 }
Пример #2
0
 private void SetFlying(bool value)
 {
     if (value)
     {
         m_btnFly.SetText(LanguageData.GetContent(101));
         MogoWorld.m_uiManager.ShowFlyControllerUI();
         m_btnJump.gameObject.SetActive(false);
     }
     else
     {
         m_btnFly.SetText(LanguageData.GetContent(102));
         MogoWorld.m_uiManager.CloseFlyControllerUI();
         m_btnJump.gameObject.SetActive(true);
     }
 }
Пример #3
0
    protected override void OnResourceLoaded()
    {
        var parent = MogoWorld.m_uiManager.MogoMainUIPanel.FindChild("BattleUI/Center");

        SyncCreateUIInstanceWithRootTransform(Resources[0], parent);
        m_myTransform.localPosition = new Vector3(0, 0, 0);
        m_myTransform.localScale    = new Vector3(1.0f, 1.0f, 1f);

        MogoUIBtn _btn = FindTransform("BtnOk").GetComponent <MogoUIBtn>();

        _btn.SetText(LanguageData.GetContent(3));
        _btn.ClickAction = OnCloseUI;
        //LoggerHelper.Error(LanguageData.GetContent(3));

        ScoreList = new List <List <UILabel> >();
        for (int i = 0; i < 2; i++)
        {
            ScoreList.Add(new List <UILabel>());
            for (int j = 0; j < 5; j++)
            {
                ScoreList[i].Add(FindTransform(string.Concat("Score", i, "Text", j)).GetComponent <UILabel>());
                FindTransform(string.Concat("ScoreName", i, "Text", j)).GetComponent <UILabel>().text = LanguageData.GetContent(173 + j);
            }
        }

        ShowScore();
    }
Пример #4
0
    protected override void OnResourceLoaded()
    {
        var parent = MogoWorld.m_uiManager.MogoMainUIPanel.FindChild("BattleUI/Right");

        SyncCreateUIInstanceWithRootTransform(Resources[0], parent);
        m_myTransform.localPosition = new Vector3(-70, 100, 0);

        var btnXuQi = FindComponent <MogoUIBtn>("BtnXuQi");

        btnXuQi.SetText(LanguageData.GetContent(100));
        var pressedMgr = btnXuQi.gameObject.AddComponent <BtnPressedMgr>();

        pressedMgr.ActionPressed   = OnPressXuQi;
        pressedMgr.ActionUnPressed = OnUnPressXuQi;

        m_btnFly              = FindComponent <MogoUIBtn>("BtnFly");
        m_btnFly.ClickAction  = OnBtnFly;
        m_btnJump             = FindComponent <MogoUIBtn>("BtnJump");
        m_btnJump.ClickAction = OnBtnJump;
        m_btnJump.SetText(LanguageData.GetContent(105));

        m_goKeyCodeXuqi = FindTransform("KeyCodeXuqi").gameObject;
        m_goKeyCodeXuqi.transform.FindChild("LblKeyCodeXuqi").GetComponent <UILabel>().text = LanguageData.GetContent(151);
        m_goKeyCodeFlyState = FindTransform("KeyCodeFly").gameObject;
        m_goKeyCodeFlyState.transform.FindChild("LblKeyCodeFly").GetComponent <UILabel>().text = LanguageData.GetContent(152);
        m_goKeyCodeJump = FindTransform("KeyCodeJump").gameObject;
        m_goKeyCodeJump.transform.FindChild("LblKeyCodeJump").GetComponent <UILabel>().text = LanguageData.GetContent(154);
        SetKeyCodeActive();

        AddListeners();
    }
Пример #5
0
    protected override void OnResourceLoaded()
    {
        var parent = MogoWorld.m_uiManager.MogoMainUIPanel.FindChild("BattleUI/Center");

        SyncCreateUIInstanceWithRootTransform(Resources[0], parent);
        m_myTransform.localPosition = new Vector3(0, -280, -10);
        m_myTransform.localScale    = new Vector3(1.0f, 1.0f, 1f);

        StarNameTxt    = FindTransform("StarName").GetComponent <UILabel>();
        EnergyTxt      = FindTransform("LblEnergy").GetComponent <UILabel>();
        EnergySp       = FindTransform("EnergyBar").GetComponent <UISprite>();
        EnergyGo       = FindTransform("Energy").gameObject;
        BuildingNumTxt = FindTransform("BuildingNumTxt").GetComponent <UILabel>();

        SetBuildingInfo();

        GatherBtn             = FindTransform("EufloriaBtnGather").GetComponent <MogoUIBtn>();
        AttackBtn             = FindTransform("EufloriaBtnAttack").GetComponent <MogoUIBtn>();
        GatherBtn.ClickAction = OnEufloriaBtnGatherAction;
        AttackBtn.ClickAction = OnEufloriaBtnAttackAction;
        GatherBtn.SetText(LanguageData.GetContent(185));
        AttackBtn.SetText(LanguageData.GetContent(184));

        HideAllInfo();

        AddListeners();
    }
Пример #6
0
    protected override void OnResourceLoaded()
    {
        var parent = MogoWorld.m_dataMapManager.GetUnitStarById(MogoWorld.thePlayer.HeadQuarterId).UnitParent.parent;

        SyncCreateUIInstanceWithRootTransform(Resources[0], parent);
        ComfirmBtn      = FindTransform("EufloriaBtnOK").GetComponent <MogoUIBtn>();
        CancelBtn       = FindTransform("EufloriaBtnCancel").GetComponent <MogoUIBtn>();
        ReconSoldierBtn = FindTransform("ReconSoldierBtn").GetComponent <MogoUIBtn>();
        DeleteBtn       = FindTransform("EufloriaBtnDelete").GetComponent <MogoUIBtn>();
        PercentBtn      = FindTransform("PercentBtn").GetComponent <MogoUIBtn>();

        ComfirmBtn.ClickAction      = OnComfirmBtnClickHandler;
        CancelBtn.ClickAction       = OnCancelBtnClickHandler;
        ReconSoldierBtn.ClickAction = OnReconSoldierBtnClickHandler;
        DeleteBtn.ClickAction       = OnDeleteBtnClickHandler;

        ComfirmBtn.gameObject.SetActive(false);
        CancelBtn.gameObject.SetActive(false);
        ReconSoldierBtn.gameObject.SetActive(false);
        DeleteBtn.gameObject.SetActive(false);

        ComfirmBtn.SetText(LanguageData.GetContent(186));
        CancelBtn.SetText(LanguageData.GetContent(187));
        DeleteBtn.SetText(LanguageData.GetContent(188));

        var opt = OptDragListener.Get(PercentBtn.gameObject);

        opt.onDrag = UpdateArrow;

        ReconSoldierBtn.SetText(LanguageData.GetContent(182));
        ShowPercent(true);

        AddListeners();
    }
Пример #7
0
    protected override void OnResourceLoaded()
    {
        /*var parent = MogoWorld.m_uiManager.MogoMainUIPanel.FindChild("BattleUI/BottomRight");
         * SyncCreateUIInstanceWithRootTransform(Resources[0], parent);
         * m_myTransform.localPosition = new Vector3(-70f, 22f, 0);
         * m_myTransform.localScale = new Vector3(1.0f, 1.0f, 1f);
         */

        var parent = MogoWorld.m_uiManager.MogoMainUIPanel;

        SyncCreateUIInstanceWithRootTransform(Resources[0], parent);
        m_myTransform.localPosition = new Vector3(0f, 0f, 0f);

        m_btnJoin = FindComponent <MogoUIBtn>("EufloriaBtnJoin");
        m_btnJoin.SetText(LanguageData.GetContent(11));
        m_btnJoin.ClickAction = OnBtnJoin;

        AddListeners();
    }