예제 #1
0
 /// <summary>
 /// Applies changes to this instance. 
 /// </summary>
 public override void Apply(ColorBlindMode mode)
 {
     base.Apply(mode);
     if (supportType == SupportType.ChangeColor || supportType == SupportType.ChangeBoth)
     {
         if (button && button.targetGraphic == image)
         {
             ColorBlock colorBlock = button.colors;
             colorBlock.normalColor = NormalColorToUse;
             colorBlock.disabledColor = DisabledColorToUse;
             colorBlock.highlightedColor = HighlightedColorToUse;
             colorBlock.pressedColor = PressedColorToUse;
             button.colors = colorBlock;
         }
         if (image)
         {
             image.color = NormalColorToUse;
         }
     }
     if (supportType == SupportType.ChangeSprite || supportType == SupportType.ChangeBoth)
     {
         if (image)
         {
             image.sprite = SpriteToUse;
         }
     }
 }
예제 #2
0
 /// <summary>
 /// Applies changes to this instance.
 /// </summary>
 public override void Apply(ColorBlindMode mode)
 {
     base.Apply(mode);
     if (supportType == SupportType.ChangeColor || supportType == SupportType.ChangeBoth)
     {
         if (button && button.targetGraphic == image)
         {
             ColorBlock colorBlock = button.colors;
             colorBlock.normalColor      = NormalColorToUse;
             colorBlock.disabledColor    = DisabledColorToUse;
             colorBlock.highlightedColor = HighlightedColorToUse;
             colorBlock.pressedColor     = PressedColorToUse;
             button.colors = colorBlock;
         }
         if (image)
         {
             image.color = NormalColorToUse;
         }
     }
     if (supportType == SupportType.ChangeSprite || supportType == SupportType.ChangeBoth)
     {
         if (image)
         {
             image.sprite = SpriteToUse;
         }
     }
 }
    // Update is called once per frame
    void Update()
    {
        ColorBlindMode mode = ColorBlindnessSettings.ColorBlindMode;

        if (mode != ColorBlindMode.Normal)
        {
            if (guiTMPText != null)
            {
                guiTMPText.text = $"[{ColorBlindnessSettings.ColorBlindMode}]\nthis will disable certain color palettes on level start";
            }
            if (guiText != null)
            {
                guiText.text = $"[{ColorBlindnessSettings.ColorBlindMode}]\nthis will disable certain color palettes on level start";
            }
        }
        else
        {
            if (guiTMPText != null)
            {
                guiTMPText.text = "Colorblind? Press [C] key or (Y) button";
            }
            if (guiText != null)
            {
                guiText.text = "Colorblind? Press [C] key or (Y) button";
            }
        }
    }
예제 #4
0
 public void SetColorBlindMode(ColorBlindMode mode)
 {
     colorBlindMode = mode;
     if (OnColorBlindModeChangeEvent != null)
     {
         OnColorBlindModeChangeEvent(colorBlindMode);
     }
 }
 public void SetColorBlindMode(ColorBlindMode mode)
 {
     colorBlindMode = mode;
     if (OnColorBlindModeChangeEvent != null)
     {
         OnColorBlindModeChangeEvent(colorBlindMode);
     }
 }
예제 #6
0
    private void Update()
    {
        if (0f < Input.GetAxis("ColorBlind") && !pressed)
        {
            ColorBlindMode = (ColorBlindMode)(((int)ColorBlindMode + 1) % Enum.GetNames(typeof(ColorBlindMode)).Length);
            pressed        = true;

            ColorBlindFilter cameraColorBlindFilter = Camera.main.GetComponent <ColorBlindFilter>();
            if (ApplyColorFilter && cameraColorBlindFilter != null)
            {
                cameraColorBlindFilter.mode = ColorBlindMode;
            }
        }

        if (0f == Input.GetAxis("ColorBlind"))
        {
            pressed = false;
        }
    }
예제 #7
0
 /// <summary>
 /// Applies changes to this instance.
 /// </summary>
 public override void Apply(ColorBlindMode mode)
 {
     base.Apply(mode);
     if (supportType == SupportType.ChangeColor || supportType == SupportType.ChangeBoth)
     {
         if (button && button.targetGraphic == text)
         {
             ColorBlock colorBlock = button.colors;
             colorBlock.normalColor      = NormalColorToUse;
             colorBlock.disabledColor    = DisabledColorToUse;
             colorBlock.highlightedColor = HighlightedColorToUse;
             colorBlock.pressedColor     = PressedColorToUse;
             button.colors = colorBlock;
         }
         text.color = NormalColorToUse;
     }
     if (supportType == SupportType.ChangeFont || supportType == SupportType.ChangeBoth)
     {
         text.font = FontToUse;
     }
 }
