#if GRAPH_DESIGNER /// --------------------------------------------- /// Behavior Designer /// Copyright (c) Opsive. All Rights Reserved. /// https://www.opsive.com /// --------------------------------------------- namespace Opsive.BehaviorDesigner.Runtime.Tasks { using Opsive.BehaviorDesigner.Runtime.Tasks.Actions; using Opsive.BehaviorDesigner.Runtime.Tasks.Composites; using Opsive.GraphDesigner.Runtime; using Opsive.Shared.Utility; using UnityEngine; /// /// Represents a task node that can no longer be found. /// [HideInFilterWindow] public class UnknownTaskNode : ActionNode { private string m_UnknownType; /// /// Default constructor. /// public UnknownTaskNode() { } /// /// UnknownTaskNode constructor. /// /// The type that cannot be found. public UnknownTaskNode(string unknownType) { m_UnknownType = unknownType; } /// /// Called once when the behavior tree is initialized. /// public override void OnAwake() { base.OnAwake(); Debug.LogWarning($"Warning: Unable to find the task of type {m_UnknownType}. An unknown task has been replaced with it."); } } /// /// Represents a task that can no longer be found. /// [HideInFilterWindow] public class UnknownTask : Action { /// /// Called once when the behavior tree is initialized. /// public override void OnAwake() { base.OnAwake(); Debug.LogWarning($"Warning: Unable to find the original task. An unknown task has been replaced with it."); } } /// /// Represents a parent task node that can no longer be found. /// [HideInFilterWindow] public class UnknownParentTaskNode : CompositeNode { private string m_UnknownType; /// /// Default constructor. /// public UnknownParentTaskNode() { } /// /// UnknownParentTaskNode constructor. /// /// The type that cannot be found. public UnknownParentTaskNode(string unknownType) { m_UnknownType = unknownType; } /// /// Called once when the behavior tree is initialized. /// public override void OnAwake() { base.OnAwake(); Debug.LogWarning($"Warning: Unable to find the task of type {m_UnknownType}. An unknown task has been replaced with it."); } } /// /// Represents an event node that can no longer be found. /// [HideInFilterWindow] public class UnknownEventTask : IEventNode { public ushort ConnectedIndex { get => ushort.MaxValue; set { } } } } #endif