rabidus-test/Assets/BNG Framework/Editor/ExplosiveEditor.cs

32 lines
682 B
C#
Raw Permalink Normal View History

2023-07-24 16:38:13 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace BNG {
[CustomEditor(typeof(Explosive))]
[CanEditMultipleObjects]
public class ExplosiveEditor : Editor {
Explosive explosive;
public override void OnInspectorGUI() {
explosive = (Explosive)target;
if (GUILayout.Button("Explode!")) {
if(Application.isPlaying) {
explosive.DoExplosion();
}
else {
Debug.Log("(Play Mode Only)");
}
}
base.OnInspectorGUI();
}
}
}