mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 14:42:19 +02:00
added example script
This commit is contained in:
parent
a53d007c33
commit
59e8a98412
1 changed files with 32 additions and 0 deletions
32
examples/animationStateExample.js
Normal file
32
examples/animationStateExample.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// animationStateExample.js
|
||||
// examples
|
||||
//
|
||||
// Created by Brad Hefta-Gaub on 7/3/14.
|
||||
// Copyright 2014 High Fidelity, Inc.
|
||||
//
|
||||
// This is an example script that runs in a loop and displays a counter to the log
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
//
|
||||
|
||||
var count = 0;
|
||||
|
||||
function displayAnimationDetails(deltaTime) {
|
||||
print("count =" + count + " deltaTime=" + deltaTime);
|
||||
count++;
|
||||
var animationDetails = MyAvatar.getAnimationDetailsByRole("idle");
|
||||
print("animationDetails.frameIndex=" + animationDetails.frameIndex);
|
||||
}
|
||||
|
||||
function scriptEnding() {
|
||||
print("SCRIPT ENDNG!!!\n");
|
||||
}
|
||||
|
||||
// register the call back so it fires before each data send
|
||||
Script.update.connect(displayAnimationDetails);
|
||||
|
||||
// register our scriptEnding callback
|
||||
Script.scriptEnding.connect(scriptEnding);
|
Loading…
Reference in a new issue