using System;
using UnityEngine;
using System.Collections;
using UnityStandardAssets.Characters.ThirdPerson;
public class Multiple_objects : MonoBehaviour {
public GameObject prefab;
public GameObject[] gos;
public int NumberOfObjects;
private ThirdPersonCharacter[] thirdPersonCharacter;
private Animator[] _animator;
private int count = 0;
void Awake()
{
Vector3 v3 = prefab.transform.position;
_animator = new Animator[NumberOfObjects];
gos = new GameObject[NumberOfObjects];
for(int i = 0; i < gos.Length; i++)
{
count = count + 2;
GameObject clone = (GameObject)Instantiate(prefab, Vector3.zero, Quaternion.identity);
gos [i] = clone;
gos [i].transform.position = new Vector3 (v3.x - count, v3.y, v3.z);
_animator [i] = gos[i].GetComponent<Animator>();
Math.Round(Random
當我鍵入點隨機後像:隨機。 我只有平等相待,的ReferenceEquals爲什麼屬性範圍不存在於統一的隨機類中?
如果我例如創建隨機的變量:
Random _random;
然後我鍵入_random。 我得到更多propeties但不Range。
我[RandomGenerator(https://github.com/chanibal/RandomGenerator)實用程序只是一個無恥的插件,它可以解決你的問題具有可實例化的「隨機」類,並且更好地控制值的隨機性。 –