This commit is contained in:
MuHua-123
2025-07-17 17:50:29 +08:00
parent 4cfefc8103
commit 4c66f3a5a2
8 changed files with 218 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Random = UnityEngine.Random;
/// <summary>
/// 骰子
/// </summary>
public static class Dice {
// 生成4d6弃最低的随机属性值
public static int RollAttribute() {
int[] rolls = { Random.Range(1, 7), Random.Range(1, 7), Random.Range(1, 7), Random.Range(1, 7) };
Array.Sort(rolls);
return rolls[1] + rolls[2] + rolls[3]; // 弃最低值
}
}