Esempio n. 1
0
        public static void VisitParticleSystem(this ParticleSystem particleSystem, ParticleSystemRenderer renderer, ref int totalCount, ref int deletedCount, ref int particleCount, ref int meshParticleVertexCount, GameObject obj)
        {
            totalCount++;

            if (renderer == null)
            {
                deletedCount++;
                Object.Destroy(particleSystem);
                return;
            }

            var particleLimit = AdvancedSafetySettings.MaxParticles - particleCount;

            if (particleSystem.maxParticles > particleLimit)
            {
                particleSystem.maxParticles = particleLimit;
            }

            particleCount += particleSystem.maxParticles;

            if (renderer.renderMode == ParticleSystemRenderMode.Mesh)
            {
                var meshes = new Il2CppReferenceArray <Mesh>(renderer.meshCount);
                renderer.GetMeshes(meshes);

                var polySum = 1;

                foreach (var mesh in meshes)
                {
                    polySum += CountMeshPolygons(mesh, Int32.MaxValue).TotalPolys;
                }

                var requestedVertexCount = polySum * particleSystem.maxParticles;
                var vertexLimit          = AdvancedSafetySettings.MaxMeshParticleVertices - meshParticleVertexCount;
                if (requestedVertexCount > vertexLimit)
                {
                    particleSystem.maxParticles = vertexLimit / polySum;
                }

                meshParticleVertexCount += polySum * particleSystem.maxParticles;
            }

            if (particleSystem.maxParticles == 0)
            {
                Object.DestroyImmediate(renderer, true);
                Object.DestroyImmediate(particleSystem, true);

                deletedCount++;
            }
        }
Esempio n. 2
0
        public static void ExtractUniqueResources(GameObject go, List <Object> resources) //Call this in the editor when serializing instead of during the game
        {
            MeshFilter   filter   = go.GetComponent <MeshFilter>();
            Renderer     rend     = go.GetComponent <Renderer>();
            AudioSource  audio    = go.GetComponent <AudioSource>();
            MeshCollider collider = go.GetComponent <MeshCollider>();

            if (filter != null)
            {
                AddIfUnique(filter.sharedMesh, resources);
            }
            if (rend != null)
            {
                for (int j = 0; j < rend.sharedMaterials.Length; j++)
                {
                    if (rend.sharedMaterials[j] != null)
                    {
                        AddIfUnique(rend.sharedMaterials[j], resources);
                        Texture[] tex = GetTexturesFromMaterial(rend.sharedMaterials[j]);
                        for (int k = 0; k < tex.Length; k++)
                        {
                            AddIfUnique(tex[k], resources);
                        }
                    }
                }
                if (rend is ParticleSystemRenderer)
                {
                    ParticleSystemRenderer psrend = (ParticleSystemRenderer)rend;
                    Mesh[] psMeshes  = new Mesh[4];
                    int    meshCount = psrend.GetMeshes(psMeshes);
                    for (int j = 0; j < meshCount; j++)
                    {
                        AddIfUnique(psMeshes[j], resources);
                    }
                }
            }
            if (audio != null && audio.clip != null && !resources.Contains(audio.clip))
            {
                resources.Add(audio.clip);
            }
            if (collider != null && collider.sharedMesh != null && !resources.Contains(collider.sharedMesh))
            {
                resources.Add(collider.sharedMesh);
            }
        }
