random enemy 1

My enemies are randomly generated from both sides

Then there are three kinds of enemies appear to be random

The level of the enemy is moving in the direction from right to left or from left to right

The enemy faster and faster

The number of the enemy will more and more

May I ask how to write code?

1 Then there are three kinds of enemies appear to be random

Use random class to generate random enemy

http://unity3d.com/support/documentation/ScriptReference/Random.html

2 The level of the enemy is moving in the direction from right to left or from left to right

Attach character controller to enemy model and use simple move function to move them.

http://unity3d.com/support/documentation/ScriptReference/CharacterController.html

3 The enemy faster and faster

Increase their speed variable overtime of course.

4 The number of the enemy will more and more
Instantiate enemy prefabs overtime.

The most important thing I feel is you should find tutorials and start to learn the basic of scripting.