2
0
ShiroSmith 6 жил өмнө
parent
commit
3b4b410fbf
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      hide/prefab/Light.hx

+ 2 - 1
hide/prefab/Light.hx

@@ -142,7 +142,8 @@ class Light extends Object3D {
 	}
 
 	function loadBaked( ctx : Context ) {
-		var light = cast(ctx.local3d,h3d.scene.pbr.Light);
+		var light = Std.instance(ctx.local3d, h3d.scene.pbr.Light);
+		if(light == null) return;
 		var res = ctx.shared.loadPrefabDat("shadowMap", "bake", name);
 		if(res != null) light.shadows.loadStaticData(res.entry.getBytes());
 	}