提交测试代码
This commit is contained in:
@@ -1,40 +1,40 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
[CustomEditor(typeof(FloatBobberController))]
|
||||
public class FloatBobberControllerEditor : Editor
|
||||
{
|
||||
private FloatBobberController _target;
|
||||
void OnEnable()
|
||||
{
|
||||
_target = target as FloatBobberController;
|
||||
// lookAtPoint = serializedObject.FindProperty("lookAtPoint");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
if (GUILayout.Button("TriggerDownPulse"))
|
||||
{
|
||||
_target.TriggerDownPulse();
|
||||
}
|
||||
if (GUILayout.Button("TriggerUpPulse"))
|
||||
{
|
||||
_target.TriggerUpPulse();
|
||||
}
|
||||
if (GUILayout.Button("AddFishPull"))
|
||||
{
|
||||
_target.AddFishPull(0.5f);
|
||||
}
|
||||
if (GUILayout.Button("AddFishPull"))
|
||||
{
|
||||
_target.ReleaseFishPull(0.5f);
|
||||
}
|
||||
// serializedObject.Update();
|
||||
// EditorGUILayout.PropertyField(lookAtPoint);
|
||||
// serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
// using UnityEditor;
|
||||
// using UnityEngine;
|
||||
//
|
||||
// namespace NBF
|
||||
// {
|
||||
// [CustomEditor(typeof(FloatBobberController))]
|
||||
// public class FloatBobberControllerEditor : Editor
|
||||
// {
|
||||
// private FloatBobberController _target;
|
||||
// void OnEnable()
|
||||
// {
|
||||
// _target = target as FloatBobberController;
|
||||
// // lookAtPoint = serializedObject.FindProperty("lookAtPoint");
|
||||
// }
|
||||
//
|
||||
// public override void OnInspectorGUI()
|
||||
// {
|
||||
// base.OnInspectorGUI();
|
||||
// if (GUILayout.Button("TriggerDownPulse"))
|
||||
// {
|
||||
// _target.TriggerDownPulse();
|
||||
// }
|
||||
// if (GUILayout.Button("TriggerUpPulse"))
|
||||
// {
|
||||
// _target.TriggerUpPulse();
|
||||
// }
|
||||
// if (GUILayout.Button("AddFishPull"))
|
||||
// {
|
||||
// _target.AddFishPull(0.5f);
|
||||
// }
|
||||
// if (GUILayout.Button("AddFishPull"))
|
||||
// {
|
||||
// _target.ReleaseFishPull(0.5f);
|
||||
// }
|
||||
// // serializedObject.Update();
|
||||
// // EditorGUILayout.PropertyField(lookAtPoint);
|
||||
// // serializedObject.ApplyModifiedProperties();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user