Playmaker Forum
PlayMaker Updates & Downloads => Share New Actions => Topic started by: MABManZ on October 02, 2015, 01:03:43 PM
-
Here is a simple action that will ping your Photon server and output as int or a string
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("Photon")]
[Tooltip("Recieves Player Ping and Stores in a String")]
[HelpUrl("https://hutonggames.fogbugz.com/default.asp?W1136")]
public class PhotonGetPing : FsmStateAction
{
[RequiredField]
[Tooltip("")]
public FsmInt ping;
public FsmString pingString;
public override void Reset()
{
ping = null;
}
public override void OnEnter()
{
DoGetPing();
Finish();
}
void DoGetPing()
{
ping.Value = PhotonNetwork.GetPing ();
pingString.Value = ping.Value.ToString();
}
}
}
-
Very usefull, thanks
-
Hi,
it's now part of the package on the wiki (http://j.mp/1IIXNRS) and Ecosystem (http://j.mp/1Esn1mF).
Thanks for your contribution!
Bye,
Jean