示例#1
0
    public IEnumerator GenerateEdges(Unitoken core, Concept concept)
    {
        List <List <Edge> > ConceptEdges = CountEdgePropertyTypes(concept);

        string[] relations = ConceptNetInterface.relationURIs;

        //Give core a branch
        ArcCollection coreCollection = new ArcCollection();

        coreCollection.Initialize();
        core.AddCollection(coreCollection);


        int count = 0;

        foreach (List <Edge> edgelist in ConceptEdges)
        {
            if (edgelist.Count > 0)
            {
                string edgeUnitokenLabel = relations[count];

                //Check if label is within toggled array
                ConceptNetProperty c = PropertyMenu.Instance.GetProperty(edgeUnitokenLabel);

                Unitoken.UnitokenState state = !c.isActive ? Unitoken.UnitokenState.Preview : Unitoken.UnitokenState.Loaded;

                Unitoken newCore = TokenFactory.Instance.AddNewToken(edgeUnitokenLabel, core.transform.position + rngVector());
                newCore.SetState(state);
                newCore.SetSprite(collectionIconSprite);
                ArcMapManager.Instance.SetFocusedToken(newCore);

                Arc arc = ArcFactory.Instance.AddNewArc(core, "", newCore);


                ArcCollection subBranch = new ArcCollection();
                subBranch.SetCore(newCore);
                foreach (Edge edge in edgelist)
                {
                    subBranch.AddEdge(edge);
                }

                coreCollection.AddConnection(subBranch);
                //yield return StartCoroutine(SpawnEdges(edgelist, newCore, edgeUnitokenLabel, state));
                yield return(new WaitForSeconds(0.1f));
            }

            count++;
            yield return(new WaitForSeconds(0.1f));
        }
    }
示例#2
0
 internal void AddCollection(ArcCollection subBranch)
 {
     Arcbranches.Add(subBranch);
 }