Example #1
0
    public void _1_13_SetupStackedGraph_FullStacked()
    {
        GraphStackController.CleanCache();

        var basePath      = Path.Combine(Application.dataPath, "AssetGraphTest/Editor/TestData");
        var graphDataPath = Path.Combine(basePath, "_1_12_RunStackedGraph_FullStacked.json");

        // load
        var dataStr = string.Empty;

        using (var sr = new StreamReader(graphDataPath)) {
            dataStr = sr.ReadToEnd();
        }
        var graphDict = Json.Deserialize(dataStr) as Dictionary <string, object>;

        var resultDict = GraphStackController.SetupStackedGraph(graphDict, string.Empty);

        // 11 is count of connections. 3 is count of end nodes.
        if (resultDict.Count == 11 + 3)
        {
            Debug.Log("passed _1_13_SetupStackedGraph_FullStacked");
            return;
        }

        Debug.LogError("shortage or excess of connections:" + resultDict.Count);
    }
Example #2
0
    public void _1_14_SetupStackedGraph_Sample()
    {
        GraphStackController.CleanCache();

        var basePath      = Path.Combine(Application.dataPath, "AssetGraphTest/Editor/TestData");
        var graphDataPath = Path.Combine(basePath, "_1_14_RunStackedGraph_Sample.json");

        // load
        var dataStr = string.Empty;

        using (var sr = new StreamReader(graphDataPath)) {
            dataStr = sr.ReadToEnd();
        }

        var graphDict = Json.Deserialize(dataStr) as Dictionary <string, object>;

        GraphStackController.SetupStackedGraph(graphDict, string.Empty);

        Debug.Log("passed _1_14_SetupStackedGraph_Sample");
    }