Пример #1
0
 public void SetScore(int _Score)
 {
     if (m_scriptScore != null)
     {
         m_scriptScore.SetNumber(_Score);
     }
 }
Пример #2
0
    protected override void SetResources()
    {
        GameObject tmpObject = new GameObject("Score");

        m_scriptScore = tmpObject.AddComponent <HudNumberManager>();
        m_scriptScore.Create();
        m_scriptScore.color       = Color.white;
        m_scriptScore.BasePosType = (int)HUD_BASE_POS._TOP_CENTER;
        m_scriptScore.ChildAnchor = SpriteRoot.ANCHOR_METHOD.UPPER_CENTER;
        m_scriptScore.IsCommaOn   = true;
        m_scriptScore.SetNumber(0);
        tmpObject.transform.parent = Main.inst.GetResourceObject_EZGUITEXTURE().transform;

        m_imgGameBoard.SetTextureSize(DefineBaseManager.inst.GameBaseWidth, DefineBaseManager.inst.GameBaseHeight);

        m_btnAdvice.SetValueChangedDelegate(AdviceProcess);

        m_btnPause.SetAnchor(SpriteRoot.ANCHOR_METHOD.UPPER_RIGHT);
        m_btnPause.SetValueChangedDelegate(SetPauseProcess);

        m_btnPlay.SetAnchor(SpriteRoot.ANCHOR_METHOD.UPPER_RIGHT);
        m_btnPlay.SetValueChangedDelegate(SetPauseProcess);

        m_imgSelectBtn.SetAnchor(SpriteRoot.ANCHOR_METHOD.MIDDLE_CENTER);

        int count = Main.game.GetGameItemManager().GetServiceableActiveItemNum();

        for (int i = 0; i < count; i++)
        {
            m_btnItem[i].GetUIButton().Data = Main.game.GetGameItemManager().GetServiceableActiveItemIndex(i);
            m_btnItem[i].SetAnchor(SpriteRoot.ANCHOR_METHOD.MIDDLE_CENTER);
            m_btnItem[i].SetValueChangedDelegate(ItemProcess);

            m_txtItem[i].SetAnchor(SpriteText.Anchor_Pos.Lower_Right);
            m_txtItem[i].SetAllignment(SpriteText.Alignment_Type.Right);
        }
    }