示例#1
0
 //Pausar o reanudar el juego
 public void Pause()
 {
     if (currentLevel != 0 && lifes > -1 && changingLevel == false && restarting == false && currentLevel != 4)
     {
         if (paused == false)
         {
             if (Time.timeScale != 0f)
             {
                 Time.timeScale = 0f;
                 pauseText.SetActive(true);
                 returnToMenuButton.SetActive(true);
                 GameObject              postProcessing = GameObject.Find("PostProcessing");
                 ColorAdjustments        ca             = (ColorAdjustments)postProcessing.GetComponent <Volume>().profile.components[1];
                 VolumeParameter <float> value          = new MinFloatParameter(-100f, 0, true);
                 ca.saturation.SetValue(value);
                 GameObject.Find("Player").GetComponent <PlayerControl>().controls.Disable();
                 paused = true;
             }
         }
         else
         {
             Time.timeScale = 1f;
             pauseText.SetActive(false);
             returnToMenuButton.SetActive(false);
             GameObject              postProcessing = GameObject.Find("PostProcessing");
             ColorAdjustments        ca             = (ColorAdjustments)postProcessing.GetComponent <Volume>().profile.components[1];
             VolumeParameter <float> value          = new MinFloatParameter(15, 0, true);
             ca.saturation.SetValue(value);
             GameObject.Find("Player").GetComponent <PlayerControl>().controls.Enable();
             paused = false;
         }
     }
 }
示例#2
0
    //private float vignetteInit = 0f;
    private void Awake()
    {
        playerAudio = GetComponent <PlayerAudio>();
        //postProcessing = FindObjectOfType<Volume>().GetComponent<Animator>();
        volume = FindObjectOfType <Volume>();

        if (volume.profile.TryGet <LensDistortion>(out var lens))
        {
            distortion = lens;
        }
        if (volume.profile.TryGet <ColorAdjustments>(out var postColors))
        {
            colors = postColors;
        }
        if (volume.profile.TryGet <ChromaticAberration>(out var chrom))
        {
            chromatic     = chrom;
            chromaticInit = chrom.intensity.value;
        }

        /*
         * if (volume.profile.TryGet<Vignette>(out var vin))
         * {
         *  vignette = vin;
         *  vignetteInit = vin.intensity.value;
         * }*/
    }
示例#3
0
    void Start()
    {
        Volume volume = gameObject.GetComponent <Volume>();

        _colorAdjustments = gameObject.GetComponent <ColorAdjustments>();
        Debug.Log(_colorAdjustments.colorFilter);
    }
示例#4
0
    private void Start()
    {
        if (v.profile.TryGet <ColorAdjustments>(out var colorAdjustments))
        {
            _ca = colorAdjustments;
        }

        ui.SetActive(true);
        deathUi.SetActive(false);
    }
示例#5
0
 private void OnEnable()
 {
     PlayerCollision.PlayerLostEvent += DoLossBlur;
     RespawnScript.RespawnEvent      += DoLossBlur;
     PlayerCollision.RestartEvent    += RemoveAllEffects;
     PlayerCollision.WinEvent        += DoWinEffect;
     _pfx = postfx.gameObject.GetComponent <Volume>();
     _vP  = _pfx.profile;
     _colorAdjustments = _vP.components[1] as ColorAdjustments;
 }
示例#6
0
    // Start is called before the first frame update
    void Start()
    {
        // StartCoroutine(blackout());
        profile = volume.sharedProfile;
        if (!profile.TryGet <ColorAdjustments>(out var colorAdjustments))
        {
            colorAdjustments = profile.Add <ColorAdjustments>(false);
        }

        FindObjectOfType <AudioManager>().Play("ooo");
    }
示例#7
0
        public override void init()
        {
            base.init();
            currentVolume = GetComponent <Volume>();

            ColorAdjustments tmp;

            if (currentVolume.profile.TryGet <ColorAdjustments>(out tmp))
            {
                colorAdj = tmp;
            }
        }
示例#8
0
 // Start is called before the first frame update
 void Awake()
 {
     _volume           = FindObjectOfType <Volume>();
     _chromatic        = (ChromaticAberration)_volume.profile.components.Find(x => x.name == "ChromaticAberration(Clone)");
     _colorAdjustments = (ColorAdjustments)_volume.profile.components.Find(x => x.name == "ColorAdjustments(Clone)");
     _grain            = (FilmGrain)_volume.profile.components.Find(x => x.name == "FilmGrain(Clone)");
     shakeList         = new List <float>();
     Debug.Log("Set CamEffect");
     instance = this;
     _cam     = GetComponent <CinemachineVirtualCamera>();
     _noise   = _cam.GetCinemachineComponent <CinemachineBasicMultiChannelPerlin>();
 }
