Exemplo n.º 1
0
 public bool Equals(ItemWithFramentsCounter obj)
 {
     return(itemCount == obj.itemCount &&
            maxItemCount == obj.maxItemCount &&
            fragmentCount == obj.fragmentCount &&
            maxFragmentCount == obj.maxFragmentCount);
 }
Exemplo n.º 2
0
 protected override void OnShow(object data)
 {
     base.OnShow(data);
     // 重新初始化
     _curLifeCounter      = new ItemWithFramentsCounter();
     _curSpellCardCounter = new ItemWithFramentsCounter();
     AddEvents();
     ResetFpsText();
     UIManager.GetInstance().RegisterViewUpdate(this);
 }
Exemplo n.º 3
0
 public PlayerInterface()
 {
     _lifeCounter = new ItemWithFramentsCounter
     {
         maxItemCount     = Consts.PlayerMaxLifeCount,
         maxFragmentCount = Consts.PlayerMaxLifeFragmentCount,
     };
     _spellCardCounter = new ItemWithFramentsCounter
     {
         maxItemCount     = Consts.PlayerMaxSpellCardCount,
         maxFragmentCount = Consts.PlayerMaxSpellCardFragmentCount,
     };
 }
Exemplo n.º 4
0
    private void UpdateSpellCardValue()
    {
        ItemWithFramentsCounter spellCardCounter = PlayerInterface.GetInstance().GetSpellCardCounter();

        if (spellCardCounter != _curSpellCardCounter)
        {
            _curSpellCardCounter = spellCardCounter;
            int i;
            for (i = 0; i < _curSpellCardCounter.itemCount; i++)
            {
                _spellCardImgList[i].sprite = ResourceManager.GetInstance().GetSprite(Consts.STGMainViewAtlasName, "sc1");
            }
            // 有符卡碎片且符卡没有达到最大值时,显示符卡碎片
            if (_curSpellCardCounter.fragmentCount > 0 && _curSpellCardCounter.itemCount != _curSpellCardCounter.maxItemCount)
            {
                _spellCardImgList[i].sprite = ResourceManager.GetInstance().GetSprite(Consts.STGMainViewAtlasName, "sc" + _curSpellCardCounter.fragmentCount + "-" + _curSpellCardCounter.maxFragmentCount);
                i++;
            }
            for (; i < Consts.PlayerMaxSpellCardCount; i++)
            {
                _spellCardImgList[i].sprite = ResourceManager.GetInstance().GetSprite(Consts.STGMainViewAtlasName, "sc0");
            }
        }
    }
Exemplo n.º 5
0
    private void UpdateLifeValue()
    {
        ItemWithFramentsCounter lifeCounter = PlayerInterface.GetInstance().GetLifeCounter();

        if (lifeCounter != _curLifeCounter)
        {
            _curLifeCounter = lifeCounter;
            int i;
            for (i = 0; i < _curLifeCounter.itemCount; i++)
            {
                _lifeImgList[i].sprite = ResourceManager.GetInstance().GetSprite(Consts.STGMainViewAtlasName, "life1");
            }
            // 有残机碎片且残机没有达到最大值时,显示残机碎片
            if (_curLifeCounter.fragmentCount > 0 && _curLifeCounter.itemCount != _curLifeCounter.maxItemCount)
            {
                _lifeImgList[i].sprite = ResourceManager.GetInstance().GetSprite(Consts.STGMainViewAtlasName, "life" + _curLifeCounter.fragmentCount + "-" + _curLifeCounter.maxFragmentCount);
                i++;
            }
            for (; i < Consts.PlayerMaxLifeCount; i++)
            {
                _lifeImgList[i].sprite = ResourceManager.GetInstance().GetSprite(Consts.STGMainViewAtlasName, "life0");
            }
        }
    }