Compatibility with latest nanobrain
This commit is contained in:
parent
1918faf280
commit
76023718cb
@ -19,7 +19,7 @@ namespace NanoBrain.Unity {
|
|||||||
|
|
||||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) {
|
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) {
|
||||||
float height = EditorGUIUtility.singleLineHeight + padding;
|
float height = EditorGUIUtility.singleLineHeight + padding;
|
||||||
string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetEntityId();
|
string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetInstanceID();//GetEntityId();
|
||||||
s_foldouts.TryGetValue(key, out bool isOpen);
|
s_foldouts.TryGetValue(key, out bool isOpen);
|
||||||
if (property.objectReferenceValue != null && isOpen) {
|
if (property.objectReferenceValue != null && isOpen) {
|
||||||
height += padding + elementHeight;
|
height += padding + elementHeight;
|
||||||
@ -45,7 +45,7 @@ namespace NanoBrain.Unity {
|
|||||||
|
|
||||||
if (property.objectReferenceValue is ClusterPrefab prefab) {
|
if (property.objectReferenceValue is ClusterPrefab prefab) {
|
||||||
// key per field instance
|
// key per field instance
|
||||||
string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetEntityId();
|
string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetInstanceID();//GetEntityId();
|
||||||
if (!s_foldouts.TryGetValue(key, out bool isOpen))
|
if (!s_foldouts.TryGetValue(key, out bool isOpen))
|
||||||
isOpen = true;
|
isOpen = true;
|
||||||
|
|
||||||
|
|||||||
@ -1,2 +1,11 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5f43b401b7d59dec7ac7d493cbc4927d
|
guid: 5f43b401b7d59dec7ac7d493cbc4927d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|||||||
@ -19,13 +19,13 @@ namespace NanoBrain.Unity {
|
|||||||
|
|
||||||
static readonly Dictionary<string, ClusterView> clusterViews = new();
|
static readonly Dictionary<string, ClusterView> clusterViews = new();
|
||||||
public static ClusterView GetClusterView(SerializedProperty property) {
|
public static ClusterView GetClusterView(SerializedProperty property) {
|
||||||
string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetEntityId();
|
string key = property.propertyPath + "_" + property.serializedObject.targetObject.GetInstanceID();//GetEntityId();
|
||||||
if (!clusterViews.TryGetValue(key, out ClusterView clusterView))
|
if (!clusterViews.TryGetValue(key, out ClusterView clusterView))
|
||||||
clusterView = new() { key = key };
|
clusterView = new() { key = key };
|
||||||
return clusterView;
|
return clusterView;
|
||||||
}
|
}
|
||||||
public static ClusterView GetClusterView(SerializedObject serializedObject) {
|
public static ClusterView GetClusterView(SerializedObject serializedObject) {
|
||||||
string key = serializedObject.targetObject.GetEntityId().ToString();
|
string key = serializedObject.targetObject.GetInstanceID().ToString(); //GetEntityId().ToString();
|
||||||
if (!clusterViews.TryGetValue(key, out ClusterView clusterView))
|
if (!clusterViews.TryGetValue(key, out ClusterView clusterView))
|
||||||
clusterView = new() { key = key };
|
clusterView = new() { key = key };
|
||||||
return clusterView;
|
return clusterView;
|
||||||
@ -267,6 +267,9 @@ namespace NanoBrain.Unity {
|
|||||||
|
|
||||||
private void DescendGraph(Dag.Node receiver, ref int ix, Dag dag) {
|
private void DescendGraph(Dag.Node receiver, ref int ix, Dag dag) {
|
||||||
Neuron receiverNeuron = receiver.nucleus as Neuron;
|
Neuron receiverNeuron = receiver.nucleus as Neuron;
|
||||||
|
if (receiverNeuron == null)
|
||||||
|
return;
|
||||||
|
|
||||||
foreach (Synapse synapse in receiverNeuron.synapses) {
|
foreach (Synapse synapse in receiverNeuron.synapses) {
|
||||||
Nucleus nucleus = synapse.neuron;
|
Nucleus nucleus = synapse.neuron;
|
||||||
if (nucleus.parent != null && nucleus.parent != currentNucleus.parent) {
|
if (nucleus.parent != null && nucleus.parent != currentNucleus.parent) {
|
||||||
|
|||||||
@ -1,2 +1,11 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 8a7663ccd347fd78dbdba393c03ed7c7
|
guid: 8a7663ccd347fd78dbdba393c03ed7c7
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|||||||
@ -1,2 +1,11 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: a755ac8461bd0c714a852df47331048e
|
guid: a755ac8461bd0c714a852df47331048e
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|||||||
@ -15,7 +15,7 @@ namespace NanoBrain.Braitenberg {
|
|||||||
protected override float SampleSensor() {
|
protected override float SampleSensor() {
|
||||||
float sum = 0f;
|
float sum = 0f;
|
||||||
// Get all active lights in scene (Point lights only)
|
// Get all active lights in scene (Point lights only)
|
||||||
Light[] lights = FindObjectsByType<Light>();
|
Light[] lights = FindObjectsByType<Light>(FindObjectsSortMode.None);
|
||||||
Vector3 pos = transform.position;
|
Vector3 pos = transform.position;
|
||||||
Vector3 forward = transform.forward;
|
Vector3 forward = transform.forward;
|
||||||
|
|
||||||
|
|||||||
@ -1,2 +1,11 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: fbdba2c00e2271d7eae755fa49a7958c
|
guid: fbdba2c00e2271d7eae755fa49a7958c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|||||||
@ -1,2 +1,11 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 07c6bf9674b9f9f0bbbf4a37f570ef4d
|
guid: 07c6bf9674b9f9f0bbbf4a37f570ef4d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|||||||
@ -1,2 +1,11 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: b3d0457beca5df1bba076ac65df90b59
|
guid: b3d0457beca5df1bba076ac65df90b59
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|||||||
@ -1,2 +1,11 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: a8d53357b6673864d91bbc5c595d48b9
|
guid: a8d53357b6673864d91bbc5c595d48b9
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user