home *** CD-ROM | disk | FTP | other *** search
/ Sony Community Place / circus2e.exe / DATA.Z / init.java < prev    next >
Text File  |  1996-09-25  |  747b  |  38 lines

  1. //
  2. // init.java
  3. //    select avatar
  4. //
  5. // (c) Copyright 1996 Sony Corporation. All rights reserved.
  6.  
  7. import vrml.*;
  8. import vrml.node.*;
  9. import vrml.field.*;
  10. import vs.*;
  11.  
  12. public class init extends Script {
  13.     SFInt32 choice;
  14.  
  15.     public void initialize() {
  16.         choice = (SFInt32)getEventOut("choice");
  17.     }
  18.  
  19.     public void processEvent(Event e) {
  20.         String avtURL = Vscp.getAvtroomAvatarURL();
  21. //        System.out.println("init.java" + e.getName());
  22.         if (!e.getName().equals("init")) {
  23.             return;
  24.         }
  25.  
  26.         if (avtURL.endsWith("boy.wrl")) {
  27.             choice.setValue(0);
  28.         } else if (avtURL.endsWith("girl.wrl")) {
  29.             choice.setValue(1);
  30.         } else {
  31. //            System.out.println("Wrong avatar URL: " + avtURL);
  32.             choice.setValue(0);
  33.         }
  34.     }
  35. }
  36.  
  37.  
  38.