UnityEditor.GameViewSizesMenuItemProvider.Replace C# (CSharp) Method

Replace() public method

public Replace ( int index, object obj ) : void
index int
obj object
return void
        public void Replace(int index, object obj)
        {
            GameViewSize other = CastToGameViewSize(obj);
            if (other != null)
            {
                if (index < this.m_GameViewSizeGroup.GetBuiltinCount())
                {
                    Debug.LogError("Only custom game view sizes can be changed");
                }
                else
                {
                    GameViewSize gameViewSize = this.m_GameViewSizeGroup.GetGameViewSize(index);
                    if (gameViewSize != null)
                    {
                        gameViewSize.Set(other);
                        ScriptableSingleton<GameViewSizes>.instance.SaveToHDD();
                    }
                }
            }
        }
    }