Assets/LightningBolt/LightningBoltScript.cs
/// <summary>
/// Call this method if you change the material on the line renderer
/// </summary>
Call this method if you change the material on the line renderer
Call this method if you change the material on the line renderer
public void UpdateFromMaterialChange()
        {
            size = new Vector2(1.0f / (float)Columns, 1.0f / (float)Rows);
            lineRenderer.material.mainTextureScale = size;
            offsets = new Vector2[Rows * Columns];
            for (int y = 0; y < Rows; y++)
            {
                for (int x = 0; x < Columns; x++)
                {
                    offsets[x + (y * Columns)] = new Vector2((float)x / Columns, (float)y / Rows);
                }
            }
        }
public void UpdateFromMaterialChange ( ) { size = new Vector2 ( 1.0f / ( float ) Columns , 1.0f / ( float ) Rows ) ; lineRenderer . material . mainTextureScale = size ; offsets = new Vector2 [ Rows * Columns ] ; for ( int y = 0 ; y < Rows ; y ++ ) { for ( int x = 0 ; x < Columns ; x ++ ) { offsets [ x + ( y * Columns ) ] = new Vector2 ( ( float ) x / Columns , ( float ) y / Rows ) ; } } }
Call this method if you change the material on the line renderer
Call this method if you change the material on the line renderer