小编Abi*_*ibi的帖子

为什么我不能在 Unity 2D 上使用 Random.Range 代码系统

我在 unity 2D 中使用此代码:

    float nilaiRandom;
    void Start()
    {
        nilaiRandom = Random.Range(1.11f, -1.88f);
        transform.position = new Vector2(transform.position.x, nilaiRandom);
    }
Run Code Online (Sandbox Code Playgroud)

Unity count 错误它说:Assets\Go.cs(14,23): error CS0104: 'Random' is an ambiguous reference between 'UnityEngine.Random' and 'System.Random' 我的团结实际上发生了什么,解决方案是什么?请帮我

c# random unity-game-engine

-2
推荐指数
1
解决办法
203
查看次数

标签 统计

c# ×1

random ×1

unity-game-engine ×1