Exemple #1
0
    /// <summary>
    /// 环形UI重置.
    /// </summary>
    public void ResetUI()
    {
        if (currentItem != null)
        {
            // 隐藏当前类别二级菜单.
            currentItem.NormalItem();

            // 重置, 显示默认空项目.
            currentItem = categoryItemList[0];
            currentItem.ActiveItem();
        }

        // 索引重置.
        categoryIndex     = 0;
        categoryScrollNum = 9000.0f;

        // 重置二级菜单项目.
        materialIndex     = 0;
        materialScrollNum = 3000.0f;
        if (currentMaterial != null)
        {
            currentMaterial.NormalItem();
        }
        currentMaterial = null;
    }
Exemple #2
0
    /// <summary>
    /// 鼠标滚轮操作切换建造类别.
    /// </summary>
    private void MouseScrollWheelCategory(float scrollValue)
    {
        // 滚轮切换建造类别.
        categoryScrollNum += scrollValue * 3;
        categoryIndex      = Mathf.Abs((int)categoryScrollNum % categoryNum);

        targetItem = categoryItemList[categoryIndex];
        if (currentItem != targetItem)
        {
            currentItem.NormalItem();
            targetItem.ActiveItem();
            m_BuildPanelView.M_CategoryNameText.text = categoryNames[categoryIndex];

            currentItem = targetItem;
        }
    }