Exemplo n.º 1
0
        /// <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>();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Recreates the mesh when this script becomes active
 /// </summary>
 protected void OnEnable()
 {
     m_AreaMeshCreator = (AreaMeshCreator)target;
     CreateMesh();
 }