Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: KellyRay on January 26, 2015, 06:33:34 PM

Title: Simple webpage access
Post by: KellyRay on January 26, 2015, 06:33:34 PM
Attempting to do make an action similar to this:

 (from here -> http://docs.unity3d.com/ScriptReference/WWW.html)

Code: [Select]
// Get the latest webcam shot from outside "Friday's" in Times Square
var url = "http://images.earthcam.com/ec_metros/ourcams/fridays.jpg";
function Start () {
// Start a download of the given URL
var www : WWW = new WWW (url);
// Wait for download to complete
yield www;

Here is what I have so far. But I'm stuck on this bug and unsure how to proceed.

"OnEnter()' cannot be an iterator block because `void' is not an iterator interface type"


Code: [Select]
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Application)]
[Tooltip("Url Request")]
public class UrlRequest : FsmStateAction
{

[RequiredField]
public FsmString url;

public override void Reset()
{
url ="";
}

public override void OnEnter()
{
WWW www = new WWW (url);
yield return www;
Finish();
}
}
}

Any thoughts?
Title: Re: Simple webpage access
Post by: Lane on January 27, 2015, 07:45:30 AM
There is a WWW action in the basic Playmaker package.