public Vector2 GetNewDirection() { var script = @"return GetEnemyToPlayerDirection()"; //var directions = new Vector2[] { new Vector2(0, 1), new Vector2(-1, 0), new Vector2(1, 0), new Vector2(0, -1) }; //e.DirectionIndex++; //e.DirectionIndex = e.DirectionIndex % 4; //e.Direction = directions[DirectionIndex]; this.direction = (Vector2)(scriptProcessor.ExecScript(this, script)); return(direction); }