BBMOD_MaterialPropertyBlock.copy

A function defined in BBMOD_MaterialPropertyBlock.gml

copy(_dest)

Description

Shallowly copies properties into another material property block.

Arguments

Name Type Description
_dest Struct.BBMOD_MaterialPropertyBlock The material property block to copy properties into.

Returns

Struct.BBMOD_MaterialPropertyBlock Returns self.

Example

// Create one set of props
var _materialPropsA = new BBMOD_MaterialPropertyBlock();
_materialPropsA.set_float("u_fA", 1.0);

// Create a different set of props
var _materialPropsB = new BBMOD_MaterialPropertyBlock();
_materialPropsB.set_float("u_fB", 1.0);

// Override props B with props A
_materialPropsA.copy(_materialPropsB);
show_debug_message(_materialPropsA.get_names()); // Prints ["u_fA"]
show_debug_message(_materialPropsB.get_names()); // Also prints ["u_fA"]!

Note

This removes properties that the other material property block has before this one's are copied into it!

Do you find this page helpful?

Copyright © 2024, BlueBurn. Built on July 03, 2024 using GMDoc.