【发布时间】:2020-10-01 09:10:57
【问题描述】:
这是我尝试在 Unity3D 中使用我的代码之一时遇到的错误。 以下是我使用的代码:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;
using UnityEngine;
using UnityEngine.Random;
public class BackgroundTile : MonoBehaviour
{
public GameObject[] dots;
// Start is called before the first frame update
void Start()
{
Initialize();
}
// Update is called once per frame
void Update()
{
}
void Initialize()
{
int dotToUse = Random.Range(0, dots.Length);
GameObject dot = Instantiate(dots[dotToUse], transform.position, Quaternion.identity);
dot.transform.parent = this.transform;
dot.name = this.GameObject.name;
}
}
你们能告诉我哪里错了,以便我更正我的代码。
【问题讨论】:
-
错误信息已经很明确了,不知道可以添加什么。只需删除
using UnityEngine.Random;行。