- Home /
Multi-Object Editing not supported
I have just tried to script an editor script, and it just shows "multi-object editing not supported," and nothing else. the script:
#pragma strict
@CustomEditor(PlayerController) @CanEditMultipleObjects
class PlayerEditor extends Editor{
var Speed: float = 0.0;
var SProp: SerializedProperty;
function OnEnable(){
SProp = serializedObject.FindProperty("MSpeed");
}
function OnInspectorGUI(){
serializedObject.Update();
Speed = EditorGUILayout.Slider(Speed, 1, 150);
if(!SProp.hasMultipleDifferentValues){
PBar(SProp / 100.0, Speed);
}
}
function PBar(val: float, label: String){
var rect: Rect = GUILayoutUtility.GetRect(18, 18, "Text Field");
EditorGUI.ProgressBar(rect, val, label);
EditorGUILayout.Space();
}
}
is here. any help would be much appreciated. thanks in advance
You should describe what your script is supposed to do. You should also describe and identify the line at which error message was displayed/reported.
there is no line that the editor specifies as to having an error, as for what it's supposed to do.. well, its supposed to show a slider that changes the variable '$$anonymous$$Speed" of the player. however, in the inspector, it just shows "multi-object edition not supported." thanks for the reply :D also, i'm sorta new to scripting for the editor.
Answer by Fehr · Feb 26, 2014 at 01:56 AM
Hey LockonS.
This same question has been asked here: http://answers.unity3d.com/questions/344813/editorguilayout-multi-object-editing-not-supported.html
The solution for me however, was that the Editor script (the class that derives from editor, eg 'extends Editor') wasn't in the Assets/Editor folder within the project.
Hopefully this helps.
Regards,
Seb.
Turns out that editor scripts should be inside a folder called "Editor". Does not matter where those folders are allocated, $$anonymous$$e was inside Assets/scripts/Editor. $$anonymous$$ore than one Editor folder is also allowed
Your answer
Follow this Question
Related Questions
How to assign object reference to ObjectField knowing the object's name? 2 Answers
ScriptableObject problem 1 Answer
Collision object Under Character Controller? 1 Answer
Change position using custom and native editor 1 Answer
Moving a 3d object in unity on mouse click with click to move controller 1 Answer