mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
Some performance improvement
This commit is contained in:
@@ -18,4 +18,27 @@ export default class LinearColorEntity extends IEntity {
|
||||
/** @type {Number} */ this.B
|
||||
/** @type {Number} */ this.A
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Number} number
|
||||
*/
|
||||
static numberToString(number) {
|
||||
return Math.round(number * 255).toString(16)
|
||||
}
|
||||
|
||||
static fromString(value) {
|
||||
return new LinearColorEntity({
|
||||
R: parseInt(value.substr(0, 2), 16) / 255,
|
||||
G: parseInt(value.substr(2, 2), 16) / 255,
|
||||
B: parseInt(value.substr(4, 2), 16) / 255,
|
||||
A: parseInt(value.substr(6, 2), 16) / 255,
|
||||
})
|
||||
}
|
||||
|
||||
toString() {
|
||||
return "#" + LinearColorEntity.numberToString(this.R)
|
||||
+ LinearColorEntity.numberToString(this.G)
|
||||
+ LinearColorEntity.numberToString(this.B)
|
||||
+ LinearColorEntity.numberToString(this.A)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ export default class PinEntity extends IEntity {
|
||||
* }}
|
||||
*/ this.PinType
|
||||
/** @type {PinReferenceEntity[]} */ this.LinkedTo
|
||||
/** @type {String} */ this.DefaultValue
|
||||
/** @type {String | LinearColorEntity} */ this.DefaultValue
|
||||
/** @type {String} */ this.AutogeneratedDefaultValue
|
||||
/** @type {ObjectReferenceEntity} */ this.DefaultObject
|
||||
/** @type {GuidEntity} */ this.PersistentGuid
|
||||
|
||||
Reference in New Issue
Block a user