Beispiel #1
0
            private void OnPostRender()
            {
                if (setting.textureScreen == null || setting.textureScreen.width != targetCamera.pixelWidth || setting.textureScreen.height != targetCamera.pixelHeight)
                {
                    UtilityCommon.Destroy(setting.textureScreen);

                    setting.textureScreen = new Texture2D(targetCamera.pixelWidth, targetCamera.pixelHeight, TextureFormat.RGBA32, false, true);
                    RecalculateGrids();
                }

                if (setting.resetStatistics)
                {
                    setting.resetStatistics = false;
                    RecalculateGrids();
                    RefreshStatistics();
                }
                else if (setting.refreshStatistics)
                {
                    RefreshStatistics();
                }
                else if (setting.realtimeStatistics)
                {
                    realtimeStatisticsFrequencyIndex = (realtimeStatisticsFrequencyIndex + 1) % setting.realtimeStatisticsFrequency;
                    if (realtimeStatisticsFrequencyIndex == 0)
                    {
                        RefreshStatistics();
                    }
                }
            }
 public void Enter(Camera camera)
 {
     Clear();
     shadingView           = UtilityCommon.TryAddComponent <ShadingView>(camera.gameObject);
     shadingView.hideFlags = HideFlags.DontSave | HideFlags.HideInInspector | HideFlags.HideInInspector;
     shadingView.setting   = setting;
     shadingView.Enter(camera);
 }
Beispiel #3
0
            public void Exit()
            {
                foreach (ShadingRenderer renderer in shadingRenderers)
                {
                    renderer.Reset();
                }
                shadingRenderers.Clear();

                UtilityCommon.Destroy(this);
            }
Beispiel #4
0
        public static string FilterCondition(AzFilter.GridFilters filter)
        {
            string whereClause = "";

            if (filter != null && (filter.Filters != null && filter.Filters.Count > 0))
            {
                var parameters = new List <object>();
                var filters    = filter.Filters;

                for (var i = 0; i < filters.Count; i++)
                {
                    if (i == 0)
                    {
                        if (filters[i].Value == null)
                        {
                            i = i + 1;
                            if (filters.Count == i)
                            {
                                break;
                            }
                        }

                        //whereClause += string.Format(" {0}",
                        //    UtilityCommon.BuildWhereClause<T>(i, filter.Logic,
                        //        filters[i],
                        //        parameters));

                        whereClause += string.Format(" {1}",
                                                     UtilityCommon.ToLinqOperator(filter.Logic),
                                                     UtilityCommon.BuildWhereClause <T>(i, filter.Logic,
                                                                                        filters[i],
                                                                                        parameters));
                    }
                    else
                    {
                        if (filters[i].Value != null)
                        {
                            whereClause += string.Format(" {0} {1}",
                                                         UtilityCommon.ToLinqOperator(filter.Logic),
                                                         UtilityCommon.BuildWhereClause <T>(i, filter.Logic,
                                                                                            filters[i],
                                                                                            parameters));
                        }
                    }
                }
            }
            return(whereClause);
        }
            public void Enter(Camera camera)
            {
                Clear();
                shadingView           = UtilityCommon.TryAddComponent <ShadingView>(camera.gameObject);
                shadingView.hideFlags = HideFlags.DontSave | HideFlags.HideInInspector | HideFlags.HideInInspector;
                shadingView.setting   = setting;
                shadingView.Enter(camera);


                //if (false/*targetCamera is UICamera*/)
                //{
                //    OptionOpaqueBlack();
                //    OptionShowWhiteNumber();
                //    ShadingView.usingCustomizedRenderer = true;
                //}
            }
Beispiel #6
0
            public void Exit()
            {
                foreach (ShadingRenderer renderer in shadingRenderers)
                {
                    renderer.Reset();
                }
                shadingRenderers.Clear();

                if (overdrawBuffer != null)
                {
                    UtilityCommon.Destroy(overdrawBuffer);
                }

                UtilityCommon.Destroy(materialClear);
                UtilityCommon.Destroy(materialApply);
                UtilityCommon.Destroy(this);
            }
Beispiel #7
0
            public void Enter(Camera camera)
            {
                CreateOverdrawBuffer(camera);

                // collect all materials of sceneView
                // although this is not a good method, but we can't directly replace renderer's shader with uniforms
                // no UI and CommandBuffer now
                List <Renderer> allRenderers = UtilityCommon.FindObjectsOfAll <Renderer>();

                shadingRenderers = new List <ShadingRenderer>(allRenderers.Count);
                foreach (Renderer renderer in allRenderers)
                {
                    ShadingRenderer shadingRenderer = new ShadingRenderer(renderer, new Vector2(overdrawBuffer.width, overdrawBuffer.height));
                    shadingRenderer.Shading();

                    shadingRenderers.Add(shadingRenderer);
                }
            }
Beispiel #8
0
            private void CreateOverdrawBuffer(Camera camera)
            {
                if (overdrawBuffer == null || overdrawBuffer.width != camera.pixelWidth || overdrawBuffer.height != camera.pixelHeight)
                {
                    if (overdrawBuffer)
                    {
                        UtilityCommon.Destroy(overdrawBuffer);
                    }

#if UNITY_EDITOR
                    overdrawBuffer = new RenderTexture(camera.pixelWidth, camera.pixelHeight, 0, RenderTextureFormat.RInt);
#else
                    // Must be ARGB32 but will get automatically converted to float or float4 or int or half, from your shader code declaration.
                    overdrawBuffer = new RenderTexture(camera.pixelWidth, camera.pixelHeight, 0, RenderTextureFormat.ARGB32);
#endif
                    overdrawBuffer.name = $"Overdraw Buffer {camera.name}";
                    overdrawBuffer.enableRandomWrite = true;
                    overdrawBuffer.Create();
                }
            }
 public void UpdateStatus(string code)
 {
     try
     {
         MemberData member = (MemberData)DataCommon.Get("DATA.MEMBER");
         DBbase.Connect();
         StringBuilder sql = new StringBuilder();
         sql.Append("UPDATE TA_SELECT_INSURANCE ");
         sql.Append("SET SELECT_INSURANCE_STATUS = '02',");
         sql.Append(" WINDOW_IP = '" + UtilityCommon.GetLocalIPAddress() + "',");
         sql.Append(" UPDATE_DATE = '" + ConvertCommon.ConvertDateTime(DateTime.Now) + "',");
         sql.Append(" UPDATE_USER = '******'");
         sql.Append(" WHERE SELECT_INSURANCE_CODE = '" + code + "'");
         SqlCommand cmd = new SqlCommand(sql.ToString(), DBbase.con);
         cmd.ExecuteNonQuery();
         DBbase.DisConnect();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #10
0
            public void Exit()
            {
                UtilityCommon.Destroy(materialClearOpaque);
                UtilityCommon.Destroy(materialApply);
                UtilityCommon.Destroy(materialDisplayShowAlpha);

                if (commandBufferBeforeForwardAlpha != null)
                {
                    targetCamera.RemoveCommandBuffer(CameraEvent.BeforeForwardAlpha, commandBufferBeforeForwardAlpha);
                }
                if (commandBufferBeforeImageEffects != null)
                {
                    targetCamera.RemoveCommandBuffer(CameraEvent.BeforeImageEffects, commandBufferBeforeImageEffects);
                }

                foreach (ShadingRenderer renderer in shadingRenderers)
                {
                    renderer.Reset();
                }
                shadingRenderers.Clear();

                UtilityCommon.Destroy(this);
            }