Example #1
0
 void Start()
 {
     RB = TargetCar.gameObject.GetComponent<Rigidbody>();
     thisCamera = GetComponent<Camera>();
     MyTiltShift = GetComponent<TiltShift>();
     PreviousPosition = transform.position;
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     tiltshift = FPS_cam.GetComponent <TiltShift>();
     ray_cam   = FPS_cam.GetComponent <Camera>();
     volume    = PostProcess.GetComponent <PostProcessVolume>();
     volume.profile.TryGetSettings(out depth);
 }
Example #3
0
    private void OnEnable()
    {
        Camera selectedCamera = null;

        Camera[] cameras = GameObject.FindObjectsOfType <Camera>();

        for (int i = 0; i < cameras.Length; ++i)
        {
            if (cameras[i].enabled == true)
            {
                selectedCamera = cameras[i];

                break;
            }
        }

        if (selectedCamera != null)
        {
            tiltShift = selectedCamera.gameObject.GetComponent <TiltShift>();
            if (tiltShift == null)
            {
                tiltShift = selectedCamera.gameObject.AddComponent <TiltShift>();
            }

            ResetDemo();
        }
        else
        {
            Debug.LogWarning("No camera found.");
        }
    }
Example #4
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        fpsController       = gameObject.GetComponentInParent <FirstPersonController>();
        characterController = gameObject.GetComponentInParent <CharacterController>();
        analogGlitch        = gameObject.GetComponent <AnalogGlitch>();
        digitalGlitch       = gameObject.GetComponent <DigitalGlitch>();
        tiltShift           = gameObject.GetComponent <TiltShift>();
        noiseAndGrain       = gameObject.GetComponent <NoiseAndGrain>();
        bloomAndFlares      = gameObject.GetComponent <BloomAndFlares>();
        ramp = gameObject.GetComponents <Ramp>()[1];
        puffOfSmokeDetonator = puffOfSmoke.GetComponent <Detonator>();
        cameraShake          = gameObject.GetComponent <CameraShake>();
        hudPowerText         = hudPowerTextGroup.GetComponent <ShakyText>();

        //Initialization
        digitalGlitch.intensity      = .2f;
        analogGlitch.scanLineJitter  = .414f;
        analogGlitch.verticalJump    = .02f;
        analogGlitch.horizontalShake = .011f;
        analogGlitch.colorDrift      = .11f;

        powerPercent = powerStartPercent;
    }
 void Start()
 {
     _anim = GetComponent<Animator>();
     _tiltShift = cam.GetComponent<TiltShift>();
     _cameraShake = GetComponent<CameraShake>();
     _player = GameManager.playerTransform.GetComponent<Player>();
     _camera = cam.GetComponent<Camera>();
     _startingDamping = damping;
 }
Example #6
0
 public override void OnInit()
 {
     cameraGo     = Camera.main.gameObject;
     cameraAnime  = cameraGo.GetComponent <Animator>();
     followRole   = cameraGo.GetComponent <FollowRole>();
     tiltShift    = cameraGo.GetComponent <TiltShift>();
     vigChrAbe    = cameraGo.GetComponent <VignetteAndChromaticAberration>();
     clrCorLookup = cameraGo.GetComponent <ColorCorrectionLookup>();
     rain         = GameObject.FindGameObjectWithTag("EffectRain");
 }
    private void Start()
    {
        playManager = GameObject.Find("PlayManager").GetComponent <PlayManager>();

        healthBarCMP    = healthBar.GetComponent <Image>();
        mainCameraCMP   = mainCamera.GetComponent <TiltShift>();
        mainCameraRc    = mainCamera.GetComponent <Camera>();
        globalMaskCMP   = globalMask.GetComponent <Image>();
        curHP           = maxHP;
        globalMaskAlpha = 0;
        Time.timeScale  = 1;
        player          = null;
    }
