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) {
|
||||
if (property == null || property.serializedObject == null || clusterView.initialized)
|
||||
if (property == null || clusterView.initialized)
|
||||
return;
|
||||
|
||||
SerializedObject serializedObject = property.serializedObject;
|
||||
if (serializedObject == null)
|
||||
return;
|
||||
|
||||
UnityEngine.Object targetObject = serializedObject.targetObject;
|
||||
if (targetObject == null)
|
||||
return;
|
||||
|
||||
SerializedProperty prefabProp = property.FindPropertyRelative(nameof(Cluster.prefab));
|
||||
UnityEngine.Object targetObject = property.serializedObject.targetObject;
|
||||
if (targetObject == null)
|
||||
return;
|
||||
|
||||
Debug.Log($"Instantiate new Cluster for {targetObject.name}");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user