mirror of
https://github.com/lubosz/overte.git
synced 2025-08-29 02:26:58 +02:00
can toggle hit effect on and off from a script
This commit is contained in:
parent
e75a6feafe
commit
dcb2012070
3 changed files with 31 additions and 3 deletions
28
examples/example/games/hitEffect.js
Normal file
28
examples/example/games/hitEffect.js
Normal 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue