mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:44:01 +02:00
added count example
This commit is contained in:
parent
18ded1d7db
commit
785d84d0ca
1 changed files with 26 additions and 0 deletions
26
examples/count.js
Normal file
26
examples/count.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// count.js
|
||||
// hifi
|
||||
//
|
||||
// Created by Brad Hefta-Gaub on 12/31/13.
|
||||
// Copyright (c) 2013 HighFidelity, Inc. All rights reserved.
|
||||
//
|
||||
// This is an example script that runs in a loop and displays a counter to the log
|
||||
//
|
||||
|
||||
var count = 0;
|
||||
|
||||
function displayCount() {
|
||||
print("count =" + count);
|
||||
count++;
|
||||
}
|
||||
|
||||
function scriptEnding() {
|
||||
print("SCRIPT ENDNG!!!\n");
|
||||
}
|
||||
|
||||
// register the call back so it fires before each data send
|
||||
Agent.willSendVisualDataCallback.connect(displayCount);
|
||||
|
||||
// register our scriptEnding callback
|
||||
Agent.scriptEnding.connect(scriptEnding);
|
Loading…
Reference in a new issue