Single smell works

This commit is contained in:
Pascal Serrarens 2026-05-06 12:10:26 +02:00
parent a651ec6e15
commit 33ea14bb72
2 changed files with 8 additions and 3 deletions

View File

@ -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);

View File

@ -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;