示例#1
0
        public AvatarSensorsController(AvatarBody body, bool isClient, int minimumSensors)
        {
            this.type           = AvatarControllerType.SENSORS;
            this.body           = body;
            this.isClient       = isClient;
            this.minimumSensors = minimumSensors;

            // Move the rig to match the eye of the body
        }
        public static AvatarController Create(AvatarControllerType type, AvatarBody body,
                                              bool isClient, int minimumSensors)
        {
            switch (type)
            {
            case AvatarControllerType.KEYBOARD:
                return(new AvatarKeyboardController(body));

            case AvatarControllerType.SENSORS:
                return(new AvatarSensorsController(body, isClient, minimumSensors));

            case AvatarControllerType.NETWORK:
                return(new AvatarNetController(body));

            default:
                throw new ArgumentException("Invalid AvatarControllerType");
            }
        }
 public AvatarKeyboardController(AvatarBody body)
 {
     this.type = AvatarControllerType.KEYBOARD;
     this.body = body;
     canvas    = GameObject.Find("Canvas").GetComponent <Canvas>();
 }
示例#4
0
 public AvatarNetController(AvatarBody body)
 {
     this.type = AvatarControllerType.NETWORK;
     this.body = body;
 }