コード例 #1
0
    void _OnSelectedFoodChanged(EventArgs args)
    {
        EventArgs_FoodType selectedFoodArgs = args as EventArgs_FoodType;

        if (selectedFoodArgs != null)
        {
            _selFoodBtn = _GetFootBtn(selectedFoodArgs.eFoodType);
        }
        else
        {
            Debug.LogErrorFormat("Error: BagManager::OnSelectedFoodChanged args type is {0}", args.GetType().ToString());
        }
    }
コード例 #2
0
    void _OnFoodItemCooldownComplete(EventArgs args)
    {
        EventArgs_FoodType foodTypeArgs = args as EventArgs_FoodType;

        if (foodTypeArgs != null)
        {
            FoodItemView btn = _GetFootBtn(foodTypeArgs.eFoodType);
            if (btn != null)
            {
                btn.ItemData.Count = _initDict[foodTypeArgs.eFoodType];
            }
        }
        else
        {
            Debug.LogErrorFormat("Error: _OnFoodItemCooldownComplete args type is {0}", args.GetType().ToString());
        }
    }
コード例 #3
0
    FoodItemView _GetFootBtn(eFoodType eType)
    {
        FoodItemView btn = null;

        if (_btnList == null || _btnList.Count <= 0)
        {
            return(btn);
        }

        for (int i = 0; i < _btnList.Count; ++i)
        {
            if (eType == _btnList[i].ItemData.Type)
            {
                btn = _btnList[i];
                break;
            }
        }
        return(btn);
    }