Exemplo n.º 1
0
        private void AdjustMeter(BatchSubset subset, float fBrushSize, bool bAddToMeter)
        {
            //make brush size not matter if we're ignorning it
            if (!m_BrushSizeAffectsCost)
            {
                fBrushSize = 1.0f;
            }

            //figure out how much this batch costs
            BrushDescriptor brush = BrushCatalog.m_Instance.GetBrush(
                subset.m_ParentBatch.ParentPool.m_BrushGuid);
            float fCost = BaseBrushScript.GetStrokeCost(brush, subset.m_VertLength, fBrushSize);

            AdjustMeter(bAddToMeter ? fCost : -fCost);
        }
Exemplo n.º 2
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);
                }
            }
        }