using System.Collections; using System.Collections.Generic; using DefaultNamespace; #if UNITY_EDITOR using UnityEditor; #endif using UnityEngine; [CustomEditor(typeof(CartFollower))] public class CartFollowerEditor : Editor { public override void OnInspectorGUI() { var cart = (CartFollower) target; cart.distance = EditorGUILayout.FloatField("Distance", cart.distance); cart._cart = (GameObject) EditorGUILayout.ObjectField("Cart", cart._cart, typeof(GameObject), true); } }