Make InstantiateCluster more robust
This commit is contained in:
parent
5e73335997
commit
6bc6f19637
@ -37,13 +37,18 @@ namespace NanoBrain.Unity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void InstantiateCluster(SerializedProperty property, ClusterView clusterView) {
|
private void InstantiateCluster(SerializedProperty property, ClusterView clusterView) {
|
||||||
if (property == null || property.serializedObject == null || clusterView.initialized)
|
if (property == null || clusterView.initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SerializedProperty prefabProp = property.FindPropertyRelative(nameof(Cluster.prefab));
|
SerializedObject serializedObject = property.serializedObject;
|
||||||
UnityEngine.Object targetObject = property.serializedObject.targetObject;
|
if (serializedObject == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
UnityEngine.Object targetObject = serializedObject.targetObject;
|
||||||
if (targetObject == null)
|
if (targetObject == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
SerializedProperty prefabProp = property.FindPropertyRelative(nameof(Cluster.prefab));
|
||||||
|
|
||||||
Debug.Log($"Instantiate new Cluster for {targetObject.name}");
|
Debug.Log($"Instantiate new Cluster for {targetObject.name}");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user