Example #1
0
    // Start is called before the first frame update
    void Start()
    {
        propertyDictionary = new Dictionary <string, ConceptNetProperty>();

        foreach (string x in relationURIs)
        {
            ConceptNetProperty y = Instantiate(propertyPrefab, Vector3.zero, Quaternion.identity, transform);
            y.SetProperty(x);
            y.isActive = false;
            propertyDictionary.Add(x, y);
        }
    }
Example #2
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));
        }
    }
Example #3
0
    // Update is called once per frame
    public void Update(){
        toggledCategories = "";
        string[] relations = ConceptNetInterface.relationURIs;


        //Check if label is within toggled array
        for(int i = 0; i < relations.Length; i++){
        string edgeUnitokenLabel = relations[i];
        bool state = PropertyMenu.Instance.Filter[i];
        ConceptNetProperty c = PropertyMenu.Instance.GetProperty(edgeUnitokenLabel);
            if(state){
                //Debug.Log("")
                toggledCategories += edgeUnitokenLabel +": ";
            }
        }

    }
Example #4
0
    // Start is called before the first frame update
    void Start()
    {
        Instance = this;
        ConceptNetPropertyList = new List <ConceptNetProperty>();
        PropertyDictionary     = new Dictionary <string, ConceptNetProperty>();

        int count = 0;

        foreach (string x in PropertyContainer.relationURIs)
        {
            ConceptNetProperty y = Instantiate(propertyMenuButton, Vector3.zero, Quaternion.identity, transform);
            y.SetProperty(x);
            y.isActive = false;
            y.index    = count;
            ConceptNetPropertyList.Add(y);
            PropertyDictionary.Add(x, y);

            count++;
        }
    }