private void EnsureCorrectGridSize() { if( numGridsHeight!=vectorField.Height || numGridsWidth!=vectorField.Width ) { vectorField = CreateVectorField(); } }
private VectorField2 CreateVectorField() { var width = Mathf.Max(1,numGridsWidth); var height = Mathf.Max(1,numGridsHeight); var vf = new VectorField2( width, height ); vf.SetAll( initialVelocity ); return vf; }
private void Awake() { vectorField = CreateVectorField(); }