topical media & game development

talk show tell print

lib-unity-demo-shader-Assets-Soft-Particles-SortParticlesToggle.js / js



  var shader1 : Shader;
  private var shader2 : Shader;
  var particles : ParticleRenderer;
  
  private var currentShader : Shader;
  
  function Start() {
          currentShader = shader1;
          shader2 = Shader.Find("Particles/~Additive-Multiply");
          particles.material.shader = currentShader;
  }
  
  function Update() {
          if (Input.GetKeyDown("space")) {
                  currentShader = (currentShader==shader1) ? shader2 : shader1;
                  particles.material.shader = currentShader;
          }
  }
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.