Exemple #1
0
        void RecalculatePercentages()
        {
            //Debug.Log("RecalculatePercentages() called");


            double totalSize = GetTotalSize();

            //Debug.LogFormat("BuildSizes total: {0}", totalSize);

            for (int n = 0, len = BuildSizes.Length; n < len; ++n)
            {
                BuildSizes[n].Percentage = System.Math.Round((BuildSizes[n].UsableSize / totalSize) * 100, 2,
                                                             System.MidpointRounding.AwayFromZero);
            }


            // note: only Used Assets are shown the percentages so we
            // don't bother recalculating percentage for Unused Assets
            if (UsedAssets != null)
            {
                UsedAssets.RecalculatePercentages(totalSize);
            }

            ChangeTotalSize(totalSize);
        }
Exemple #2
0
        void RecalculatePercentages()
        {
            double totalSize = GetTotalSize();

            if (totalSize > 0)
            {
                for (int n = 0, len = BuildSizes.Length; n < len; ++n)
                {
                    BuildSizes[n].Percentage = Math.Round((BuildSizes[n].UsableSize / totalSize) * 100, 2, MidpointRounding.AwayFromZero);
                }
            }

            // note: only Used Assets are shown the percentages so we
            // don't bother recaulculating percentage for Unused Assets
            if (UsedAssets != null)
            {
                UsedAssets.RecalculatePercentages(totalSize);
            }
        }