In this recipe, we take a mixed approach to tag vertices with a given odor particle that collides with it.
The smelling function using a graph-based system
Getting ready
The vertices should have a broad collider attached so that they catch the odor particles nearby.
How to do it...
- Add the following member variable to the odor-particle script to store its parent ID:
public int parent;
- Create the new odor-enabled class, deriving from the original vertex:
using UnityEngine; using System.Collections; using System.Collections.Generic; public class VertexOdour : Vertex...