Esempio n. 3
0
 private void DoVertexStreamsGUI(RendererModuleUI.RenderMode renderMode)
 {
     this.m_NumTexCoords         = 0;
     this.m_TexCoordChannelIndex = 0;
     this.m_HasTangent           = false;
     this.m_HasColor             = false;
     this.m_VertexStreamsList.DoLayoutList();
     if (!this.m_ParticleSystemUI.multiEdit)
     {
         string text = "";
         if (this.m_Material != null)
         {
             Material material             = this.m_Material.objectReferenceValue as Material;
             int      texCoordChannelCount = this.m_NumTexCoords * 4 + this.m_TexCoordChannelIndex;
             bool     flag  = false;
             bool     flag2 = false;
             bool     flag3 = false;
             bool     flag4 = this.m_ParticleSystemUI.m_ParticleSystems[0].CheckVertexStreamsMatchShader(this.m_HasTangent, this.m_HasColor, texCoordChannelCount, material, ref flag, ref flag2, ref flag3);
             if (flag4)
             {
                 text += "Vertex streams do not match the shader inputs. Particle systems may not render correctly. Ensure your streams match and are used by the shader.";
                 if (flag)
                 {
                     text += "\n- TANGENT stream does not match.";
                 }
                 if (flag2)
                 {
                     text += "\n- COLOR stream does not match.";
                 }
                 if (flag3)
                 {
                     text += "\n- TEXCOORD streams do not match.";
                 }
             }
         }
         int maxTexCoordStreams = this.m_ParticleSystemUI.m_ParticleSystems[0].GetMaxTexCoordStreams();
         if (this.m_NumTexCoords > maxTexCoordStreams || (this.m_NumTexCoords == maxTexCoordStreams && this.m_TexCoordChannelIndex > 0))
         {
             if (text != "")
             {
                 text += "\n\n";
             }
             string text2 = text;
             text = string.Concat(new object[]
             {
                 text2,
                 "Only ",
                 maxTexCoordStreams,
                 " TEXCOORD streams are supported."
             });
         }
         if (renderMode == RendererModuleUI.RenderMode.Mesh)
         {
             ParticleSystemRenderer component = this.m_ParticleSystemUI.m_ParticleSystems[0].GetComponent <ParticleSystemRenderer>();
             Mesh[] array  = new Mesh[4];
             int    meshes = component.GetMeshes(array);
             for (int i = 0; i < meshes; i++)
             {
                 if (array[i].HasChannel(Mesh.InternalShaderChannel.TexCoord2))
                 {
                     if (text != "")
                     {
                         text += "\n\n";
                     }
                     text += "Meshes may only use a maximum of 2 input UV streams.";
                 }
             }
         }
         if (text != "")
         {
             GUIContent gUIContent = EditorGUIUtility.TextContent(text);
             EditorGUILayout.HelpBox(gUIContent.text, MessageType.Error, true);
         }
     }
 }
        public static Dictionary <ParticleSystem, int> EnforceParticleSystemLimits(GameObject currentAvatar)
        {
            Dictionary <ParticleSystem, int> particleSystems = new Dictionary <ParticleSystem, int>();

            foreach (ParticleSystem ps in currentAvatar.transform.GetComponentsInChildren <ParticleSystem>(true))
            {
                int realtime_max = ps_max_particles;

                // always limit collision force
                var collision = ps.collision;
                if (collision.colliderForce > ps_max_particle_force)
                {
                    collision.colliderForce = ps_max_particle_force;
                    Debug.LogError("Collision force is restricted on avatars, particle system named " + ps.gameObject.name + " collision force restricted to " + ps_max_particle_force);
                }

                if (ps_limiter_enabled)
                {
                    if (particleSystems.Count > ps_max_systems)
                    {
                        Debug.LogError("Too many particle systems, #" + particleSystems.Count + " named " + ps.gameObject.name + " deleted");
                        Validation.RemoveComponent(ps);
                        continue;
                    }
                    else
                    {
                        var main     = ps.main;
                        var emission = ps.emission;


                        if (ps.GetComponent <ParticleSystemRenderer>())
                        {
                            ParticleSystemRenderer renderer = ps.GetComponent <ParticleSystemRenderer>();
                            if (renderer.renderMode == ParticleSystemRenderMode.Mesh)
                            {
                                Mesh[] meshes       = new Mesh[0];
                                int    heighestPoly = 0;
                                renderer.GetMeshes(meshes);
                                if (meshes.Length == 0 && renderer.mesh != null)
                                {
                                    meshes = new Mesh[] { renderer.mesh };
                                }
                                // Debug.Log(meshes.Length + " meshes possible emmited meshes from " + ps.gameObject.name);
                                foreach (Mesh m in meshes)
                                {
                                    if (m.isReadable)
                                    {
                                        if (m.triangles.Length / 3 > heighestPoly)
                                        {
                                            heighestPoly = m.triangles.Length / 3;
                                        }
                                    }
                                    else
                                    {
                                        if (1000 > heighestPoly)
                                        {
                                            heighestPoly = 1000;
                                        }
                                    }
                                }
                                if (heighestPoly > 0)
                                {
                                    heighestPoly = Mathf.Clamp(heighestPoly / ps_mesh_particle_divider, 1, heighestPoly);
                                    if (heighestPoly < realtime_max)
                                    {
                                        realtime_max = realtime_max / heighestPoly;
                                    }
                                    else
                                    {
                                        realtime_max = 1;
                                    }
                                    if (heighestPoly > ps_mesh_particle_poly_limit)
                                    {
                                        Debug.LogError("Particle system named " + ps.gameObject.name + " breached polygon limits, it has been deleted");
                                        Validation.RemoveComponent(ps);
                                        continue;
                                    }
                                }
                            }
                        }


                        ParticleSystem.MinMaxCurve rate = emission.rateOverTime;

                        if (rate.mode == ParticleSystemCurveMode.Constant)
                        {
                            rate.constant = Mathf.Clamp(rate.constant, 0, ps_max_emission);
                        }
                        else if (rate.mode == ParticleSystemCurveMode.TwoConstants)
                        {
                            rate.constantMax = Mathf.Clamp(rate.constantMax, 0, ps_max_emission);
                        }
                        else
                        {
                            rate.curveMultiplier = Mathf.Clamp(rate.curveMultiplier, 0, ps_max_emission);
                        }

                        emission.rateOverTime = rate;
                        rate = emission.rateOverDistance;

                        if (rate.mode == ParticleSystemCurveMode.Constant)
                        {
                            rate.constant = Mathf.Clamp(rate.constant, 0, ps_max_emission);
                        }
                        else if (rate.mode == ParticleSystemCurveMode.TwoConstants)
                        {
                            rate.constantMax = Mathf.Clamp(rate.constantMax, 0, ps_max_emission);
                        }
                        else
                        {
                            rate.curveMultiplier = Mathf.Clamp(rate.curveMultiplier, 0, ps_max_emission);
                        }

                        emission.rateOverDistance = rate;

                        //Disable collision with PlayerLocal layer
                        collision.collidesWith &= ~(1 << 10);
                    }
                }

                particleSystems.Add(ps, realtime_max);
            }

            EnforceRealtimeParticleSystemLimits(particleSystems, true, false);

            return(particleSystems);
        }
        private void DoVertexStreamsGUI(RenderMode renderMode)
        {
            ParticleSystemRenderer renderer = m_ParticleSystemUI.m_ParticleSystems[0].GetComponent <ParticleSystemRenderer>();

            // render list
            m_NumTexCoords         = 0;
            m_TexCoordChannelIndex = 0;
            m_NumInstancedStreams  = 0;
            m_HasTangent           = false;
            m_HasColor             = false;
            m_HasGPUInstancing     = (renderMode == RenderMode.Mesh) ? renderer.supportsMeshInstancing : false;
            m_VertexStreamsList.DoLayoutList();

            if (!m_ParticleSystemUI.multiEdit)
            {
                // error messages
                string errors = "";

                // check we have the same streams as the assigned shader
                if (m_Material != null)
                {
                    Material material = m_Material.objectReferenceValue as Material;
                    int      totalChannelCount = m_NumTexCoords * 4 + m_TexCoordChannelIndex;
                    bool     tangentError = false, colorError = false, uvError = false;
                    bool     anyErrors = m_ParticleSystemUI.m_ParticleSystems[0].CheckVertexStreamsMatchShader(m_HasTangent, m_HasColor, totalChannelCount, material, ref tangentError, ref colorError, ref uvError);
                    if (anyErrors)
                    {
                        errors += "Vertex streams do not match the shader inputs. Particle systems may not render correctly. Ensure your streams match and are used by the shader.";
                        if (tangentError)
                        {
                            errors += "\n- TANGENT stream does not match.";
                        }
                        if (colorError)
                        {
                            errors += "\n- COLOR stream does not match.";
                        }
                        if (uvError)
                        {
                            errors += "\n- TEXCOORD streams do not match.";
                        }
                    }
                }

                // check we aren't using too many texcoords
                int maxTexCoords = m_ParticleSystemUI.m_ParticleSystems[0].GetMaxTexCoordStreams();
                if (m_NumTexCoords > maxTexCoords || (m_NumTexCoords == maxTexCoords && m_TexCoordChannelIndex > 0))
                {
                    if (errors != "")
                    {
                        errors += "\n\n";
                    }
                    errors += "Only " + maxTexCoords + " TEXCOORD streams are supported.";
                }

                // check input meshes aren't using too many UV streams
                if (renderMode == RenderMode.Mesh)
                {
                    Mesh[] meshes    = new Mesh[k_MaxNumMeshes];
                    int    numMeshes = renderer.GetMeshes(meshes);
                    for (int i = 0; i < numMeshes; i++)
                    {
                        if (meshes[i].HasChannel(Mesh.InternalShaderChannel.TexCoord2))
                        {
                            if (errors != "")
                            {
                                errors += "\n\n";
                            }
                            errors += "Meshes may only use a maximum of 2 input UV streams.";
                        }
                    }
                }

                if (errors != "")
                {
                    GUIContent warning = EditorGUIUtility.TextContent(errors);
                    EditorGUILayout.HelpBox(warning.text, MessageType.Error, true);
                }
            }
        }
