home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-09-25 | 747 b | 38 lines |
- //
- // init.java
- // select avatar
- //
- // (c) Copyright 1996 Sony Corporation. All rights reserved.
-
- import vrml.*;
- import vrml.node.*;
- import vrml.field.*;
- import vs.*;
-
- public class init extends Script {
- SFInt32 choice;
-
- public void initialize() {
- choice = (SFInt32)getEventOut("choice");
- }
-
- public void processEvent(Event e) {
- String avtURL = Vscp.getAvtroomAvatarURL();
- // System.out.println("init.java" + e.getName());
- if (!e.getName().equals("init")) {
- return;
- }
-
- if (avtURL.endsWith("boy.wrl")) {
- choice.setValue(0);
- } else if (avtURL.endsWith("girl.wrl")) {
- choice.setValue(1);
- } else {
- // System.out.println("Wrong avatar URL: " + avtURL);
- choice.setValue(0);
- }
- }
- }
-
-
-