Example #1
0
        private void AddExistingQualiScorerPort(QualiScorerNode qsNode, int qsIndex, int nwIndex)
        {
            NodeWeightedLink nwLink = graphData.qualiScorers[qsIndex].inLinks[nwIndex];

            SaveGraphData();
            SerializedProperty serNWL = graphDataSerialized
                                        .FindProperty("qualiScorers")
                                        .GetArrayElementAtIndex(qsIndex)
                                        .FindPropertyRelative("inLinks")
                                        .GetArrayElementAtIndex(nwIndex)
                                        .FindPropertyRelative("weight");
            Port port = qsNode.AddInputPort(nwLink, serNWL);

            AddExistingPort(nwLink, port, qsNode);
        }
Example #2
0
        private void AddNewQualiScorerPort(QualiScorerNode qsNode, int qsIndex)
        {
            NodeWeightedLink nwLink = new NodeWeightedLink();

            nwLink.otherNodeID = "";
            nwLink.weight      = 0.5f;
            graphData.qualiScorers[qsIndex].inLinks.Add(nwLink);
            int linkIndex = graphData.qualiScorers[qsIndex].inLinks.Count - 1;

            SaveGraphData();
            SerializedProperty serNWL = graphDataSerialized
                                        .FindProperty("qualiScorers")
                                        .GetArrayElementAtIndex(qsIndex)
                                        .FindPropertyRelative("inLinks")
                                        .GetArrayElementAtIndex(linkIndex)
                                        .FindPropertyRelative("weight");

            qsNode.AddInputPort(nwLink, serNWL);
        }