Esempio n. 6
0
        private static IEnumerator AnalyzeParticleSystemRenderers(IEnumerable <ParticleSystem> particleSystems, AvatarPerformanceStats perfStats)
        {
            int   particleSystemCount           = 0;
            ulong particleTotalCount            = 0;
            ulong particleTotalMaxMeshPolyCount = 0;
            bool  particleTrailsEnabled         = false;
            bool  particleCollisionEnabled      = false;
            int   materialSlots = 0;

            foreach (ParticleSystem particleSystem in particleSystems)
            {
                int particleCount = particleSystem.main.maxParticles;
                if (particleCount <= 0)
                {
                    continue;
                }

                particleSystemCount++;
                particleTotalCount += (uint)particleCount;

                ParticleSystemRenderer particleSystemRenderer = particleSystem.GetComponent <ParticleSystemRenderer>();
                if (particleSystemRenderer == null)
                {
                    continue;
                }

                materialSlots++;

                // mesh particles
                if (particleSystemRenderer.renderMode == ParticleSystemRenderMode.Mesh && particleSystemRenderer.meshCount > 0)
                {
                    uint highestPolyCount = 0;

                    Mesh[] meshes = new Mesh[particleSystemRenderer.meshCount];
                    int    particleRendererMeshCount = particleSystemRenderer.GetMeshes(meshes);
                    for (int meshIndex = 0; meshIndex < particleRendererMeshCount; meshIndex++)
                    {
                        Mesh mesh = meshes[meshIndex];
                        if (mesh == null)
                        {
                            continue;
                        }

                        uint polyCount = MeshUtils.GetMeshTriangleCount(mesh);
                        if (polyCount > highestPolyCount)
                        {
                            highestPolyCount = polyCount;
                        }
                    }

                    ulong maxMeshParticlePolyCount = (uint)particleCount * highestPolyCount;
                    particleTotalMaxMeshPolyCount += maxMeshParticlePolyCount;
                }

                if (particleSystem.trails.enabled)
                {
                    particleTrailsEnabled = true;
                    materialSlots++;
                }

                if (particleSystem.collision.enabled)
                {
                    particleCollisionEnabled = true;
                }
            }

            perfStats.particleSystemCount      = particleSystemCount;
            perfStats.particleTotalCount       = particleTotalCount > int.MaxValue ? int.MaxValue : (int)particleTotalCount;
            perfStats.particleMaxMeshPolyCount = particleTotalMaxMeshPolyCount > int.MaxValue ? int.MaxValue : (int)particleTotalMaxMeshPolyCount;
            perfStats.particleTrailsEnabled    = particleTrailsEnabled;
            perfStats.particleCollisionEnabled = particleCollisionEnabled;
            perfStats.materialCount           += materialSlots;

            yield break;
        }
