Ejemplo n.º 1
0
        public override void _Create()
        {
            if (mpb == null)
            {
                mpb = new MaterialPropertyBlock();
            }

            if (verts == null)
            {
                verts = GetComponent <MeshVerts>();
            }
            if (triangles == null)
            {
                triangles = GetComponent <MeshTris>();
            }

            SafeInsert(verts);
            SafeInsert(triangles);


            mpb.SetInt("_VertCount", verts.count);
            mpb.SetBuffer("_VertBuffer", verts._buffer);
            mpb.SetBuffer("_TriBuffer", triangles._buffer);

            DoCreate();
        }
Ejemplo n.º 2
0
        public override void _Create()
        {
            print("run SEcOND");
            if (mpb == null)
            {
                mpb = new MaterialPropertyBlock();
            }


            if (verts == null)
            {
                verts = GetComponent <Form>();
            }
            if (triangles == null)
            {
                triangles = GetComponent <IndexForm>();
            }

            SafeInsert(verts);
            SafeInsert(triangles);


            mpb.SetInt("_VertCount", verts.count);
            mpb.SetBuffer("_VertBuffer", verts._buffer);
            mpb.SetBuffer("_TriBuffer", triangles._buffer);

            DoCreate();
        }
Ejemplo n.º 3
0
        // Use this for initialization
        public override void _Create()
        {
            _Destroy();


            transformArray = new float[16];



            binders = GetComponents <Binder>();
            for (int i = 0; i < binders.Length; i++)
            {
                SafeInsert(binders[i]);
            }

            if (body == null)
            {
                body = GetComponent <Body>();
            }
            if (transfer == null)
            {
                transfer = GetComponent <Life>();
            }
            if (verts == null)
            {
                verts = GetComponent <Form>();
            }
            if (triangles == null)
            {
                triangles = GetComponent <IndexForm>();
            }

            DebugThis("" + body.GetType());

            SafeInsert(body);
            SafeInsert(transfer);

            DoCreate();
        }