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; }, enumerable: true }); }