BasicParticleComponent

Provides setting and control of basic particles.

# Properties

[{"index":"BasicParticleType ParticleType (Sync)","0":"Set the type of particle to be created."}]

##### inherited from BaseParticleComponent:

[{"index":"boolean AutoRandomSeed (Sync)","0":"Sets whether to create a new random seed whenever particle emission begins."}]

[{"index":"Color Color (Sync)","0":"Corrects the color of the particles to be rendered."}]

[{"index":"boolean IgnoreMapLayerCheck (Sync)","0":"Does not perform automatic substitution when the Map Layer's name is specified in SortingLayer."}]

[{"index":"boolean IsEmitting (Sync) (ReadOnly) (HideFromInspector)","0":"Indicates whether new particles are being emitted."}]

[{"index":"LitMode LitMode (Sync)","0":"Selects the rendering method that will determine whether materials or objects will be affected by light sources."}]

[{"index":"boolean Loop (Sync)","0":"Set whether to play particles repeatedly."}]

[{"index":"int32 OrderInLayer (Sync)","0":"Determines the priority within the same layer. A higher number indicates higher priority."}]

[{"index":"float ParticleCount (Sync)","0":"Set the number of particles."}]

[{"index":"float ParticleLifeTime (Sync)","0":"Set the particle duration."}]

[{"index":"float ParticleSize (Sync)","0":"Set the particle size."}]

[{"index":"float ParticleSpeed (Sync)","0":"Set the particle speed."}]

[{"index":"boolean PlayOnEnable (Sync)","0":"Set whether to play particles when the particle component is set to Enable."}]

[{"index":"float PlaySpeed (Sync)","0":"Set the play speed of particles."}]

[{"index":"boolean Prewarm (Sync)","0":"If set to Enable, the maximum number of particles is loaded, and the particles play naturally."}]

[{"index":"integer RandomSeed (Sync)","0":"Sets the random seed used to determine creation position, emission direction, speed, etc. when particle is played."}]

[{"index":"string SortingLayer (Sync)","0":"When two or more Entities overlap, the priority is determined by the Sorting Layer."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

##### inherited from BaseParticleComponent:

[{"index":"void Play()","0":"Play stopped particles."}]

[{"index":"void Stop()","0":"Stop playing particles."}]

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Events

[{"index":"OrderInLayerChangedEvent","0":"This event occurs when changing the Component's OrderInLayer."}]

[{"index":"ParticleEmitEndEvent","0":"This event is raised by BaseParticleComponent when emission of the particle has been completed."}]

[{"index":"ParticleEmitStartEvent","0":"The event that takes place when particle emission begins."}]

[{"index":"ParticleLoopEvent","0":"If the Loop property is enabled, this event is fired when the particle's emission cycle returns and the emission repeats."}]

[{"index":"SortingLayerChangedEvent","0":"This event occurs when changing the component's SortingLayer."}]

# Examples

This is an example of playing back and pausing the particle and controlling the particle property.
    
    
    @Component
    script ParticlePlaybackController extends Component
        property any particleComponent = nil
    
        @ExecSpace("ClientOnly")
        method void OnBeginPlay()
        self.particleComponent = self.Entity.BasicParticleComponent
    
        self.particleComponent.PlaySpeed = _UtilLogic:RandomDouble() * 2
        self.particleComponent.ParticleCount = 2
        end
    
        @EventSender("Service", "InputService")
        handler HandleKeyDownEvent(KeyDownEvent event)
        ----------------- Native Emitter Info ------------------
        -- Emitter: InputService
        -- Space: Client
        --------------------------------------------------------
    
        -- Parameters
        local key = event.key
        --------------------------------------------------------
        if key == KeyboardKey.Q then
        self.particleComponent:Stop()
        elseif key == KeyboardKey.E then
        self.particleComponent:Play()
        end
        end
    end
    

# SeeAlso

  * KeyboardKey
  * UtilLogic
  * InputService
  * ParticleService
  * [Using Particles](/docs?postId=1036)
  * [Utilizing Particles](/docs?postId=764)