Random Maze, leaving a question:
"Quaternion This API can not understand, first put on the study list, if this, should be able to cross the wall, vertical wall only with one."
Check out the official API below.
Use only one wall, the effect is the same.
Update the Code:
usingUnityengine;/// <summary>///Initializing the Maze/// </summary> Public classinitializemazerev1:monobehaviour{ PublicGameobject WALLHS; PublicGameobject pillars; Public intSumber = -; //Use this for initialization voidAwake () {intSidexy = Sumber * One; for(inti =0; I < (Sumber +1); i++) { for(intj =0; J < (Sumber +1); J + +) { intPillarx = i * the; intWALLHX = -+ the*i; intPillarz = J * the; intWallvz = -+ the*J; if(i = = Sumber && J = =Sumber) {Instantiate (pillars,NewVector3 (Pillarx, -, Pillarz), quaternion.identity); Continue; } if(i = =Sumber) {Instantiate (pillars,NewVector3 (Pillarx, -, Pillarz), quaternion.identity); //Instantiate (WALLV, New Vector3 (Pillarx, Wallvz), quaternion.identity);Instantiate (WALLHS,NewVector3 (Pillarx, -, Wallvz), Quaternion.euler (0, -,0)); Continue; } if(J = =Sumber) {Instantiate (pillars,NewVector3 (Pillarx, -, Pillarz), quaternion.identity); Instantiate (WALLHS,NewVector3 (WALLHX, -, Pillarz), quaternion.identity); } Else{Instantiate (pillars,NewVector3 (Pillarx, -, Pillarz), quaternion.identity); Instantiate (WALLHS,NewVector3 (WALLHX, -, Pillarz), quaternion.identity); //Instantiate (WALLV, New Vector3 (Pillarx, Wallvz), quaternion.identity)Instantiate (WALLHS,NewVector3 (Pillarx, -, Wallvz), Quaternion.euler (0, -,0)); } } } }}
[Game development-Learning notes] Rookie slowly flying (vii)-MAZE update