//public Vector3 direction=new Vector3(0,-1,0); // Use this for initialization void Start() { GENERATOR = transform.root.GetComponent <CloudGen> (); speed += Random.Range(-SpeedAmplitude, SpeedAmplitude); GetComponent <Animator> ().speed = speed; //Debug.Log (GENERATOR.GetComponent<CloudGen>().Z); }
public void CreateCloud(int x, int y, int z) { WorldPos worldPos = new WorldPos(x, y + 40, z); GameObject newCloudObject = Instantiate(cloudPrefab, new Vector3(worldPos.x, worldPos.y, worldPos.z), Quaternion.Euler(Vector3.zero)) as GameObject; AVVoxel.Cloud newCloud = newCloudObject.GetComponent <AVVoxel.Cloud>(); newCloud.worldPos = worldPos; newCloud.world = this; //chunks.Add(worldPos, newCloud); CloudGen cloudGen = new CloudGen(); newCloud = cloudGen.ChunkGen(newCloud); }