Development environment: WIN10, Unity5.3.4, C #, VS2015
Date Created: 2016-05-09 I. INTRODUCTION
In a specific game scenario, you can control the path of an object by layering, such as which objects only travel on the surface of the water, which can only travel on land, and which can travel on land and on the water. Ii. examples
1. Create a scene
(1) in the Ch1201_navmesh_sample project, create a new scene named Demo3, adding the following objects to the scene:
The structure in the hierarchy view is as follows:
The cube below the middle is bridge1, and the cube above is bridge2 to simulate two bridges.
(2) Switch to the "Navigation" window of the areas, add Bridge1 and Bridge2 as shown:
(3) Click the "Bake" button to finish baking. You can see that the different layers of the navigation grid automatically use different colors to indicate:
(4) switch to the hierarchy view, select Player, then set the "Area Mask" property in the viewer view, tick Bridge2, uncheck Bridge1, as shown in:
(5) Press "play" to see which bridge the moving animation is walking.
(6) Change to tick bridge1, uncheck Bridge2, and press "play" again to see which bridge the moving animation is.
Unity 12.4 Select a route from the grid hierarchy