OldBlueWater/BlueWater/Assets/Doozy/Runtime/Nody/Nodes/System/StartNode.cs
2023-08-02 15:08:03 +09:00

40 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Copyright (c) 2015 - 2023 Doozy Entertainment. All Rights Reserved.
// This code can only be used under the standard Unity Asset Store End User License Agreement
// A Copy of the EULA APPENDIX 1 is available at http://unity3d.com/company/legal/as_terms
using System;
using Doozy.Runtime.Nody.Nodes.Internal;
namespace Doozy.Runtime.Nody.Nodes.System
{
/// <summary>
/// System node used as the first node that gets activated in a graph.
/// Its treated as the root node and it cannot be moved.
/// </summary>
[Serializable]
public sealed class StartNode : SystemNode
{
public override int minNumberOfInputPorts => 0;
public override int minNumberOfOutputPorts => 1;
public StartNode() : base(SystemNodeType.Start)
{
AddOutputPort();
lastOutputPort
.SetCanBeDeleted(false)
.SetCanBeReordered(false);
clearGraphHistory = true;
}
public override void OnEnter(FlowNode previousNode = null, FlowPort previousPort = null)
{
base.OnEnter(previousNode, previousPort);
GoToNextNode(firstOutputPort);
}
public override FlowNode Clone() =>
Instantiate(this);
}
}