//************************************************************************************************* /// <summary> /// Inspector drawing /// </summary> //************************************************************************************************* public override void OnInspectorGUI() { base.OnInspectorGUI(); EditorGUI.BeginChangeCheck(); EditorGUILayout.Space(); toggle = EditorGUILayout.ToggleLeft("Simulate Now at Editor", toggle); // True if GUI.changed was set to true, otherwise false. if (EditorGUI.EndChangeCheck()) { if (toggle) { comp.SimulateAtEditor(); } else { comp.Apply(); } } }
//************************************************************************************************* /// <summary> /// Inspector 描画 /// </summary> //************************************************************************************************* public override void OnInspectorGUI() { base.OnInspectorGUI(); EditorGUI.BeginChangeCheck(); // toggle をマウスでクリックして値を変更する EditorGUILayout.Space(); toggle = EditorGUILayout.ToggleLeft("Editor上で即シミュレート", toggle); // toggle の値が変更されるたびに true になる if (EditorGUI.EndChangeCheck()) { if (toggle) { comp.SimulateAtEditor(); } else { comp.Setup(); comp.Apply(); } } }