This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void startRandomMotion(string name ,int priority) | |
{ | |
int max = modelSetting.getMotionNum( name ); | |
int no = (int)(rand.NextDouble() * max ) ; // picking a random number from your motion group | |
startMotion( name, no, priority ) ; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"expressions": | |
[ | |
{"name":"f01","file":"motions/expressions/f01.exp.json"}, | |
{"name":"f02","file":"motions/expressions/f02.exp.json"}, | |
{"name":"f03","file":"motions/expressions/f03.exp.json"}, | |
{"name":"f04","file":"motions/expressions/f04.exp.json"} | |
], | |
"motions": | |
{ | |
"idle": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void setExpression(string name) | |
{ | |
if( ! expressions.ContainsKey( name ) )return; | |
if( LAppDefine.DEBUG_LOG ) Debug.Log( "Setting expression : " + name ) ; | |
AMotion motion=expressions[ name ] ; | |
expressionManager.startMotion( motion , false ) ; | |
} | |
public void setRandomExpression() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void startRandomMotion(string name ,int priority) | |
{ | |
int max = modelSetting.getMotionNum( name ); | |
int no = (int)(rand.NextDouble() * max ) ; // picking a random number from your motion group | |
startMotion( name, no, priority ) ; | |
} | |
public void startMotion(string name, int no,int priority) | |
{ | |
string motionName = modelSetting.getMotionFile( name, no ) ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void motionCorrect() | |
{ | |
points++; // adds one point to the score | |
percentage = points/total; // recalculates percentage with new score | |
// character becomes happy that you answered the question correctly | |
appModel.setExpression("happy"); | |
// body movement changes depending on percentage | |
if (percentage >= 70) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool tapEvent(float x,float y) | |
{ | |
if(LAppDefine.DEBUG_LOG) Debug.Log("tapEvent view x:"+x+" y:"+y); | |
if(hitTest( "D_REF.HEAD",x, y )) | |
{ | |
startMotion("nod", 0, LAppDefine.PRIORITY_NORMAL); // display motion | |
Camera.main.GetComponent<GUIAnswers>().eliminateAnswer (); // eliminate answer | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool tapEvent(float x,float y) | |
{ | |
if(LAppDefine.DEBUG_LOG) Debug.Log("tapEvent view x:"+x+" y:"+y); | |
if(hitTest( "D_REF.HEAD",x, y )) | |
{ | |
startMotion("nod", 0, LAppDefine.PRIORITY_NORMAL); // display motion | |
Camera.main.GetComponent<GUIAnswers>().eliminateAnswer (); // eliminate answer | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void getAudio(string src) { | |
string url = "http://api.voicerss.org/?"; | |
string key = "your0api0key"; | |
string hl = "ja-jp"; | |
string r = "-3"; | |
string c = "OGG"; | |
string f = "48khz_16bit_stereo"; | |
url = url + "key=" + key + "&src=" + src + "&hl=" + hl + "&r=" + r + "&c=" + c + "&f=" + f; |