Nav Mesh Agent Is Path Stale#
Navigation / Nav Mesh Agent / Nav Mesh Agent Is Path Stale
Can Read
Cannot Write
Description#
The Is Path Stale property of the Nav Mesh Agent component
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.AI;
namespace VisualScript.Runtime
{
[Get]
[Title("Nav Mesh Agent Is Path Stale")]
[Category("Navigation/Nav Mesh Agent/Is Path Stale")]
[Description("The Is Path Stale property of the Nav Mesh Agent component")]
[Image(typeof(IconNavmeshAgent), ColorTheme.Type.Red)]
[Keywords("Navigation, NavMesh, AI, Pathfinding, Agent")]
[Serializable]
public class GenTypeBool_NavMeshAgent_IsPathStale : TypeBool
{
[SerializeField] private GetGameObject m_NavMeshAgent = new GetGameObject(
new GenTypeGameObject_NavMeshAgent()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_NavMeshAgent.GetPreview(source);
if (instance == null) return default;
NavMeshAgent component = instance.GetComponent<NavMeshAgent>();
return component != null ? component.isPathStale : default;
}
public override bool Get(Args args)
{
NavMeshAgent instance = this.m_NavMeshAgent.Get<NavMeshAgent>(args);
return instance != null
? instance.isPathStale
: default;
}
public override string ToString()
{
return $"{this.m_NavMeshAgent} Is Path Stale";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}