Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: jeanfabre on January 10, 2012, 11:24:16 PM

Title: Get System environment user name
Post by: jeanfabre on January 10, 2012, 11:24:16 PM

 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: [Select]
// (c) Copyright HutongGames, LLC 2010-2012. All rights reserved.

using System;

namespace HutongGames.PlayMaker.Actions
[Tooltip("Gets system environment User Name and stores it in a string variable.")]
public class GetSystemEnvironmentUserName : FsmStateAction
[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;