using UnityEngine;
using System.Collections;
public class WaterMesh : MonoBehaviour {
private Mesh mesh;
private Vector3[] vertices;
private float deltaTime;
void Start() {
mesh = GetComponent<MeshFilter>().mesh;
vertices = mesh.vertices;
deltaTime = 0.0f;
}
void Update() {
int numberVertex = 0;
while (numberVertex < vertices.Length) {
vertices[numberVertex].y = Mathf.Sin(deltaTime + numberVertex);
numberVertex++;
}
deltaTime += Time.deltaTime;
}
}
Почему такой скрипт не работает?