using System.Collections; using System.Collections.Generic; using UnityEngine; namespace YKMoon { public static class ListExtension { public static T PopTop(this List list) { var result = list[0]; list.RemoveAt(0); return result; } public static T PopEnd(this List list) { var result = list[list.Count - 1]; list.RemoveAt(list.Count - 1); return result; } public static void MoveForward(this List list) { if (list.Count <=0) { return; } var temp = list.PopTop(); list.Add(temp); } public static void MoveBackward(this List list) { if(list.Count <= 0) { return; } var temp = list.PopEnd(); list.Insert(0, temp); } } }