File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,18 @@ public void SetNewTransform(string transformName)
145145#if UNITY_EDITOR
146146 Debug . Log ( $ "Atlas transform set to { transformName } ") ;
147147#endif
148- SetNewTransform ( BrainAtlasManager . AtlasTransforms . Find ( x => x . Name . Equals ( transformName ) ) ) ;
148+
149+ AtlasTransform newTransform = BrainAtlasManager . AtlasTransforms . Find ( x => x . Name . Equals ( transformName ) ) ;
150+
151+ if ( newTransform != null )
152+ {
153+ SetNewTransform ( newTransform ) ;
154+ }
155+ else
156+ {
157+ SetNewTransform ( BrainAtlasManager . AtlasTransforms [ 0 ] ) ;
158+ Debug . LogWarning ( $ "(PAM) No matching atlas transform exists for { transformName } , reverting to NULL transform. This is not the intended behavior!") ;
159+ }
149160 }
150161
151162 public void SetNewTransform ( AtlasTransform newTransform )
You can’t perform that action at this time.
0 commit comments