The 2nd one is done too.
Get day of week for specific year, month, day:
// https://msdn.microsoft.com/en-us/library/bb762911%28v=vs.110%29.aspx
using UnityEngine;
using System;
using System.Globalization;
using System.Threading;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Time)]
[Tooltip("Returns day of the week (Monday, Tuesday, ...) for the specified year, month, day.")]
public class GetDayOfWeek : FsmStateAction
{
[RequiredField]
public FsmInt year;
[RequiredField]
public FsmInt month;
[RequiredField]
public FsmInt day;
public FsmString dayOfWeek;
public override void Reset()
{
year = null;
month = null;
day = null;
dayOfWeek = null;
}
public override void OnEnter()
{
CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
//DateTime dateValue = new DateTime(year.Value, month.Value, day.Value);
//dayOfWeek.Value = dateValue.ToString("dddd", new CultureInfo("en-US"));
DateTime dateValue = new DateTime(year.Value, month.Value, day.Value);
dayOfWeek.Value = dateValue.ToString("dddd");
Thread.CurrentThread.CurrentCulture = originalCulture;
}
}
}