mirror of
https://gitee.com/nomat/lcc-ui-sorting-group-demo.git
synced 2025-01-27 21:51:03 +00:00
35 lines
739 B
TypeScript
35 lines
739 B
TypeScript
import { UIRenderer } from "cc";
|
|
|
|
declare module 'cc' {
|
|
interface UIRenderer {
|
|
|
|
/**
|
|
* 排序优先级 - private
|
|
*/
|
|
_sortingPriority:number;
|
|
|
|
/**
|
|
* 排序优先级
|
|
*/
|
|
sortingPriority:number;
|
|
|
|
/**
|
|
* 排序透明度
|
|
*/
|
|
sortingOpacity:number;
|
|
}
|
|
}
|
|
|
|
if(!('sortingPriority' in UIRenderer.prototype)){
|
|
Object.defineProperty(UIRenderer.prototype, 'sortingPriority', {
|
|
get: function() {
|
|
return this._sortingPriority;
|
|
},
|
|
set: function(value) {
|
|
this._sortingPriority = value;
|
|
this._renderEntity.sortingPriority = value;
|
|
},
|
|
enumerable: true
|
|
});
|
|
}
|