Ejemplo n.º 1
0
        void Init()
        {
            mesh         = new Mesh();
            vertices     = new Vector3[4];
            uv           = new Vector2[] { new Vector2(0, 0), new Vector2(0, 1), new Vector2(1, 0), new Vector2(1, 1) };
            vertexColors = new Color[] { Color.white, Color.white, Color.white, Color.white };
            indices      = new int[] { 0, 1, 2, 2, 1, 3 };
            currentTime  = 0;

            if (target == null)
            {
                target = transform.Find("target");
                if (target == null)
                {
                    target = new GameObject("target").transform;
                    target.SetParent(transform);
                    target.localPosition = new Vector3(0, 0, 5);
                }
            }

            if (mat == null)
            {
                mat = new Material(ShaderUtilCat.FindShader("XGame/Particles/Additive"));
            }
        }
Ejemplo n.º 2
0
        private void HandleAssetShader_Mat(ref Material mat)
        {
            var shader = mat.shader;

            if (shader != null)
            {
                var shaderName = shader.name;
                mat.shader = ShaderUtilCat.FindShader(shaderName);
            }
        }