void OnSceneGUI() { WayPointFunction myScript = (WayPointFunction)target; myScript.UpdateStateWayPoint(); GUIStyle style = new GUIStyle(); style.normal.textColor = Color.white; style.fontStyle = FontStyle.Bold; Handles.Label(myScript.transform.position, "Selected", style); GUILayout.BeginArea(new Rect(10, 10, 150, 100), "Waypoints Functions"); GUILayout.Label(" Waypoints Functions", style); if (GUILayout.Button("Create Neighbor", GUILayout.Width(120), GUILayout.Height(20))) { var way = myScript.CreateNeighbor(); Selection.SetActiveObjectWithContext(way, null); AssignLabel(way); } if (GUILayout.Button("Is Walkable", GUILayout.Width(120), GUILayout.Height(20))) { myScript.WalkableChange(); } GUILayout.EndArea(); }
public override void OnInspectorGUI() { DrawDefaultInspector(); WayPointFunction myScript = (WayPointFunction)target; if (GUILayout.Button("Create Neighbor ")) { var way = myScript.CreateNeighbor(); Selection.SetActiveObjectWithContext(way, null); AssignLabel(way); } }