示例#9
0
    // Start is called before the first frame update
    void Start()
    {
        maxTime = timeLeft;
        vol     = GetComponent <Volume>();
        colors  = (ColorAdjustments)vol.profile.components[2];
        player  = GameObject.FindGameObjectWithTag("Player");

        respawnPoint = player.transform.position;


        StartCoroutine("Countdown");
    }
示例#10
0
        public void ChangeColorAdjustmentsInOneFrame(bool isInverting)
        {
            ColorAdjustments ca = ((ColorAdjustments)Camera.main.GetComponent <Volume>().profile.components[0]);

            if (isInverting)
            {
                ca.saturation.value = -100;
            }
            else
            {
                ca.saturation.value = 0;
            }
        }
示例#11
0
    void Awake()
    {
        ColorAdjustments colorAdjustments = null;

        if (!ppGlobalVolume.profile.TryGet <ColorAdjustments>(out colorAdjustments))
        {
            Debug.LogWarning("No color adjustments found!");
        }
        else
        {
            cp = colorAdjustments.colorFilter;
        }
    }
 private async void OnBlurButtonClick(object sender, RoutedEventArgs eventArgs)
 {
     if (mainWindow.Working)
     {
         return;
     }
     if (mainWindow.CurrentBitmap != null)
     {
         mainWindow.Working = true;
         statusText.Text    = "Bluring image";
         float sigma = (float)blurSigmaNumeric.Value;
         mainWindow.ChangeMainImage(await Task.Run(() => ColorAdjustments.BlurImage(mainWindow.CurrentBitmap, sigma)));
         statusText.Text    = "";
         mainWindow.Working = false;
     }
 }
 private async void OnShiftHslButtonClick(object sender, RoutedEventArgs eventArgs)
 {
     if (mainWindow.Working)
     {
         return;
     }
     if (mainWindow.CurrentBitmap != null)
     {
         mainWindow.Working = true;
         statusText.Text    = "Adjusting image";
         float hue        = (float)hueNumeric.Value;
         float saturation = (float)(saturationNumeric.Value / 100);
         float lightness  = (float)(lightnessNumeric.Value / 100);
         mainWindow.ChangeMainImage(await Task.Run(() => ColorAdjustments.ShiftHsl(mainWindow.CurrentBitmap, hue, saturation, lightness)));
         statusText.Text    = "";
         mainWindow.Working = false;
     }
 }
示例#14
0
    // Start is called before the first frame update
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        activeFleets = new List <Fleet>();
        activeFleets.AddRange(FindObjectsOfType <Fleet>());

        ColorAdjustments tmp;

        if (volume.profile.TryGet <ColorAdjustments>(out tmp))
        {
            colorAdjustments = tmp;
        }

        foreach (Color color in possibleColours)
        {
            activeColours.Add(color, false);
        }
        gameOverWarning.SetActive(false);
    }
示例#15
0
    // Start is called before the first frame update
    void Start()
    {
        Player.OnDefenseTimerON += UpdateFillAmount;
        Player.OnPlayerChangeHP += CheckStatus;
        Player.OnDefenseStart   += ActivateDefenseIcon;
        Player.OnDefenseStop    += DeactivateDefenseIcon;
        player = GameManager.Get().playerGO.GetComponent <Player>();

        DeactivateDefenseIcon();

        ColorAdjustments colorAdjust;

        if (postProcess.profile.TryGet <ColorAdjustments>(out colorAdjust))
        {
            color = colorAdjust;
        }

        defenseImage = defenseIcon.GetComponent <Image>();

        healthBar.maxValue = player.health;
        healthBar.value    = player.health;

        fillBar.color = healthBarGradient.Evaluate(1f);
    }
 public void Update()
 {
     if (target == null)
     {
         Volume tempVolume = GetComponent <Volume>();
         foreach (VolumeComponent tempComponent in tempVolume.sharedProfile.components)
         {
             target = tempComponent as ColorAdjustments;
             if (target != null)
             {
                 break;
             }
         }
     }
     else
     {
         target.active             = ifOpen;
         target.postExposure.value = postExposure;
         target.contrast.value     = contrast;
         target.colorFilter.value  = fliter;
         target.hueShift.value     = hueShift;
         target.saturation.value   = saturation;
     }
 }