# RandomUtils

|Class Info|
|:--------------------------------------------------------------------------------------|
|public static class RandomUtils 伪随机数生成器。 > 说明 > RandomUtil类的命名空间为Com.Huawei.Game.Gobes。|

## Method Summary

|Qualifier and Type|Method Name and Description|
|:-----------------|:-------------------------------------------------------|
|static void|[InitSeed](#section25771143193520)(randomSeed) 初始化随机数种子。|
|static double|[GetRandom](#section173715455354)() 返回伪随机数。|

## Methods

### InitSeed

|Method|
|:-----------------------------------------------------|
|public static void InitSeed(long randomSeed) 初始化随机数种子。|

**Parameters**

|Name|Description|
|:---------|:----------|
|randomSeed|随机数种子。|

**Sample Code**

```screen
float seed = 1.0;
RandomUtils.InitSeed((long)seed);
```

### GetRandom

|Method|
|:---------------------------------------|
|public static double GetRandom() 返回伪随机数。|

**Return**

|Type|Description|
|:-----|:--------------|
|double|伪随机数，0~1之间的浮点数。|

**Sample Code**

```screen
RandomUtils.GetRandom();
```

