예제 #1
0
        public void CheckPrototypeChanges()
        {
            if (shaderBindings != null)
            {
                shaderBindings.ClearEmptyShaderInstances();

                CheckForShaderBindings(detailPrototypes);
                CheckForShaderBindings(treePrototypes);
                CheckForShaderBindings(prefabPrototypes);
            }
            if (billboardAtlasBindings != null)
            {
                billboardAtlasBindings.ClearEmptyBillboardAtlases();

                CheckForBillboardBindinds(detailPrototypes);
                CheckForBillboardBindinds(treePrototypes);
                CheckForBillboardBindinds(prefabPrototypes);
            }
        }
예제 #2
0
        public virtual void CheckPrototypeChanges()
        {
            if (prototypeList == null)
            {
                GeneratePrototypes();
            }
            else
            {
                prototypeList.RemoveAll(p => p == null);
            }

            if (shaderBindings != null)
            {
                shaderBindings.ClearEmptyShaderInstances();
                foreach (GPUInstancerPrototype prototype in prototypeList)
                {
                    if (prototype.prefabObject != null)
                    {
                        GPUInstancerUtility.GenerateInstancedShadersForGameObject(prototype, shaderBindings);
                        if (string.IsNullOrEmpty(prototype.warningText))
                        {
                            if (prototype.prefabObject.GetComponentInChildren <MeshRenderer>() == null)
                            {
                                prototype.warningText = "Prefab object does not contain any Mesh Renderers.";
                            }
                        }
                    }
                }
            }
            if (billboardAtlasBindings != null)
            {
                billboardAtlasBindings.ClearEmptyBillboardAtlases();
                //foreach (GPUInstancerPrototype prototype in prototypeList)
                //{
                //    if (prototype.prefabObject != null && prototype.useGeneratedBillboard &&
                //        (prototype.billboard == null || prototype.billboard.albedoAtlasTexture == null || prototype.billboard.normalAtlasTexture == null))
                //        GPUInstancerUtility.GeneratePrototypeBillboard(prototype, billboardAtlasBindings);
                //}
            }
        }