playMaker

Author Topic: Simple webpage access  (Read 2366 times)

KellyRay

  • Full Member
  • ***
  • Posts: 170
Simple webpage access
« 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?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Simple webpage access
« Reply #1 on: January 27, 2015, 07:45:30 AM »
There is a WWW action in the basic Playmaker package.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D