Skip to content

Commit

Permalink
Replace WWW with UnityWebRequest in GoSpline.cs
Browse files Browse the repository at this point in the history
WWW is deprecated. UnityWebRequest is now the way to request data from a URL.

See the docs for:
  - WWW: https://docs.unity3d.com/ScriptReference/WWW-ctor.html
  - UnityWebRequest: https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.html
  • Loading branch information
swalls committed Oct 19, 2020
1 parent 58c3eba commit f5eb04e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/Plugins/GoKit/properties/splines/GoSpline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ private static List<Vector3> nodeListFromAsset( string pathAssetName )
{
path = Path.Combine( "jar:file://" + Application.dataPath + "!/assets/", pathAssetName );

WWW loadAsset = new WWW( path );
UnityWebRequest loadAsset = new UnityWebRequest( path );
while( !loadAsset.isDone ) { } // maybe make a safety check here

return bytesToVector3List( loadAsset.bytes );
return bytesToVector3List( loadAsset.downloadHandler.data );
}
else if( Application.platform == RuntimePlatform.IPhonePlayer )
{
Expand Down

1 comment on commit f5eb04e

@stylophone
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might forget to call loadAsset.SendWebRequest() there?

Please sign in to comment.