public void setFilePath ( String filePath ) throws IOException , GVRScriptException { GVRResourceVolume . VolumeType volumeType = GVRResourceVolume . VolumeType . ANDROID_ASSETS ; String fname = filePath . toLowerCase ( ) ; mLanguage = FileNameUtils . getExtension ( fname ) ; if ( fname . startsWith ( "sd:" ) ) { volumeType = GVRResourceVolume . VolumeType . ANDROID_SDCARD ; } else if ( fname . startsWith ( "http:" ) || fname . startsWith ( "https:" ) ) { volumeType = GVRResourceVolume . VolumeType . NETWORK ; } GVRResourceVolume volume = new GVRResourceVolume ( getGVRContext ( ) , volumeType , FileNameUtils . getParentDirectory ( filePath ) ) ; GVRAndroidResource resource = volume . openResource ( filePath ) ; setScriptFile ( ( GVRScriptFile ) getGVRContext ( ) . getScriptManager ( ) . loadScript ( resource , mLanguage ) ) ; }
Sets the path to the script file to load and loads the script .