/// <summary> /// Create multiple lightning bolts, attempting to batch them into as few draw calls as possible /// </summary> /// <param name="parameters">Lightning bolt creation parameters</param> public void CreateLightningBolts(ICollection <LightningBoltParameters> parameters) { if (parameters != null && parameters.Count != 0) { UpdateTexture(); LightningBolt bolt = GetOrCreateLightningBolt(); LightningBoltDependencies dependencies = CreateLightningBoltDependencies(parameters); bolt.SetupLightningBolt(dependencies); } }
/// <summary> /// Create a lightning bolt /// </summary> /// <param name="p">Lightning bolt creation parameters</param> public virtual void CreateLightningBolt(LightningBoltParameters p) { if (p != null) { UpdateTexture(); oneParameterArray[0] = p; LightningBolt bolt = GetOrCreateLightningBolt(); LightningBoltDependencies dependencies = CreateLightningBoltDependencies(oneParameterArray); bolt.SetupLightningBolt(dependencies); } }
/// <summary> /// Create multiple lightning bolts, attempting to batch them into as few draw calls as possible /// </summary> /// <param name="parameters">Lightning bolt creation parameters</param> public void CreateLightningBolts(ICollection <LightningBoltParameters> parameters) { #if UNITY_EDITOR if (Camera == null) { UnityEngine.Debug.LogError("Camera not assigned to lightning script. Either set the camera or tag your camera as main camera."); } #endif if (parameters != null && parameters.Count != 0 && Camera != null) { UpdateTexture(); LightningBolt bolt = GetOrCreateLightningBolt(); LightningBoltDependencies dependencies = CreateLightningBoltDependencies(parameters); bolt.SetupLightningBolt(dependencies); } }
/// <summary> /// Create a lightning bolt /// </summary> /// <param name="p">Lightning bolt creation parameters</param> public virtual void CreateLightningBolt(LightningBoltParameters p) { #if UNITY_EDITOR if (Camera == null) { UnityEngine.Debug.LogError("Camera not assigned to lightning script. Either set the camera or tag your camera as main camera."); } #endif if (p != null && Camera != null) { UpdateTexture(); oneParameterArray[0] = p; LightningBolt bolt = GetOrCreateLightningBolt(); LightningBoltDependencies dependencies = CreateLightningBoltDependencies(oneParameterArray); bolt.SetupLightningBolt(dependencies); } }