Assets/LightningBolt/LightningBoltScript.cs
/// <summary>
/// Trigger a lightning bolt. Use this if ManualMode is true.
/// </summary>
Trigger a lightning bolt. Use this if ManualMode is true.
Trigger a lightning bolt . Use this if ManualMode is true .
public void Trigger()
        {
            Vector3 start, end;
            timer = Duration + Mathf.Min(0.0f, timer);
            if (StartObject == null)
            {
                start = StartPosition;
            }
            else
            {
                start = StartObject.transform.position + StartPosition;
            }
            if (EndObject == null)
            {
                end = EndPosition;
            }
            else
            {
                end = EndObject.transform.position + EndPosition;
            }
            startIndex = 0;
            GenerateLightningBolt(start, end, Generations, Generations, 0.0f);
            UpdateLineRenderer();
        }
public void Trigger ( ) { Vector3 start , end ; timer = Duration + Mathf . Min ( 0.0f , timer ) ; if ( StartObject == null ) { start = StartPosition ; } else { start = StartObject . transform . position + StartPosition ; } if ( EndObject == null ) { end = EndPosition ; } else { end = EndObject . transform . position + EndPosition ; } startIndex = 0 ; GenerateLightningBolt ( start , end , Generations , Generations , 0.0f ) ; UpdateLineRenderer ( ) ; }
Trigger a lightning bolt.
Trigger a lightning bolt .