123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using XNode;
- using System;
- using Sirenix.OdinInspector;
- using System.Linq;
- namespace ChivaVR.State
- {
- /// <summary>
- /// 流程进入
- /// </summary>
- public class EnterStateNode : StateNode
- {
- [Output] public Empty exit;
- public override void OnEnter()
- {
- base.OnEnter();
- OnExit();
- }
- public override void OnExit()
- {
- base.OnExit();
- NodePort exitPort = GetOutputPort("exit");
- if (!exitPort.IsConnected)
- {
- Debug.LogWarning("Node isn't connected");
- return;
- }
- for (int i = 0; i < exitPort.GetConnections().Count; i++)
- {
- StateNode connectEnterNode = exitPort.GetConnection(i).node as StateNode;
- if (connectEnterNode.CheckEnterConnectState())
- {
- connectEnterNode.OnEnter();
- }
- }
- }
- }
- }
|