using UnityEngine;
using System.Collections;
public class GroupMovement : MonoBehaviour {
Random rnd = new Random();
public static short Round = 0;
public static int rGroup;
public static void SendGroup()
{
rGroup = rnd.Next(2);
switch (Round) {
case 0:
switch(rGroup)
{
case 0:
Group_1.Group1_Active = true;
break;
case 1:
break;
}
break;
}
Round ++;
}
}
答案 0 :(得分:0)
问题是rnd变量不是静态的,你想在静态属性中使用它,所以使其他字段和属性不是静态的或使rnd静态。在这里你可以如何使静态。
public static Random rnd = new Random();