GameObject problem, A Puzzled difference between Unity Editor and Build result.

Well, this problem confused me for two days but I still cannot solve it.


Figure 1. Assign the variable

Figure 2. Code in script
1369553--68780--$3.png
Figure 3. Running in the Play Mode

Figure 4. Running the exe on Windows

The first image shows that I’ve dragged the GameObject “Road1” “Road2” into the slot;

And the second image shows the content of the script, what I wanna do is that when the player(the sphere) trigger the EntranceCollider object (a sub object of Road), the specific GameObject “Road1”(or “Road2”) would translate a vector3-offset assigned in the Inspector View.

It works well in the Game View when I Play the game in the Unity Editor, as shown in the third image.
But it doesn’t work when I build it to an windows exe file, you can find the screen printing the text “fucking null” in the top left of the image, (sorry for using this word).

Well, my apologize for my pool English cuz I’m poor in English. I doubt whether it’s a bug of Unity or just some mistake I made.

Where is Road1 in the project? Image 1 suggests that Raod1 is a prefab, not the scene object called Road1.

Road1 and Road2 are both the copy of Prefab Road, they are almost same except the GameObject variable of script EnterTerrain.cs, in Road1, the AnotherTerrain is assigned as Road2, and parentTerrain is assigned as Road1 itself, in Road2 they are in the opposite slots.
The PROBLEM that confused me is that the game plays in an expected result in Unity Editor, but an unexpected one when I build the game as a windows execution file as well as an apk file in Android.