Esempio n. 1
0
 void OnDisable()
 {
     if (s_instance == this)
     {
         s_instance = null;
     }
 }
Esempio n. 2
0
 void PutExplosion(Vector3 pos)
 {
     if (m_enable_shockwave)
     {
         DSShockwaveManager.AddEntity(pos);
     }
     if (m_enable_radialblur)
     {
         DSRadialBlurManager.AddEntity(pos);
     }
     if (m_enable_particles)
     {
         CSParticle[] additional = new CSParticle[1024];
         for (int i = 0; i < additional.Length; ++i)
         {
             additional[i].position = pos + (new Vector3(R(), R(), R())).normalized * R(0.1f);
             additional[i].velocity = (new Vector3(R(), R(), R())).normalized * R(20.0f);
         }
         m_pset.AddParticles(additional);
     }
     if (m_enable_light)
     {
         Instantiate(m_light, pos, Quaternion.identity);
     }
 }
Esempio n. 3
0
 void OnEnable()
 {
     ResetDSRenderer();
     s_instance = this;
     if (m_render == null)
     {
         m_render = Render;
         GetDSRenderer().AddCallbackPostEffect(m_render, 10000);
         m_i_radialblur_params = Shader.PropertyToID("radialblur_params");
         m_i_stretch_params    = Shader.PropertyToID("stretch_params");
         m_i_color_bias        = Shader.PropertyToID("color_bias");
         m_i_base_position     = Shader.PropertyToID("base_position");
     }
 }
Esempio n. 4
0
    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_render == null)
     {
         m_render = Render;
         GetDSRenderer().AddCallbackPostEffect(m_render, 10000);
         m_i_radialblur_params = Shader.PropertyToID("radialblur_params");
         m_i_stretch_params = Shader.PropertyToID("stretch_params");
         m_i_color_bias = Shader.PropertyToID("color_bias");
         m_i_base_position = Shader.PropertyToID("base_position");
     }
 }
 void OnDisable()
 {
     if (s_instance == this) s_instance = null;
 }