예제 #1
0
    public void ActivateVert()
    {
        activeCycleInfo = info.allCyclesInfo[selectedVert];
        activeVert      = activeCycleInfo.id;
        string title = "" + activeCycleInfo.goName + " || " + activeCycleInfo.name;

        nameGO.GetComponent <TextMesh>().text = title;
        HighlightGameObject();

        //data.audio.Play( selectClips[Random.Range(0,selectClips.Length)]  , 1.01f, .6f);

        float [] d = new float[verts.structSize];
        verts._buffer.GetData(d, 0, (int)activeVert * verts.structSize, verts.structSize);
        //GetData(Array data, int managedBufferStartIndex, int computeBufferStartIndex, int count);

        target = new Vector3(d[0], d[1], d[2]);

        if (activeCycleInfo.type == -1)
        {
            moreInfoGO.SetActive(false);
        }
        else if (activeCycleInfo.type == -2)
        {
            moreInfoGO.SetActive(false);
        }
        else if (activeCycleInfo.type == 0)
        {
            moreInfoGO.SetActive(false);
        }
        else if (activeCycleInfo.type == 1)
        {
            moreInfoGO.SetActive(true);
            moreInfoGO.GetComponent <TextMesh>().text = "Save Form";
        }
        else if (activeCycleInfo.type == 2)
        {
            moreInfoGO.SetActive(true);
            moreInfoGO.GetComponent <TextMesh>().text = "Open Compute Shader";
        }
        else if (activeCycleInfo.type == 6)
        {
            moreInfoGO.SetActive(true);
            moreInfoGO.GetComponent <TextMesh>().text = "Open Shader";
        }
        else
        {
            moreInfoGO.SetActive(false);
        }
    }
예제 #2
0
    public void GetCycleInfo()
    {
        for (int cycleID = 0; cycleID < allCycles.Count; cycleID++)
        {
            Cycle cycle = allCycles[cycleID];



            HELP.CycleInfo ci = new HELP.CycleInfo();

            ci.type = 0;
            if (cycle is God)
            {
                ci.type = -2;
            }
            if (cycle is StorySetter)
            {
                ci.type = -1;
            }
            if (cycle is Form)
            {
                ci.type = 1;
            }
            if (cycle is Life)
            {
                ci.type = 2;
            }
            if (cycle is Binder)
            {
                ci.type = 3;
            }
            if (cycle is Simulation)
            {
                ci.type = 4;
            }
            if (cycle is Page)
            {
                ci.type = 5;
            }
            if (cycle is Body)
            {
                ci.type = 6;
            }
            if (cycle is TransferLifeForm)
            {
                ci.type = 7;
            }                                            // should eventually be simulation?

            ci.id    = cycleID;
            ci.cycle = cycle;

            ci.position = cycle.transform.position;
            ci.name     = "" + cycle.GetType();
            ci.goName   = "" + cycle.gameObject.name;
            ci.go       = cycle.gameObject;
//      bool alreadyOne = false;
            if (cycle.parent)
            {
                ci.parent = cycle.parent.executionID;

                ci.lookupStart = lookupBuffer.Count;
                //ci.position = allCyclesInfo[ci.parent].position;


                int me = -1;
                for (int i = 0; i < cycle.parent.Cycles.Count; i++)
                {
                    if (cycle.parent.Cycles[i] == cycle)
                    {
                        me = i;
                    }
                }

                ci.siblingID    = me;
                ci.siblingCount = cycle.parent.Cycles.Count;

                print(ci.parent);
                print(allCyclesInfo.Count);

                ci.position = allCyclesInfo[ci.parent].position + new Vector3((float)me, 1, 0);


                //print( allCyclesInfo.Count );
                //print( parent.executionID );
                //print( allCycles.Count );
                //ci.position = (allCyclesInfo[parent.executionID]).position;
                //ci.position += new Vector3(me , 0,0);
            }
            else
            {
                ci.position = new Vector3(0, -2, 5);
                ci.parent   = 0;
            }
            ci.lookupStart = lookupBuffer.Count;

            ci.children = new int[cycle.Cycles.Count];
            ci.active   = 1;

            ci.lookupLength = ci.children.Length;
            for (int i = 0; i < cycle.Cycles.Count; i++)
            {
                lookupBuffer.Add(cycle.Cycles[i].executionID);
                ci.children[i] = cycle.Cycles[i].executionID;
            }


            allCyclesInfo.Add(ci);
        }
    }