public override void OnInspectorGUI() { DrawDefaultInspector(); //显示默认所有参数 Hitbox demo = (Hitbox)target; demo.frames = (int)GUILayout.HorizontalSlider(demo.frames, 0, demo.bounds.Length); if (GUILayout.Button("AutoPlay")) { demo.AutoPlay(); } if (GUILayout.Button("Previous")) { demo.frames--; demo.frames = Mathf.Clamp(demo.frames, 0, demo.bounds.Length); demo.Play(demo.frames); } if (GUILayout.Button("Next")) { demo.frames++; demo.frames = Mathf.Clamp(demo.frames, 0, demo.bounds.Length); demo.Play(demo.frames); } }