예제 #1
0
    void LateUpdate()
    {
        /* Draw-Object Buffer Create */
        if (null != ChainDrawObject)
        {
            /* Draw-Object Sort */
            ChainDrawObject.DrawObjectSort(InstanceCamera);             /* InstanceCamera, InstanceView */

            /* Combined-Mesh Create */
            if ((null != InstanceMeshFilter) && (null != InstanceMeshRenderer))
            {
                /* DrawParts-Cluster Create */
                if (null == ChainClusterDrawParts)
                {
                    ChainClusterDrawParts = new Library_SpriteStudio.ManagerDraw.TerminalClusterDrawParts();
                    ChainClusterDrawParts.BootUp(0);                            /* ManagerDraw has No-Cluster for "Draw" */
                }
                ChainDrawObject.ClusterConstruct(ChainClusterDrawParts);

                /* Cluster-Chain Fix (Collect Sub-Clusters & Optimize) */
                Library_SpriteStudio.ManagerDraw.ClusterFix(ChainClusterDrawParts);

                /* Meshes Combine */
//				FlagDelayFrame = true;
                int IndexParameterMeshWrite = IndexParameterMesh;
                int IndexParameterMeshDraw  = (true == FlagDelayFrame) ? ((IndexParameterMesh + 1) % (int)Library_SpriteStudio.ManagerDraw.Constant.MAX_MESHPARAMETERBUFFER) : IndexParameterMesh;
                if (null == InstanceMesh)
                {
                    CreateInstanceMesh((int)(int)Library_SpriteStudio.ManagerDraw.Constant.MAX_MESHPARAMETERBUFFER);
                }
                if (null == InstanceMaterial)
                {
                    CreateInstanceMaterial((int)(int)Library_SpriteStudio.ManagerDraw.Constant.MAX_MESHPARAMETERBUFFER);
                }
                Library_SpriteStudio.ManagerDraw.MeshCreate(ChainClusterDrawParts,
                                                            ref InstanceMesh[IndexParameterMeshWrite],
                                                            ref InstanceMaterial[IndexParameterMeshWrite],
                                                            ref InstanceMesh[IndexParameterMeshDraw],
                                                            ref InstanceMaterial[IndexParameterMeshDraw],
                                                            ref CombineInstanceCache,
                                                            InstanceMeshRenderer,
                                                            InstanceMeshFilter,
                                                            InstanceTransform,
                                                            InstanceCamera
                                                            );
                IndexParameterMesh++;
                IndexParameterMesh %= (int)Library_SpriteStudio.ManagerDraw.Constant.MAX_MESHPARAMETERBUFFER;

                /* Draw-Object Clear */
//				ChainDrawObject.ChainCleanUp();
            }

            /* Draw-Object Clear */
            ChainDrawObject.ChainCleanUp();
        }
    }
    void LateUpdate()
    {
        /* Draw-Object Buffer Create */
        if (null != ChainDrawObject)
        {
            /* Draw-Object Sort */
            ChainDrawObject.DrawObjectSort(InstanceCamera);             /* InstanceCamera, InstanceView */

            /* Combined-Mesh Create */
            if ((null != InstanceMeshFilter) && (null != InstanceMeshRenderer))
            {
                /* DrawParts-Cluster Create */
                if (null == ChainClusterDrawParts)
                {
                    ChainClusterDrawParts = new Library_SpriteStudio.ManagerDraw.TerminalClusterDrawParts();
                    ChainClusterDrawParts.BootUp(0);                            /* ManagerDraw has No-Cluster for "Draw" */
                }
                ChainDrawObject.ClusterConstruct(ChainClusterDrawParts);

                /* Cluster-Chain Fix (Collect Sub-Clusters & Optimize) */
                Library_SpriteStudio.ManagerDraw.ClusterFix(ChainClusterDrawParts);

                /* Meshes Combine */
                Library_SpriteStudio.ManagerDraw.MeshCreate(ChainClusterDrawParts,
                                                            InstanceMesh[IndexParameterMesh],
                                                            InstanceMeshRenderer,
                                                            InstanceMeshFilter,
                                                            InstanceTransform,
                                                            InstanceCamera
                                                            );
                IndexParameterMesh++;
                IndexParameterMesh %= (int)Library_SpriteStudio.ManagerDraw.Constant.MAX_MESHPARAMETERBUFFER;
                InstanceMesh[IndexParameterMesh].Clear();

                /* Draw-Object Clear */
//				ChainDrawObject.ChainCleanUp();
            }

            /* Draw-Object Clear */
            ChainDrawObject.ChainCleanUp();
        }
    }