Esempio n. 1
0
        /// <summary>Internal method to notify the NavmeshAdd that it has just been used to update the navmesh</summary>
        internal override void NotifyUpdated(Pathfinding.Util.GridLookup <NavmeshClipper> .Root previousState)
        {
            previousState.previousPosition = tr.position;

            if (useRotationAndScale)
            {
                previousState.previousRotation = tr.rotation;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Returns true if this object has moved so much that it requires an update.
 /// When an update to the navmesh has been done, call NotifyUpdated to be able to get
 /// relavant output from this method again.
 /// </summary>
 public override bool RequiresUpdate(Pathfinding.Util.GridLookup <NavmeshClipper> .Root previousState)
 {
     return((tr.position - previousState.previousPosition).sqrMagnitude > updateDistance * updateDistance || (useRotationAndScale && (Quaternion.Angle(previousState.previousRotation, tr.rotation) > updateRotationDistance)));
 }