Esempio n. 7
0
        private void DoVertexStreamsGUI(RendererModuleUI.RenderMode renderMode)
        {
            Rect controlRect = ModuleUI.GetControlRect(13, new GUILayoutOption[0]);

            GUI.Label(controlRect, RendererModuleUI.s_Texts.streams, ParticleSystemStyles.Get().label);
            int num = 0;

            for (int i = 0; i < RendererModuleUI.s_Texts.vertexStreams.Length; i++)
            {
                if ((this.m_VertexStreamMask.intValue & 1 << i) != 0)
                {
                    bool   flag     = this.m_ParticleSystemUI.m_ParticleEffectUI.m_Owner is ParticleSystemInspector;
                    string text     = (!flag) ? "TEX" : "TEXCOORD";
                    Rect   position = new Rect(controlRect.x + EditorGUIUtility.labelWidth, controlRect.y, controlRect.width, controlRect.height);
                    if (RendererModuleUI.s_Texts.vertexStreamIsTexCoord[i])
                    {
                        GUI.Label(position, string.Concat(new object[]
                        {
                            RendererModuleUI.s_Texts.vertexStreams[i],
                            " (",
                            text,
                            num++,
                            ", ",
                            RendererModuleUI.s_Texts.vertexStreamDataTypes[i],
                            ")"
                        }), ParticleSystemStyles.Get().label);
                    }
                    else
                    {
                        GUI.Label(position, RendererModuleUI.s_Texts.vertexStreams[i] + " (" + RendererModuleUI.s_Texts.vertexStreamDataTypes[i] + ")", ParticleSystemStyles.Get().label);
                    }
                    position.x  = controlRect.xMax - 12f;
                    controlRect = ModuleUI.GetControlRect(13, new GUILayoutOption[0]);
                    if (i == 0)
                    {
                        if (this.m_VertexStreamMask.intValue != (1 << RendererModuleUI.s_Texts.vertexStreams.Length) - 1)
                        {
                            position.x -= 2f;
                            position.y -= 2f;
                            if (EditorGUI.ButtonMouseDown(position, GUIContent.none, FocusType.Passive, "OL Plus"))
                            {
                                List <GUIContent> list = new List <GUIContent>();
                                for (int j = 0; j < RendererModuleUI.s_Texts.vertexStreams.Length; j++)
                                {
                                    if ((this.m_VertexStreamMask.intValue & 1 << j) == 0)
                                    {
                                        list.Add(new GUIContent(RendererModuleUI.s_Texts.vertexStreams[j]));
                                    }
                                }
                                GenericMenu genericMenu = new GenericMenu();
                                for (int k = 0; k < list.Count; k++)
                                {
                                    GenericMenu arg_292_0 = genericMenu;
                                    GUIContent  arg_292_1 = list[k];
                                    bool        arg_292_2 = false;
                                    if (RendererModuleUI.< > f__mg$cache0 == null)
                                    {
                                        RendererModuleUI.< > f__mg$cache0 = new GenericMenu.MenuFunction2(RendererModuleUI.SelectVertexStreamCallback);
                                    }
                                    arg_292_0.AddItem(arg_292_1, arg_292_2, RendererModuleUI.< > f__mg$cache0, new RendererModuleUI.StreamCallbackData(this.m_VertexStreamMask, list[k].text));
                                }
                                genericMenu.ShowAsContext();
                                Event.current.Use();
                            }
                        }
                    }
                    else if (ModuleUI.MinusButton(position))
                    {
                        this.m_VertexStreamMask.intValue &= ~(1 << i);
                    }
                }
            }
            string text2 = "";

            if (this.m_Material != null)
            {
                Material material = this.m_Material.objectReferenceValue as Material;
                ParticleSystemVertexStreams particleSystemVertexStreams = this.m_ParticleSystemUI.m_ParticleSystem.CheckVertexStreamsMatchShader((ParticleSystemVertexStreams)this.m_VertexStreamMask.intValue, material);
                if (particleSystemVertexStreams != ParticleSystemVertexStreams.None)
                {
                    text2 += "Vertex streams do not match the shader inputs. Particle systems may not render correctly. Ensure your streams match and are used by the shader.";
                    if ((particleSystemVertexStreams & ParticleSystemVertexStreams.Tangent) != ParticleSystemVertexStreams.None)
                    {
                        text2 += "\n- TANGENT stream does not match.";
                    }
                    if ((particleSystemVertexStreams & ParticleSystemVertexStreams.Color) != ParticleSystemVertexStreams.None)
                    {
                        text2 += "\n- COLOR stream does not match.";
                    }
                    if ((particleSystemVertexStreams & ParticleSystemVertexStreams.UV) != ParticleSystemVertexStreams.None)
                    {
                        text2 += "\n- TEXCOORD streams do not match.";
                    }
                }
            }
            int maxTexCoordStreams = this.m_ParticleSystemUI.m_ParticleSystem.GetMaxTexCoordStreams();

            if (num > maxTexCoordStreams)
            {
                if (text2 != "")
                {
                    text2 += "\n\n";
                }
                string text3 = text2;
                text2 = string.Concat(new object[]
                {
                    text3,
                    "Only ",
                    maxTexCoordStreams,
                    " TEXCOORD streams are supported."
                });
            }
            if (renderMode == RendererModuleUI.RenderMode.Mesh)
            {
                ParticleSystemRenderer component = this.m_ParticleSystemUI.m_ParticleSystem.GetComponent <ParticleSystemRenderer>();
                Mesh[] array  = new Mesh[4];
                int    meshes = component.GetMeshes(array);
                for (int l = 0; l < meshes; l++)
                {
                    if (array[l].HasChannel(Mesh.InternalShaderChannel.TexCoord2))
                    {
                        if (text2 != "")
                        {
                            text2 += "\n\n";
                        }
                        text2 += "Meshes may only use a maximum of 2 input UV streams.";
                    }
                }
            }
            if (text2 != "")
            {
                GUIContent gUIContent = EditorGUIUtility.TextContent(text2);
                EditorGUILayout.HelpBox(gUIContent.text, MessageType.Error, true);
            }
        }
