Beispiel #1
0
    private LevelNodeData SaveNodeData(LevelNode _lvnode)
    {
        LevelNode _node = (LevelNode)_lvnode;

        Debug.Log("SAVE portset count " + _node.portSets.Count);
        LevelNodeData _data = new LevelNodeData
        {
            guid      = _node.NodeGuid,
            position  = _node.GetPosition().position,
            portSets  = _node.portSets,
            loadType  = _node.loadType,
            asyncType = _lvnode.asyncType,
            scenePath = _lvnode.scenePath,
            //scene = _node.scene,
            sceneAssestGuid = _node.scenAssetGuid,
        };

        return(_data);
    }
Beispiel #2
0
    public static async void LoadNextScene(string _setGuid)
    {
        Init();
        if (flowData == null)
        {
            Debug.Log("flow Data unset");
            return;
        }
        //Get this portSet
        PortSet _thisPortSet = flowData.GetPortSet(_setGuid);

        if (_thisPortSet == null)
        {
            //  => Not on the data : return
            Debug.Log("Port " + _setGuid + " is Null");
        }
        else
        {
            //Get this port's next port in link data
            PortSet _nextPortSet = flowData.GetLinkedPort(_thisPortSet.localOutGuid);
            if (_nextPortSet != null)
            {
                //Get Next port's scene data and enterPoint object
                LevelNodeData _node = (LevelNodeData)flowData.GetNode(_nextPortSet.nodeGuid);

                //Apply scene load Mode
                if (_node.asyncType == AsyncLoadType.Async)
                {
                    await LoadSceneAsync(_node.GetScenePath(), _nextPortSet.setGuid, _node.loadType);
                }
                else
                {
                    LoadSceneSync(_node.GetScenePath(), _nextPortSet.setGuid, _node.loadType);
                }

                loadingScene = _node.GetScenePath();
            }
            else
            {
                Debug.Log("Next Port " + " is Null");
            }
        }
    }