Example #8
0
 private void Awake()
 {
     isTyping               = false;
     isPausing              = false;
     base.name              = "MainCamera";
     instance               = this;
     this.baseT             = Camera.main.transform;
     this.baseR             = Camera.main.rigidbody;
     this.Smov              = base.GetComponent <SpectatorMovement>();
     this.mouselook         = base.GetComponent <MouseLook>();
     this.camLght           = CachingsGM.Find("mainLight").GetComponent <Light>();
     this.skybox            = base.GetComponent <Skybox>();
     this.tiltShift         = base.GetComponent <TiltShift>();
     this.tiltShift.enabled = false;
     this.CreateMinimap();
 }
        public virtual void OnLevelCleanUp()
        {
            StopAllCoroutines();

            if (Tilt)
            {
                Tilt.enabled  = false;
                Tilt.blurArea = 0;
                Tilt          = null;
            }

            if (ColorCorrection)
            {
                ColorCorrection.saturation = 1;
                ColorCorrection            = null;
            }

            _isDesaturating = false;
        }
        public virtual void OnLevelLoaded()
        {
            StopAllCoroutines();

            Tilt            = GetComponent <TiltShift>();
            ColorCorrection = GetComponent <ColorCorrectionCurves>();

            if (Tilt)
            {
                Tilt.enabled  = false;
                Tilt.blurArea = 0;
            }

            if (ColorCorrection)
            {
                ColorCorrection.saturation = 1;
            }

            _isDesaturating = false;
        }
