UnityPackage-RoadPathTool

来源:互联网 发布:下载高品质音乐的软件 编辑:程序博客网 时间:2024/06/02 05:48

Road/Path Tool












Overview

The Road/Path Tool was developed by Chris Morris for an upcoming Six Times Nothing game, Dawn Of The Tyrant, and adapted for public use.

For the latest news on updates for this tool or other Six Times Nothing projects, follow: @_chris_morris on Twitter.

Requirements

The Road/Path Tool requires Unity 3.x

 

Watch the Tutorial Video

Installation instructions

Unzip and import "PublicRoadPathTool.unitypackage" into your project. If no package exists, just unzip and copy the folder directly into your assets folder.

Usage

First, drag "PathScript.cs" onto your terrain object.

*Note: The terrain object's position needs to be at (0, 0, 0). If you need to you can create the road at this position and then move the terrain and road mesh back to the original, offset, location.

*IMPORTANT TIP: After finalizing, delete the script attached to your new path game object to avoid accidentally deleting your mesh. If you close out of Unity (thus deleting local variables), open it back up and try to edit your finalized river, it will be deleted.

The Road/Path Tool has a few basic functions:

  1. New Path - Creates a new path object
    1. Click "New Path" to create a new path Game Object - 'Path' - and select it.
    2. Click "Add Path Node". Give the editor window focus (right click) and find an appropriate node position with your mouse. Press 'p' on your keyboard to add a node at that location.
    3. Continue adding nodes and changing parameters until you are satisfied with your path.
    4. Click "Finalize Path" to finish the path and deform the terrain. *You cannot add nodes after finalizing*
    5. Click "Smooth Path" to smooth the terrain local to the path. This is available after you finalize.
    6. Click "Smooth Path Slope" to smooth the terrain leading into the path. This is available after you finalize.

Parameters

The Road/Path Tool has a few parameters that define the type of path to create:

  1. "Road" - This check box defines whether or not the path created will be a mesh or a texture. A road will create a mesh.
  2. "Path Width" - This is the width of the path.
  3. "Texture Prototype" - This is the texture prototype number (from you terrain textures list) to use. *Remember, these start at 0 so if you have 2 terrain textures they are textures 0 and 1
  4. "Uniform Texture" - This check box defines whether or not you want the path texture to be uniformly distributed or not.
  5. "Wear" - If you choose not to have a uniform texture, wear is the amount of fade placed on the texture. The higher the wear, the more worn the path will be
  6. "Flat" - This forces your path to be flat and deforms the terrain in order to do so.
  7. "Mesh Smoothing" - This is the step number of interpolation points - sort of like a level of detail

Tips

  • A material is included that uses an Offset to bring the texture above the terrain when viewed from far distances where the terrain's LOD changes.
  • If you have a terrain issue with the very beginning or very end of your road, use the built-in terrain tools to lower the terrain and then change the Mesh Smoothing slider to refresh the mesh
  • If you get an "Invalid Texture Prototype" message, it means you entered a texture ID outside of the bounds of your terrain's textures.

原创粉丝点击