public DecalEntityManager Get()
        {
            if (m_DecalEntityManager == null)
            {
                Assert.AreEqual(m_ReferenceCounter, 0);

                m_DecalEntityManager = new DecalEntityManager();

                var decalProjectors = GameObject.FindObjectsOfType <DecalProjector>();
                foreach (var decalProjector in decalProjectors)
                {
                    if (!decalProjector.isActiveAndEnabled || m_DecalEntityManager.IsValid(decalProjector.decalEntity))
                    {
                        continue;
                    }
                    decalProjector.decalEntity = m_DecalEntityManager.CreateDecalEntity(decalProjector);
                }

                DecalProjector.onDecalAdd            += OnDecalAdd;
                DecalProjector.onDecalRemove         += OnDecalRemove;
                DecalProjector.onDecalPropertyChange += OnDecalPropertyChange;
                DecalProjector.onDecalMaterialChange += OnDecalMaterialChange;
            }

            m_ReferenceCounter++;

            return(m_DecalEntityManager);
        }
Exemple #2
0
        public DecalDrawSystem(string sampler, DecalEntityManager entityManager)
        {
            m_EntityManager = entityManager;

            m_WorldToDecals  = new Matrix4x4[250];
            m_NormalToDecals = new Matrix4x4[250];

            m_Sampler = new ProfilingSampler(sampler);
        }
        public void Dispose()
        {
            m_DecalEntityManager.Dispose();
            m_DecalEntityManager = null;
            m_ReferenceCounter   = 0;

            DecalProjector.onDecalAdd            -= OnDecalAdd;
            DecalProjector.onDecalRemove         -= OnDecalRemove;
            DecalProjector.onDecalPropertyChange -= OnDecalPropertyChange;
            DecalProjector.onDecalMaterialChange -= OnDecalMaterialChange;
        }
        public void Release(DecalEntityManager decalEntityManager)
        {
            if (m_ReferenceCounter == 0)
            {
                return;
            }

            m_ReferenceCounter--;

            if (m_ReferenceCounter == 0)
            {
                Dispose();
            }
        }
Exemple #5
0
 public DecalUpdateCullingGroupSystem(DecalEntityManager entityManager, float drawDistance)
 {
     m_EntityManager       = entityManager;
     m_BoundingDistance[0] = drawDistance;
     m_Sampler             = new ProfilingSampler("DecalUpdateCullingGroupsSystem.Execute");
 }
 public DecalDrawGBufferSystem(DecalEntityManager entityManager) : base("DecalDrawGBufferSystem.Execute", entityManager)
 {
 }
Exemple #7
0
 public DecalUpdateCachedSystem(DecalEntityManager entityManager)
 {
     m_EntityManager = entityManager;
     m_Sampler       = new ProfilingSampler("DecalUpdateCachedSystem.Execute");
     m_SamplerJob    = new ProfilingSampler("DecalUpdateCachedSystem.ExecuteJob");
 }
 public DecalSkipCulledSystem(DecalEntityManager entityManager)
 {
     m_EntityManager = entityManager;
     m_Sampler       = new ProfilingSampler("DecalSkipCulledSystem.Execute");
 }
 public DecalDrawErrorSystem(DecalEntityManager entityManager, DecalTechnique technique) : base("DecalDrawErrorSystem.Execute", entityManager)
 {
     m_Technique = technique;
 }
 public DecalDrawFowardEmissiveSystem(DecalEntityManager entityManager) : base("DecalDrawFowardEmissiveSystem.Execute", entityManager)
 {
 }
Exemple #11
0
 public DecalDrawScreenSpaceSystem(DecalEntityManager entityManager) : base("DecalDrawScreenSpaceSystem.Execute", entityManager)
 {
 }