コード例 #1
0
ファイル: UISlider.cs プロジェクト: hhs900110/ProjectKT
    // Called to update the slider bar's appearance
    protected void UpdateAppearance(float truncVal)
    {
        this.TruncateRight(truncVal);

        if (emptySprite != null)
        {
            emptySprite.TruncateLeft(1f - truncVal);
        }

        // Truncate layers:
        for (int i = 0; i < filledLayers.Length; ++i)
        {
            //if (filledIndices[i] != -1)
            filledLayers[i].TruncateRight(truncVal);
        }
        for (int i = 0; i < emptyLayers.Length; ++i)
        {
            //if (emptyIndices[i] != -1)
            emptyLayers[i].TruncateLeft(1f - truncVal);
        }
    }
コード例 #2
0
    // Updates the appearance of the bar
    // according to our progress value:
    protected void UpdateProgress()
    {
        this.TruncateRight(m_value);

        if (emptySprite != null)
        {
            emptySprite.TruncateLeft(1f - m_value);
        }

        // Truncate layers:
        for (int i = 0; i < filledLayers.Length; ++i)
        {
            //if (filledIndices[i] != -1)
            filledLayers[i].TruncateRight(m_value);
        }
        for (int i = 0; i < emptyLayers.Length; ++i)
        {
            //if (emptyIndices[i] != -1)
            emptyLayers[i].TruncateLeft(1f - m_value);
        }
    }