Exemple #1
0
    // Use this for initialization
    public void Live()
    {
        vBuf = gameObject.AddComponent <vBuffer>() as vBuffer;

        updater = gameObject.AddComponent <vBuffUpdater>() as vBuffUpdater;
        updater.computeShader = physicsShader;
        updater.update        = true;
        updater.resetOnStart  = true;


        vbt  = gameObject.AddComponent <vBuff_Transform>() as vBuff_Transform;
        tBuf = gameObject.AddComponent <tBuffer>() as tBuffer;


        dvbwt   = gameObject.AddComponent <DisplayVertBufferWithTriangles>() as DisplayVertBufferWithTriangles;
        dvbwt.m = new Material(renderer);
        //dvbwt.enabled = false;

        vbh       = gameObject.AddComponent <vBuff_Human>() as vBuff_Human;
        vbh.human = humanBuffer;

        vdo = gameObject.AddComponent <vBuff_DataOut>() as vBuff_DataOut;
        vdo.gatherShader = gatherShader;

        tBuf.Live();
        vBuf.Live();
        updater.Live();
        vbt.Live();
        vbh.Live();
        vdo.Live();
        dvbwt.Live();

        GetComponent <MeshRenderer>().enabled = false;
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        vBuffer vBuf = GetComponent <vBuffer>() as vBuffer;

        tBuffer tBuf = GetComponent <tBuffer>() as tBuffer;
        hBuffer hBuf = GetComponent <hBuffer>() as hBuffer;

        vBuffUpdater    baseUpdater = GetComponent <vBuffUpdater>() as vBuffUpdater;
        vBuff_Transform vbt         = GetComponent <vBuff_Transform>() as vBuff_Transform;

        hBuffUpdater    hairUpdater = GetComponent <hBuffUpdater>() as hBuffUpdater;
        hBuff_Transform hbt         = GetComponent <hBuff_Transform>() as hBuff_Transform;

        DisplayHairBufferWithLines dhbwl = GetComponent <DisplayHairBufferWithLines>() as DisplayHairBufferWithLines;
        DisplayVertBufferWithLines dvbwl = GetComponent <DisplayVertBufferWithLines>() as DisplayVertBufferWithLines;

        tBuf.Live();
        vBuf.Live();
        hBuf.Live();

        baseUpdater.Live();
        hairUpdater.Live();

        vbt.Live();
        hbt.Live();

        dhbwl.Live();
        dvbwl.Live();
    }
Exemple #3
0
    // Use this for initialization
    public void Live()
    {
        vBuf = gameObject.AddComponent <vBuffer>() as vBuffer;

        baseUpdater = gameObject.AddComponent <vBuffUpdater>() as vBuffUpdater;
        baseUpdater.computeShader = basePhysicsShader;
        baseUpdater.update        = true;


        vbt = gameObject.AddComponent <vBuff_Transform>() as vBuff_Transform;

        tBuf = gameObject.AddComponent <tBuffer>() as tBuffer;

        hBuf = gameObject.AddComponent <hBuffer>() as hBuffer;

        hBuf.tBuf = tBuf;
        hBuf.vBuf = vBuf;

        hBuf.numVertsPerHair = vertsPerHair;
        hBuf.hairLength      = hairLength;
        hBuf.totalHairs      = totalHairs;


//		print("HAHWS");

        hairUpdater = gameObject.AddComponent <hBuffUpdater>() as hBuffUpdater;

        hairUpdater.collisionShader  = hairCollisionShader;
        hairUpdater.constraintShader = hairConstraintShader;
        hairUpdater.update           = true;



        hbt = gameObject.AddComponent <hBuff_Transform>() as hBuff_Transform;
        hdo = gameObject.AddComponent <hBuff_DataOut>() as hBuff_DataOut;
        hdo.gatherShader = hairGatherShader;


        dhbwl   = gameObject.AddComponent <DisplayHairBufferWithLines>() as DisplayHairBufferWithLines;
        dhbwl.m = new Material(hairLineRenderer);


        dvbwl         = gameObject.AddComponent <DisplayVertBufferWithLines>() as DisplayVertBufferWithLines;
        dvbwl.m       = new Material(baseLineRenderer);
        dvbwl.enabled = false;


        dvbwt   = gameObject.AddComponent <DisplayVertBufferWithTriangles>() as DisplayVertBufferWithTriangles;
        dvbwt.m = new Material(baseRenderer);
        //dvbwt.enabled = false;

        hbh = gameObject.AddComponent <hBuff_Human>() as hBuff_Human;
        vbh = gameObject.AddComponent <vBuff_Human>() as vBuff_Human;

        hbh.human = humanBuffer;
        vbh.human = humanBuffer;

        tBuf.Live();
        vBuf.Live();
        hBuf.Live();

        baseUpdater.Live();
        hairUpdater.Live();

        vbt.Live();
        hbt.Live();

        vbh.Live();
        hbh.Live();

        hdo.Live();

        dhbwl.Live();
        dvbwl.Live();
        dvbwt.Live();

        GetComponent <MeshRenderer>().enabled = false;
    }