Example #11
0
            /// <summary>
            /// OnInspectorGUI.
            /// </summary>
            protected override void InspectorGUI()
            {
                TiltShift baseTarget = this.target as TiltShift;

                BeginVertical();
                {
                    /////////////////////////////////////////////////
                    // Common.
                    /////////////////////////////////////////////////

                    Separator();

                    baseTarget.Strength = Slider("Strength", "The strength of the effect.\nFrom 0.0 (no effect) to 1.0 (full effect).", baseTarget.Strength, 0.0f, 1.0f, 1.0f);

                    baseTarget.Mode = (TiltShiftModes)EnumPopup("Mode", "Blur zone mode, proportional or fixed (default).", baseTarget.Mode, TiltShiftModes.Fixed);

                    /////////////////////////////////////////////////
                    // Mask.
                    /////////////////////////////////////////////////

                    Separator();

                    Header("Mask");

                    IndentLevel++;

                    if (baseTarget.Mode == TiltShiftModes.Proportional)
                    {
                        baseTarget.Angle = Slider("Angle", "Mask angle [-89, 90].", baseTarget.Angle, -90.0f, 90.0f, 0.0f);

                        baseTarget.Aperture = Slider("Aperture", "Mask aperture [0.1, 5].", baseTarget.Aperture, 0.1f, 5.0f, 0.5f);

                        baseTarget.Offset = Slider("Offset", "Mask vertical offset [-1, 1].", baseTarget.Offset, -1.0f, 1.0f, 0.0f);
                    }
                    else
                    {
                        baseTarget.TopFixedZone = Slider("Top", "Width of the upper zone, in pixels [0, ...].", baseTarget.TopFixedZone, 0.0f, 2048.0f, 100.0f);

                        baseTarget.BottomFixedZone = Slider("Bottom", "Width of the lower zone, in pixels [0, ...].", baseTarget.BottomFixedZone, 0.0f, 2048.0f, 100.0f);

                        baseTarget.FocusFixedFallOff = Slider("Falloff", "Width of the falloff zone, in pixels [0, ...].", baseTarget.FocusFixedFallOff, 0.0f, 2048.0f, 100.0f);
                    }

                    IndentLevel--;

                    /////////////////////////////////////////////////
                    // Blur.
                    /////////////////////////////////////////////////

                    Separator();

                    Header("Blur");

                    IndentLevel++;

                    baseTarget.BlurCurve = Slider("Blur curve", "Blur curve [1, 10].", baseTarget.BlurCurve, 1.0f, 10.0f, 3.0f);

                    baseTarget.BlurMultiplier = Slider("Blur multiplier", "Blur multiplier [0, 10].", baseTarget.BlurMultiplier, 0.0f, 10.0f, 5.0f);

                    IndentLevel--;

                    /////////////////////////////////////////////////
                    // Distortion.
                    /////////////////////////////////////////////////

                    Separator();

                    bool showDistortion = true;
                    baseTarget.EnableDistortion = ToogleFoldout("Distortion", baseTarget.EnableDistortion, ref showDistortion);
                    if (showDistortion == true)
                    {
                        IndentLevel++;

                        EnableGUI = baseTarget.EnableDistortion;

                        baseTarget.Distortion      = Slider("Force", "Distortion force [0, 20].", baseTarget.Distortion, 0.0f, 20.0f, 5.0f);
                        baseTarget.DistortionScale = Slider("Scale", "Distortion scale [0.01, 2].", baseTarget.DistortionScale, 0.01f, 20.0f, 1.0f);

                        EnableGUI = true;

                        IndentLevel--;
                    }

                    /////////////////////////////////////////////////
                    // Color.
                    /////////////////////////////////////////////////

                    Separator();

                    bool showColor = true;
                    baseTarget.EnableColor = ToogleFoldout("Color", baseTarget.EnableColor, ref showColor);
                    if (showColor == true)
                    {
                        IndentLevel++;

                        EnableGUI = baseTarget.EnableColor;

                        baseTarget.Tint = Color("Tint", "Tint color", baseTarget.Tint, UnityEngine.Color.white);

                        baseTarget.Saturation = Slider("Saturation", "Color saturation [0, 1].", baseTarget.Saturation, 0.0f, 1.0f, 1.0f);
                        baseTarget.Brightness = Slider("Brightness", "Color brightness.", baseTarget.Brightness, -1.0f, 1.0f, 0.0f);
                        baseTarget.Contrast   = Slider("Contrast", "The difference in color and brightness.", baseTarget.Contrast, -1.0f, 1.0f, 0.0f);
                        baseTarget.Gamma      = Slider("Gamma", "Optimizes the contrast and brightness in the midtones.", baseTarget.Gamma, 0.01f, 5.0f, 1.0f);

                        EnableGUI = true;

                        IndentLevel--;
                    }

                    /////////////////////////////////////////////////
                    // Debug.
                    /////////////////////////////////////////////////

                    Separator();

                    if (Foldout("Debug") == true)
                    {
                        IndentLevel++;

                        if (baseTarget.Mode == TiltShiftModes.Proportional)
                        {
                            baseTarget.ShowLine = Toggle("Focus line", "Show focus line.", baseTarget.ShowLine, false);
                        }

                        baseTarget.ShowMask = Toggle("Show mask", "Show blur mask.", baseTarget.ShowMask, false);

                        IndentLevel--;
                    }

                    /////////////////////////////////////////////////
                    // Description.
                    /////////////////////////////////////////////////

                    Separator();

                    EditorGUILayout.HelpBox("'Tilt Shift' makes the scene seem much smaller than it actually is, simulating the shallow depth of field normally encountered in close-up photography.", MessageType.Info);

                    /////////////////////////////////////////////////
                    // Misc.
                    /////////////////////////////////////////////////

                    Separator();

                    BeginHorizontal();
                    {
                        if (GUILayout.Button(new GUIContent("[doc]", "Online documentation"), GUI.skin.label) == true)
                        {
                            Application.OpenURL("http://www.ibuprogames.com/2019/10/02/tilt-shift/");
                        }

                        FlexibleSpace();

                        if (Button("Reset") == true)
                        {
                            baseTarget.ResetDefaultValues();
                        }
                    }
                    EndHorizontal();
                }
                EndVertical();

                Separator();
            }
Example #12
0
 void Start()
 {
     audioSource = GetComponent<AudioSource>();
     lenseBlur = GetComponent<TiltShift>();
     cShading = GetComponent<CreaseShading>();
 }
Example #13
0
 void Start()
 {
     _beingDrunk = GetComponent <BeingDrunk>();
     _tiltShift  = GetComponent <TiltShift>();
 }
Example #14
0
 private void Start()
 {
     TiltShift tiltShift = gameObject.AddComponent <TiltShift>();
 }