GetVertices() public method

public GetVertices ( int vcount, int icount ) : VertexSegment
vcount int
icount int
return VertexSegment
コード例 #1
0
ファイル: Decal.cs プロジェクト: mengtest/omega-buster
        void GetCorrectSegment()
        {
            if (mVertexsegment == null)
            {
                mVertexsegment = mPool.GetVertices(bufVertices.Count, bufIndices.Count);
                return;
            }

            //int vcount = mVertexsegment.VertCount;
            //int icount = mVertexsegment.IndexCount;



            //if (vcount < bufVertices.Count || icount < bufIndices.Count)
            //{
            //    mPool.DiscardSegment(mVertexsegment);

            //    mVertexsegment = mPool.GetAvailableSegment(bufVertices.Count, bufIndices.Count);

            //    Debug.LogWarning(mVertexsegment);


            //    //re-create a bigger one.
            //    if (mVertexsegment == null)
            //        mVertexsegment = mPool.GetVertices(bufVertices.Count, bufIndices.Count);

            //}
        }
コード例 #2
0
 void InitMeshObj()
 {
     //init vertexpool
     mVertexPool    = new VertexPool(MyMaterial, this);
     mVertexSegment = mVertexPool.GetVertices(Granularity * 3, (Granularity - 1) * 12);
     UpdateIndices();
 }
コード例 #3
0
ファイル: XWeaponTrail.cs プロジェクト: alerithe/guardian
        private void InitMeshObj()
        {
            mMeshObj       = new GameObject("_XWeaponTrailMesh: " + base.gameObject.name);
            mMeshObj.layer = base.gameObject.layer;
            mMeshObj.SetActive(value: true);
            MeshFilter   meshFilter   = mMeshObj.AddComponent <MeshFilter>();
            MeshRenderer meshRenderer = mMeshObj.AddComponent <MeshRenderer>();

            meshRenderer.castShadows             = false;
            meshRenderer.receiveShadows          = false;
            meshRenderer.renderer.sharedMaterial = MyMaterial;
            meshFilter.sharedMesh = new Mesh();
            mVertexPool           = new VertexPool(meshFilter.sharedMesh, MyMaterial);
            mVertexSegment        = mVertexPool.GetVertices(Granularity * 3, (Granularity - 1) * 12);
            UpdateIndices();
        }
コード例 #4
0
        void InitMeshObj()
        {
            //create a new mesh obj
            mMeshObj       = new GameObject("_XWeaponTrailMesh: " + gameObject.name);
            mMeshObj.layer = gameObject.layer;
            mMeshObj.SetActive(true);
            MeshFilter   mf = mMeshObj.AddComponent <MeshFilter>();
            MeshRenderer mr = mMeshObj.AddComponent <MeshRenderer>();

            mr.castShadows             = false;
            mr.receiveShadows          = false;
            mr.renderer.sharedMaterial = MyMaterial;
            mf.sharedMesh = new Mesh();

            //init vertexpool
            mVertexPool    = new VertexPool(mf.sharedMesh, MyMaterial);
            mVertexSegment = mVertexPool.GetVertices(Granularity * 3, (Granularity - 1) * 12);


            UpdateIndices();
        }
コード例 #5
0
ファイル: XWeaponTrail1.cs プロジェクト: Andi07/TestRepo
        void InitMeshObj()
        {
            //create a new mesh obj
            mMeshObj = new GameObject("_XWeaponTrailMesh: " + gameObject.name);
            mMeshObj.layer = gameObject.layer;
            mMeshObj.SetActive(true);
            MeshFilter mf = mMeshObj.AddComponent<MeshFilter>();
            MeshRenderer mr = mMeshObj.AddComponent<MeshRenderer>();
            mr.castShadows = false;
            mr.receiveShadows = false;
            mr.GetComponent<Renderer>().sharedMaterial = MyMaterial;
            mf.sharedMesh = new Mesh();

            //init vertexpool
            mVertexPool = new VertexPool(mf.sharedMesh, MyMaterial);
            mVertexSegment = mVertexPool.GetVertices(Granularity * 3, (Granularity - 1) * 12);

            UpdateIndices();
        }
コード例 #6
0
 void InitMeshObj()
 {
     //init vertexpool
     mVertexPool = new VertexPool(MyMaterial, this);
     mVertexSegment = mVertexPool.GetVertices(Granularity * 3, (Granularity - 1) * 12);
     UpdateIndices();
 }