mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-15 01:12:05 +07:00
33 lines
689 B
C#
Executable File
33 lines
689 B
C#
Executable File
// (c) Copyright HutongGames, LLC 2010-2014. All rights reserved.
|
|
|
|
using UnityEngine;
|
|
using System.Collections.Generic;
|
|
|
|
namespace HutongGames.PlayMaker.Actions
|
|
{
|
|
|
|
[ActionCategory(ActionCategory.Array)]
|
|
[Tooltip("Reverse the order of items in an Array.")]
|
|
public class ArrayReverse : FsmStateAction
|
|
{
|
|
[RequiredField]
|
|
[UIHint(UIHint.Variable)]
|
|
[Tooltip("The Array to reverse.")]
|
|
public FsmArray array;
|
|
|
|
public override void Reset()
|
|
{
|
|
array = null;
|
|
}
|
|
|
|
// Code that runs on entering the state.
|
|
public override void OnEnter()
|
|
{
|
|
var _list = new List<object>(array.Values);
|
|
_list.Reverse();
|
|
array.Values = _list.ToArray();
|
|
|
|
Finish();
|
|
}
|
|
}
|
|
} |