can toggle hit effect on and off from a script

This commit is contained in:
ericrius1 2015-07-20 12:02:01 -07:00
parent e75a6feafe
commit dcb2012070
3 changed files with 31 additions and 3 deletions

View file

@ -0,0 +1,28 @@
//
// hitEffect.js
// examples
//
// Created by Eric Levin on July 20, 2015
// Copyright 2015 High Fidelity, Inc.
//
// An example of how to toggle a screen-space hit effect using the Scene global object.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
var hitEffectEnabled = false;
toggleHitEffect();
function toggleHitEffect() {
Script.setTimeout(function() {
hitEffectEnabled = !hitEffectEnabled;
Scene.setEngineDisplayHitEffect(hitEffectEnabled);
toggleHitEffect();
}, 1000);
}

View file

@ -2,7 +2,7 @@
<$VERSION_HEADER$>
// Generated on <$_SCRIBE_DATE$>
//
// ambient_occlusion.frag
// hit_effect.frag
// fragment shader
//
// Created by Eric Levin on 7/20

View file

@ -2,10 +2,10 @@
<$VERSION_HEADER$>
// Generated on <$_SCRIBE_DATE$>
//
// ambient_occlusion.vert
// hit_effect.vert
// vertex shader
//
// Created by Niraj Venkat on 7/20/15.
// Created by Eric Levin on 7/20/15.
// Copyright 2015 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.