Example #1
0
 public void Process(bool show, bool pick)
 {
     if (base.isActiveAndEnabled != show)
     {
         base.gameObject.SetActive(show);
     }
     if (allowPicking != pick)
     {
         allowPicking = pick;
         if (allowPicking)
         {
             MenuCameraEffects.SuspendEffects(suspend: true);
             mainCamera.SetReplacementShader(Shaders.instance.customizeUnlitShader, "RenderType");
             mainCamera.renderingPath = RenderingPath.Forward;
         }
         else
         {
             MenuCameraEffects.SuspendEffects(suspend: false);
             mainCamera.ResetReplacementShader();
             mainCamera.renderingPath = RenderingPath.UsePlayerSettings;
         }
     }
     if (show)
     {
         Vector2 anchoredPosition = UICanvas.ScreenPointToLocal(parentRect, Input.mousePosition);
         rect.anchoredPosition = anchoredPosition;
         if (allowPicking)
         {
             StartCoroutine(PickColor());
         }
         colorPreviewBox.color = color;
     }
 }