简体   繁体   中英

Getting errors while creating a custom terrain editor (Unity C#)

I created two scripts called "CustomTerrain" and "CustomTerrainEditor". Here is the code for the latter:

using UnityEngine;
using UnityEditor;
using EditorGUITable;

[CustomEditor(typeOf(CustomTerrain))] // Links editor code in here with CustomTerrain.cs
[CanEditMultipleObjects]
public class CustomTerrainEditor : Editor
{
    void OnEnable() {}

    public override void OnInspectorGUI() {} // The GUI we will see in the inspector
}

Here are the 2 errors I get: 在此处输入图像描述

I don't understand what I am doing wrong. Thanks for the help!

First, change typeOf to typeof.

And next if CustomTerrain in another namespace, add this space to your script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM