예제 #1
0
        /// <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;
        }
 private void OnEnable()
 {
     if (BeamGeometry.IsUsingCustomRenderPipeline())
     {
         RenderPipelineManager.beginCameraRendering += new Action <ScriptableRenderContext, Camera>(this.OnBeginCameraRendering);
     }
 }
 private void DestroyBeam()
 {
     if (this.m_BeamGeom)
     {
         UnityEngine.Object.DestroyImmediate(this.m_BeamGeom.gameObject);
     }
     this.m_BeamGeom = null;
 }
예제 #4
0
 void DestroyBeam()
 {
     if (m_BeamGeom)
     {
         DestroyImmediate(m_BeamGeom.gameObject);             // Make sure to delete the GAO
     }
     m_BeamGeom = null;
 }
 private void DestroyBeam()
 {
     if (Object.op_Implicit((Object)this.m_BeamGeom))
     {
         Object.DestroyImmediate((Object)((Component)this.m_BeamGeom).get_gameObject());
     }
     this.m_BeamGeom = (BeamGeometry)null;
 }
예제 #6
0
 private void OnEnable()
 {
     if (!BeamGeometry.IsUsingCustomRenderPipeline())
     {
         return;
     }
     RenderPipeline.add_beginCameraRendering(new Action <Camera>(this.OnBeginCameraRendering));
 }
 private void OnWillRenderObject()
 {
     if (!BeamGeometry.IsUsingCustomRenderPipeline())
     {
         Camera camera = Camera.current;
         if (camera != null)
         {
             this.UpdateCameraRelatedProperties(camera);
         }
     }
 }
예제 #8
0
 void OnDestroy()
 {
     if (m_BeamGeom)
     {
         DestroyImmediate(m_BeamGeom.gameObject);             // Make sure to delete the GAO
     }
     m_BeamGeom = null;
     if (m_BeamGeom_back)
     {
         DestroyImmediate(m_BeamGeom_back.gameObject);                  // Make sure to delete the GAO
     }
     m_BeamGeom_back = null;
 }
예제 #9
0
        private void OnWillRenderObject()
        {
            if (BeamGeometry.IsUsingCustomRenderPipeline())
            {
                return;
            }
            Camera current = Camera.get_current();

            if (!Object.op_Inequality((Object)current, (Object)null))
            {
                return;
            }
            this.UpdateCameraRelatedProperties(current);
        }
예제 #10
0
        /// <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;
        }
예제 #11
0
 /// <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;
 }
 public virtual void GenerateGeometry()
 {
     this.HandleBackwardCompatibility(this.pluginVersion, 1510);
     this.pluginVersion = 1510;
     this.ValidateProperties();
     if (this.m_BeamGeom == null)
     {
         Shader instance = Config.Instance.beamShader;
         if (!instance)
         {
             UnityEngine.Debug.LogError("Invalid BeamShader set in VLB Config");
             return;
         }
         this.m_BeamGeom = Utils.NewWithComponent <BeamGeometry>("Beam Geometry");
         this.m_BeamGeom.Initialize(this, instance);
     }
     this.m_BeamGeom.RegenerateMesh();
     this.m_BeamGeom.visible = base.enabled;
 }
 public virtual void GenerateGeometry()
 {
     this.HandleBackwardCompatibility(this.pluginVersion, 1510);
     this.pluginVersion = 1510;
     this.ValidateProperties();
     if (Object.op_Equality((Object)this.m_BeamGeom, (Object)null))
     {
         Shader beamShader = Config.Instance.beamShader;
         if (!Object.op_Implicit((Object)beamShader))
         {
             Debug.LogError((object)"Invalid BeamShader set in VLB Config");
             return;
         }
         this.m_BeamGeom = Utils.NewWithComponent <BeamGeometry>("Beam Geometry");
         this.m_BeamGeom.Initialize(this, beamShader);
     }
     this.m_BeamGeom.RegenerateMesh();
     this.m_BeamGeom.visible = ((Behaviour)this).get_enabled();
 }
예제 #14
0
        /// <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;
        }