#if GRAPH_DESIGNER /// --------------------------------------------- /// Behavior Designer /// Copyright (c) Opsive. All Rights Reserved. /// https://www.opsive.com /// --------------------------------------------- namespace Opsive.BehaviorDesigner.Runtime.Tasks.Actions.SceneManagementTasks { using Opsive.GraphDesigner.Runtime.Variables; using System.Collections.Generic; using UnityEngine; [Opsive.Shared.Utility.Category("Scene Management")] [Opsive.Shared.Utility.Description("Marks the target GameObject to persist across scenes.")] public class DontDestroyOnLoad : TargetGameObjectAction { [Tooltip("The list of GameObjects to mark as DontDestroyOnLoad.")] [SerializeField] protected List> m_GameObjects = new List>(); /// /// Marks the target GameObject as DontDestroyOnLoad. /// /// The status of the action. public override TaskStatus OnUpdate() { Object.DontDestroyOnLoad(gameObject); return TaskStatus.Success; } } } #endif