forked from cocos/cocos-engine
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
213 additions
and
546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,66 @@ | ||
import { CurveRange } from '../../../typedoc-index'; | ||
import { ccclass } from '../../core/data/class-decorator'; | ||
import { Enum } from '../../core'; | ||
import { ccclass, serializable, tooltip, type } from '../../core/data/class-decorator'; | ||
import { CurveRange } from '../curve-range'; | ||
import { DistributionMode } from '../define'; | ||
import { Impl } from '../impl'; | ||
import { Shape } from './shape'; | ||
|
||
@ccclass('cc.DistributableShape') | ||
export abstract class DistributableShape extends Shape { | ||
|
||
|
||
Check failure on line 11 in cocos/particle/modules/distributable-shape.ts
|
||
@type(Enum(DistributionMode)) | ||
@tooltip('i18n:ParticleSystem.DistributableShape.mode') | ||
public get mode (): DistributionMode { | ||
return this._mode; | ||
} | ||
|
||
public set mode (mode: DistributionMode) { | ||
this._mode = mode; | ||
this.impl?.setMode(mode); | ||
} | ||
|
||
@type(CurveRange) | ||
@tooltip('i18n:ParticleSystem.DistributableShape.speed') | ||
public get speed (): Readonly<CurveRange> { | ||
return this._speed; | ||
} | ||
|
||
public set speed (speed: Readonly<CurveRange>) { | ||
this._speed.set(speed); | ||
if (this.impl) { | ||
this._speed.copyToLowLevelCurveRange(this.impl.getSpeed()); | ||
} | ||
} | ||
|
||
@tooltip('i18n:ParticleSystem.DistributableShape.spread') | ||
public get spread (): number { | ||
return this._spread; | ||
} | ||
|
||
public set spread (spread: number) { | ||
this._spread = spread; | ||
this.impl?.setSpread(spread); | ||
} | ||
|
||
|
||
public get impl (): Impl.DistributableShape | null { | ||
return this._impl as Impl.DistributableShape | null; | ||
Check failure on line 48 in cocos/particle/modules/distributable-shape.ts
|
||
} | ||
|
||
@serializable | ||
private _spread = 0; | ||
@serializable | ||
private _speed = new CurveRange(1); | ||
private _mode = Dis; | ||
@serializable | ||
private _mode = DistributionMode.RANDOM; | ||
|
||
public initialize (): void { | ||
super.initialize(); | ||
if (this.impl) { | ||
this.impl.setSpread(this._spread); | ||
this.impl.setMode(this._mode); | ||
this._speed.copyToLowLevelCurveRange(this.impl.getSpeed()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.