/// <summary> /// Ensure the collider is a trigger /// </summary> protected void OnValidate() { var trigger = GetComponent <Collider>(); if (trigger != null) { trigger.isTrigger = true; } // Try and find AreaMeshCreator if (areaMesh == null) { areaMesh = GetComponentInChildren <AreaMeshCreator>(); } }
/// <summary> /// Recreates the mesh when this script becomes active /// </summary> protected void OnEnable() { m_AreaMeshCreator = (AreaMeshCreator)target; CreateMesh(); }