Testing new pipelineData object.

This commit is contained in:
Richard Davey 2020-10-27 18:06:53 +00:00
parent 88d2ecd760
commit 4b3cc7145e

View file

@ -40,6 +40,16 @@ var Pipeline = {
*/
pipeline: null,
/**
* An object to store pipeline specific data in, to be read by the pipeline this Game Object uses.
*
* @name Phaser.GameObjects.Components.Pipeline#pipelineData
* @type {object}
* @webglOnly
* @since 3.50.0
*/
pipelineData: {},
/**
* Sets the initial WebGL Pipeline of this Game Object.
*
@ -87,7 +97,7 @@ var Pipeline = {
*
* @return {this} This Game Object instance.
*/
setPipeline: function (pipeline)
setPipeline: function (pipeline, pipelineData)
{
var renderer = this.scene.sys.renderer;
var pipelines = renderer.pipelines;
@ -99,12 +109,20 @@ var Pipeline = {
if (instance)
{
this.pipeline = instance;
this.pipelineData = pipelineData;
}
}
return this;
},
setPipelineData: function (key, value)
{
this.pipelineData[key] = value;
return this;
},
/**
* Resets the WebGL Pipeline of this Game Object back to the default it was created with.
*