Playmaker Forum

PlayMaker Updates & Downloads => Official Action Updates => Topic started by: Alex Chouls on November 29, 2011, 06:18:44 PM

Title: Device Vibrate
Post by: Alex Chouls on November 29, 2011, 06:18:44 PM
Simple action to call iPhoneUtils.Vibrate:

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Device)]
[Tooltip("Causes the device to vibrate for half a second.")]
public class DeviceVibrate : FsmStateAction
{
public override void Reset()
{
}

public override void OnEnter()
{
iPhoneUtils.Vibrate();
}
}
}

As you can see it's super easy to wrap a simple Unity command - just make an action and call the command in OnEnter().

EDIT: Changed action name to DeviceVibrate.