UnityEditor.TerrainInspector.CheckKeys C# (CSharp) Method

CheckKeys() private method

private CheckKeys ( ) : void
return void
        private void CheckKeys()
        {
            for (int i = 0; i < s_ToolKeys.Length; i++)
            {
                if (s_ToolKeys[i].activated)
                {
                    this.selectedTool = (TerrainTool) i;
                    base.Repaint();
                    Event.current.Use();
                }
            }
            if (s_PrevBrush.activated)
            {
                this.m_SelectedBrush--;
                if (this.m_SelectedBrush < 0)
                {
                    this.m_SelectedBrush = s_BrushTextures.Length - 1;
                }
                base.Repaint();
                Event.current.Use();
            }
            if (s_NextBrush.activated)
            {
                this.m_SelectedBrush++;
                if (this.m_SelectedBrush >= s_BrushTextures.Length)
                {
                    this.m_SelectedBrush = 0;
                }
                base.Repaint();
                Event.current.Use();
            }
            int num2 = 0;
            if (s_NextTexture.activated)
            {
                num2 = 1;
            }
            if (s_PrevTexture.activated)
            {
                num2 = -1;
            }
            if (num2 != 0)
            {
                switch (this.selectedTool)
                {
                    case TerrainTool.PaintDetail:
                        this.m_SelectedDetail = (int) Mathf.Repeat((float) (this.m_SelectedDetail + num2), (float) this.m_Terrain.terrainData.detailPrototypes.Length);
                        Event.current.Use();
                        base.Repaint();
                        break;

                    case TerrainTool.PlaceTree:
                        if (TreePainter.selectedTree >= 0)
                        {
                            TreePainter.selectedTree = (int) Mathf.Repeat((float) (TreePainter.selectedTree + num2), (float) this.m_TreeContents.Length);
                        }
                        else if ((num2 == -1) && (this.m_TreeContents.Length > 0))
                        {
                            TreePainter.selectedTree = this.m_TreeContents.Length - 1;
                        }
                        else if ((num2 == 1) && (this.m_TreeContents.Length > 0))
                        {
                            TreePainter.selectedTree = 0;
                        }
                        Event.current.Use();
                        base.Repaint();
                        break;

                    case TerrainTool.PaintTexture:
                        this.m_SelectedSplat = (int) Mathf.Repeat((float) (this.m_SelectedSplat + num2), (float) this.m_Terrain.terrainData.splatPrototypes.Length);
                        Event.current.Use();
                        base.Repaint();
                        break;
                }
            }
        }