Error CS0118

I need help with my game. I can’t run my game due to a error in code. The error is:

Assets/Fracture/Common/Editor/BaseDestructableEditor.cs(10,39): error CS0118: ‘Editor’ is a ‘namespace’ but a ‘type’ was expected.

I would show the code but I would be hung and quartered :). How can I fix this error?

Here is the entire code as my brain is completely jelly at the moment.

using System.Collections.Generic;
using System.Linq;

using UnityEngine;
using UnityEditor;

using Destruction.Tools;
using Destruction.Common;

public class BaseDestructableEditor : Editor
{
    private enum Tools
    {
        StickyZone = 0,
        Joiner,
        Cleanup,
        Options
    }

    private Tools CurrentToolKey = Tools.StickyZone;

    private readonly Dictionary<Tools, IDestructionTool> tools = new Dictionary<Tools, IDestructionTool>
                                                                {
                                                                    { Tools.StickyZone, new StickyZoneTool() },
                                                                    { Tools.Joiner, new Joiner() },
                                                                    { Tools.Cleanup, new CleanupTool() },
                                                                    { Tools.Options, new Options() }
                                                                };
    private IDestructionTool CurrentSelectedTool
    {
        get { return tools[CurrentToolKey]; }
    }

    protected virtual void OnEnable()
    {
        CurrentSelectedTool.OnEnable(targets);
    }

    public override void OnInspectorGUI()
    {
        if (EditorApplication.isPlayingOrWillChangePlaymode) return;

        GUILayout.Space(10);

        using (new Vertical("box"))
        {
            using (new Horizontal("TE Toolbar"))
            {
                foreach (KeyValuePair<Tools, IDestructionTool> tool in tools)
                {
                    using (new GUIBackgroundColor(tool.Key == CurrentToolKey ? Color.grey : Color.white))
                    {
                        if (GUILayout.Button(tool.Value.Name, "toolbarbutton"))
                        {
                            if (CurrentToolKey != tool.Key)
                            {
                                tools[tool.Key].OnEnable(targets);
                            }

                            CurrentToolKey = tool.Key;

                            break;
                        }
                    }
                }

                GUILayout.FlexibleSpace();
            }

            CurrentSelectedTool.OnInspectorGUI(targets.Cast<BaseDestructable>().ToArray());
        }
    }

    protected virtual void OnSceneGUI()
    {
        if (EditorApplication.isPlayingOrWillChangePlaymode) return;

        CurrentSelectedTool.OnSceneGUI(target as BaseDestructable);
    }
}`

For this to work you need to add

[CustomEditor(typeof(class_name))]

Before your class definition, where class_name is the name of the class of which you want to make an editor class. Without that, editor classes won’t work. So you will have to keep your class code ie. The code you want to execute during runtime will have to be in a separate class, of which you will create an editor class which will contain all your OnInspectorGUI() functions and the others associated with the Editor namespace.