예제 #8
0
    void OnRenderImage(RenderTexture source, RenderTexture destination)
    {
        // No effect
        if (mode == ColorBlindMode.Normal)
        {
            Graphics.Blit(source, destination);
            return;
        }

        // Change effect
        if (mode != previousMode)
        {
            material.SetColor("_R", RGB[(int)mode, 0]);
            material.SetColor("_G", RGB[(int)mode, 1]);
            material.SetColor("_B", RGB[(int)mode, 2]);
            previousMode = mode;
        }

        // Apply effect
        Graphics.Blit(source, destination, material, showDifference ? 1 : 0);
    }
예제 #9
0
    void OnRenderImage(RenderTexture source, RenderTexture destination)
    {
        // No effect
        if (mode == ColorBlindMode.Normal)
        {
            Graphics.Blit(source, destination);
            return;
        }

        // Change effect
        if (mode != previousMode)
        {
            material.SetColor("_R", RGB[(int)mode, 0]);
            material.SetColor("_G", RGB[(int)mode, 1]);
            material.SetColor("_B", RGB[(int)mode, 2]);
            previousMode = mode;
        }

        // Apply effect
        Graphics.Blit(source, destination, material, showDifference ? 1 : 0);
    }
 public virtual void Apply(ColorBlindMode mode)
 {
     colorBlindMode = mode;
 }
예제 #11
0
    public void Update()
    {
        #region Quest Complete Cheat

        if (Input.GetKeyUp(KeyCode.Q))
        {
            basicPlantsHarvested++;
        }
        if (Input.GetKeyUp(KeyCode.W))
        {
            firePlantsHarvested++;
        }
        if (Input.GetKeyUp(KeyCode.E))
        {
            icePlantsHarvested++;
        }
        if (Input.GetKeyUp(KeyCode.R))
        {
            voidPlantsHarvested++;
        }

        #endregion

        #region Get Objective References

        if (!Objective1)
        {
            if (GameObject.FindGameObjectWithTag("Objective1"))
            {
                pauseWindow = GameObject.FindGameObjectWithTag("PauseWindow");
                Objective1  = GameObject.FindGameObjectWithTag("Objective1");
                Objective2  = GameObject.FindGameObjectWithTag("Objective2");
                Objective3  = GameObject.FindGameObjectWithTag("Objective3");

                pauseWindow.GetComponent <Pause_Canvas_Controller>().pauseTitle.SetActive(true);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().objectivesButton.SetActive(true);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().controlsButton.SetActive(true);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().instructionsButton.SetActive(true);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().creditsButton.SetActive(true);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().backstoryButton.SetActive(true);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().mainMenuButton.SetActive(true);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().settingsButton.SetActive(true);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().objectivesPanel.SetActive(false);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().controlsPanel.SetActive(false);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().instructionsPanel.SetActive(false);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().creditsPanel.SetActive(false);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().backstoryPanel.SetActive(false);
                pauseWindow.GetComponent <Pause_Canvas_Controller>().pauseWindow.SetActive(false);
            }
        }

        #endregion

        if (gameStarted)
        {
            #region End Game Check

            if (questsCompleted >= questsRequired)
            {
                gameOver  = true;
                pauseGame = true;
            }

            #endregion
        }
        else
        {
            pauseGame = false;
        }

        if (!pauseGame && gameStarted)
        {
            #region Day Night Phase

            if (currentPhase == Phase.DAY)
            {
                dayTimer--;

                if (dayTimer <= 0)
                {
                    currentPhase = Phase.NIGHT;
                    nightTimer   = nightTimerConstant * waveNumber;
                }
            }
            else
            {
                nightTimer--;

                if (nightTimer <= 0)
                {
                    //currentPhase = Phase.DAY;
                    //dayTimer = dayTimerConstant;
                    //waveNumber++;
                }
            }

            #endregion
        }

        #region Colorblind Modes

        if (Input.GetKeyUp(KeyCode.F1))
        {
            BlindMode = ColorBlindMode.Normal;
        }

        if (Input.GetKeyUp(KeyCode.F2))
        {
            BlindMode = ColorBlindMode.Protanope;
        }

        if (Input.GetKeyUp(KeyCode.F3))
        {
            BlindMode = ColorBlindMode.Deuteranope;
        }

        #endregion
    }
예제 #12
0
 public virtual void Apply(ColorBlindMode mode)
 {
     colorBlindMode = mode;
 }