Example #1
0
 public static new BlackJackMode GetInstance()
 {
     if (instance == null)
     {
         instance = new BlackJackMode();
     }
     return(instance);
 }
Example #2
0
    // Use this for initialization
    void Start()
    {
        GameSystem.GetInstance().OnWaveNumberChanged    += HandleOnWaveNumberChanged;
        GameSystem.GetInstance().OnScoreChanged         += HandleOnScoreChanged;
        SurvivalMode.GetInstance().OnHPChanged          += HandleOnHPChanged;
        TimeRushMode.GetInstance().OnLifeTimeChanged    += HandleOnLifeTimeChanged;
        ColorFullMode.GetInstance().OnColorChanged      += HandleOnColorChanged;
        BlackJackMode.GetInstance().OnSelectCardChanged += HandleOnSelectCardChanged;
        DualMode.GetInstance().OnTurnChanged            += HandleOnTurnChanged;
        DualMode.GetInstance().OnLeftHPChanged          += HandleOnLeftHPChanged;
        DualMode.GetInstance().OnRightHPChanged         += HandleOnRightHPChanged;
        WordMode.GetInstance().OnWordTextChanged        += HandleOnWordTextChanged;
        translationLabel.gameObject.SetActive(LocalVersion.local == LocalVersion.Local.CN_ZH);

        dualLeftSideSlider.foregroundWidget.color  = Constant.LEFT_COLOR;
        dualRightSideSlider.foregroundWidget.color = Constant.RIGHT_COLOR;
    }
Example #3
0
    void HandleOnSelectCardChanged()
    {
        int index = 0;

        foreach (UISprite cardSprite in cardArray)
        {
            if (index < BlackJackMode.GetInstance().SelectedCardNames.Count)
            {
                cardSprite.spriteName = BlackJackMode.GetInstance().SelectedCardNames[index];
                cardSprite.gameObject.SetActive(true);
            }
            else
            {
                cardSprite.gameObject.SetActive(false);
            }
            index++;
        }
        cardTable.Reposition();
    }