I have a list of vector3s and I want to go through and multiply each vector3 by a random.value but when ever I do my script i get the error that the list is a field when type was expected. Here is my script:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MeshEditing1 : MonoBehaviour {
public Vector3[] vertices;
public Vector3[] normals;
public System.Collections.Generic.List<Vector3> firststep;
public System.Collections.Generic.List<Vector3> underWater;
public Vector3[] aboveWater;
public Mesh mesh;
public float distance;
public int f;
// Use this for initialization
void Start () {
mesh = GetComponent<MeshFilter>().mesh;
vertices = mesh.vertices;
normals = mesh.normals;
int i = 0;
while(i < vertices.Length)
{
var percent = Random.value;
var number= (1 + percent)/85;
//vertices <em>+= normals_* number;_</em>
* var positionPercent = Random.value;*
* int x = i+1;*
* if (percent >= .50f)*
* {*
_ distance= vertices*.magnitude - vertices.magnitude;
//distance = Mathf.Pow( Mathf.Pow((vertices.x - vertices[x].x),2) + Mathf.Pow((vertices.y - vertices[x].y),2) + Mathf.Pow((vertices.z - vertices.z),2),1/2);
if (distance < .5f)
{
firststep.Add(vertices);
x++;
percent = Random.value;
}*_
* }*
* if (percent < .50f)*
* {*
_ underWater.Add(vertices*);
percent = Random.value;
i= x+1;
}*_
* }*
* vertices = firststep.ToArray();*
* //aboveWater = firststep.ToArray();*
* for(int f = 0; f < firststep.Count; f++)*
* {*
* var number = 1+ Random.value;*
_ vertices[f] *= number;_
* }*
_ mesh.vertices= firststep;_
* }*
* // Update is called once per frame*
* void Update () {*
* }*
}
any ideas?
EDIT: edited my question to include all of the code