Nav Mesh Agent Auto Repath#
Navigation / Nav Mesh Agent / Nav Mesh Agent Auto Repath
Can Read
Can Write
Description#
The Auto Repath 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]
[Set]
[Title("Nav Mesh Agent Auto Repath")]
[Category("Navigation/Nav Mesh Agent/Auto Repath")]
[Description("The Auto Repath property of the Nav Mesh Agent component")]
[Image(typeof(IconNavmeshAgent), ColorTheme.Type.Red)]
[Keywords("Navigation, NavMesh, AI, Pathfinding, Agent")]
[Serializable]
public class GenTypeBool_NavMeshAgent_AutoRepath : 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.autoRepath : default;
}
public override bool Get(Args args)
{
NavMeshAgent instance = this.m_NavMeshAgent.Get<NavMeshAgent>(args);
return instance != null
? instance.autoRepath
: default;
}
public override void Set(bool value, Args args)
{
NavMeshAgent component = this.m_NavMeshAgent.Get<NavMeshAgent>(args);
if (component != null) component.autoRepath = (bool) value;
}
public override string ToString()
{
return $"{this.m_NavMeshAgent} Auto Repath";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}