Archived
移除了影响打包的部分;
修正了洗牌算法中的错误; 将弱类型中历史记录的功能拆开了,减小了不必要的消耗;
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Codice.CM.WorkspaceServer.Tree.GameUI.HeadTree;
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -6,7 +6,9 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using Unity.VisualScripting.YamlDotNet.Core.Tokens;
|
||||
#endif
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor.Experimental.GraphView;
|
||||
#endif
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
|
||||
@@ -21,9 +21,12 @@ namespace XericLibrary.Runtime.MacroLibrary
|
||||
/// <returns></returns>
|
||||
public static List<int> FisherYatesShuffle(int length, int select)
|
||||
{
|
||||
if(select > length)
|
||||
throw new ArgumentOutOfRangeException("在进行洗牌时,要求输出的项目比拥有的项目更多,这是不合理的。");
|
||||
|
||||
var random = new System.Random();
|
||||
|
||||
List<int> arr = Enumerable.Range(1, length).ToList();
|
||||
List<int> arr = Enumerable.Range(0, length).ToList();
|
||||
List<int> res = new List<int>();
|
||||
|
||||
for(int i = 0; i < select; ++i)
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor.Experimental.GraphView;
|
||||
#endif
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user