SubEmitter module

SubEmittersModule

2024.4.12

yisky

Hierarchy (view full)

Constructors

Properties

_enable: boolean = false

Accessors

  • get enable(): boolean
  • Specifies whether enable the module.

    Returns boolean

    ParticleModule

  • set enable(value): void
  • Specifies whether enable the module.

    Parameters

    • value: boolean

    Returns void

    ParticleModule

  • get subEmittersCount(): number
  • The total number of sub-emitters.

    Returns number

    SubEmittersModule

Methods

  • Protected

    Enable callback

    Returns void

    ParticleModule

  • Protected

    Serialize

    Parameters

    • meta: {
          [key: string]: any;
      }
      • [key: string]: any

    Returns void

    ParticleModule

  • Update particle

    Parameters

    • particle: Particle
    • deltaTime: number

    Returns void

    SubEmittersModule

  • Add a new sub-emitter.

    Parameters

    Returns void

    SubEmittersModule

  • Emit event

    Parameters

    • event: {
          type: string;
          [key: string]: any;
      }
      • [key: string]: any
      • type: string

    Returns void

    EventDispatcher

  • Deserialize

    Parameters

    • json: {
          [key: string]: any;
      }
      • [key: string]: any

    Returns void

    ParticleModule

  • Gets the probability that the sub-emitter emits particles.

    Parameters

    • index: number

      The index of the sub-emitter.

    Returns number

    SubEmittersModule

  • Gets the sub - emitter Particle System at the given index.

    Parameters

    • index: number

      The index of the desired sub-emitter.

    Returns ParticleSystem

    SubEmittersModule

  • Unsubscribe a event, if the callback param is not defined, all subscribers of this type will be removed.

    Parameters

    • type: string
    • Optionalcallback: SubscriberCallbackFn

      subscriber callback

    Returns void

    EventDispatcher

  • Subscribe a event

    Parameters

    • type: string

      event type

    • callback: SubscriberCallbackFn

      callback functions

    • Optionaloptions: {
          priority?: Priority;
          target?: any;
      }

      options

      • Optionalpriority?: Priority
      • Optionaltarget?: any

    Returns void

    EventDispatcher

  • Subscribe a event, just emit once

    Parameters

    • type: string
    • callback: SubscriberCallbackFn

      subscriber callback

    • Optionaloptions: {
          priority?: Priority;
          target?: any;
      }
      • Optionalpriority?: Priority
      • Optionaltarget?: any

    Returns void

    EventDispatcher

  • Removes a sub-emitter from the given index in the array.

    Parameters

    • index: number

      The index from which to remove a sub-emitter.

    Returns void

    SubEmittersModule

  • Sets the probability that the sub - emitter emits particles.

    Parameters

    • index: number

      The index of the sub-emitter you want to modify.

    • emitProbability: number

      The probability value.

    Returns void

    SubEmittersModule

  • Sets the properties of the sub - emitter at the given index.

    Parameters

    Returns void

    SubEmittersModule

  • Sets the Particle System to use as the sub-emitter at the given index.

    Parameters

    • index: number

      The index of the sub-emitter you want to modify.

    • subEmitter: ParticleSystem

      The Particle System to use as the sub-emitter at the specified index.

    Returns void

    SubEmittersModule

  • Sets the type of the sub - emitter at the given index.

    Parameters

    • index: number

      The index of the sub-emitter you want to modify.

    • type: ParticleSystemSubEmitterType

      The new spawning type to assign to this sub-emitter.

    Returns void

    SubEmittersModule

  • Serialize

    Returns {
        [key: string]: any;
    }

    • [key: string]: any

    ParticleModule