void OnDisable() { if (s_instance == this) { s_instance = null; } }
void OnEnable() { ResetDSRenderer(); s_instance = this; if (m_depth_prepass == null) { m_depth_prepass = DepthPrePass; m_render = Render; GetDSRenderer().AddCallbackPreGBuffer(m_depth_prepass); GetDSRenderer().AddCallbackPostGBuffer(m_render); m_i_beam_direction = Shader.PropertyToID("beam_direction"); m_i_base_position = Shader.PropertyToID("base_position"); } }
void Update() { CameraControl(); if (Time.frameCount % 30 == 0) { Vector3 pos = new Vector3(Random.Range(-5.0f, 5.0f), Random.Range(-1.0f, 2.0f) + 1.0f, Random.Range(-4.0f, 4.0f) - 10.0f); Vector3 dir = new Vector3(0.0f, 0.0f, 1.0f); DSBeamManager.AddEntity(pos, dir); DSShockwaveManager.AddEntity(pos); DSRadialBlurManager.AddEntity(pos); } if (Input.GetKeyUp(KeyCode.Space)) { showGUI = !showGUI; } }
void OnEnable() { ResetDSRenderer(); s_instance = this; if (m_depth_prepass==null) { m_depth_prepass = DepthPrePass; m_render = Render; GetDSRenderer().AddCallbackPreGBuffer(m_depth_prepass); GetDSRenderer().AddCallbackPostGBuffer(m_render); m_i_beam_direction = Shader.PropertyToID("beam_direction"); m_i_base_position = Shader.PropertyToID("base_position"); } }
void OnDisable() { if (s_instance == this) s_instance = null; }