playMaker

Author Topic: Simple webpage access  (Read 664 times)

KellyRay

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Simple webpage access
« on: January 26, 2015, 04: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?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: Simple webpage access
« Reply #1 on: January 27, 2015, 05:45:30 AM »
There is a WWW action in the basic Playmaker package.