Ejemplo n.º 1
0
    void Init()
    {
        if (m_inited)
        {
            return;
        }

        Profiler.BeginSample("Init");

        m_inited = true;

        _manager.SystemComp          = this;
        _emitter.SystemComp          = this;
        _colliderManager.SystemComp  = this;
        _forcesManager.SystemComp    = this;
        _particleRenderer.SystemComp = this;

        _manager.Awake(_emitter, _colliderManager, _particleRenderer, _forcesManager, _manager);
        _emitter.Awake(_emitter, _colliderManager, _particleRenderer, _forcesManager, _manager);
        _colliderManager.Awake(_emitter, _colliderManager, _particleRenderer, _forcesManager, _manager);
        _forcesManager.Awake(_emitter, _colliderManager, _particleRenderer, _forcesManager, _manager);
        _particleRenderer.Awake(_emitter, _colliderManager, _particleRenderer, _forcesManager, _manager);
        _manager.Initialize();
        _emitter.Initialize();
        _colliderManager.Initialize();
        _forcesManager.Initialize();
        _particleRenderer.Initialize();

        Profiler.EndSample();
    }