PlayMaker Updates & Downloads > Share New Actions

Get System environment user name

(1/1)

jeanfabre:
HI,

 Something I wrote today cause I was tired of having to change settings. So now I check that the application runs on my computer and all the settings adjust to what I want, easier for development as many times settings for the end user is different from the developer. But it can find other usage as well I am sure.

 If you need more environment properties custom actions, let me know. Else you can duplicate this action, rename it ( both the file and the class name) and simply change the property you want to access, easy enough.


--- Code: ---// (c) Copyright HutongGames, LLC 2010-2012. All rights reserved.

using System;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("System")]
[Tooltip("Gets system environment User Name and stores it in a string variable.")]
public class GetSystemEnvironmentUserName : FsmStateAction
{
[UIHint(UIHint.Variable)]
[Tooltip("Store System environment User Name as a string.")]
public FsmString storeString;

public override void Reset()
{
storeString = null;
}

public override void OnEnter()
{
storeString.Value = System.Environment.UserName;
Finish();
}
}
}



--- End code ---

 Bye,

Jean

Navigation

[0] Message Index

Go to full version