Пример #1
0
        private void AdjustMeter(GameObject rBrushStroke, float fBrushSize, bool bAddToMeter)
        {
            // Make brush size not matter if we're ignoring it
            if (!m_BrushSizeAffectsCost)
            {
                fBrushSize = 1.0f;
            }

            // If this brush stroke had a valid cost, adjust the meter
            BaseBrushScript rBrush = rBrushStroke.GetComponent <BaseBrushScript>();

            if (rBrush != null)
            {
                float fCost = BaseBrushScript.GetStrokeCost(
                    rBrush.Descriptor, rBrush.GetNumUsedVerts(), fBrushSize);
                if (fCost > 0.0f)
                {
                    AdjustMeter(bAddToMeter ? fCost : -fCost);
                }
            }
        }