Esempio n. 8
0
        static MeshInitializer()
        {
            #region Unity Primatives
            new AssetAccessor <Mesh>(MeshIndex.Sphere, () =>
            {
                var obj   = GameObject.CreatePrimitive(PrimitiveType.Sphere);
                Mesh mesh = obj.GetComponent <MeshFilter>().mesh;
                UnityEngine.Object.Destroy(obj);
                return(mesh);
            }).RegisterAccessor();

            new AssetAccessor <Mesh>(MeshIndex.Capsule, () =>
            {
                var obj   = GameObject.CreatePrimitive(PrimitiveType.Capsule);
                Mesh mesh = obj.GetComponent <MeshFilter>().mesh;
                UnityEngine.Object.Destroy(obj);
                return(mesh);
            }).RegisterAccessor();

            new AssetAccessor <Mesh>(MeshIndex.Cylinder, () =>
            {
                var obj   = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
                Mesh mesh = obj.GetComponent <MeshFilter>().mesh;
                UnityEngine.Object.Destroy(obj);
                return(mesh);
            }).RegisterAccessor();

            new AssetAccessor <Mesh>(MeshIndex.Cube, () =>
            {
                var obj   = GameObject.CreatePrimitive(PrimitiveType.Cube);
                Mesh mesh = obj.GetComponent <MeshFilter>().mesh;
                UnityEngine.Object.Destroy(obj);
                return(mesh);
            }).RegisterAccessor();

            new AssetAccessor <Mesh>(MeshIndex.Plane, () =>
            {
                var obj   = GameObject.CreatePrimitive(PrimitiveType.Plane);
                Mesh mesh = obj.GetComponent <MeshFilter>().mesh;
                UnityEngine.Object.Destroy(obj);
                return(mesh);
            }).RegisterAccessor();

            new AssetAccessor <Mesh>(MeshIndex.Quad, () =>
            {
                var obj   = GameObject.CreatePrimitive(PrimitiveType.Quad);
                Mesh mesh = obj.GetComponent <MeshFilter>().mesh;
                UnityEngine.Object.Destroy(obj);
                return(mesh);
            }).RegisterAccessor();
            #endregion
            #region Hopoo Meshes
            new AssetAccessor <Mesh>(MeshIndex.Spiral1, () =>
            {
                Transform trans             = AssetLibrary <GameObject> .GetAsset(PrefabIndex.refWillOWispExplosion).transform;
                ParticleSystemRenderer rend = trans.Find("Flames, Tube").GetComponent <ParticleSystemRenderer>();
                Int32 count = rend.meshCount;
                if (count > 1)
                {
                    var meshes = new Mesh[count];
                    _          = rend.GetMeshes(meshes);
                    return(meshes[0]);
                }
                return(rend.mesh);
            }, PrefabIndex.refWillOWispExplosion).RegisterAccessor();

            new AssetAccessor <Mesh>(MeshIndex.TornadoMesh, () =>
            {
                Transform obj = AssetLibrary <GameObject> .GetAsset(PrefabIndex.refFireTornadoGhost).transform.Find("TornadoSmokeMesh");
                return(obj.GetComponent <ParticleSystemRenderer>().mesh);
            }, PrefabIndex.refFireTornadoGhost).RegisterAccessor();

            new AssetAccessor <Mesh>(MeshIndex.TornadoMesh2, () =>
            {
                Transform obj = AssetLibrary <GameObject> .GetAsset(PrefabIndex.refFireTornadoGhost).transform.Find("TornadoMesh");
                return(obj.GetComponent <ParticleSystemRenderer>().mesh);
            }, PrefabIndex.refFireTornadoGhost).RegisterAccessor();

            new AssetAccessor <Mesh>(MeshIndex.MdlTriTip, () =>
            {
                MeshFilter obj = AssetLibrary <GameObject> .GetAsset(PrefabIndex.refPickupTriTip).transform.Find("mslTriTip").GetComponent <MeshFilter>();
                return(obj.sharedMesh);
            }, PrefabIndex.refPickupTriTip).RegisterAccessor();

            new AssetAccessor <Mesh>(MeshIndex.Donut2,
                                     () => AssetLibrary <GameObject> .GetAsset(PrefabIndex.refMercSwordSlashWhirlwind).transform.Find("SwingTrail").GetComponent <ParticleSystemRenderer>().mesh,
                                     PrefabIndex.refMercSwordSlashWhirlwind).RegisterAccessor();

            #endregion

            completedProperly = true;
        }