/// <summary> /// Regenerate the beam mesh and material. /// This can be slow, so don't call this function during playtime. /// </summary> public void GenerateGeometry() { #if UNITY_EDITOR HandleBackwardCompatibility(pluginVersion, Version.Current); #endif pluginVersion = Version.Current; AssignPropertiesFromSpotLight(lightSpotAttached); ValidateProperties(); if (m_BeamGeom == null) { var shader = Config.Instance.beamShader; if (!shader) { Debug.LogError("Invalid BeamShader set in VLB Config"); return; } m_BeamGeom = Utils.NewWithComponent <BeamGeometry>("Beam Geometry"); m_BeamGeom.Initialize(this, shader); } m_BeamGeom.RegenerateMesh(); m_BeamGeom.visible = enabled; }
/// <summary> /// Regenerate the beam mesh (and also the material). /// This can be slow (it recreates a mesh from scratch), so don't call this function during playtime. /// You would need to call this function only if you want to change the properties 'geomSides' and 'geomCap' during playtime. /// Otherwise, for the other properties, just enable 'trackChangesDuringPlaytime', or manually call 'UpdateAfterManualPropertyChange()' /// </summary> public virtual void GenerateGeometry() { HandleBackwardCompatibility(pluginVersion, Version.Current); pluginVersion = Version.Current; ValidateProperties(); if (m_BeamGeom == null) { m_BeamGeom = Utils.NewWithComponent <BeamGeometry>("Beam Geometry"); m_BeamGeom.Initialize(this); } m_BeamGeom.RegenerateMesh(); m_BeamGeom.visible = enabled; }
/// <summary> /// Regenerate the beam mesh (and also the material). /// This can be slow (it recreates a mesh from scratch), so don't call this function during playtime. /// You would need to call this function only if you want to change the properties 'geomSides' and 'geomCap' during playtime. /// Otherwise, for the other properties, just enable 'trackChangesDuringPlaytime', or manually call 'UpdateAfterManualPropertyChange()' /// </summary> public void GenerateGeometry() { if (m_BeamGeom == null) { m_BeamGeom = Utils.NewWithComponent <BeamGeometry>("Beam Geometry"); } m_BeamGeom.Initialize(this); m_BeamGeom.visible = enabled; if (m_BeamGeom_back == null) { m_BeamGeom_back = Utils.NewWithComponent <BeamGeometry>("Beam Geometry"); m_BeamGeom_back.front = false; } m_BeamGeom_back.Initialize(this); m_BeamGeom_back.visible = enabled; }
/// <summary> /// Regenerate the beam mesh (and also the material). /// This can be slow (it recreates a mesh from scratch), so don't call this function during playtime. /// You would need to call this function only if you want to change the properties 'geomSides' and 'geomCap' during playtime. /// Otherwise, for the other properties, just enable 'trackChangesDuringPlaytime', or manually call 'UpdateAfterManualPropertyChange()' /// </summary> public virtual void GenerateGeometry() { HandleBackwardCompatibility(pluginVersion, Version.Current); pluginVersion = Version.Current; ValidateProperties(); if (m_BeamGeom == null) { var shader = Config.Instance.beamShader; if (!shader) { Debug.LogError("Invalid BeamShader set in VLB Config"); return; } m_BeamGeom = Utils.NewWithComponent <BeamGeometry>("Beam Geometry"); m_BeamGeom.Initialize(this, shader); } m_BeamGeom.RegenerateMesh(); m_BeamGeom.visible = enabled; }