diff --git a/Editor/Neuron_Drawer.cs b/Editor/Neuron_Drawer.cs index dac91b2..6cb226c 100644 --- a/Editor/Neuron_Drawer.cs +++ b/Editor/Neuron_Drawer.cs @@ -7,7 +7,11 @@ using System.Collections; namespace NanoBrain { [CustomPropertyDrawer(typeof(Neuron))] - class NeuronDrawer : PropertyDrawer { + class Neuron_Drawer : PropertyDrawer { + public static void Insepctor(SerializedObject serializedObject, string propertyName ) { + EditorGUILayout.PropertyField(serializedObject.FindProperty(propertyName)); + } + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { // Draw foldout + properties label = EditorGUI.BeginProperty(position, label, property); diff --git a/Runtime/Scripts/Core/Neuron.cs b/Runtime/Scripts/Core/Neuron.cs index d434b04..43b6507 100644 --- a/Runtime/Scripts/Core/Neuron.cs +++ b/Runtime/Scripts/Core/Neuron.cs @@ -284,8 +284,8 @@ namespace NanoBrain { } public Action WhenFiring; - - public virtual bool isSleeping => false;// Time.time - this.lastUpdate > this.timeToSleep; //this.outputMagnitude == 0; + public bool persistOutput = false; + public virtual bool isSleeping => persistOutput ? false : (Time.time - this.lastUpdate > this.timeToSleep); public void SleepCheck() { if (this.isSleeping) { #if UNITY_MATHEMATICS @@ -330,6 +330,7 @@ namespace NanoBrain { protected virtual void CloneFields(Neuron clone) { clone.bias = this.bias; + clone.persistOutput = this.persistOutput; clone.combinator = this.combinator; clone.curve = this.curve; clone.curvePreset = this.curvePreset;