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
asked
May 11 '12 at 03:01 AM
LockonS
11
●
2
●
3
●
3
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 'MSpeed" 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.