|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
这是在unity中打开的脚本,但是他提示
if (Randow.Range(0f, 1f) > 0.5f)
这一句的
error CS0103: The name 'Randow' does not exist in the current context
这是为什么??
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class enemyCreat : MonoBehaviour
- {
- public GameObject enemyToCreat;
- public float timeToCreat;
- private float creatNumb;
- public Transform minCreat, maxCreat;
- // Start is called before the first frame update
- void Start()
- {
- creatNumb = timeToCreat;
- }
- // Update is called once per frame
- void Update()
- {
- creatNumb -= Time.deltaTime;
- if (creatNumb <= 0)
- {
- creatNumb = timeToCreat;
- //Instantiate(enemyToCreat, transform.position, transform.rotation);
- Instantiate(enemyToCreat, SelectCreatPoint(), transform.rotation);
- }
- }
- public Vector3 SelectCreatPoint()
- {
- Vector3 creatPoint = Vector3.zero;
- bool creatVerticalEdge = Randow.Range(0f, 1f) > 0.5f;
- if (creatVerticalEdge)
- {
- creatPoint.y = Randow.Range(minCreat.position.y, maxCreat.position.y);
- if (Randow.Range(0f, 1f) > 0.5f)
- {
- creatPoint.x = maxCreat.position.x;
- }
- else
- {
- creatPoint.x = minCreat.position.x;
- }
- }
- else
- {
- creatPoint.x = UnityEngine.Randow.Range(minCreat.position.x, maxCreat.position.x);
- if (Randow.Range(0f, 1f) > 0.5f)
- {
- creatPoint.y = maxCreat.position.y;
- }
- else
- {
- creatPoint.y = minCreat.position.y;
- }
- }
- return creatPoint;
- }
- }
复制代码 |
|