Tuesday, April 16, 2024
HomeSample Page

Sample Page Title


Hello,

In model 3.5.2, if you use a CurveRange property with a getter and setter, modifying the mode and modifying the worth in fixed mode execute the setter code, however selecting a curve preset or modifying a customized curve doesn’t.

Example :

import { _decorator, Component, Node, CurveRange } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Test')
export class Test extends Component {
    @property(CurveRange)
    personal _curve: CurveRange = new CurveRange();
    @property(CurveRange)
    protected get curve(): CurveRange {
      return this._curve;
    }
    protected set curve(worth: CurveRange) {
      this._curve = worth;
      console.log('curve modifictaion');
    }
}

Is this a bug ? Or is there one other method of listening to the curve modification ?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments