Пример #1
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();
                }
            }
        }
Пример #2
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);
            }
        }
Пример #3
0
        private void EnsureSelectedSizeAreValid()
        {
            if (ScriptableSingleton <GameViewSizes> .instance.GetChangeID() != this.m_SizeChangeID)
            {
                this.m_SizeChangeID = ScriptableSingleton <GameViewSizes> .instance.GetChangeID();

                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 GameViewSizesMenuItemProvider(GameViewSizeGroupType gameViewSizeGroupType)
 {
     this.m_GameViewSizeGroup = ScriptableSingleton <GameViewSizes> .instance.GetGroup(gameViewSizeGroupType);
 }
Пример #5
0
 public GameViewSizesMenuItemProvider(GameViewSizeGroupType gameViewSizeGroupType)
 {
     m_GameViewSizeGroup = GameViewSizes.instance.GetGroup(gameViewSizeGroupType);
 }
		public GameViewSizesMenuItemProvider(GameViewSizeGroupType gameViewSizeGroupType)
		{
			this.m_GameViewSizeGroup = ScriptableSingleton<GameViewSizes>.instance.GetGroup(gameViewSizeGroupType);
		}