加入边缘阈值

This commit is contained in:
caizhitao
2019-12-24 17:07:17 +08:00
parent c43d246b8f
commit eec09600af
10 changed files with 1060 additions and 61 deletions

View File

@@ -0,0 +1,27 @@
const { ccclass, property } = cc._decorator;
@ccclass
export default class GlowThresholdSliderPrefab extends cc.Component {
@property(cc.Slider)
slider: cc.Slider = null;
@property(cc.Label)
valueLabel: cc.Label = null;
onEnable() {
this.slider.node.on("slide", this._onSliderChanged, this);
}
onDisable() {
this.slider.node.off("slide", this._onSliderChanged, this);
}
start() {
this._onSliderChanged();
}
private _onSliderChanged() {
let realProgress = this.slider.progress * 0.01;
this.valueLabel.string = `${(realProgress * 100).toFixed(2)}%`;
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "c5a62981-21fc-466d-a3ed-0b5672a778cf",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}