Skip to content

Commit

Permalink
feat: add userData property to Node,Geometry,Material and Skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
06wj committed Sep 10, 2020
1 parent 850ba5d commit 40db285
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ const Node = Class.create(/** @lends Node.prototype */ {
*/
useHandCursor: false,

/**
* 用户数据
* @default null
* @type {any}
*/
userData: null,

/**
* 是否强制使用父元素 worldMatrix,供高级开发者使用
* @private
Expand Down
8 changes: 8 additions & 0 deletions src/core/Skeleton.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ const Skeleton = Class.create(/** @lends Skeleton.prototype */ {
* @type {String}
*/
className: 'Skeleton',

/**
* 用户数据
* @default null
* @type {any}
*/
userData: null,

/**
* @constructs
* @param {Object} [params] 创建对象的属性参数。可包含此类的所有属性。
Expand Down
7 changes: 7 additions & 0 deletions src/geometry/Geometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ const Geometry = Class.create(/** @lends Geometry.prototype */ {
*/
useAABBRaycast: false,

/**
* 用户数据
* @default null
* @type {any}
*/
userData: null,

/**
* @constructs
* @param {object} [params] 初始化参数,所有params都会复制到实例上
Expand Down
7 changes: 7 additions & 0 deletions src/material/Material.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ const Material = Class.create(/** @lends Material.prototype */ {
*/
isDiffuesEnvAndAmbientLightWorkTogether: false,

/**
* 用户数据
* @default null
* @type {any}
*/
userData: null,

/**
* 渲染顺序数字小的先渲染(透明物体和不透明在不同的队列)
* @default 0
Expand Down

0 comments on commit 40db285

Please sign in to comment.