Skip to content

Commit

Permalink
add module
Browse files Browse the repository at this point in the history
  • Loading branch information
SantyWang committed Sep 25, 2023
1 parent 0d4ec2f commit a20fcc9
Show file tree
Hide file tree
Showing 37 changed files with 761 additions and 468 deletions.
6 changes: 3 additions & 3 deletions cocos/core/curves/gradient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
*/

import { CCClass } from '../data';
import { Color, lerp, repeat, EPSILON, approx, random, clamp01, clamp } from '../math';
import { Enum } from '..';
import { Color, lerp, random, clamp } from '../math';
import { Enum, ValueType } from '..';

const tempColor = new Color();

Expand Down Expand Up @@ -102,7 +102,7 @@ export declare namespace Gradient {
* @en Gradient is a component that has a lot of color keys and alpha keys to get the interpolated color value.
* @zh 渐变曲线控件包含了颜色关键帧和透明度关键帧,在关键帧中进行插值渐变返回最终的颜色值。
*/
export class Gradient {
export class Gradient extends ValueType {
/**
* @en
* There are 2 kind of mode:
Expand Down
31 changes: 27 additions & 4 deletions cocos/particle/Impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,22 @@ export declare namespace Impl {
dispose();
}

export class CurveRange {
export class OptimizedCurve {
setMinTime(minTime: number);
setLength(length: number);
setLUTSize(size: number);
getLUTData(): Uint32Array;
}

export class CurveRange {
setMode(mode: number);
setScalar(scalar: number): void
setMinScalar(scalar: number): void
getWritableCurve(): OptimizedCurve;
getWritableMinCurve(): OptimizedCurve;
}

export class OptimizedGradient {
setMode(mode: number);
setMinTime(minTime: number);
setLength(length: number);
setLUTSize(size: number);
Expand All @@ -36,8 +46,8 @@ export declare namespace Impl {
setMode(mode: number): void;
setColor(color: number): void
setMinColor(color: number): void
getGradient(): OptimizedGradient;
getMinGradient(): OptimizedGradient;
getWritableGradient(): OptimizedGradient;
getWritableMinGradient(): OptimizedGradient;
}

export class ParticleSystemModule {
Expand All @@ -60,6 +70,15 @@ export declare namespace Impl {
setEmitFrom(emitFrom: BoxShapeEmitFrom): void;
}

export class CircleShape extends Shape {
setRadius(radius: number): void;
setRadiusThickness(radius: number): void;
setArc(arc: number): void;
setSpread(spread: number): void;
getSpeed(): CurveRange;
setMode(arcMode: ArcMode): void;
}

export class ColorBySpeed extends ParticleSystemModule {
getColor(): GradientRange;
setSpeedRange(min: number, max: number): void;
Expand All @@ -81,6 +100,10 @@ export declare namespace Impl {
setMultiplyBySize(multiplyBySize: boolean): void;
setMultiplyByVelocity(multiplyByVelocity: boolean): void;
}

export class SpeedMultiplierOverLifetime extends ParticleSystemModule {
getMultiplier(): CurveRange;
}
}

export class Impl {
Expand Down
Loading

0 comments on commit a20fcc9

Please sign in to comment.