Make InitializeCluster more robust
This commit is contained in:
parent
9d92767786
commit
ca8cc526f6
@ -40,13 +40,15 @@ namespace NanoBrain.Unity {
|
||||
}
|
||||
|
||||
private void InitializeCluster(SerializedProperty property, ClusterView clusterView) {
|
||||
if (clusterView.initialized)
|
||||
if (property == null || property.serializedObject == null || clusterView.initialized)
|
||||
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}");
|
||||
// Debug.Log($"Instantiate new Cluster for {targetObject.name}");
|
||||
|
||||
// This does not work properly yet it seems
|
||||
ClusterPrefab clusterPrefab = prefabProp.objectReferenceValue as ClusterPrefab;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user