ParticleSystem.MainModule.customSimulationSpace

Unity · Версия 2020.3 LTS · Scripting · MainModule

ParticleSystem.MainModule.customSimulationSpace

public Transform customSimulationSpace;

Описание

Имитация частиц относительно пользовательского компонента преобразования.

Смотрите так же: ParticleSystemSimulationSpace.Custom.

using System.Collections;
using UnityEngine;

[RequireComponent(typeof(ParticleSystem))]
public class ExampleClass : MonoBehaviour
{
    private ParticleSystem ps;
    public Transform relativeTo;

    void Start()
    {
        ps = GetComponent<ParticleSystem>();

        var main = ps.main;
        main.simulationSpace = ParticleSystemSimulationSpace.Custom;
        main.customSimulationSpace = relativeTo;
    }
}

Обновлено 17 ноября 2026 г.