GetTotalCount() public method

public GetTotalCount ( ) : int
return int
示例#1
0
        private void EnsureSelectedSizeAreValid()
        {
            int length = Enum.GetNames(typeof(GameViewSizeGroupType)).Length;

            if (this.m_SelectedSizes.Length != length)
            {
                Array.Resize <int>(ref this.m_SelectedSizes, length);
            }
            foreach (int num in Enum.GetValues(typeof(GameViewSizeGroupType)))
            {
                GameViewSizeGroupType gameViewSizeGroupType = (GameViewSizeGroupType)num;
                GameViewSizeGroup     group = ScriptableSingleton <GameViewSizes> .instance.GetGroup(gameViewSizeGroupType);

                int index = (int)gameViewSizeGroupType;
                this.m_SelectedSizes[index] = Mathf.Clamp(this.m_SelectedSizes[index], 0, group.GetTotalCount() - 1);
            }
        }
示例#2
0
        private void EnsureSelectedSizeAreValid()
        {
            int num = Enum.GetNames(typeof(GameViewSizeGroupType)).Length;

            if (this.m_SelectedSizes.Length != num)
            {
                Array.Resize <int>(ref this.m_SelectedSizes, num);
            }
            IEnumerator enumerator = Enum.GetValues(typeof(GameViewSizeGroupType)).GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    GameViewSizeGroupType gameViewSizeGroupType = (GameViewSizeGroupType)((int)enumerator.Current);
                    GameViewSizeGroup     group = ScriptableSingleton <GameViewSizes> .instance.GetGroup(gameViewSizeGroupType);

                    int num2 = (int)gameViewSizeGroupType;
                    this.m_SelectedSizes[num2] = Mathf.Clamp(this.m_SelectedSizes[num2], 0, group.GetTotalCount() - 1);
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }
示例#3
0
        private void EnsureSelectedSizeAreValid()
        {
            Array values = Enum.GetValues(typeof(GameViewSizeGroupType));

            if (this.m_SelectedSizes.Length != values.Length)
            {
                Array.Resize <int>(ref this.m_SelectedSizes, values.Length);
            }
            IEnumerator enumerator = values.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    GameViewSizeGroupType gameViewSizeGroupType = (GameViewSizeGroupType)enumerator.Current;
                    GameViewSizeGroup     group = ScriptableSingleton <GameViewSizes> .instance.GetGroup(gameViewSizeGroupType);

                    int num = (int)gameViewSizeGroupType;
                    this.m_SelectedSizes[num] = Mathf.Clamp(this.m_SelectedSizes[num], 0, group.GetTotalCount() - 1);
                }
            }
            finally
            {
                IDisposable disposable;
                if ((disposable = (enumerator as IDisposable)) != null)
                {
                    disposable.Dispose();
                }
            }
            int num2 = this.m_LowResolutionForAspectRatios.Length;

            if (this.m_LowResolutionForAspectRatios.Length != values.Length)
            {
                Array.Resize <bool>(ref this.m_LowResolutionForAspectRatios, values.Length);
            }
            for (int i = num2; i < values.Length; i++)
            {
                this.m_LowResolutionForAspectRatios[i] = GameViewSizes.DefaultLowResolutionSettingForSizeGroupType((GameViewSizeGroupType)values.GetValue(i));
            }
        }
 public int Count()
 {
     return(m_GameViewSizeGroup.GetTotalCount());
 }