throw exception on setMaterialColor failure
This commit is contained in:
@@ -401,9 +401,9 @@ class FilamentController {
|
|||||||
await _channel.invokeMethod("setTexture", [_assetManager, asset]);
|
await _channel.invokeMethod("setTexture", [_assetManager, asset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMaterialColor(FilamentEntity asset, String meshName,
|
Future setMaterialColor(FilamentEntity asset, String meshName,
|
||||||
int materialIndex, Color color) async {
|
int materialIndex, Color color) async {
|
||||||
await _channel.invokeMethod("setMaterialColor", [
|
var result = await _channel.invokeMethod("setMaterialColor", [
|
||||||
_assetManager,
|
_assetManager,
|
||||||
asset,
|
asset,
|
||||||
meshName,
|
meshName,
|
||||||
@@ -415,6 +415,9 @@ class FilamentController {
|
|||||||
color.alpha.toDouble() / 255.0
|
color.alpha.toDouble() / 255.0
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
if (!result) {
|
||||||
|
throw Exception("Failed to set material color");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void transformToUnitCube(FilamentEntity asset) async {
|
void transformToUnitCube(FilamentEntity asset) async {
|
||||||
|
|||||||
Reference in New Issue
Block a user